Repository: tuntorius/mightier_amp Branch: main Commit: e05b6d06fadc Files: 560 Total size: 3.5 MB Directory structure: gitextract_4w2zv_vh/ ├── .firebaserc ├── .github/ │ └── FUNDING.yml ├── .gitignore ├── .metadata ├── .vscode/ │ ├── launch.json │ └── settings.json ├── LICENSE.md ├── PRIVACY_POLICY.md ├── README.md ├── analysis_options.yaml ├── android/ │ ├── .gitignore │ ├── app/ │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src/ │ │ ├── debug/ │ │ │ ├── AndroidManifest.xml │ │ │ └── res/ │ │ │ └── values/ │ │ │ └── strings.xml │ │ ├── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin/ │ │ │ │ └── com/ │ │ │ │ └── tuntori/ │ │ │ │ └── mightieramp/ │ │ │ │ └── MainActivity.kt │ │ │ └── res/ │ │ │ ├── drawable/ │ │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26/ │ │ │ │ └── launcher_icon.xml │ │ │ └── values/ │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── profile/ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── settings.gradle │ └── settings_aar.gradle ├── fastlane/ │ └── metadata/ │ └── android/ │ └── en-US/ │ ├── full_description.txt │ ├── short_description.txt │ └── title.txt ├── firebase.json ├── ios/ │ ├── .gitignore │ ├── Flutter/ │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.imageset/ │ │ │ ├── Contents.json │ │ │ └── README.md │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h │ ├── Runner.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── Runner.xcscheme │ └── Runner.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ ├── IDEWorkspaceChecks.plist │ └── WorkspaceSettings.xcsettings ├── lib/ │ ├── UI/ │ │ ├── mainTabs.dart │ │ ├── mightierIcons.dart │ │ ├── pages/ │ │ │ ├── DebugConsolePage.dart │ │ │ ├── calibration.dart │ │ │ ├── developerPage.dart │ │ │ ├── device_specific_settings/ │ │ │ │ ├── LiteMk2Settings.dart │ │ │ │ ├── PlugAirSettings.dart │ │ │ │ ├── PlugAirUsbSettings.dart │ │ │ │ ├── PlugProMicSettings.dart │ │ │ │ ├── PlugProSettings.dart │ │ │ │ ├── PlugProUsbSettings.dart │ │ │ │ └── eq/ │ │ │ │ ├── MightySpaceSpeakerEQ.dart │ │ │ │ ├── PlugProEQSettings.dart │ │ │ │ ├── bt_audio_options.dart │ │ │ │ └── eq_group.dart │ │ │ ├── drum_editor/ │ │ │ │ ├── DrumStyleBottomSheet.dart │ │ │ │ ├── drumEditor.dart │ │ │ │ ├── drum_eq_bottom_sheet.dart │ │ │ │ ├── drumstyle_scroll_picker.dart │ │ │ │ ├── looperPage.dart │ │ │ │ ├── tap_buttons.dart │ │ │ │ └── tempoTrainerSheet.dart │ │ │ ├── drumsPage.dart │ │ │ ├── hotkeysMainPage.dart │ │ │ ├── hotkeysSetup.dart │ │ │ ├── jamTracks.dart │ │ │ ├── midiControllers.dart │ │ │ ├── mighty_patches_importer.dart │ │ │ ├── presetEditor.dart │ │ │ ├── settings.dart │ │ │ ├── settings_advanced.dart │ │ │ └── tunerPage.dart │ │ ├── popups/ │ │ │ ├── alertDialogs.dart │ │ │ ├── changeCategory.dart │ │ │ ├── exportQRCode.dart │ │ │ ├── hotkeyInput.dart │ │ │ ├── midiControlInfo.dart │ │ │ ├── savePreset.dart │ │ │ ├── selectPreset.dart │ │ │ └── selectTrack.dart │ │ ├── theme.dart │ │ ├── toneshare/ │ │ │ ├── cloud_authentication.dart │ │ │ ├── cloud_login.dart │ │ │ ├── cloud_signup.dart │ │ │ ├── share_preset.dart │ │ │ ├── toneshare_home.dart │ │ │ └── toneshare_main.dart │ │ ├── utils.dart │ │ └── widgets/ │ │ ├── MidiDeviceTile.dart │ │ ├── ModeControl.dart │ │ ├── NuxAppBar.dart │ │ ├── VolumeDrawer.dart │ │ ├── app_drawer.dart │ │ ├── bottomBar.dart │ │ ├── circular_button.dart │ │ ├── common/ │ │ │ ├── blinkWidget.dart │ │ │ ├── customPopupMenu.dart │ │ │ ├── modeControlRegular.dart │ │ │ ├── nestedWillPopScope.dart │ │ │ ├── numberPicker.dart │ │ │ ├── rounded_icon_button.dart │ │ │ └── searchTextField.dart │ │ ├── deviceList.dart │ │ ├── fabMenu.dart │ │ ├── hold_to_repeat.dart │ │ ├── presets/ │ │ │ ├── EffectChainBar.dart │ │ │ ├── EffectChainButton.dart │ │ │ ├── channelSelector.dart │ │ │ ├── effectEditor.dart │ │ │ ├── effectEditors/ │ │ │ │ ├── EqualizerEditor.dart │ │ │ │ └── SlidersEditor.dart │ │ │ ├── effectSelector.dart │ │ │ ├── preset_list/ │ │ │ │ ├── presetEffectPreview.dart │ │ │ │ ├── presetItem.dart │ │ │ │ ├── presetList.dart │ │ │ │ ├── presetListMethods.dart │ │ │ │ ├── preset_widget.dart │ │ │ │ └── presets_popup_menus.dart │ │ │ └── trackEventsBlockInfo.dart │ │ ├── rounded_icon_button.dart │ │ ├── scrollParent.dart │ │ ├── scrollPicker.dart │ │ ├── search_field.dart │ │ ├── thickRangeSlider.dart │ │ ├── thickSlider.dart │ │ └── verticalThickSlider.dart │ ├── audio/ │ │ ├── audioEditor.dart │ │ ├── automationController.dart │ │ ├── models/ │ │ │ ├── jamTrack.dart │ │ │ ├── setlist.dart │ │ │ ├── trackAutomation.dart │ │ │ └── waveform_data.dart │ │ ├── online_sources/ │ │ │ ├── YoutubeSource.dart │ │ │ ├── backingTracksCoSource.dart │ │ │ ├── guitarBackingTracksSource.dart │ │ │ ├── onlineSource.dart │ │ │ ├── onlineTrack.dart │ │ │ └── sourceResolver.dart │ │ ├── setlistPage.dart │ │ ├── setlist_player/ │ │ │ └── setlistPlayerState.dart │ │ ├── setlistsPage.dart │ │ ├── trackdata/ │ │ │ └── trackData.dart │ │ ├── tracksPage.dart │ │ └── widgets/ │ │ ├── eventEditor.dart │ │ ├── jamtracksView.dart │ │ ├── loopPanel.dart │ │ ├── media_library/ │ │ │ ├── albumTracks.dart │ │ │ ├── artistAlbums.dart │ │ │ └── media_browse.dart │ │ ├── online_source/ │ │ │ ├── online_source.dart │ │ │ └── search_screen.dart │ │ ├── painted_waveform.dart │ │ ├── presetsPanel.dart │ │ ├── setlistPlayer.dart │ │ ├── speedPanel.dart │ │ └── waveform_painter.dart │ ├── bluetooth/ │ │ ├── NuxDeviceControl.dart │ │ ├── bleMidiHandler.dart │ │ ├── ble_controllers/ │ │ │ ├── BLEController.dart │ │ │ ├── DummyBLEController.dart │ │ │ ├── FlutterBluePluginController.dart │ │ │ ├── FlutterBluePlusController.dart │ │ │ ├── FlutterReactiveBle.dart │ │ │ ├── MightyBle.dart │ │ │ ├── QuickBlueController.dart │ │ │ ├── WebBleController.dart │ │ │ └── WinBleController.dart │ │ └── devices/ │ │ ├── NuxConstants.dart │ │ ├── NuxDevice.dart │ │ ├── NuxFXID.dart │ │ ├── NuxMighty2040BT.dart │ │ ├── NuxMighty8BT.dart │ │ ├── NuxMighty8BTMk2.dart │ │ ├── NuxMightyLite.dart │ │ ├── NuxMightyLiteMk2.dart │ │ ├── NuxMightyPlugAir.dart │ │ ├── NuxMightyPlugPro.dart │ │ ├── NuxMightySpace.dart │ │ ├── NuxReorderableDevice.dart │ │ ├── communication/ │ │ │ ├── communication.dart │ │ │ ├── liteCommunication.dart │ │ │ ├── liteMk2Communication.dart │ │ │ ├── plugAirCommunication.dart │ │ │ └── plugProCommunication.dart │ │ ├── device_data/ │ │ │ ├── drumstyles.dart │ │ │ └── processors_list.dart │ │ ├── effects/ │ │ │ ├── MidiControllerHandles.dart │ │ │ ├── NoiseGate.dart │ │ │ ├── Processor.dart │ │ │ ├── lite/ │ │ │ │ ├── Ambience.dart │ │ │ │ ├── Amps.dart │ │ │ │ └── Modulation.dart │ │ │ ├── liteMk2/ │ │ │ │ ├── delay.dart │ │ │ │ ├── efx.dart │ │ │ │ ├── modulation.dart │ │ │ │ └── reverb.dart │ │ │ ├── mighty_2040bt/ │ │ │ │ ├── Amps.dart │ │ │ │ ├── Delay.dart │ │ │ │ ├── Modulation.dart │ │ │ │ └── Reverb.dart │ │ │ ├── mighty_8bt/ │ │ │ │ ├── Amps.dart │ │ │ │ ├── Delay.dart │ │ │ │ ├── Modulation.dart │ │ │ │ └── Reverb.dart │ │ │ ├── plug_air/ │ │ │ │ ├── Amps.dart │ │ │ │ ├── Ampsv2.dart │ │ │ │ ├── Cabinet.dart │ │ │ │ ├── Delay.dart │ │ │ │ ├── EFX.dart │ │ │ │ ├── EFXv2.dart │ │ │ │ ├── Modulation.dart │ │ │ │ └── Reverb.dart │ │ │ └── plug_pro/ │ │ │ ├── Amps.dart │ │ │ ├── Cabinet.dart │ │ │ ├── Compressor.dart │ │ │ ├── Delay.dart │ │ │ ├── EFX.dart │ │ │ ├── EQ.dart │ │ │ ├── EmptyEffects.dart │ │ │ ├── Modulation.dart │ │ │ └── Reverb.dart │ │ ├── features/ │ │ │ ├── drumsTone.dart │ │ │ ├── looper.dart │ │ │ ├── proUsbSettings.dart │ │ │ └── tuner.dart │ │ ├── presets/ │ │ │ ├── Mighty8BTPreset.dart │ │ │ ├── MightyLitePreset.dart │ │ │ ├── MightyMk2Preset.dart │ │ │ ├── MightyXXBTPreset.dart │ │ │ ├── PlugAirPreset.dart │ │ │ ├── PlugProPreset.dart │ │ │ ├── Preset.dart │ │ │ └── preset_constants.dart │ │ └── value_formatters/ │ │ ├── DecibelFormatter.dart │ │ ├── FrequencyFormatter.dart │ │ ├── PercentageFormatter.dart │ │ ├── SwitchFormatters.dart │ │ ├── TempoFormatter.dart │ │ └── ValueFormatter.dart │ ├── main.dart │ ├── midi/ │ │ ├── BleMidiManager.dart │ │ ├── ControllerConstants.dart │ │ ├── MidiControllerManager.dart │ │ ├── UsbMidiManager.dart │ │ └── controllers/ │ │ ├── BleMidiController.dart │ │ ├── ControllerHotkey.dart │ │ ├── HidController.dart │ │ ├── MidiController.dart │ │ └── UsbMidiController.dart │ ├── modules/ │ │ ├── cloud/ │ │ │ ├── cloudManager.dart │ │ │ ├── cloudStorageListener.dart │ │ │ ├── customAuthStore.dart │ │ │ └── presetEncoder.dart │ │ └── tempo_trainer.dart │ ├── platform/ │ │ ├── fileSaver.dart │ │ ├── platformUtils.dart │ │ ├── presetStorageListener.dart │ │ ├── presetsStorage.dart │ │ └── simpleSharedPrefs.dart │ └── utilities/ │ ├── DelayTapTimer.dart │ ├── MathEx.dart │ ├── list_extenstions.dart │ └── string_extensions.dart ├── linux/ │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter/ │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── mightieramp.code-workspace ├── plugins/ │ ├── audio_picker/ │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── .gitignore │ │ │ ├── app/ │ │ │ │ └── src/ │ │ │ │ └── main/ │ │ │ │ └── java/ │ │ │ │ └── io/ │ │ │ │ └── flutter/ │ │ │ │ └── plugins/ │ │ │ │ └── GeneratedPluginRegistrant.java │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── settings.gradle │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── java/ │ │ │ │ └── com/ │ │ │ │ └── audio_picker/ │ │ │ │ └── audio_picker/ │ │ │ │ └── FileUtils.java │ │ │ └── kotlin/ │ │ │ └── com/ │ │ │ └── audio_picker/ │ │ │ └── audio_picker/ │ │ │ └── AudioPickerPlugin.kt │ │ ├── ios/ │ │ │ ├── .gitignore │ │ │ ├── Assets/ │ │ │ │ └── .gitkeep │ │ │ ├── Classes/ │ │ │ │ ├── AudioPickerPlugin.h │ │ │ │ ├── AudioPickerPlugin.m │ │ │ │ └── SwiftAudioPickerPlugin.swift │ │ │ └── audio_picker.podspec │ │ ├── lib/ │ │ │ └── audio_picker.dart │ │ └── pubspec.yaml │ ├── audio_waveform/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── android/ │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── settings.gradle │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ └── java/ │ │ │ └── com/ │ │ │ └── tuntori/ │ │ │ └── audio_waveform/ │ │ │ ├── AudioWaveformPlugin.java │ │ │ ├── SimpleEncoder.java │ │ │ └── WaveformExtractor.java │ │ ├── darwin/ │ │ │ ├── .gitignore │ │ │ └── Classes/ │ │ │ └── AudioWaveformPlugin.m │ │ ├── ios/ │ │ │ ├── Assets/ │ │ │ │ └── .gitkeep │ │ │ ├── Classes/ │ │ │ │ ├── AudioWaveformPlugin.h │ │ │ │ ├── AudioWaveformPlugin.m │ │ │ │ ├── SwiftWaveformPlugin.swift │ │ │ │ └── WaveformExtractor.swift │ │ │ └── audio_waveform.podspec │ │ ├── lib/ │ │ │ └── audio_waveform.dart │ │ ├── macos/ │ │ │ ├── Assets/ │ │ │ │ └── .gitkeep │ │ │ ├── Classes/ │ │ │ │ └── AudioWaveformPlugin.h │ │ │ └── audio_waveform.podspec │ │ ├── pubspec.yaml │ │ └── test/ │ │ └── audio_waveform_test.dart │ ├── drag_and_drop_list/ │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib/ │ │ │ ├── drag_and_drop_builder_parameters.dart │ │ │ ├── drag_and_drop_interface.dart │ │ │ ├── drag_and_drop_item.dart │ │ │ ├── drag_and_drop_item_target.dart │ │ │ ├── drag_and_drop_item_wrapper.dart │ │ │ ├── drag_and_drop_list.dart │ │ │ ├── drag_and_drop_list_expansion.dart │ │ │ ├── drag_and_drop_list_interface.dart │ │ │ ├── drag_and_drop_list_target.dart │ │ │ ├── drag_and_drop_list_wrapper.dart │ │ │ ├── drag_and_drop_lists.dart │ │ │ ├── drag_handle.dart │ │ │ ├── measure_size.dart │ │ │ └── programmatic_expansion_tile.dart │ │ ├── pubspec.yaml │ │ └── test/ │ │ └── drag_and_drop_lists_test.dart │ ├── file_picker/ │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── android/ │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── settings.gradle │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ └── kotlin/ │ │ │ └── com/ │ │ │ └── example/ │ │ │ └── file_picker/ │ │ │ └── FilePickerPlugin.kt │ │ ├── ios/ │ │ │ ├── .gitignore │ │ │ ├── Assets/ │ │ │ │ └── .gitkeep │ │ │ ├── Classes/ │ │ │ │ ├── FilePickerPlugin.h │ │ │ │ ├── FilePickerPlugin.m │ │ │ │ └── SwiftFilePickerPlugin.swift │ │ │ └── file_picker.podspec │ │ ├── lib/ │ │ │ ├── file_picker.dart │ │ │ ├── file_picker_method_channel.dart │ │ │ └── file_picker_platform_interface.dart │ │ └── pubspec.yaml │ ├── flutter_blue_plus/ │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── android/ │ │ │ ├── build.gradle │ │ │ ├── settings.gradle │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ └── java/ │ │ │ └── com/ │ │ │ └── boskokg/ │ │ │ └── flutter_blue_plus/ │ │ │ ├── AdvertisementParser.java │ │ │ ├── FlutterBluePlusPlugin.java │ │ │ └── ProtoMaker.java │ │ ├── ios/ │ │ │ ├── Classes/ │ │ │ │ ├── FlutterBluePlusPlugin.h │ │ │ │ └── FlutterBluePlusPlugin.m │ │ │ ├── flutter_blue_plus.podspec │ │ │ └── gen/ │ │ │ ├── Flutterblueplus.pbobjc.h │ │ │ └── Flutterblueplus.pbobjc.m │ │ ├── lib/ │ │ │ ├── flutter_blue_plus.dart │ │ │ ├── gen/ │ │ │ │ ├── flutterblueplus.pb.dart │ │ │ │ ├── flutterblueplus.pbenum.dart │ │ │ │ ├── flutterblueplus.pbjson.dart │ │ │ │ └── flutterblueplus.pbserver.dart │ │ │ └── src/ │ │ │ ├── bluetooth_characteristic.dart │ │ │ ├── bluetooth_descriptor.dart │ │ │ ├── bluetooth_device.dart │ │ │ ├── bluetooth_service.dart │ │ │ ├── flutter_blue_plus.dart │ │ │ └── guid.dart │ │ ├── protos/ │ │ │ ├── flutterblueplus.proto │ │ │ └── regenerate.md │ │ └── pubspec.yaml │ ├── flutter_midi_command/ │ │ ├── flutter_midi_command-0.3.7/ │ │ │ ├── .gitignore │ │ │ ├── .metadata │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── android/ │ │ │ │ ├── .gitignore │ │ │ │ ├── app/ │ │ │ │ │ ├── build.gradle │ │ │ │ │ └── src/ │ │ │ │ │ ├── debug/ │ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── main/ │ │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ │ ├── java/ │ │ │ │ │ │ │ └── io/ │ │ │ │ │ │ │ └── flutter/ │ │ │ │ │ │ │ └── plugins/ │ │ │ │ │ │ │ └── GeneratedPluginRegistrant.java │ │ │ │ │ │ ├── kotlin/ │ │ │ │ │ │ │ └── com/ │ │ │ │ │ │ │ └── invisiblewrench/ │ │ │ │ │ │ │ └── flutter_midi_command/ │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ │ └── res/ │ │ │ │ │ │ ├── drawable/ │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ └── values/ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── profile/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── build.gradle │ │ │ │ ├── gradle/ │ │ │ │ │ └── wrapper/ │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ │ ├── gradle.properties │ │ │ │ ├── gradlew │ │ │ │ ├── gradlew.bat │ │ │ │ ├── settings.gradle │ │ │ │ └── src/ │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── kotlin/ │ │ │ │ └── com/ │ │ │ │ └── invisiblewrench/ │ │ │ │ └── fluttermidicommand/ │ │ │ │ └── FlutterMidiCommandPlugin.kt │ │ │ ├── ios/ │ │ │ │ ├── .gitignore │ │ │ │ ├── Assets/ │ │ │ │ │ └── .gitkeep │ │ │ │ ├── Classes/ │ │ │ │ │ ├── FlutterMidiCommandPlugin.h │ │ │ │ │ ├── FlutterMidiCommandPlugin.m │ │ │ │ │ └── SwiftFlutterMidiCommandPlugin.swift │ │ │ │ ├── Flutter/ │ │ │ │ │ ├── AppFrameworkInfo.plist │ │ │ │ │ ├── Debug.xcconfig │ │ │ │ │ └── Release.xcconfig │ │ │ │ ├── Podfile │ │ │ │ ├── Runner/ │ │ │ │ │ ├── AppDelegate.swift │ │ │ │ │ ├── Assets.xcassets/ │ │ │ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ │ └── LaunchImage.imageset/ │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── Base.lproj/ │ │ │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ │ │ └── Main.storyboard │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── Runner-Bridging-Header.h │ │ │ │ ├── Runner.xcodeproj/ │ │ │ │ │ ├── project.pbxproj │ │ │ │ │ ├── project.xcworkspace/ │ │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ │ └── xcshareddata/ │ │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ │ │ └── xcshareddata/ │ │ │ │ │ └── xcschemes/ │ │ │ │ │ └── Runner.xcscheme │ │ │ │ ├── Runner.xcworkspace/ │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata/ │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ │ └── flutter_midi_command.podspec │ │ │ ├── lib/ │ │ │ │ ├── flutter_midi_command.dart │ │ │ │ ├── flutter_midi_command_linux_stub.dart │ │ │ │ └── flutter_midi_command_messages.dart │ │ │ ├── macos/ │ │ │ │ ├── Classes/ │ │ │ │ │ └── SwiftFlutterMidiCommandPlugin.swift │ │ │ │ └── flutter_midi_command.podspec │ │ │ ├── pubspec.yaml │ │ │ └── test/ │ │ │ └── flutter_midi_command_test.dart │ │ ├── flutter_midi_command_linux-0.1.3/ │ │ │ ├── .gitignore │ │ │ ├── .metadata │ │ │ ├── .vscode/ │ │ │ │ ├── c_cpp_properties.json │ │ │ │ ├── launch.json │ │ │ │ └── settings.json │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib/ │ │ │ │ ├── alsa_generated_bindings.dart │ │ │ │ └── flutter_midi_command_linux.dart │ │ │ ├── linux/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── flutter/ │ │ │ │ │ ├── generated_plugin_registrant.cc │ │ │ │ │ ├── generated_plugin_registrant.h │ │ │ │ │ └── generated_plugins.cmake │ │ │ │ ├── flutter_midi_command_linux_plugin.cc │ │ │ │ └── include/ │ │ │ │ └── flutter_midi_command_linux/ │ │ │ │ └── flutter_midi_command_linux_plugin.h │ │ │ ├── pubspec.yaml │ │ │ └── test/ │ │ │ └── flutter_midi_command_linux_test.dart │ │ └── flutter_midi_command_platform_interface-0.3.3/ │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib/ │ │ │ ├── flutter_midi_command_platform_interface.dart │ │ │ ├── method_channel_midi_command.dart │ │ │ ├── midi_device.dart │ │ │ ├── midi_packet.dart │ │ │ └── midi_port.dart │ │ └── pubspec.yaml │ ├── mighty_ble/ │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── android/ │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── settings.gradle │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ └── java/ │ │ │ └── com/ │ │ │ └── tuntori/ │ │ │ └── mighty_ble/ │ │ │ ├── BLEManager.java │ │ │ └── MightyBlePlugin.java │ │ ├── ios/ │ │ │ ├── .gitignore │ │ │ ├── Assets/ │ │ │ │ └── .gitkeep │ │ │ ├── Classes/ │ │ │ │ ├── MightyBlePlugin.h │ │ │ │ ├── MightyBlePlugin.m │ │ │ │ └── SwiftMightyBlePlugin.swift │ │ │ └── mighty_ble.podspec │ │ ├── lib/ │ │ │ ├── mighty_ble.dart │ │ │ ├── mighty_ble_method_channel.dart │ │ │ └── mighty_ble_platform_interface.dart │ │ └── pubspec.yaml │ └── qr_utils-0.1.5/ │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── settings.gradle │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── aeologic/ │ │ │ └── adhoc/ │ │ │ └── qr_utils/ │ │ │ ├── QrUtilsPlugin.java │ │ │ ├── activity/ │ │ │ │ └── QRScannerActivity.java │ │ │ └── utils/ │ │ │ └── Utility.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── ic_flash_active.xml │ │ │ ├── ic_flash_inactive.xml │ │ │ └── ic_shape_circle.xml │ │ ├── layout/ │ │ │ └── activity_qr_scanner.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── xml/ │ │ └── provider_paths.xml │ ├── ios/ │ │ ├── .gitignore │ │ ├── Assets/ │ │ │ └── .gitkeep │ │ ├── Classes/ │ │ │ ├── QrUtilsPlugin.h │ │ │ ├── QrUtilsPlugin.m │ │ │ ├── SwiftQRScanner.swift │ │ │ └── SwiftQrUtilsPlugin.swift │ │ └── qr_utils.podspec │ ├── lib/ │ │ └── qr_utils.dart │ └── pubspec.yaml ├── pubspec.yaml ├── web/ │ ├── index.html │ └── manifest.json └── windows/ ├── .gitignore ├── CMakeLists.txt ├── flutter/ │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── runner/ ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h ================================================ FILE CONTENTS ================================================ ================================================ FILE: .firebaserc ================================================ { "projects": { "default": "mightier-amp" }, "targets": { "mightieramp": { "hosting": { "mightieramp": [ "mightieramp" ] } }, "mightier-amp": { "hosting": { "mightieramp": [ "mightieramp" ] } } }, "etags": {} } ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: tuntori tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: ["https://www.paypal.com/donate?hosted_button_id=FZWWAM4NUFRPC"] ================================================ FILE: .gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ # IntelliJ related *.iml *.ipr *.iws .idea/ just_audio/ #ignore sign key /android/key.properties #ignore api keys and similar /lib/configKeys.dart # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter/Dart/Pub related **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ build/ # Web related # Symbolication related app.*.symbols # Obfuscation related app.*.map.json .firebase/ ================================================ FILE: .metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled. version: revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 channel: stable project_type: app # Tracks metadata for the flutter migrate command migration: platforms: - platform: root create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 - platform: linux create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 # User provided section # List of Local paths (relative to this file) that should be # ignored by the migrate tool. # # Files that are not part of the templates will be ignored by default. unmanaged_files: - 'lib/main.dart' - 'ios/Runner.xcodeproj/project.pbxproj' ================================================ FILE: .vscode/launch.json ================================================ { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Mightier Amp", "request": "launch", "type": "dart", "program": "lib/main.dart" }, { "name": "Mightier Amp Profile", "request": "launch", "type": "dart", "program": "lib/main.dart", "flutterMode": "profile" } ] } ================================================ FILE: .vscode/settings.json ================================================ { "cmake.configureOnOpen": false, } ================================================ FILE: LICENSE.md ================================================ MIT License Copyright (c) 2020-2021 Dian Iliev (Tuntorius) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: PRIVACY_POLICY.md ================================================ # Privacy Policy I (Diyan Iliev) built the Mightier Amp app as an Open Source app. This SERVICE is provided by me at no cost and is intended for use as is. This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Mightier Amp unless otherwise defined in this Privacy Policy. ## Data Collection Mightier Amp app does not collect any personal data from its users. ## Third-Party Services Mightier Amp does not use third-party data collection services. ## Contact Us If you have any questions or concerns about our privacy practices, please contact us at mightieramp@gmail.com. ## Changes to This Policy I may update this Privacy Policy from time to time. If I make any material changes to how the data is collected, used, or shared, I will reflect the changes on this page. ================================================ FILE: README.md ================================================ # Mightier Amp Alternative app for controlling NUX Mighty amps series. ## Features This app aims to cover all the functionality of the original app plus many enhancements: - Ability to save presets locally on your mobile device and export them to share with others. - Remote control using a MIDI controller or a HID device. Both USB and Bluetooth MIDI controllers are supported. - Landscape mode. - Improved Jam Tracks functionality. Select any audio file in your device, add events like loop points, preset changes and others at any point and play along. - The app unlocks 8 secret amp models in Mighty Plug Pro and Mighty Space: Twin Rvb, Class A15, Vibro King, Budda, Brit Blues, Match D30, Brit 2000 and Uber HiGain - Tempo/Beat Trainer - Various other enhancements. ## Supported Amps 1.Mighty Plug / Mighty Air 2.Mighty Plug Pro / Mighty Space 3.Mighty Lite BT MKII 4.Mighty 8 BT\*\* 5.Mighty 20 BT \*\* / Mighty 40 BT \*\* 6.Mighty BT Lite / AirBorne Go\*\* / GUO AN\*\* \*\* These amps are not tested and might not work. ## Helpful Resources Check out the great video tutorial series created by Diego Zuccotti, where he walks through the features and functionality of the app, and the usage of the NUX amps in general. [Click here to watch!](https://www.youtube.com/@TutoJam) Facebook groups for presets sharing and amps discussion: [Mighty Plug/Mighty Air](https://www.facebook.com/groups/nuxmightyplugairgroup/) [Mighty Plug Pro/Mighty Space](https://www.facebook.com/groups/mightyplugpro/) ## Download [Get it on Google Play](https://play.google.com/store/apps/details?id=com.tuntori.mightieramp) [Get it on Google Play](https://apps.apple.com/us/app/mightier-amp/id6447451371) [Get it on F-Droid](https://f-droid.org/packages/com.tuntori.mightieramp/) ## Donation Mightier Amp is an open-source project that I am developing in my free time. If you find the app useful and would like to support its development, please consider making a donation. Your contribution will help me invest more time into the development of the app. Thank you for your support! Buy Me a Coffee at ko-fi.com   [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?hosted_button_id=FZWWAM4NUFRPC) ================================================ FILE: analysis_options.yaml ================================================ # This file configures the analyzer, which statically analyzes Dart code to # check for errors, warnings, and lints. # # The issues identified by the analyzer are surfaced in the UI of Dart-enabled # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be # invoked from the command line by running `flutter analyze`. # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints # and their documentation is published at # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code # or a specific dart file by using the `// ignore: name_of_lint` and # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options ================================================ FILE: android/.gitignore ================================================ gradle-wrapper.jar /.gradle /captures/ /gradlew /gradlew.bat /local.properties GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties ================================================ FILE: android/app/build.gradle ================================================ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { compileSdkVersion 34 namespace 'com.tuntori.mightieramp' compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { applicationId "com.tuntori.mightieramp" minSdkVersion flutter.minSdkVersion targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } buildTypes { debug { defaultConfig.minSdkVersion 19 applicationIdSuffix ".debug" } profile { defaultConfig.minSdkVersion 19 applicationIdSuffix ".debug" } release { signingConfig signingConfigs.release minifyEnabled true shrinkResources true ndk { abiFilters 'armeabi-v7a', 'x86_64', 'arm64-v8a' } } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.multidex:multidex:2.0.1' } ================================================ FILE: android/app/proguard-rules.pro ================================================ -keep class androidx.lifecycle.** { *; } -keep class com.boskokg.flutter_blue_plus.** { *; } ================================================ FILE: android/app/src/debug/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/debug/res/values/strings.xml ================================================ Mightier Amp Debug ================================================ FILE: android/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/kotlin/com/tuntori/mightieramp/MainActivity.kt ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) package com.tuntori.mightieramp import androidx.annotation.NonNull import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.GeneratedPluginRegistrant import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry import io.flutter.view.FlutterMain import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result import android.content.Intent import android.app.Activity import android.net.Uri import java.io.BufferedWriter import java.io.OutputStream import java.io.OutputStreamWriter import java.io.BufferedReader import java.io.InputStream import java.io.InputStreamReader import java.io.DataOutputStream import java.nio.ShortBuffer class MainActivity: FlutterActivity() { internal var WRITE_REQUEST_CODE = 77777 //unique request code internal var OPEN_REQUEST_CODE = 22222 internal var OPEN_REQUEST_CODE_BYTEARRAY = 33333 internal var _result: Result? = null internal var _data: String = "" internal var _dataBa: ByteArray? = null internal var saveByteArray:Boolean = false override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); configureFileSaveAPI(flutterEngine); } fun configureFileSaveAPI(@NonNull flutterEngine: FlutterEngine) { MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), "com.msvcode.filesaver/files") .setMethodCallHandler { call, result -> // Note: this method is invoked on the main thread. if (call.method == "saveFile") { _result = result saveByteArray = call.argument("byteArray") ?: false; if (saveByteArray) _dataBa =call.argument("data") else _data = call.argument("data") ?: ""; var mime:String? = call.argument("mime"); var name:String? = call.argument("name"); if (mime!=null && name!=null) createFile(mime, name) } else if (call.method == "openFile") { _result = result var mime:String? = call.argument("mime"); var byteArray:Boolean? = call.argument("byte_array"); if (mime!=null) openFile(mime, byteArray) } else { result.notImplemented() } } } private fun createFile(mimeType: String, fileName: String) { val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply { // Filter to only show results that can be "opened", such as // a file (as opposed to a list of contacts or timezones). addCategory(Intent.CATEGORY_OPENABLE) // Create a file with the requested MIME type. type = mimeType putExtra(Intent.EXTRA_TITLE, fileName) } startActivityForResult(intent, WRITE_REQUEST_CODE) } //replace with ACTION_GET_CONTENT for just a temporary access //the other is ACTION_OPEN_DOCUMENT private fun openFile(mimeType: String, byteArray: Boolean?) { val intent = Intent(Intent.ACTION_GET_CONTENT).apply { // Filter to only show results that can be "opened", such as // a file (as opposed to a list of contacts or timezones). addCategory(Intent.CATEGORY_OPENABLE) // Create a file with the requested MIME type. type = mimeType } if (byteArray != null && byteArray == true) startActivityForResult(intent, OPEN_REQUEST_CODE_BYTEARRAY) else startActivityForResult(intent, OPEN_REQUEST_CODE) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) // Check which request we're responding to if (requestCode == WRITE_REQUEST_CODE) { // Make sure the request was successful if (resultCode == Activity.RESULT_OK) { if (data != null && data.getData() != null) { //now write the data writeInFile(data.getData() as Uri) //data.getData() is Uri } else { _result?.error("NO DATA", "No data", null) } } else { _result?.error("CANCELED", "User cancelled", null) } } else if (requestCode == OPEN_REQUEST_CODE || requestCode == OPEN_REQUEST_CODE_BYTEARRAY) { if (resultCode == Activity.RESULT_OK) { if (data != null && data.getData() != null) { //now write the data if (requestCode == OPEN_REQUEST_CODE) readFile(data.getData() as Uri, false) else readFile(data.getData() as Uri, true) }else { _result?.error("NO DATA", "No data", null) } } else { _result?.error("CANCELED", "User cancelled", null) } } } private fun writeInFile(uri: Uri) { val outputStream: OutputStream? try { outputStream = getContentResolver().openOutputStream(uri); if (outputStream!=null) { if (saveByteArray && _dataBa!=null) { outputStream.write(_dataBa); outputStream.close(); } else { outputStream.write(_data.toByteArray(Charsets.UTF_8)); outputStream.close(); } _result?.success("SUCCESS"); } else _result?.error("ERROR", "writeInFile: Output stream is null", null) } catch (e:Exception){ _result?.error("ERROR", "Unable to write. Exception: $e", null) e.printStackTrace() } } private fun readFile(uri: Uri, dataArray: Boolean) { val inputStream: InputStream? val inputStreamReader: InputStreamReader try { inputStream = getContentResolver().openInputStream(uri) inputStreamReader = InputStreamReader(inputStream) if (!dataArray) { val br = BufferedReader(inputStreamReader) val fileContent = br.use { inputStreamReader.readText() } br.close() _result?.success(fileContent) } else { if (inputStream!=null) { val array = inputStream.readBytes(); inputStream.close(); _result?.success(array) } } } catch (e:Exception){ _result?.error("ERROR", "Unable to read", null) } } } ================================================ FILE: android/app/src/main/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/mipmap-anydpi-v26/launcher_icon.xml ================================================ ================================================ FILE: android/app/src/main/res/values/colors.xml ================================================ #ffffff ================================================ FILE: android/app/src/main/res/values/strings.xml ================================================ Mightier Amp ================================================ FILE: android/app/src/main/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/profile/AndroidManifest.xml ================================================ ================================================ FILE: android/build.gradle ================================================ buildscript { ext.kotlin_version = '1.8.22' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() mavenCentral() } gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:deprecation" } } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } tasks.register("clean", Delete) { delete rootProject.buildDir } ================================================ FILE: android/gradle/wrapper/gradle-wrapper.properties ================================================ #Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip ================================================ FILE: android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=C:/AndroidSDK/jdk-17.0.9 ================================================ FILE: android/settings.gradle ================================================ include ':app' def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() assert localPropertiesFile.exists() localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" ================================================ FILE: android/settings_aar.gradle ================================================ include ':app' ================================================ FILE: fastlane/metadata/android/en-US/full_description.txt ================================================ An alternative app for controlling NUX Mighty series guitar amplifiers This app aims to cover all of the functionality the original app offers plus many enhancements: • All amps and effects are enabled for all channels. • Ability to save and recall hundreds of presets locally on your mobile device. • Improved Jam Tracks functionality. Select any audio file in your device, add preset change events at any point and play along. The app is open-source. Full code available at https://github.com/tuntorius/mightier_amp "NUX" and the "Mighty" amps series are a trademark of CHERUB TECHNOLOGY COMPANY LIMITED. ================================================ FILE: fastlane/metadata/android/en-US/short_description.txt ================================================ An alternative app for controlling NUX Mighty amps series. ================================================ FILE: fastlane/metadata/android/en-US/title.txt ================================================ Mightier Amp ================================================ FILE: firebase.json ================================================ { "hosting": { "public": "/build/web/", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ], "domain": "mightieramp.web.app", "site":"mightieramp" } } ================================================ FILE: ios/.gitignore ================================================ *.mode1v3 *.mode2v3 *.moved-aside *.pbxuser *.perspectivev3 **/*sync/ .sconsign.dblite .tags* **/.vagrant/ **/DerivedData/ Icon? **/Pods/ **/.symlinks/ profile xcuserdata **/.generated/ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !default.mode1v3 !default.mode2v3 !default.pbxuser !default.perspectivev3 ================================================ FILE: ios/Flutter/AppFrameworkInfo.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable App CFBundleIdentifier io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName App CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 MinimumOSVersion 11.0 ================================================ FILE: ios/Flutter/Debug.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Flutter/Release.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Podfile ================================================ # Uncomment this line to define a global platform for your project platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) # Disable the NSMicrophoneUsageDescription requirement target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', 'AUDIO_SESSION_MICROPHONE=0' ] end end end ================================================ FILE: ios/Runner/AppDelegate.swift ================================================ import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ================================================ FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "filename" : "Icon_20x20@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "20x20" }, { "filename" : "Icon_20x20@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "20x20" }, { "filename" : "Icon_29x29@1x.png", "idiom" : "iphone", "scale" : "1x", "size" : "29x29" }, { "filename" : "Icon_29x29@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { "filename" : "Icon_29x29@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "29x29" }, { "filename" : "Icon_40x40@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { "filename" : "Icon_40x40@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "40x40" }, { "filename" : "Icon_60x60@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { "filename" : "Icon_60x60@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "60x60" }, { "filename" : "Icon_20x20@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "20x20" }, { "filename" : "Icon_20x20@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "20x20" }, { "filename" : "Icon_29x29@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { "filename" : "Icon_29x29@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "29x29" }, { "filename" : "Icon_40x40@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { "filename" : "Icon_40x40@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { "filename" : "Icon_76x76@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { "filename" : "Icon_76x76@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { "filename" : "Icon_83.5x83.5@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "83.5x83.5" }, { "filename" : "Icon_1024x1024.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md ================================================ # Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. ================================================ FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ios/Runner/Info.plist ================================================ CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDocumentTypes CFBundleTypeName JSON Document CFBundleTypeRole Editor LSHandlerRank Owner LSItemContentTypes public.json CFBundleTypeExtensions nuxpreset CFBundleTypeName NUX Preset CFBundleTypeRole Editor LSHandlerRank Owner LSItemContentTypes com.tuntori.nuxpreset CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName Mightier Amp CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS LSSupportsOpeningDocumentsInPlace NSAppleMusicUsageDescription The app uses music as backing tracks that are streamed to the connected guitar amplifier NSBluetoothAlwaysUsageDescription Bluetooth Low Energy is used to connect to a BLE enabled guitar amplifier NSBluetoothPeripheralUsageDescription Bluetooth Low Energy is used to connect to a BLE enabled guitar amplifier NSCameraUsageDescription This app uses camera to scan QR codes that contain preset data for the connected amplifier NSPhotoLibraryUsageDescription This app lets you scan a photo containing QR code with amp preset data. UIApplicationSupportsIndirectInputEvents UIBackgroundModes audio bluetooth-central UIFileSharingEnabled UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance UTImportedTypeDeclarations UTTypeConformsTo public.json UTTypeDescription NUX Preset UTTypeIconFiles UTTypeIdentifier com.tuntori.nuxpreset UTTypeTagSpecification public.filename-extension nuxpreset ================================================ FILE: ios/Runner/Runner-Bridging-Header.h ================================================ #import "GeneratedPluginRegistrant.h" ================================================ FILE: ios/Runner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 84C82414292992D6001A7DDC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCC37E5B2EA4022EAC7C519F /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 130F32F4717A7AF5D4F6585E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 97D11407EEF2CD9B9EB7F3BF /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; CCC37E5B2EA4022EAC7C519F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F37F8A97064DC522B40DF3A2 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 84C82414292992D6001A7DDC /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 07C65F7300B0E156A019970F /* Pods */ = { isa = PBXGroup; children = ( 130F32F4717A7AF5D4F6585E /* Pods-Runner.debug.xcconfig */, F37F8A97064DC522B40DF3A2 /* Pods-Runner.release.xcconfig */, 97D11407EEF2CD9B9EB7F3BF /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; }; 65DA474ACEE31D5FA261D7E3 /* Frameworks */ = { isa = PBXGroup; children = ( CCC37E5B2EA4022EAC7C519F /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, ); name = Flutter; sourceTree = ""; }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 07C65F7300B0E156A019970F /* Pods */, 65DA474ACEE31D5FA261D7E3 /* Frameworks */, ); sourceTree = ""; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, ); name = Products; sourceTree = ""; }; 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 71EB3D73602EF3E01C2EC6E4 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, C57858137186C0D10D48D7B8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 71EB3D73602EF3E01C2EC6E4 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; C57858137186C0D10D48D7B8 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 97C146FB1CF9000F007C117D /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 97C147001CF9000F007C117D /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Profile; }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 97D11407EEF2CD9B9EB7F3BF /* Pods-Runner.profile.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = BRTQKAVFDX; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Mightier Amp"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; PRODUCT_BUNDLE_IDENTIFIER = com.tuntori.mightieramp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 130F32F4717A7AF5D4F6585E /* Pods-Runner.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = BRTQKAVFDX; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Mightier Amp"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; PRODUCT_BUNDLE_IDENTIFIER = com.tuntori.mightieramp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = F37F8A97064DC522B40DF3A2 /* Pods-Runner.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = BRTQKAVFDX; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Mightier Amp"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; PRODUCT_BUNDLE_IDENTIFIER = com.tuntori.mightieramp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme ================================================ ================================================ FILE: ios/Runner.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: lib/UI/mainTabs.dart ================================================ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:mighty_plug_manager/UI/pages/drumsPage.dart'; import 'package:mighty_plug_manager/UI/utils.dart'; import 'package:mighty_plug_manager/UI/widgets/NuxAppBar.dart'; import '../bluetooth/NuxDeviceControl.dart'; import '../bluetooth/bleMidiHandler.dart'; import '../bluetooth/ble_controllers/BLEController.dart'; import '../main.dart'; import '../midi/MidiControllerManager.dart'; import '../platform/platformUtils.dart'; import 'pages/jamTracks.dart'; import 'pages/presetEditor.dart'; import 'pages/settings.dart'; import 'popups/alertDialogs.dart'; import 'theme.dart'; import 'widgets/VolumeDrawer.dart'; import 'widgets/app_drawer.dart'; import 'widgets/bottomBar.dart'; import 'widgets/common/nestedWillPopScope.dart'; import 'widgets/presets/preset_list/presetList.dart'; class MainTabs extends StatefulWidget { final MidiControllerManager midiMan = MidiControllerManager(); MainTabs({Key? key}) : super(key: key); @override State createState() => MainTabsState(); } class MainTabsState extends State with TickerProviderStateMixin { int _currentIndex = 0; late BuildContext dialogContext; late TabController controller; late TabVisibilityController _visibilityController; late final List _tabs; bool isBottomDrawerOpen = false; bool connectionFailed = false; late Timer _timeout; StateSetter? dialogSetState; @override void initState() { if (!AppThemeConfig.allowRotation) { SystemChrome.setPreferredOrientations( [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); } else { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight ]); } super.initState(); _visibilityController = TabVisibilityController(5); //add 5 pages widgets _tabs = [ const PresetEditor(), PresetList( visibilityEventHandler: _visibilityController.getEventHandler(1)), const DrumsPage(), const JamTracks(), const Settings(), ]; controller = TabController(initialIndex: 0, length: _tabs.length, vsync: this); // controller.addListener(() { // setState(() { // _visibilityController.onTabChanged(_currentIndex, controller.index); // _currentIndex = controller.index; // }); // }); NuxDeviceControl.instance().connectStatus.listen(connectionStateListener); NuxDeviceControl.instance().addListener(onDeviceChanged); BLEMidiHandler.instance().initBle(bleErrorHandler); } void bleErrorHandler(BleError error, dynamic data) { { switch (error) { case BleError.unavailable: if (!PlatformUtils.isIOS) { AlertDialogs.showInfoDialog(context, title: "Warning!", description: "Your device does not support bluetooth!", confirmButton: "OK"); } break; case BleError.permissionDenied: AlertDialogs.showLocationPrompt(context, false, null); break; case BleError.locationServiceOff: AlertDialogs.showInfoDialog(context, title: "Location service is disabled!", description: "Please, enable location service. It is required for Bluetooth connection to work.", confirmButton: "OK"); break; case BleError.scanPermissionDenied: AlertDialogs.showInfoDialog(context, title: "Bluetooth permissions required!", description: "Please, grant bluetooth scan and connect permissions. They are required for Mightier Amp to work.", confirmButton: "OK"); break; } } } @override void dispose() { super.dispose(); NuxDeviceControl.instance().removeListener(onDeviceChanged); } void onConnectionTimeout() async { connectionFailed = true; if (dialogSetState != null) { dialogSetState?.call(() {}); await Future.delayed(const Duration(seconds: 3)); Navigator.pop(context); dialogSetState = null; BLEMidiHandler.instance().disconnectDevice(); } } void connectionStateListener(DeviceConnectionState event) { switch (event) { case DeviceConnectionState.connectionBegin: if (dialogSetState != null) break; connectionFailed = false; showDialog( context: context, barrierDismissible: false, builder: (BuildContext context) { dialogContext = context; return StatefulBuilder( builder: (BuildContext context, StateSetter setState) { dialogSetState = setState; return NestedWillPopScope( onWillPop: () => Future.value(false), child: Dialog( backgroundColor: Colors.grey[700], child: Padding( padding: const EdgeInsets.all(16.0), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ if (!connectionFailed) const CircularProgressIndicator.adaptive(), if (connectionFailed) const Icon( Icons.error, color: Colors.red, ), const SizedBox( width: 8, ), Text(connectionFailed ? "Connection Failed!" : "Connecting"), ], ), ), ), ); }, ); }, ); //setup a timer in case something fails _timeout = Timer(const Duration(seconds: 10), onConnectionTimeout); break; case DeviceConnectionState.presetsLoaded: //if the device is connected in this step, then it's //just a reset, not connect if (NuxDeviceControl.instance().isConnectionComplete()) { dialogSetState = null; if (_timeout.isActive) { _timeout.cancel(); Navigator.pop(context); } } debugPrint("presets loaded"); break; case DeviceConnectionState.connectionComplete: dialogSetState = null; if (_timeout.isActive) { _timeout.cancel(); Navigator.pop(context); } break; case DeviceConnectionState.disconnected: break; } } Future _willPopCallback() async { Completer confirmation = Completer(); AlertDialogs.showConfirmDialog(context, title: "Exit Mightier Amp?", cancelButton: "No", confirmButton: "Yes", confirmColor: Colors.red, description: "Are you sure?", onConfirm: (val) { if (val) { //disconnect device if connected BLEMidiHandler.instance().disconnectDevice(); } confirmation.complete(val); }); return confirmation.future; } void onDeviceChanged() { setState(() {}); } @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); final screenWidth = mediaQuery.size.width; final layoutMode = getLayoutMode(mediaQuery); //WARNING: Workaround for a flutter bug - if the app is started with screen off, //one of the widgets throws an exception and the app scaffold is empty if (screenWidth < 10) return const SizedBox(); return PageStorage( bucket: bucketGlobal, child: FocusScope( autofocus: true, onKey: (node, event) { if (event.runtimeType.toString() == 'RawKeyDownEvent' && event.logicalKey.keyId != 0x100001005) { MidiControllerManager().onHIDData(event); } return KeyEventResult.skipRemainingHandlers; }, child: NestedWillPopScope( onWillPop: _willPopCallback, child: Scaffold( resizeToAvoidBottomInset: controller.index == 1, appBar: layoutMode != LayoutMode.navBar ? null : const MAAppBar(), body: Stack( alignment: Alignment.bottomCenter, children: [ Row( children: [ if (layoutMode == LayoutMode.drawer) AppDrawer( onSwitchPageIndex: _onSwitchPageIndex, currentIndex: _currentIndex, totalTabs: _tabs.length, ), Expanded( child: layoutMode == LayoutMode.navBar ? TabBarView( physics: const NeverScrollableScrollPhysics(), controller: controller, children: _tabs, ) : _tabs.elementAt(_currentIndex), ), ], ), if (layoutMode != LayoutMode.drawer && _currentIndex != 3) BottomDrawer( isBottomDrawerOpen: isBottomDrawerOpen, onExpandChange: (val) => setState(() { isBottomDrawerOpen = val; }), child: VolumeSlider(), ), ], ), bottomNavigationBar: layoutMode == LayoutMode.navBar ? GestureDetector( onVerticalDragUpdate: _onBottomBarSwipe, child: BottomBar( index: _currentIndex, onTap: _onSwitchPageIndex, ), ) : null, ), ), ), ); } void _onBottomBarSwipe(DragUpdateDetails details) { if (details.delta.dy < 0) { //open setState(() { isBottomDrawerOpen = true; }); } else { //close setState(() { isBottomDrawerOpen = false; }); } } void _onSwitchPageIndex(int index) { setState(() { _visibilityController.onTabChanged(_currentIndex, index); _currentIndex = index; controller.animateTo(_currentIndex); }); } } class TabVisibilityEventHandler { void Function()? onTabSelected; void Function()? onTabDeselected; } class TabVisibilityController { late List eventHandlers; TabVisibilityController(int tabAmount) { eventHandlers = List.generate(tabAmount, (index) => TabVisibilityEventHandler()); } TabVisibilityEventHandler getEventHandler(int tab) { return eventHandlers[tab]; } void onTabChanged(int oldTab, int newTab) { eventHandlers[oldTab].onTabDeselected?.call(); eventHandlers[newTab].onTabSelected?.call(); } } ================================================ FILE: lib/UI/mightierIcons.dart ================================================ /// Flutter icons MightierIcons /// Copyright (C) 2021 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. /// /// To use this font, place it in your fonts/ directory and include the /// following in your pubspec.yaml /// /// flutter: /// fonts: /// - family: MightierIcons /// fonts: /// - asset: fonts/MightierIcons.ttf /// /// /// * Font Awesome 5, Copyright (C) 2016 by Dave Gandy /// Author: Dave Gandy /// License: SIL (https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt) /// Homepage: http://fortawesome.github.com/Font-Awesome/ /// import 'package:flutter/widgets.dart'; class MightierIcons { MightierIcons._(); static const _kFontFam = 'MightierIcons'; static const String? _kFontPkg = null; static const IconData tag = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData amp = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData cabinet = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData gate = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData pedal = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData sliders = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData compressor = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData sinewave = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData repeat = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData repeat_a = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData repeat_ab = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData tuner = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData drum = IconData(0xf569, fontFamily: _kFontFam, fontPackage: _kFontPkg); } ================================================ FILE: lib/UI/pages/DebugConsolePage.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class DebugConsole extends StatelessWidget { static String output = ""; const DebugConsole({Key? key}) : super(key: key); static void print(Object? value) { output += "$value\n"; } static void printHex(List array) { output += '[ '; output += array .map((x) => '${x < 16 ? '0' : ''}${x.toRadixString(16)}') .join(" "); output += ']\n'; } static void printString(Object? value) { output += "$value\n"; } @override Widget build(BuildContext context) { TextEditingController c = TextEditingController(text: DebugConsole.output); return Scaffold( appBar: AppBar(title: const Text("Debug console")), body: SafeArea( child: Column( children: [ Expanded( child: TextField( maxLines: null, readOnly: true, controller: c, ), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( onPressed: () { Clipboard.setData(ClipboardData(text: output)); }, child: const Text("Copy to Clipboard")), const SizedBox(width: 8), ElevatedButton( onPressed: () { output = ""; c.clear(); }, child: const Text("Clear")), ], ) ], ), ), ); } } ================================================ FILE: lib/UI/pages/calibration.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'package:flutter/material.dart'; import 'package:just_audio/just_audio.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import '../../bluetooth/NuxDeviceControl.dart'; import '../../bluetooth/devices/presets/preset_constants.dart'; class Calibration extends StatefulWidget { const Calibration({Key? key}) : super(key: key); @override State createState() => _CalibrationState(); } class _CalibrationState extends State { int delay = 0; late AudioPlayer player; int nuxMode = 0; bool toggled = false; Color presetColor = PresetConstants.channelColorsPlug[0]; NuxDeviceControl devControl = NuxDeviceControl.instance(); StreamSubscription? _playerSub; @override void initState() { super.initState(); player = AudioPlayer(); player.setAsset("assets/audio/calibration.wav"); player.setLoopMode(LoopMode.one); player.play(); _playerSub = player .createPositionStream( steps: 99999999, minPeriod: const Duration(milliseconds: 1), maxPeriod: const Duration(milliseconds: 100)) .listen(onPositionUpdate); delay = SharedPrefs().getInt(SettingsKeys.latency, 0); } void onPositionUpdate(Duration pos) { int posMs = pos.inMilliseconds; if (posMs >= 500 + delay) { if (!toggled) { nuxMode++; if (nuxMode > 2) nuxMode = 0; devControl.changeDeviceChannel(nuxMode); setState(() { presetColor = PresetConstants.channelColorsPlug[nuxMode]; }); toggled = true; } } else { toggled = false; } } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () async { await player.stop(); _playerSub?.cancel(); await player.dispose(); //reset to prevent device losing sync NuxDeviceControl.instance().resetToChannelDefaults(); return true; }, child: Scaffold( appBar: AppBar( title: const Text("Latency Calibration"), ), body: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ const Text( "Make sure the NUX device is connected in both Audio and App mode!", textAlign: TextAlign.center, ), const SizedBox( height: 20, ), const Text( "Adjust the slider so that the NUX light change and the audio clicks happen at the same time.", textAlign: TextAlign.center, ), // Text( // "The app uses this value to apply extra latency to the commands sent to the device", // textAlign: TextAlign.center, // ), Slider( value: delay.toDouble(), min: 0, max: 400, label: "$delay", divisions: 400, onChanged: (val) { setState(() { delay = val.round(); }); }, onChangeEnd: (val) { SharedPrefs().setInt(SettingsKeys.latency, val.round()); }, ) ], ), ), ), ); } } ================================================ FILE: lib/UI/pages/developerPage.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/UI/widgets/common/numberPicker.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import '../../bluetooth/devices/NuxConstants.dart'; enum midiMessage { ccMessage, sysExMessage } class DeveloperPage extends StatefulWidget { const DeveloperPage({Key? key}) : super(key: key); @override State createState() => _DeveloperPageState(); } class _DeveloperPageState extends State { TextEditingController controller = TextEditingController(text: ""); midiMessage msgType = midiMessage.ccMessage; List data = [0, 0, 0, 0]; bool sliderChanging = false; @override void initState() { super.initState(); NuxDeviceControl.instance().onDataReceiveDebug = _onDataReceive; NuxDeviceControl.instance().developer = true; } void _onDataReceive(List data) { setState(() { controller.text += "$data\n"; }); } Widget _buildCCPage() { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const Text( "CC Message", style: TextStyle(fontSize: 18), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text("CC Number"), NumberPicker( axis: Axis.horizontal, minValue: 0, maxValue: 127, value: data[0], //hex: true, textStyle: TextStyle(color: Colors.grey[600]), itemWidth: 60, zeroPad: false, onChanged: (val) { data[0] = val; setState(() {}); }, ) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text("Value (numeric)"), NumberPicker( axis: Axis.horizontal, minValue: 0, maxValue: 127, value: data[1], textStyle: TextStyle(color: Colors.grey[600]), //hex: true, itemWidth: 60, zeroPad: false, onChanged: (val) { if (sliderChanging) return; data[1] = val; setState(() {}); }, ), ], ), Slider( min: 0, max: 127, label: "${data[1]}", value: data[1].toDouble(), onChangeStart: (value) => sliderChanging = true, onChangeEnd: (value) async { await Future.delayed(const Duration(milliseconds: 800)); sliderChanging = false; }, onChanged: (value) { data[1] = value.round(); setState(() {}); }), SwitchListTile( contentPadding: EdgeInsets.zero, title: const Text("Value (switch)"), value: data[1] != 0, onChanged: (value) { data[1] = value ? 127 : 0; setState(() {}); }), ElevatedButton( onPressed: () { if (!NuxDeviceControl.instance().isConnected) return; var msg = NuxDeviceControl.instance() .createCCMessage(data[0], data[1]); BLEMidiHandler.instance().sendData(msg); }, child: const Text("Send")), ElevatedButton( onPressed: () { setState(() { controller.text = ""; }); }, child: const Text("Clear console")) ], ), ); } Widget _buildSysExPage() { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const Text( "SysEx Request", style: TextStyle(fontSize: 18), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text("SysEx number"), NumberPicker( axis: Axis.horizontal, minValue: 0, maxValue: 127, value: data[2], //hex: true, textStyle: TextStyle(color: Colors.grey[600]), itemWidth: 60, zeroPad: false, onChanged: (val) { data[2] = val; setState(() {}); }, ) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text("Additional (-1 - no val)"), NumberPicker( axis: Axis.horizontal, minValue: -1, maxValue: 127, value: data[3], textStyle: TextStyle(color: Colors.grey[600]), //hex: true, itemWidth: 60, zeroPad: false, onChanged: (val) { if (sliderChanging) return; data[3] = val; setState(() {}); }, ), ], ), Slider( min: -1, max: 127, label: "${data[1]}", value: data[1].toDouble(), onChangeStart: (value) => sliderChanging = true, onChangeEnd: (value) async { await Future.delayed(const Duration(milliseconds: 800)); sliderChanging = false; }, onChanged: (value) { data[3] = value.round(); setState(() {}); }), SwitchListTile( contentPadding: EdgeInsets.zero, title: const Text("Value (switch)"), value: data[3] != 0, onChanged: (value) { data[3] = value ? 127 : 0; setState(() {}); }), ElevatedButton( onPressed: () { if (!NuxDeviceControl.instance().isConnected) return; List msg = []; //create header msg.addAll([ 0x80, 0x80, MidiMessageValues.sysExStart, 0x43, 0x58, SysexPrivacy.kSYSEX_PRIVATE, data[2], SyxDir.kSYXDIR_REQ, ]); if (data[3] >= 0) msg.add(data[3]); msg.addAll([0x80, MidiMessageValues.sysExEnd]); BLEMidiHandler.instance().sendData(msg); }, child: const Text("Send")), ElevatedButton( onPressed: () { setState(() { controller.text = ""; }); }, child: const Text("Clear console")) ], ), ); } @override Widget build(BuildContext context) { // if (!NuxDeviceControl.instance().isConnected) // return Center( // child: Text("No device connected"), // ); return NestedWillPopScope( onWillPop: () { NuxDeviceControl.instance().developer = false; return Future.value(true); }, child: Scaffold( body: Column(mainAxisSize: MainAxisSize.min, children: [ Expanded( flex: 4, child: AbsorbPointer( absorbing: !NuxDeviceControl.instance().developer, child: Opacity( opacity: NuxDeviceControl.instance().developer ? 1 : 0.5, child: SingleChildScrollView( child: TextField( enabled: NuxDeviceControl.instance().developer, controller: controller, maxLines: null, readOnly: true, ), ), ), ), ), SizedBox( height: 350, child: PageView( children: [_buildCCPage(), _buildSysExPage()], )), ]), ), ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/LiteMk2Settings.dart ================================================ import 'package:flutter/material.dart'; import '../../../bluetooth/bleMidiHandler.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../popups/alertDialogs.dart'; import 'PlugProUsbSettings.dart'; class LiteMk2Settings extends StatefulWidget { final NuxDevice device; const LiteMk2Settings({Key? key, required this.device}) : super(key: key); @override State createState() => _LiteMk2SettingsState(); } class _LiteMk2SettingsState extends State { @override Widget build(BuildContext context) { return Column( children: [ ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.volume_up), title: const Text("USB Audio Settings"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProUsbSettings())); }, ), /*ListTile( leading: const Icon(Icons.bluetooth_audio), enabled: widget.device.deviceControl.isConnected, title: const Text("Bluetooth Audio EQ"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProEQSettings())); }, ),*/ /* ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.mic), title: const Text("Microphone Settings"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProMicSettings())); }, ), */ ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.restart_alt), title: const Text("Reset Device Presets"), onTap: () { if (BLEMidiHandler.instance().connectedDevice != null) { AlertDialogs.showConfirmDialog(context, title: "Reset device presets", cancelButton: "Cancel", confirmButton: "Reset", confirmColor: Colors.red, description: "Are you sure?", onConfirm: (val) { if (val) widget.device.resetNuxPresets(); }); } }, ), const Divider() ], ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/PlugAirSettings.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugAir.dart'; import '../../../bluetooth/bleMidiHandler.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../popups/alertDialogs.dart'; import 'PlugAirUsbSettings.dart'; const _eqOptions = [ "Normal", "Acoustic", "Blues", "Clean Bass", "Guitar Cut", "Metal", "Pop", "Rock", "Solo Cut" ]; class PlugAirSettings extends StatefulWidget { final NuxDevice device; const PlugAirSettings({Key? key, required this.device}) : super(key: key); @override State createState() => _PlugAirSettingsState(); NuxMightyPlug get plugAirDevice => device as NuxMightyPlug; } class _PlugAirSettingsState extends State { @override Widget build(BuildContext context) { return Column( children: [ ListTile( enabled: widget.device.deviceControl.isConnected, title: const Text("USB Audio Settings"), leading: const Icon(Icons.volume_up), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugAirUsbSettings())); }, ), ListTile( enabled: widget.device.deviceControl.isConnected, title: const Text("Bluetooth Audio EQ"), subtitle: Text(_eqOptions[widget.plugAirDevice.btEq]), leading: const Icon(Icons.bluetooth_audio), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { var oldValue = widget.plugAirDevice.btEq; var dialog = AlertDialogs.showOptionDialog(context, confirmButton: "OK", cancelButton: "Cancel", title: "Bluetooth Audio EQ", confirmColor: Theme.of(context).hintColor, value: widget.plugAirDevice.btEq, options: _eqOptions, onConfirm: (changed, newValue) { setState(() { if (changed) { widget.plugAirDevice.setBtEq(newValue); } else { widget.plugAirDevice.setBtEq(oldValue); } }); }, onSelectionChanged: (selected) { widget.plugAirDevice.setBtEq(selected); }); showDialog( context: context, builder: (BuildContext context) => dialog, ); }, ), ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.restart_alt), title: const Text("Reset Device Presets"), onTap: () { if (BLEMidiHandler.instance().connectedDevice != null) { AlertDialogs.showConfirmDialog(context, title: "Reset device presets", cancelButton: "Cancel", confirmButton: "Reset", confirmColor: Colors.red, description: "Are you sure?", onConfirm: (val) { if (val) widget.device.resetNuxPresets(); }); } }, ), SwitchListTile( secondary: const Icon(Icons.eco), title: const Text("Eco Mode"), value: widget.device.ecoMode, onChanged: widget.device.deviceControl.isConnected ? (val) { setState( () { widget.device.setEcoMode(val); }, ); } : null), const Divider() ], ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/PlugAirUsbSettings.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/thickSlider.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugAir.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; class RouteModel { final String name; final int value; final String schemeAsset; const RouteModel( {required this.name, required this.value, required this.schemeAsset}); } class PlugAirUsbSettings extends StatefulWidget { static const List routes = [ RouteModel( name: "Normal", value: 1, schemeAsset: "assets/images/route_normal_mp2.png"), RouteModel( name: "Reamp", value: 0, schemeAsset: "assets/images/route_reamp.png"), RouteModel( name: "Dry Out", value: 2, schemeAsset: "assets/images/route_dryout.png"), ]; const PlugAirUsbSettings({Key? key}) : super(key: key); @override State createState() => _PlugAirUsbSettingsState(); } class _PlugAirUsbSettingsState extends State { final device = NuxDeviceControl.instance().device as NuxMightyPlug; static const fontSize = TextStyle(fontSize: 20); @override void didChangeDependencies() { // Adjust the provider based on the image type for (var route in PlugAirUsbSettings.routes) { precacheImage(AssetImage(route.schemeAsset), context); } super.didChangeDependencies(); } Widget _modeButton(String mode) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 18), child: Text(mode, style: fontSize), ); } void _setUsbInputValue(double value, bool skip) { if (skip) { device.config.inputVol = value.round(); } else { device.setUsbInputVol(value.round()); } setState(() {}); } void _setUsbOutputValue(double value, bool skip) { if (skip) { device.config.outputVol = value.round(); } else { device.setUsbOutputVol(value.round()); } setState(() {}); } @override Widget build(BuildContext context) { const routes = PlugAirUsbSettings.routes; var routeMode = routes.firstWhere((r) => r.value == device.config.usbMode); var arrayIndex = routes.indexOf(routeMode); var selected = List.filled(routes.length, false); selected[arrayIndex] = true; return Scaffold( appBar: AppBar( title: const Text("USB Audio Settings"), ), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ const Padding( padding: EdgeInsets.all(16.0), child: Text( "Route Mode", style: fontSize, ), ), ToggleButtons( fillColor: Colors.blue, selectedBorderColor: Colors.blue, color: Colors.grey, isSelected: selected, onPressed: (index) { var mode = routes[index]; var value = mode.value; device.setUsbMode(value); setState(() {}); }, children: [ for (var i = 0; i < routes.length; i++) _modeButton(routes[i].name) ], ), const SizedBox( height: 8, ), Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: Image.asset(routeMode.schemeAsset), ), ThickSlider( activeColor: Colors.blue, label: "Input Level", value: device.config.inputVol.toDouble(), min: 0, max: 100, labelFormatter: (val) { return "${val.round()}%"; }, handleVerticalDrag: true, onChanged: _setUsbInputValue, onDragEnd: (value) => _setUsbInputValue(value, false), ), ThickSlider( activeColor: Colors.blue, label: "Output Level", value: device.config.outputVol.toDouble(), min: 0, max: 100, labelFormatter: (val) { return "${val.round()}%"; }, handleVerticalDrag: true, onChanged: _setUsbOutputValue, onDragEnd: (value) => _setUsbOutputValue(value, false), ) ], ), ), ), ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/PlugProMicSettings.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugPro.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/communication/plugProCommunication.dart'; class PlugProMicSettings extends StatefulWidget { const PlugProMicSettings({Key? key}) : super(key: key); @override State createState() => _PlugProMicSettingsState(); } class _PlugProMicSettingsState extends State { final device = NuxDeviceControl.instance().device as NuxMightyPlugPro; final communication = NuxDeviceControl.instance().device.communication as PlugProCommunication; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Microphone Settings"), ), body: ListTileTheme( minLeadingWidth: 0, iconColor: Colors.white, child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ SwitchListTile( title: const Text("Mute"), onChanged: (value) { device.config.micMute = value; communication.setMicMute(device.config.micMute); setState(() {}); }, value: device.config.micMute), ListTile( title: const Text("Mic Level"), subtitle: Slider( min: 0, max: 100, label: "${((device.config.micVolume - 50) / 50 * 12).toStringAsFixed(1)} db", divisions: 100, value: device.config.micVolume.toDouble(), onChanged: (val) { device.config.micVolume = val.round(); communication.setMicLevel(device.config.micVolume); setState(() {}); }, ), ), SwitchListTile( title: const Text("Noise Gate"), onChanged: (value) { device.config.micNoiseGate = value; communication.setMicNoiseGate(value); setState(() {}); }, value: device.config.micNoiseGate), ListTile( enabled: device.config.micNoiseGate, title: const Text("Gate Sensitivity"), subtitle: Slider( min: 0, max: 100, label: device.config.micNGSensitivity.toString(), divisions: 100, value: device.config.micNGSensitivity.toDouble(), onChanged: device.config.micNoiseGate == false ? null : (val) { device.config.micNGSensitivity = val.round(); communication.setMicNoiseGateSens( device.config.micNGSensitivity); setState(() {}); }, ), ), ListTile( enabled: device.config.micNoiseGate, title: const Text("Gate Decay"), subtitle: Slider( min: 0, max: 100, label: device.config.micNGDecay.toString(), divisions: 100, value: device.config.micNGDecay.toDouble(), onChanged: device.config.micNoiseGate == false ? null : (val) { device.config.micNGDecay = val.round(); communication .setMicNoiseGateDecay(device.config.micNGDecay); setState(() {}); }, ), ), ], ), ), ), ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/PlugProSettings.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/device_specific_settings/eq/MightySpaceSpeakerEQ.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightySpace.dart'; import '../../../bluetooth/bleMidiHandler.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../popups/alertDialogs.dart'; import 'PlugProMicSettings.dart'; import 'PlugProUsbSettings.dart'; import 'eq/PlugProEQSettings.dart'; class PlugProSettings extends StatefulWidget { final NuxDevice device; final bool mightySpace; const PlugProSettings( {Key? key, required this.device, required this.mightySpace}) : super(key: key); @override State createState() => _PlugProSettingsState(); } class _PlugProSettingsState extends State { @override Widget build(BuildContext context) { return Column( children: [ ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.volume_up), title: const Text("USB Audio Settings"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProUsbSettings())); }, ), ListTile( leading: const Icon(Icons.bluetooth_audio), enabled: widget.device.deviceControl.isConnected, title: const Text("Bluetooth Audio EQ"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProEQSettings())); }, ), if (widget.mightySpace && (!widget.device.deviceControl.isConnected || (widget.device as NuxMightySpace).speakerAvailable)) ListTile( leading: const Icon(Icons.speaker), enabled: widget.device.deviceControl.isConnected, title: const Text("Speaker EQ"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const SpaceSpeakerEQSettings())); }, ), if (!widget.mightySpace) ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.mic), title: const Text("Microphone Settings"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const PlugProMicSettings())); }, ), ListTile( enabled: widget.device.deviceControl.isConnected, leading: const Icon(Icons.restart_alt), title: const Text("Reset Device Presets"), onTap: () { if (BLEMidiHandler.instance().connectedDevice != null) { AlertDialogs.showConfirmDialog(context, title: "Reset device presets", cancelButton: "Cancel", confirmButton: "Reset", confirmColor: Colors.red, description: "Are you sure?", onConfirm: (val) { if (val) widget.device.resetNuxPresets(); }); } }, ), const Divider() ], ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/PlugProUsbSettings.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/thickSlider.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugPro.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/features/proUsbSettings.dart'; import '../../widgets/common/modeControlRegular.dart'; class RouteModel { final String name; final int value; final String schemeAsset; final bool loopback; final bool dryWet; const RouteModel( {required this.name, required this.value, required this.schemeAsset, required this.loopback, required this.dryWet}); } class PlugProUsbSettings extends StatefulWidget { static const List routes = [ RouteModel( name: "Normal", value: 1, schemeAsset: "assets/images/route_normal.png", loopback: true, dryWet: true), RouteModel( name: "Reamp", value: 2, schemeAsset: "assets/images/route_reamp.png", loopback: false, dryWet: false), RouteModel( name: "Dry Out", value: 0, schemeAsset: "assets/images/route_dryout.png", loopback: false, dryWet: false), ]; const PlugProUsbSettings({Key? key}) : super(key: key); @override State createState() => _PlugProUsbSettingsState(); } class _PlugProUsbSettingsState extends State { final loopbackMask = 0x10; final modeMask = 0x07; final config = NuxDeviceControl.instance().device.config as NuxPlugProConfiguration; final usbSettings = NuxDeviceControl.instance().device as ProUsbSettings; static const fontSize = TextStyle(fontSize: 20); @override void didChangeDependencies() { // Adjust the provider based on the image type for (var route in PlugProUsbSettings.routes) { precacheImage(AssetImage(route.schemeAsset), context); } super.didChangeDependencies(); } void _setUsbDryWetValue(double value, bool skip) { if (skip) { config.usbDryWet = value.round(); } else { usbSettings.setUsbDryWetVol(value.round()); } setState(() {}); } void _setUsbRecordingValue(double value, bool skip) { if (skip) { config.recLevel = value.round(); } else { usbSettings.setUsbRecordingVol(value.round()); } setState(() {}); } void _setUsbPlaybackValue(double value, bool skip) { if (skip) { config.playbackLevel = value.round(); } else { usbSettings.setUsbPlaybackVol(value.round()); } setState(() {}); } @override Widget build(BuildContext context) { const routes = PlugProUsbSettings.routes; var routeModeInt = config.routingMode & modeMask; var routeMode = routes.firstWhere((r) => r.value == routeModeInt); var modeIndex = routes.indexOf(routeMode); var loopback = config.routingMode & loopbackMask != 0; return Scaffold( appBar: AppBar( title: const Text("USB Audio Settings"), ), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ const Padding( padding: EdgeInsets.all(16.0), child: Text( "Route Mode", style: fontSize, ), ), ModeControlRegular( selected: modeIndex, options: routes.map((e) => e.name).toList(), onSelected: (index) { var mode = routes[index]; var value = mode.value; if (mode.loopback && loopback) value |= loopbackMask; usbSettings.setUsbMode(value); setState(() {}); }, textStyle: fontSize, ), const SizedBox( height: 8, ), SwitchListTile( title: const Text( "Loopback", style: fontSize, ), subtitle: const Text( "Redirect Bluetooth and microphone audio to USB input"), value: loopback, onChanged: !routeMode.loopback ? null : (value) { if (value) { routeModeInt |= loopbackMask; } else { routeModeInt &= modeMask; } usbSettings.setUsbMode(routeModeInt); setState(() {}); }), Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: Image.asset(routeMode.schemeAsset), ), ThickSlider( enabled: routeMode.dryWet, activeColor: Colors.blue, label: "Dry/Wet", value: config.usbDryWet.toDouble(), min: 0, max: 100, labelFormatter: (val) { return "${config.usbDryWet}%"; }, handleVerticalDrag: true, onChanged: _setUsbDryWetValue, onDragEnd: (value) => _setUsbDryWetValue(value, false), ), ThickSlider( activeColor: Colors.blue, label: "Recording Level", value: config.recLevel.toDouble(), min: 0, max: 100, labelFormatter: (val) { return "${((val - 50) / 50 * 12).toStringAsFixed(2)} db"; }, handleVerticalDrag: true, onChanged: _setUsbRecordingValue, onDragEnd: (value) => _setUsbRecordingValue(value, false), ), ThickSlider( activeColor: Colors.blue, label: "Playback Level", value: config.playbackLevel.toDouble(), min: 0, max: 100, labelFormatter: (val) { return "${((val - 50) / 50 * 12).toStringAsFixed(2)} db"; }, handleVerticalDrag: true, onChanged: _setUsbPlaybackValue, onDragEnd: (value) => _setUsbPlaybackValue(value, false), ) ], ), ), ), ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/eq/MightySpaceSpeakerEQ.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/presets/effectEditors/EqualizerEditor.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightySpace.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/plugProCommunication.dart'; import '../../../../bluetooth/NuxDeviceControl.dart'; import '../../../../bluetooth/devices/effects/Processor.dart'; import '../../../../bluetooth/devices/effects/plug_pro/EQ.dart'; import 'eq_group.dart'; class SpaceSpeakerEQSettings extends StatefulWidget { const SpaceSpeakerEQSettings({Key? key}) : super(key: key); @override State createState() => _SpaceSpeakerEQSettingsState(); } class _SpaceSpeakerEQSettingsState extends State { final device = NuxDeviceControl.instance().device as NuxMightySpace; final communication = NuxDeviceControl.instance().device.communication as PlugProCommunication; bool _requestInProgress = false; static const List defaultSpeakerEQ = [ 0x32, 0x49, 0x4b, 0x40, 0x32, 0x43, 0x24, 0x32, 0x32, 0x22, 0x51 ]; @override void initState() { super.initState(); _requestEQData(device.config.speakerEQGroup); } void _requestEQData(int index) { _requestInProgress = true; (device.communication as PlugProCommunication).requestSpeakerEQData(index); } Widget _buildGroupWidget() { return EQGroup( eqGroup: device.config.speakerEQGroup, onChanged: (int? value) { if (value != null) { //request another device.config.speakerEQGroup = value; communication.setSpeakerEq(value); _requestEQData(device.config.speakerEQGroup); setState(() {}); } }, ); } List _buildButtons(EQTenBandSpeaker btEQ) { return [ ElevatedButton( child: const Text("Reset"), onPressed: () { for (int i = 0; i < btEQ.parameters.length; i++) { if (device.config.speakerEQGroup == 0) { btEQ.parameters[i].midiValue = defaultSpeakerEQ[i]; } else { btEQ.parameters[i].value = 0; } NuxDeviceControl.instance() .sendParameter(btEQ.parameters[i], false); } setState(() {}); }), const SizedBox(width: 6), ElevatedButton( child: const Text("Save"), onPressed: () { communication.saveSpeakerEQGroup(device.config.speakerEQGroup); }) ]; } @override Widget build(BuildContext context) { var btEQ = device.config.speakerEQ; bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; return Scaffold( appBar: AppBar( title: const Text("Speaker EQ Settings"), ), body: StreamBuilder( stream: (device.communication as PlugProCommunication).speakerEQStream, builder: (context, AsyncSnapshot> snapshot) { if (snapshot.connectionState == ConnectionState.done && _requestInProgress) { btEQ.setupFromNuxPayload(snapshot.data!); _requestInProgress = false; } return ListTileTheme( minLeadingWidth: 0, iconColor: Colors.white, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ if (isPortrait) ListTile( leading: const Icon(Icons.speaker), title: const Text("Speaker Settings"), trailing: Row( mainAxisSize: MainAxisSize.min, children: _buildButtons(btEQ)), ), if (isPortrait) _buildGroupWidget(), if (!isPortrait) Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ _buildGroupWidget(), Row(children: _buildButtons(btEQ)) ], ), Expanded( child: EqualizerEditor( eqEffect: btEQ, enabled: true, onChanged: _changeEQValue, onChangedFinal: (parameter, value, oldValue) => _changeEQValue(parameter, value, false), ), ) ], )); }), ); } void _changeEQValue(Parameter parameter, double value, bool skip) { parameter.value = value; setState(() { if (!skip) NuxDeviceControl.instance().sendParameter(parameter, false); }); } } ================================================ FILE: lib/UI/pages/device_specific_settings/eq/PlugProEQSettings.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/device_specific_settings/eq/bt_audio_options.dart'; import 'package:mighty_plug_manager/UI/widgets/presets/effectEditors/EqualizerEditor.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugPro.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/plugProCommunication.dart'; import '../../../../bluetooth/NuxDeviceControl.dart'; import '../../../../bluetooth/devices/effects/Processor.dart'; import '../../../../bluetooth/devices/effects/plug_pro/EQ.dart'; import 'eq_group.dart'; class PlugProEQSettings extends StatefulWidget { const PlugProEQSettings({Key? key}) : super(key: key); @override State createState() => _PlugProEQSettingsState(); } class _PlugProEQSettingsState extends State { final device = NuxDeviceControl.instance().device as NuxMightyPlugPro; final communication = NuxDeviceControl.instance().device.communication as PlugProCommunication; bool _requestInProgress = false; @override void initState() { super.initState(); _requestEQData(device.config.bluetoothGroup); } void _requestEQData(int index) { _requestInProgress = true; (device.communication as PlugProCommunication).requestBTEQData(index); } List _buildGroupWidget() { return [ EQGroup( eqGroup: device.config.bluetoothGroup, onChanged: (int? value) { if (value != null) { //request another device.config.bluetoothGroup = value; communication.setBTEq(value); _requestEQData(device.config.bluetoothGroup); setState(() {}); } }, ), BTAudioOptions( btInvertChannel: device.config.bluetoothInvertChannel, btEQMute: device.config.bluetoothEQMute, onInvert: (invert) { device.config.bluetoothInvertChannel = invert; communication.setBTInvert(device.config.bluetoothInvertChannel); setState(() {}); }, onMute: (mute) { device.config.bluetoothEQMute = mute; communication.setBTMute(device.config.bluetoothEQMute); setState(() {}); }) ]; } List _buildButtons(EQTenBandBT btEQ) { return [ ElevatedButton( child: const Text("Reset"), onPressed: () { for (var param in btEQ.parameters) { param.value = 0; NuxDeviceControl.instance().sendParameter(param, false); } setState(() {}); }), const SizedBox(width: 6), ElevatedButton( child: const Text("Save"), onPressed: () { communication.saveBTEQGroup(device.config.bluetoothGroup); }) ]; } @override Widget build(BuildContext context) { var btEQ = device.config.bluetoothEQ; bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; return Scaffold( appBar: AppBar( title: const Text("Bluetooth EQ Settings"), ), body: StreamBuilder( stream: (device.communication as PlugProCommunication).bluetoothEQStream, builder: (context, AsyncSnapshot> snapshot) { if (snapshot.connectionState == ConnectionState.done && _requestInProgress) { btEQ.setupFromNuxPayload(snapshot.data!); device.config.bluetoothInvertChannel = snapshot.data![12] > 0; device.config.bluetoothEQMute = snapshot.data![13] > 0; _requestInProgress = false; } return ListTileTheme( minLeadingWidth: 0, iconColor: Colors.white, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ if (isPortrait) ListTile( leading: const Icon(Icons.bluetooth), title: const Text("Bluetooth Settings"), trailing: Row( mainAxisSize: MainAxisSize.min, children: _buildButtons(btEQ)), ), if (isPortrait) Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: _buildGroupWidget(), ), if (!isPortrait) Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ..._buildGroupWidget(), Row(children: _buildButtons(btEQ)) ], ), Expanded( child: EqualizerEditor( eqEffect: btEQ, enabled: true, onChanged: _changeEQValue, onChangedFinal: (parameter, value, oldValue) => _changeEQValue(parameter, value, false), ), ) ], )); }), ); } void _changeEQValue(Parameter parameter, double value, bool skip) { parameter.value = value; setState(() { if (!skip) NuxDeviceControl.instance().sendParameter(parameter, false); }); } } ================================================ FILE: lib/UI/pages/device_specific_settings/eq/bt_audio_options.dart ================================================ import 'package:flutter/material.dart'; import '../../../mightierIcons.dart'; class BTAudioOptions extends StatelessWidget { final bool btInvertChannel; final bool btEQMute; final void Function(bool) onInvert; final void Function(bool) onMute; const BTAudioOptions( {super.key, required this.btInvertChannel, required this.btEQMute, required this.onInvert, required this.onMute}); @override Widget build(BuildContext context) { return ToggleButtons( fillColor: Colors.blue, selectedBorderColor: Colors.blue, color: Colors.grey, isSelected: [btInvertChannel, btEQMute], onPressed: (index) { switch (index) { case 0: onInvert(!btInvertChannel); break; case 1: onMute(!btEQMute); break; } }, children: [ const Tooltip( message: "Invert the phase of Bluetooth Audio.", child: Padding( padding: EdgeInsets.symmetric(horizontal: 15.0), child: Icon(MightierIcons.sinewave, size: 40), ), ), Tooltip( message: "Mute Bluetooth audio.", child: Padding( padding: const EdgeInsets.symmetric(horizontal: 25.0), child: Icon(btEQMute ? Icons.volume_off : Icons.volume_up), ), ), ], ); } } ================================================ FILE: lib/UI/pages/device_specific_settings/eq/eq_group.dart ================================================ import 'package:flutter/material.dart'; class EQGroup extends StatelessWidget { final int eqGroup; final void Function(int?)? onChanged; const EQGroup({super.key, required this.eqGroup, this.onChanged}); static const List> eqGroups = [ DropdownMenuItem( value: 0, child: Text("Group 1"), ), DropdownMenuItem( value: 1, child: Text("Group 2"), ), DropdownMenuItem( value: 2, child: Text("Group 3"), ), DropdownMenuItem( value: 3, child: Text("Group 4"), ), ]; @override Widget build(BuildContext context) { return Row( children: [ const Text( "EQ Group", style: TextStyle(fontSize: 16), ), const SizedBox( width: 8, ), DropdownButton( items: eqGroups, onChanged: onChanged, value: eqGroup, ) ], ); } } ================================================ FILE: lib/UI/pages/drum_editor/DrumStyleBottomSheet.dart ================================================ import 'package:flutter/material.dart'; import '../../widgets/scrollPicker.dart'; enum DrumStyleMode { flat, categorized } class DrumStyleBottomSheet extends StatefulWidget { final dynamic styleMap; final DrumStyleMode mode; final int selected; final Function(int) onChange; const DrumStyleBottomSheet( {Key? key, required this.styleMap, required this.selected, required this.onChange, required this.mode}) : super(key: key); @override State createState() => _DrumStyleBottomSheetState(); } class _DrumStyleBottomSheetState extends State { List categoriesList = []; List stylesList = []; int categoriesIndex = 0; int selectedStyle = 0; @override void initState() { super.initState(); selectedStyle = widget.selected; if (widget.mode == DrumStyleMode.categorized) { categoriesList = widget.styleMap.keys.toList(); for (var key in widget.styleMap.keys) { stylesList.addAll(widget.styleMap[key]!.keys as Iterable); for (var style in widget.styleMap[key]!.keys) { if (widget.styleMap[key]![style] == widget.selected) { categoriesIndex = categoriesList.indexOf(key); } } } } else { stylesList = widget.styleMap; } } void _onCategoryChanged(int value, bool userGenerated) { categoriesIndex = value; if (userGenerated) { var key = categoriesList[categoriesIndex]; var firstKey = widget.styleMap[key]!.keys.first as String; selectedStyle = widget.styleMap[key]![firstKey]; setState(() {}); } } void _onStyleChanged(int value, bool userGenerated, bool finalChange) { selectedStyle = value; if (userGenerated) { //find category for (var cat in widget.styleMap.keys) { for (var style in widget.styleMap[cat]!.keys) { if (widget.styleMap[cat]![style] == value) { categoriesIndex = categoriesList.indexOf(cat); setState(() {}); break; } } } } if (finalChange) widget.onChange(selectedStyle); } void _onFlatStyleChanged(int value, bool finalChange) { selectedStyle = value; widget.onChange(selectedStyle); if (!finalChange) setState(() {}); } @override Widget build(BuildContext context) { return SizedBox( height: 400, child: Column( children: [ const SizedBox( height: 40, // ignore: unnecessary_const child: Center( child: Text( "Select Style", textAlign: TextAlign.center, style: TextStyle(fontSize: 20), ), ), ), const Divider( thickness: 1, ), Expanded( child: widget.mode == DrumStyleMode.flat ? ScrollPicker( initialValue: selectedStyle, items: stylesList, onChanged: (value) { _onFlatStyleChanged(value, false); }, onChangedFinal: (value, user) => _onFlatStyleChanged(value, true), ) : Row( children: [ Expanded( child: ScrollPicker( initialValue: categoriesIndex, items: categoriesList, onChanged: (value) { _onCategoryChanged(value, true); }, onChangedFinal: _onCategoryChanged, ), ), Expanded( child: ScrollPicker( initialValue: selectedStyle, items: stylesList, onChanged: (value) { _onStyleChanged(value, true, false); }, onChangedFinal: (value, user) => _onStyleChanged(value, user, true), ), ) ], ), ), ], ), ); } } ================================================ FILE: lib/UI/pages/drum_editor/drumEditor.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/drum_eq_bottom_sheet.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/drumstyle_scroll_picker.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/tap_buttons.dart'; import 'package:mighty_plug_manager/UI/widgets/circular_button.dart'; import 'package:mighty_plug_manager/UI/widgets/common/modeControlRegular.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/tempoTrainerSheet.dart'; import 'package:mighty_plug_manager/bluetooth/devices/features/drumsTone.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/features/looper.dart'; import '../../../modules/tempo_trainer.dart'; import '../../widgets/thickSlider.dart'; import 'looperPage.dart'; enum DrumEditorLayout { standard, extendedToneControls } enum DrumEditorMode { regular, trainer, looper } class DrumEditor extends StatefulWidget { static const fontStyle = TextStyle(fontSize: 18); const DrumEditor({Key? key}) : super(key: key); @override State createState() => _DrumEditorState(); } class _DrumEditorState extends State with AutomaticKeepAliveClientMixin { late dynamic _drumStyles; DrumEditorLayout _layout = DrumEditorLayout.standard; DrumEditorMode _mode = DrumEditorMode.regular; int _selectedDrumPattern = 0; late NuxDevice device; @override void initState() { super.initState(); _drumStyles = NuxDeviceControl.instance().device.getDrumStyles(); NuxDeviceControl.instance().addListener(_onStateChanged); } @override void dispose() { super.dispose(); NuxDeviceControl.instance().removeListener(_onStateChanged); } Widget _createScrollPicker( bool smallControls, bool showPlay, bool playEnabled) { var picker = DrumStyleScrollPicker( smallControls: smallControls, selectedDrumPattern: _selectedDrumPattern, layout: _layout, device: device, drumStyles: _drumStyles, onChanged: _onScrollPickerChanged, onChangedFinal: _onScrollPickerChangedFinal, onComplete: () => setState(() {})); if (!showPlay) return picker; return Row( children: [ Expanded(child: picker), IconButton( onPressed: !playEnabled || !NuxDeviceControl().isConnected ? null : () { device.setDrumsEnabled(!device.drumsEnabled); if (device.drumsEnabled == false) { TempoTrainer.instance().enable = false; } NuxDeviceControl.instance().forceNotifyListeners(); }, padding: const EdgeInsets.only(left: 12, right: 4), iconSize: smallControls ? 44 : 56, color: device.drumsEnabled ? Colors.orange : Colors.green, icon: Icon(device.drumsEnabled ? Icons.stop : Icons.play_arrow)) ], ); } Widget _landscapePlayControl(bool enabled) { return CircularButton( onPressed: TempoTrainer.instance().enable || !enabled ? null : () { device.setDrumsEnabled(!device.drumsEnabled); if (device.drumsEnabled == false) { TempoTrainer.instance().enable = false; } NuxDeviceControl.instance().forceNotifyListeners(); }, backgroundColor: device.drumsEnabled ? Colors.orange : Colors.green, icon: device.drumsEnabled ? Icons.stop : Icons.play_arrow); } Widget _createModeControl( {required bool looper, required bool landscape, required bool smallControls}) { double height = smallControls ? 48 : 56; if (landscape && !looper) { return SizedBox( height: height, child: const Center( child: Text( "Trainer", style: TextStyle(fontSize: 20), )), ); } if (landscape) { var controls = ["Trainer", "Looper"]; var mode = _mode; if (mode == DrumEditorMode.regular) mode = DrumEditorMode.trainer; return ConstrainedBox( constraints: BoxConstraints(maxHeight: height), child: ModeControlRegular( options: controls, textStyle: DrumEditor.fontStyle, selected: mode.index - 1, onSelected: (index) { _mode = DrumEditorMode.values[index + 1]; setState(() {}); }), ); } var controls = ["Regular", "Trainer"]; if (looper) controls.add("Looper"); return Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: ConstrainedBox( constraints: const BoxConstraints(maxHeight: 40), child: ModeControlRegular( options: controls, textStyle: DrumEditor.fontStyle, selected: _mode.index, onSelected: (index) { _mode = DrumEditorMode.values[index]; setState(() {}); }), ), ); } Widget _drumLevelSlider(bool small) { return ThickSlider( min: 0, max: 100, maxHeight: small ? 40 : null, activeColor: Colors.blue, label: "Drums Level", value: device.drumsVolume.toDouble(), labelFormatter: (val) => "${device.drumsVolume.round()} %", onChanged: (value, skip) { setState(() { device.setDrumsLevel(value, !skip); }); }, ); } bool _tempoControlsEnabled() { return !TempoTrainer.instance().enable && (device is! Looper || (device is Looper && (device as Looper).loopState == 0)); } Widget _tempoSlider(bool small, bool landscape) { if (_mode != DrumEditorMode.trainer || landscape) { return ThickSlider( enabled: _tempoControlsEnabled(), min: device.drumsMinTempo, max: device.drumsMaxTempo, maxHeight: small ? 40 : null, skipEmitting: 5, activeColor: Colors.blue, label: "Tempo", value: device.drumsTempo, labelFormatter: (val) => "${device.drumsTempo.toStringAsFixed(1)} BPM", onChanged: (val, skip) { setState(() { device.setDrumsTempo(val, !skip); }); }, ); } return const SizedBox.shrink(); } List _toneSliders(bool small) { if (device is! DrumsTone) return []; var dev = device as DrumsTone; return [ ThickSlider( min: 0, max: 100, maxHeight: small ? 40 : null, skipEmitting: 5, activeColor: Colors.blue, label: "Bass", value: dev.drumsBass, labelFormatter: (val) => "${dev.drumsBass.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.bass, !skip); setState(() {}); }, ), ThickSlider( min: 0, max: 100, maxHeight: small ? 40 : null, skipEmitting: 5, activeColor: Colors.blue, label: "Middle", value: dev.drumsMiddle, labelFormatter: (val) => "${dev.drumsMiddle.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.middle, !skip); setState(() {}); }, ), ThickSlider( min: 0, max: 100, maxHeight: small ? 40 : null, skipEmitting: 5, activeColor: Colors.blue, label: "Treble", value: dev.drumsTreble, labelFormatter: (val) => "${dev.drumsTreble.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.treble, !skip); setState(() {}); }, ) ]; } Widget _tapButton(bool smallControls) { return Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: TapButtons( smallControls: smallControls, device: device, onTempoModified: _modifyTempo, onTempoChanged: _onTempoChanged, enabled: _tempoControlsEnabled()), ); } @override Widget build(BuildContext context) { super.build(context); final mediaQuery = MediaQuery.of(context); final bool portrait = mediaQuery.orientation == Orientation.portrait; final bool smallControls = portrait ? mediaQuery.size.height < 690 : mediaQuery.size.height < 400; device = NuxDeviceControl.instance().device; final bool hasLooper = device is Looper; final bool looperEnabled = hasLooper && (device as Looper).loopState != 0; _layout = _drumStyles is List ? DrumEditorLayout.standard : DrumEditorLayout.extendedToneControls; _selectedDrumPattern = device.selectedDrumStyle; if (portrait) { return Column( mainAxisSize: MainAxisSize.max, //padding: const EdgeInsets.all(16.0), children: [ Card( color: Colors.grey[850], child: Padding( padding: const EdgeInsets.all(8.0), child: Column(children: [ _createScrollPicker(smallControls, true, !looperEnabled), const SizedBox(height: 6), _drumLevelSlider(smallControls), ]), ), ), _createModeControl( looper: hasLooper, landscape: false, smallControls: smallControls), Card( color: Colors.grey[850], child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ _tempoSlider(smallControls, false), if (_mode == DrumEditorMode.regular) _tapButton(smallControls), if (_mode == DrumEditorMode.regular && device is DrumsTone) ..._toneSliders(smallControls), if (_mode == DrumEditorMode.trainer) TempoTrainerSheet( smallControls: smallControls, overtakeDrums: true, enabled: !looperEnabled), if (_mode == DrumEditorMode.looper) LooperControl( onStateChanged: _onStateChanged, smallControls: smallControls, ), ], ), ), ), ], ); } var mode = _mode; if (mode == DrumEditorMode.regular) mode = DrumEditorMode.trainer; return Row( mainAxisSize: MainAxisSize.min, children: [ Expanded( flex: 1, child: Card( color: Colors.grey[850], child: Padding( padding: const EdgeInsets.all(6.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ _createScrollPicker(smallControls, false, false), const SizedBox(height: 6), _drumLevelSlider(smallControls), _tempoSlider(smallControls, true), _tapButton(smallControls), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (device is DrumsTone) CircularButton( icon: Icons.equalizer, backgroundColor: Colors.blue, onPressed: () { showModalBottomSheet( showDragHandle: true, context: context, builder: (context) { return const DrumEQBottomSheet(); }); }), _landscapePlayControl(!looperEnabled) ], )), ]), ), )), const SizedBox( width: 6, ), Expanded( flex: 1, child: Card( color: Colors.grey[850], child: Padding( padding: const EdgeInsets.all(6.0), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ Center( child: _createModeControl( looper: hasLooper, landscape: true, smallControls: smallControls)), const SizedBox(height: 6), if (!hasLooper || mode == DrumEditorMode.trainer) TempoTrainerSheet( smallControls: smallControls, overtakeDrums: false, enabled: device.drumsEnabled == TempoTrainer.instance().enable && !looperEnabled, ), if (mode == DrumEditorMode.looper) LooperControl( onStateChanged: _onStateChanged, smallControls: smallControls, ), ], ), ), )) ], ); } void _onScrollPickerChanged(value) { _selectedDrumPattern = value; setState(() {}); } void _onScrollPickerChangedFinal( int value, bool userGenerated, NuxDevice? device) { if (userGenerated) { _selectedDrumPattern = value; device?.setDrumsStyle(value); //workaround for a bug in Mighty Plug device?.setDrumsTempo(device.drumsTempo + 1, true); device?.setDrumsTempo(device.drumsTempo - 1, true); } } void _modifyTempo(double amount) { setState(() { double newTempo = device.drumsTempo + amount; device.setDrumsTempo(newTempo, true); }); } void _onTempoChanged(double value) { setState(() { device.setDrumsTempo(value, true); }); } void _onStateChanged() { _drumStyles = NuxDeviceControl.instance().device.getDrumStyles(); if (device.drumsEnabled == false && TempoTrainer.instance().enable == true) { TempoTrainer.instance().enable = false; } setState(() {}); } @override bool get wantKeepAlive => true; } ================================================ FILE: lib/UI/pages/drum_editor/drum_eq_bottom_sheet.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/features/drumsTone.dart'; import '../../widgets/thickSlider.dart'; class DrumEQBottomSheet extends StatefulWidget { const DrumEQBottomSheet({super.key}); @override State createState() => _DrumEQBottomSheetState(); } class _DrumEQBottomSheetState extends State { @override Widget build(BuildContext context) { var dev = NuxDeviceControl.instance().device as DrumsTone; return Column( mainAxisSize: MainAxisSize.min, children: [ ThickSlider( min: 0, max: 100, maxHeight: 45, skipEmitting: 5, activeColor: Colors.blue, label: "Bass", value: dev.drumsBass, handleVerticalDrag: false, labelFormatter: (val) => "${dev.drumsBass.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.bass, !skip); setState(() {}); }, ), ThickSlider( min: 0, max: 100, maxHeight: 45, skipEmitting: 5, activeColor: Colors.blue, label: "Middle", value: dev.drumsMiddle, handleVerticalDrag: false, labelFormatter: (val) => "${dev.drumsMiddle.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.middle, !skip); setState(() {}); }, ), ThickSlider( min: 0, max: 100, maxHeight: 45, skipEmitting: 5, activeColor: Colors.blue, label: "Treble", value: dev.drumsTreble, handleVerticalDrag: false, labelFormatter: (val) => "${dev.drumsTreble.round()} %", onChanged: (val, skip) { dev.setDrumsTone(val, DrumsToneControl.treble, !skip); setState(() {}); }, ), const SizedBox( height: 15, ) ], ); } } ================================================ FILE: lib/UI/pages/drum_editor/drumstyle_scroll_picker.dart ================================================ import 'package:flutter/material.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import 'DrumStyleBottomSheet.dart'; import 'drumEditor.dart'; class DrumStyleScrollPicker extends StatelessWidget { static const _fontStyle = TextStyle(fontSize: 20); final int selectedDrumPattern; final DrumEditorLayout layout; final NuxDevice device; final dynamic drumStyles; // Events final ValueChanged onChanged; final Function(int, bool, NuxDevice) onChangedFinal; final Function() onComplete; final bool smallControls; const DrumStyleScrollPicker( {super.key, required this.selectedDrumPattern, required this.layout, required this.device, required this.drumStyles, required this.onChanged, required this.onChangedFinal, required this.onComplete, required this.smallControls}); String _getComplexListStyle(Map list) { for (String cat in list.keys) { for (String style in list[cat]!.keys) { if (list[cat]![style] == selectedDrumPattern) return "$cat - $style"; } } return ""; } @override Widget build(BuildContext context) { return Semantics( label: "Drum style", child: ListTile( dense: smallControls, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5), side: const BorderSide(width: 1, color: Colors.white)), title: Text( layout == DrumEditorLayout.extendedToneControls ? _getComplexListStyle(drumStyles) : drumStyles[selectedDrumPattern], style: _fontStyle, overflow: TextOverflow.ellipsis, ), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { showModalBottomSheet( context: context, builder: (context) { return DrumStyleBottomSheet( styleMap: drumStyles, mode: layout == DrumEditorLayout.extendedToneControls ? DrumStyleMode.categorized : DrumStyleMode.flat, selected: selectedDrumPattern, onChange: (value) { onChangedFinal(value, true, device); }, ); }).whenComplete(() { onComplete(); }); }, ), ); } } ================================================ FILE: lib/UI/pages/drum_editor/looperPage.dart ================================================ import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/thickSlider.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/features/looper.dart'; import '../../../modules/tempo_trainer.dart'; import '../../widgets/circular_button.dart'; import '../../widgets/common/modeControlRegular.dart'; class LooperControl extends StatefulWidget { final VoidCallback onStateChanged; final bool smallControls; const LooperControl( {super.key, required this.onStateChanged, required this.smallControls}); @override State createState() => _LooperControlState(); } class _LooperControlState extends State { static const fontSize = TextStyle(fontSize: 18); late Looper _looper; late LooperData _data = LooperData(); Timer? _blinkTimer; StreamSubscription? _subscription; bool _blinkOn = true; @override void initState() { super.initState(); _looper = NuxDeviceControl().device as Looper; _subscription = _looper.getLooperDataStream().listen(_onData); _looper.requestLooperSettings(); _blinkTimer = Timer.periodic(const Duration(milliseconds: 400), _onBlink); } @override void dispose() { _subscription?.cancel(); _blinkTimer?.cancel(); super.dispose(); } void _onData(LooperData data) { _data = data; widget.onStateChanged(); setState(() {}); } void _onBlink(timer) { _blinkOn = !_blinkOn; setState(() {}); } IconData getRecordButtonIcon() { switch (_data.loopState) { case 0: case 1: return Icons.fiber_manual_record; case 2: case 4: return Icons.play_arrow; case 3: return Icons.fiber_smart_record; case 9: return Icons.pause; default: return Icons.fiber_manual_record; } } Color _getRecordButtonColor() { if (!_blinkOn && _data.loopState > 0 && _data.loopState < 4) { return Colors.grey[700]!; } switch (_data.loopState) { case 0: case 1: return Colors.red; case 2: case 4: return Colors.green; case 3: return Colors.amber[700]!; case 9: return Colors.green; default: return Colors.red; } } IconData getUndoButtonIcon() { if (_data.loopUndoState == 2) return Icons.redo; return Icons.undo; } Color _getUndoButtonColor() { if (_data.loopUndoState == 2) return Colors.purple[700]!; return Colors.blue; } bool getStopEnabled() { switch (_data.loopState) { case 2: case 3: return true; default: return false; } } bool getClearEnabled() { if (_data.loopState > 0 && _data.loopState < 5) return true; return false; } bool getUndoEnabled() { return _data.loopUndoState > 0; } @override Widget build(BuildContext context) { var looper = (NuxDeviceControl().device as Looper); var connected = NuxDeviceControl().isConnected; return Column(children: [ const SizedBox( height: 8, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: LayoutBuilder( builder: (content, constraints) { double width = constraints.maxWidth; double size = min((width - 28 * 4) / 8, 20); return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ CircularButton( icon: getRecordButtonIcon(), iconPadding: size, backgroundColor: _getRecordButtonColor(), onPressed: connected ? () { if (TempoTrainer.instance().enable == true) { TempoTrainer.instance().enable = false; } looper.looperRecordPlay(); } : null), CircularButton( icon: Icons.stop, iconPadding: size, backgroundColor: Colors.amber, onPressed: getStopEnabled() ? looper.looperStop : null), CircularButton( icon: Icons.clear, iconPadding: size, backgroundColor: Colors.amber, onPressed: getClearEnabled() ? looper.looperClear : null), CircularButton( iconPadding: size, icon: getUndoButtonIcon(), backgroundColor: _getUndoButtonColor(), onPressed: getUndoEnabled() ? looper.looperUndoRedo : null), ]); }, ), ), const SizedBox(height: 8), ListTile( enabled: connected, title: const Text("Recording", style: fontSize), trailing: ConstrainedBox( constraints: const BoxConstraints(maxHeight: 40), child: ModeControlRegular( options: const ["Normal", "Auto"], textStyle: fontSize, selected: looper.loopRecordMode, onSelected: connected ? (index) { looper.looperNrAr(index == 1); setState(() {}); } : null, ), ), ), const SizedBox( height: 8, ), ThickSlider( enabled: connected, min: 0, max: 100, maxHeight: widget.smallControls ? 40 : null, activeColor: Colors.blue, label: "Looper Level", value: looper.loopLevel.toDouble(), labelFormatter: (val) => val.toInt().toString(), onChanged: (value, skip) { looper.looperLevel(value.toInt()); setState(() {}); }, onDragEnd: (value) { looper.looperLevel(value.toInt()); setState(() {}); }, ) ]); } } ================================================ FILE: lib/UI/pages/drum_editor/tap_buttons.dart ================================================ import 'package:flutter/material.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../../utilities/DelayTapTimer.dart'; import 'drumEditor.dart'; class TapButtons extends StatelessWidget { final NuxDevice device; final Function(double) onTempoModified; final Function(double) onTempoChanged; final bool smallControls; final bool enabled; const TapButtons( {super.key, required this.device, required this.onTempoModified, required this.onTempoChanged, required this.smallControls, this.enabled = true}); void _onTapTempo() { DelayTapTimer.addClickTime(); var bpm = DelayTapTimer.calculateBpm(); if (bpm != false) { onTempoChanged(bpm); } } @override Widget build(BuildContext context) { return ConstrainedBox( constraints: BoxConstraints(maxHeight: smallControls ? 45 : 60), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox( width: 48, child: ElevatedButton( style: ElevatedButton.styleFrom(padding: EdgeInsets.zero), onPressed: enabled ? () => onTempoModified(-5) : null, child: const Text("-5", semanticsLabel: "Tempo -5", softWrap: false), ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: SizedBox( width: 48, child: ElevatedButton( style: ElevatedButton.styleFrom(padding: EdgeInsets.zero), onPressed: enabled ? () => onTempoModified(-1) : null, child: const Text("-1", semanticsLabel: "Tempo -1", softWrap: false), ), ), ), Expanded( child: ElevatedButton( onPressed: enabled ? _onTapTempo : null, style: ButtonStyle( overlayColor: MaterialStateProperty.resolveWith( (states) { return states.contains(MaterialState.pressed) ? Colors.lightBlue[100] : null; }, ), ), child: const Text( "Tap Tempo", style: DrumEditor.fontStyle, textAlign: TextAlign.center, ), ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 4), child: SizedBox( width: 48, child: ElevatedButton( style: ElevatedButton.styleFrom(padding: EdgeInsets.zero), onPressed: enabled ? () => onTempoModified(1) : null, child: const Text( "+1", softWrap: false, semanticsLabel: "Tempo +1", ), ), ), ), SizedBox( width: 48, child: ElevatedButton( style: ElevatedButton.styleFrom(padding: EdgeInsets.zero), onPressed: enabled ? () => onTempoModified(5) : null, child: const Text( "+5", softWrap: false, semanticsLabel: "Tempo +5", ), ), ) ], ), ); } } ================================================ FILE: lib/UI/pages/drum_editor/tempoTrainerSheet.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/drumEditor.dart'; import 'package:mighty_plug_manager/UI/widgets/common/modeControlRegular.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import '../../../modules/tempo_trainer.dart'; import '../../widgets/thickRangeSlider.dart'; import '../../widgets/thickSlider.dart'; class TempoTrainerSheet extends StatefulWidget { final bool smallControls; final bool overtakeDrums; final bool enabled; const TempoTrainerSheet( {Key? key, required this.smallControls, required this.overtakeDrums, this.enabled = true}) : super(key: key); @override State createState() => _TempoTrainerSheetState(); } class _TempoTrainerSheetState extends State with SingleTickerProviderStateMixin { final _tempoTrainer = TempoTrainer.instance(); late AnimationController _animationController; late Animation _animation; @override void initState() { super.initState(); _animationController = AnimationController( duration: const Duration(milliseconds: 16), vsync: this, )..repeat(); _animation = Tween(begin: 0.0, end: 1.0).animate(_animationController); NuxDeviceControl.instance().addListener(_updateBpm); } @override void dispose() { NuxDeviceControl.instance().removeListener(_updateBpm); _animationController.dispose(); super.dispose(); } static const List _dropDownValues = ['Beats', 'Seconds']; void _updateBpm() { if (widget.overtakeDrums && NuxDeviceControl.instance().device.drumsEnabled != _tempoTrainer.enable) { _tempoTrainer.enable = NuxDeviceControl.instance().device.drumsEnabled; } setState(() {}); } Widget _progressPlayPauseButton(bool small) { double size = small ? 60 : 80; return Padding( padding: const EdgeInsets.all(8.0), child: Stack( alignment: Alignment.center, children: [ SizedBox( width: size, height: size, child: AnimatedBuilder( animation: _animation, builder: (BuildContext context, Widget? child) { double fill = _tempoTrainer.getTimerCountdown(); return CircularProgressIndicator( value: fill, strokeWidth: 10, //backgroundColor: Colors.grey[300], valueColor: const AlwaysStoppedAnimation( Colors.green, ), ); }, ), ), ElevatedButton( onPressed: !widget.enabled || !NuxDeviceControl().isConnected ? null : () async { NuxDeviceControl.instance().device.setDrumsEnabled(false); await Future.delayed(const Duration(milliseconds: 50)); setState(() { _tempoTrainer.enable = !_tempoTrainer.enable; }); }, style: ElevatedButton.styleFrom( backgroundColor: _tempoTrainer.enable ? Colors.orange : Colors.green, shape: const CircleBorder(), padding: EdgeInsets.all(small ? 14 : 20), ), child: Icon(_tempoTrainer.enable ? Icons.stop : Icons.play_arrow), ), ], ), ); } @override Widget build(BuildContext context) { var device = NuxDeviceControl.instance().device; return Column(children: [ ThickRangeSlider( maxHeight: widget.smallControls ? 40 : null, min: device.drumsMinTempo, max: device.drumsMaxTempo, enabled: widget.enabled, activeColor: Colors.blue, values: _tempoTrainer.tempoRange, onChanged: (range, skip) { _tempoTrainer.tempoRange = range; setState(() {}); }, onDragEnd: (value) { _tempoTrainer.saveConfig(); }, label: 'Tempo Range', labelFormatter: (ranges) => "${ranges.start.round()} - ${ranges.end.round()}"), ListTile( enabled: widget.enabled, contentPadding: const EdgeInsets.symmetric(horizontal: 8), title: const FittedBox( alignment: Alignment.centerLeft, fit: BoxFit.none, child: Text( "Mode", style: TextStyle(fontSize: 20), ), ), trailing: ConstrainedBox( constraints: const BoxConstraints(maxHeight: 40), child: ModeControlRegular( options: _dropDownValues, textStyle: DrumEditor.fontStyle, selected: _tempoTrainer.changeMode.index, onSelected: !widget.enabled ? null : (index) { setState(() { _tempoTrainer.changeMode = TempoChangeMode.values[index]; _tempoTrainer.saveConfig(); }); }), ), ), ThickSlider( min: 2, max: 100, enabled: widget.enabled, maxHeight: widget.smallControls ? 40 : null, activeColor: Colors.blue, label: "Increase every", labelFormatter: (val) { return "${val.round()} ${_tempoTrainer.changeMode == TempoChangeMode.beat ? "beats" : "seconds"}"; }, value: _tempoTrainer.changeUnits.toDouble(), onChanged: (value, skip) { _tempoTrainer.changeUnits = value.round(); setState(() {}); }, onDragEnd: (value) { _tempoTrainer.saveConfig(); }), ThickSlider( min: 1, max: 20, enabled: widget.enabled, maxHeight: widget.smallControls ? 40 : null, activeColor: Colors.blue, label: "Increase by", labelFormatter: (val) { return "${val.round()} bpm"; }, value: _tempoTrainer.tempoStep.toDouble(), onChanged: (value, skip) { _tempoTrainer.tempoStep = value.round(); setState(() {}); }, onDragEnd: (value) { _tempoTrainer.saveConfig(); }), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ const Expanded(child: SizedBox.shrink()), _progressPlayPauseButton(widget.smallControls), Expanded( child: Padding( padding: const EdgeInsets.only(left: 8.0), child: Text( _tempoTrainer.enable ? "${device.drumsTempo.round()} bpm" : "", style: DrumEditor.fontStyle.copyWith( color: widget.enabled ? Colors.white : Colors.grey[600]), ), ), ) ], ), ]); } } ================================================ FILE: lib/UI/pages/drumsPage.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/drum_editor/drumEditor.dart'; class DrumsPage extends StatelessWidget { const DrumsPage({super.key}); @override Widget build(BuildContext context) { return const SafeArea( child: DrumEditor(), ); } } ================================================ FILE: lib/UI/pages/hotkeysMainPage.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/hotkeysSetup.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/devices/features/tuner.dart'; import 'package:mighty_plug_manager/midi/ControllerConstants.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; import '../../bluetooth/devices/features/looper.dart'; class HotkeysMainPage extends StatelessWidget { final MidiController controller; const HotkeysMainPage({Key? key, required this.controller}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Setup"), ), body: ListView( children: [ ListTile( title: const Text("Channel/Preset Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.Channels, ))), ), ListTile( title: const Text("Effect Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.EffectSlots, ))), ), ListTile( title: const Text("Parameter Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.EffectParameters, )))), ListTile( title: const Text("Drums Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.Drums, )))), if (NuxDeviceControl.instance().device is Looper) ListTile( title: const Text("Looper Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.Looper, )))), ListTile( title: const Text("JamTracks Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.JamTracks, )))), if (NuxDeviceControl.instance().device is Tuner) ListTile( title: const Text("Misc Hotkeys"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () => Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysSetup( controller: controller, category: HotkeyCategory.Misc, )))), ], ), ); } } ================================================ FILE: lib/UI/pages/hotkeysSetup.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/hotkeyInput.dart'; import 'package:mighty_plug_manager/UI/popups/midiControlInfo.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/MidiControllerHandles.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import 'package:mighty_plug_manager/midi/ControllerConstants.dart'; import 'package:mighty_plug_manager/midi/MidiControllerManager.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; class HotkeysSetup extends StatefulWidget { final MidiController controller; final HotkeyCategory category; const HotkeysSetup( {Key? key, required this.controller, required this.category}) : super(key: key); @override State createState() => _HotkeysSetupState(); } class _HotkeysSetupState extends State { Widget buildWidget(String name, IconData? icon, Color? color, HotkeyControl ctrl, int ctrlIndex, int ctrlSubIndex, bool sliderMode, {Function()? infoButton}) { //sliders are not enabled in hid mode bool enabled = !(sliderMode && widget.controller.type == ControllerType.Hid); Widget trailing; var hk = widget.controller.getHotkeyByFunction(ctrl, ctrlIndex, ctrlSubIndex); String key = hk == null ? "None" : hk.hotkeyName; if (infoButton == null) { trailing = Text(key); } else { trailing = Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( onPressed: infoButton, icon: const Icon(Icons.info_outline)), Text(key) ], ); } return ListTile( enabled: enabled, leading: Icon( icon, color: color, ), minLeadingWidth: 0, onTap: () { showDialog( context: context, builder: (BuildContext context) => HotkeyInputDialog().buildDialog( context, hotkeyName: name, midiController: widget.controller, ctrl: ctrl, ctrlIndex: ctrlIndex, ctrlSubIndex: ctrlSubIndex, sliderMode: sliderMode), ).then((value) { MidiControllerManager().cancelOnDataOverride(); setState(() {}); }); }, title: Text(name), subtitle: enabled ? null : const Text("Not supported in HID mode"), trailing: trailing); } List _buildChannelWidgets() { List widgets = []; widgets.add(buildWidget("Previous Channel", Icons.keyboard_arrow_left, null, HotkeyControl.PreviousChannel, 0, 0, false)); widgets.add(buildWidget("Next Channel", Icons.keyboard_arrow_right, null, HotkeyControl.NextChannel, 0, 0, false)); var colors = NuxDeviceControl.instance().device.presets[0].channelColorsList; for (int i = 0; i < NuxDeviceControl.instance().device.channelsCount; i++) { widgets.add(buildWidget("Channel ${i + 1}", Icons.circle, colors[i], HotkeyControl.ChannelByIndex, i, 0, false)); } widgets.add(buildWidget("Previous Preset", Icons.keyboard_double_arrow_up, null, HotkeyControl.PreviousPresetGlobal, 0, 0, false)); widgets.add(buildWidget("Next Preset", Icons.keyboard_double_arrow_down, null, HotkeyControl.NextPresetGlobal, 0, 0, false)); widgets.add(buildWidget( "Previous Preset in Category", Icons.keyboard_arrow_up, null, HotkeyControl.PreviousPresetCategory, 0, 0, false)); widgets.add(buildWidget( "Next Preset in Category", Icons.keyboard_arrow_down, null, HotkeyControl.NextPresetCategory, 0, 0, false)); return widgets; } List _buildEffectsWidgets() { List widgets = []; var dev = NuxDeviceControl.instance().device; for (int i = 0; i < dev.processorList.length; i++) { var fxid = dev.processorList[i].nuxFXID; var slot = dev.getPreset(dev.selectedChannel).getSlotFromFXID(fxid)!; //var count = // dev.getPreset(dev.selectedChannel).getEffectsForSlot(prc).length; //var index = fxid.toInt(); var name = dev.processorList[i].longName; var icon = dev.processorList[i].icon; var color = dev.processorList[i].color; var switchable = dev.getPreset(dev.selectedChannel).slotSwitchable(slot); var effects = dev.getPreset(dev.selectedChannel).getEffectsForSlot(slot); var fx = effects[0]; if (switchable) { widgets.add(buildWidget( "Switch $name on", icon, color, HotkeyControl.EffectSlotEnable, fx.midiControlOn!.id.index, 0, false)); widgets.add(buildWidget( "Switch $name off", icon, color, HotkeyControl.EffectSlotDisable, fx.midiControlOff!.id.index, 0, false)); widgets.add(buildWidget( "Toggle $name", icon, color, HotkeyControl.EffectSlotToggle, fx.midiControlToggle!.id.index, 0, false)); } if (effects.length > 1) { widgets.add(buildWidget( "Previous $name", icon, color, HotkeyControl.EffectDecrement, fx.midiControlPrev!.id.index, 0, false)); widgets.add(buildWidget( "Next $name", icon, color, HotkeyControl.EffectIncrement, fx.midiControlNext!.id.index, 0, false)); } } return widgets; } List _buildParametersWidgets() { List widgets = []; var dev = NuxDeviceControl.instance().device; //add master volume widgets.add(buildWidget("Volume", Icons.volume_up, Colors.white, HotkeyControl.MasterVolumeSet, 0, 0, true, infoButton: null)); List effectHandles = []; //enumerate all the slots in the signal chain for (int i = 0; i < dev.processorList.length; i++) { effectHandles.clear(); var fxid = dev.processorList[i].nuxFXID; var prc = dev.getPreset(dev.selectedChannel).getSlotFromFXID(fxid)!; var effects = dev.getPreset(dev.selectedChannel).getEffectsForSlot(prc); for (int p = 0; p < effects.length; p++) { for (var param in effects[p].parameters) { if (param.midiControllerHandle != null && !effectHandles.contains(param.midiControllerHandle)) { effectHandles.add(param.midiControllerHandle!); } } } var name = dev.processorList[i].longName; var icon = dev.processorList[i].icon; var color = dev.processorList[i].color; for (var handle in effectHandles) { var title = "$name ${handle.label}"; widgets.add(buildWidget(title, icon, color, HotkeyControl.ParameterSet, handle.id.index, 0, true, infoButton: () => _displayParameterInfo(effects, handle.id))); if (handle.id == ControllerHandleId.delayTime) { widgets.add(buildWidget("$name Tap Tempo", icon, color, HotkeyControl.DelayTapTempo, handle.id.index, 0, false, infoButton: null)); } } } return widgets; } List _buildWidgetsRange(HotkeyControl from, HotkeyControl to) { List widgets = []; for (int i = from.index; i <= to.index; i++) { HotkeyControl cat = HotkeyControl.values[i]; widgets.add( buildWidget(cat.label!, cat.icon, null, cat, 0, 0, cat.sliderMode)); } return widgets; } _displayParameterInfo(List effects, ControllerHandleId handleId) { showDialog( context: context, builder: (BuildContext context) => MidiControlInfoDialog() .buildDialog(context, effects: effects, handleId: handleId), ); } @override Widget build(BuildContext context) { List widgetList = []; String title = ""; switch (widget.category) { case HotkeyCategory.Channels: widgetList = _buildChannelWidgets(); title = "Channel Hotkeys"; break; case HotkeyCategory.EffectSlots: widgetList = _buildEffectsWidgets(); title = "Effect Hotkeys"; break; case HotkeyCategory.EffectParameters: widgetList = _buildParametersWidgets(); title = "Parameter Hotkeys"; break; case HotkeyCategory.Drums: title = "Drums Hotkeys"; widgetList = _buildWidgetsRange( HotkeyControl.DrumsStartStop, HotkeyControl.DrumsNextStyle); break; case HotkeyCategory.Looper: title = "Looper Hotkeys"; widgetList = _buildWidgetsRange( HotkeyControl.LooperRecord, HotkeyControl.LooperLevel); break; case HotkeyCategory.JamTracks: title = "JamTracks Hotkeys"; widgetList = _buildWidgetsRange( HotkeyControl.JamTracksPlayPause, HotkeyControl.JamTracksABRepeat); break; case HotkeyCategory.Misc: title = "Misc Hotkeys"; widgetList = _buildWidgetsRange( HotkeyControl.ToggleTuner, HotkeyControl.ToggleTuner); } return Scaffold( appBar: AppBar( title: Text(title), ), body: ListView( children: widgetList, ), ); } } ================================================ FILE: lib/UI/pages/jamTracks.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) //import 'package:audio_picker/audio_picker.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/setlistPage.dart'; import 'package:mighty_plug_manager/audio/setlistsPage.dart'; import 'package:mighty_plug_manager/audio/trackdata/trackData.dart'; import 'package:mighty_plug_manager/audio/tracksPage.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:permission_handler/permission_handler.dart'; import '../../audio/models/setlist.dart'; import '../../audio/setlist_player/setlistPlayerState.dart'; import '../../audio/widgets/jamtracksView.dart'; import '../../platform/platformUtils.dart'; import '../widgets/common/nestedWillPopScope.dart'; class JamTracks extends StatefulWidget { const JamTracks({Key? key}) : super(key: key); static final GlobalKey jamtracksNavigator = GlobalKey(); @override State createState() => _JamTracksState(); } class _JamTracksState extends State with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { late TabController cntrl; final SetlistPlayerState playerState = SetlistPlayerState.instance(); Permission? _mediaPermission; @override void initState() { super.initState(); DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); if (PlatformUtils.isAndroid) { deviceInfoPlugin.androidInfo.then((androidInfo) { int sdk = androidInfo.version.sdkInt; if (sdk < 33) { _mediaPermission = Permission.storage; } else { _mediaPermission = Permission.audio; } setState(() {}); }); } else if (PlatformUtils.isIOS) { _mediaPermission = Permission.storage; } cntrl = TabController(length: 2, vsync: this); cntrl.addListener(() { if (cntrl.index == 0) setState(() {}); }); PresetsStorage().waitLoading().then((value) { TrackData().waitLoading().then((value) { if (mounted) setState(() {}); }); }); playerState.addListener(onPlayerStateChange); } @override void dispose() { super.dispose(); cntrl.dispose(); playerState.removeListener(onPlayerStateChange); } void onPlayerStateChange() { setState(() {}); } Widget showSetlists() { var innerContext = JamTracks.jamtracksNavigator.currentContext!; return Setlists( onAllTracksSelect: () { Navigator.pushNamed(innerContext, '/setlist', arguments: SetlistArguments(TrackData().allTracks, true)); }, onSetlistSelect: (setlist) { Navigator.pushNamed(innerContext, '/setlist', arguments: SetlistArguments(setlist, false)) .then((value) => onPlayerStateChange()); }, ); } Widget mainView() { return Navigator( key: JamTracks.jamtracksNavigator, onGenerateRoute: (settings) { if (settings.name == '/') { return MaterialPageRoute( builder: (context) { return Column( children: [ TabBar( tabs: const [Tab(text: "Setlists"), Tab(text: "Tracks")], controller: cntrl, ), Expanded( child: TabBarView( controller: cntrl, children: [ showSetlists(), const TracksPage(), ], ), ), ], ); }, ); } else if (settings.name == "/setlist") { return MaterialPageRoute( builder: (context) { final SetlistArguments arguments = settings.arguments as SetlistArguments; return SetlistPage( setlist: arguments.setlist, readOnly: arguments.readOnly, ); }, ); } return null; }, ); } Widget _permissionInfo() { return Center( child: Padding( padding: const EdgeInsets.all(20.0), child: Column( mainAxisSize: MainAxisSize.min, children: [ const Text( textAlign: TextAlign.center, "To access your music files and play along to your favorite songs, the app requires permission to access your device's media library."), const SizedBox( height: 30, ), SizedBox( height: 60, child: ElevatedButton( child: const Text("Grant access to Media Library "), onPressed: () async { Stopwatch stopwatch = Stopwatch()..start(); var status = await _mediaPermission!.request(); stopwatch.stop(); if (status == PermissionStatus.permanentlyDenied && stopwatch.elapsedMilliseconds < 500) { await openAppSettings(); } setState(() {}); }, ), ), ], ), ), ); } Widget _jamtracksWidget() { return NestedWillPopScope( onWillPop: () { if (playerState.expanded) { playerState.toggleExpanded(); return Future.value(false); } else if (JamTracks.jamtracksNavigator.currentState?.canPop() ?? false) { JamTracks.jamtracksNavigator.currentState?.pop(); return Future.value(false); } return Future.value(true); }, child: JamtracksView(child: mainView())); } @override Widget build(BuildContext context) { super.build(context); return SafeArea( child: FutureBuilder( future: _mediaPermission?.status, builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData) { switch (snapshot.data) { case PermissionStatus.denied: return _permissionInfo(); case PermissionStatus.granted: return _jamtracksWidget(); default: return const Text("Permission declined"); } } return const SizedBox(); }, ), ); } @override bool get wantKeepAlive => true; } class SetlistArguments { final Setlist setlist; final bool readOnly; SetlistArguments(this.setlist, this.readOnly); } ================================================ FILE: lib/UI/pages/midiControllers.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/hotkeysMainPage.dart'; import 'package:mighty_plug_manager/UI/theme.dart'; import 'package:mighty_plug_manager/UI/widgets/MidiDeviceTile.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import 'package:mighty_plug_manager/midi/MidiControllerManager.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; import '../../bluetooth/ble_controllers/BLEController.dart'; class MidiControllers extends StatefulWidget { const MidiControllers({Key? key}) : super(key: key); @override State createState() => _MidiControllersState(); } class _MidiControllersState extends State { final ctrl = MidiControllerManager(); final midiHandler = BLEMidiHandler.instance(); @override void initState() { super.initState(); MidiControllerManager().addListener(onControllersUpdate); } @override void dispose() { super.dispose(); MidiControllerManager().removeListener(onControllersUpdate); } onControllersUpdate() { setState(() {}); } _onControllerSettings(MidiController controller) { Navigator.of(context).push(MaterialPageRoute( builder: (context) => HotkeysMainPage( controller: controller, ))); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("MIDI/HID Remote Control"), ), body: StreamBuilder( stream: midiHandler.status, builder: (context, snapshot) { return Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ ListTile( title: Text("Available Devices", style: AppThemeConfig.ListTileHeaderStyle), dense: true, trailing: !ctrl.isScanning ? null : const SizedBox( width: 15, height: 15, child: CircularProgressIndicator.adaptive()), ), Flexible( child: ConstrainedBox( constraints: const BoxConstraints(maxHeight: 250), child: ListView.builder( itemBuilder: (context, index) { var dev = ctrl.controllers[index]; return MidiControllerTile( controller: dev, onTap: () async { if (!dev.connected) { await dev.connect(); setState(() {}); } else { _onControllerSettings(dev); } }, onSettings: () => _onControllerSettings(dev), ); }, itemCount: ctrl.controllers.length, ), ), ), ElevatedButton( onPressed: ctrl.isScanning ? ctrl.stopScan : ctrl.startScan, child: !ctrl.isScanning ? const Text("Start Scanning") : const Text("Stop Scanning")), if (midiHandler.bleState == BleState.off) const Text("Enable Bluetooth to discover BLE MIDI devices"), const Divider(), ], ); }), ); } } ================================================ FILE: lib/UI/pages/mighty_patches_importer.dart ================================================ // import the necessary packages /* import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/savePreset.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'package:http/http.dart' as http; import 'package:qr_utils/qr_utils.dart'; // create a stateful widget for the page class MightyPatchesPage extends StatefulWidget { const MightyPatchesPage({super.key}); @override _MightyPatchesPageState createState() => _MightyPatchesPageState(); } // create the state class for the widget class _MightyPatchesPageState extends State { // create a web view controller late WebViewController _controller; bool _fromAppBar = false; @override void initState() { super.initState(); _fromAppBar = false; _controller = WebViewController() ..setJavaScriptMode(JavaScriptMode.unrestricted) ..enableZoom(false) ..setNavigationDelegate(NavigationDelegate( onPageFinished: (url) { _registerDOMChanged(); }, onProgress: (progress) { _addImportButtons(); }, )) ..addJavaScriptChannel( "flutter_inappwebview", onMessageReceived: (message) { // Handle the message received from JavaScript String jsonMessage = message.message; Map data = json.decode(jsonMessage); // Extract title and URL from the JSON data String title = data['title']; String imageUrl = data['imageUrl']; // Call your Flutter method with the title and image URL _importImage(imageUrl, title); }, ) ..addJavaScriptChannel("flutter_domchange", onMessageReceived: (message) { print("DOM Changed"); _addImportButtons(); }); _home(); } void _home() { _controller.loadRequest(Uri.parse('https://www.mightypatches.com/')); } void _registerDOMChanged() { const String script = ''' var observeDOM = (function(){ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; return function( obj, callback ) { if( !obj || obj.nodeType !== 1 ) return; if( MutationObserver ){ // define a new observer var mutationObserver = new MutationObserver(callback) // have the observer observe for changes in children mutationObserver.observe( obj, { childList:true, subtree:true }) return mutationObserver } // browser support fallback else if( window.addEventListener ){ obj.addEventListener('DOMNodeInserted', callback, false) obj.addEventListener('DOMNodeRemoved', callback, false) } } })() var observed = document.querySelector(".page-content, [data-elementor-type=single-post]"); observeDOM(observed, function(m){ flutter_domchange.postMessage(""); }); '''; _controller.runJavaScript(script); } void _addImportButtons() async { // Evaluate JavaScript to find elements and add import buttons const String script = ''' function getSmallestSizeImageUrl(srcset) { // Split the srcset into individual URL-width pairs const pairs = srcset.split(',').map(pair => pair.trim().split(' ')); // Find the pair with the smallest width const smallestPair = pairs.reduce((smallest, current) => { const currentWidth = parseInt(current[1], 10); const smallestWidth = parseInt(smallest[1], 10); return currentWidth < smallestWidth ? current : smallest; }, pairs[0]); // Return the URL from the smallest pair return smallestPair[0]; } var elements = document.querySelectorAll(".page-content [data-elementor-type=jet-listing-items]:not(:has(.import-button)), [data-elementor-type=single-post]:not(:has(.import-button))"); elements.forEach(function(element) { var imageWidget = element.querySelector(".elementor-widget-image"); var imgElement = imageWidget.querySelector("img"); //var imageUrl = imgElement.src; const srcset = imgElement.getAttribute('srcset'); const imageUrl = getSmallestSizeImageUrl(srcset); var titleElement = element.querySelector(".elementor-page-title .elementor-heading-title,.page-content .elementor-heading-title"); var title = titleElement.textContent; var importButton = document.createElement("a"); importButton.href = "javascript:void(0);"; // Placeholder href, you can change this importButton.className = "import-button"; importButton.style.position = "absolute"; importButton.style.bottom = "0"; importButton.style.right = "0"; importButton.style.width = "50%"; importButton.style.height = "50px"; importButton.style.backgroundColor = "blue"; importButton.style.color = "white"; importButton.style.display = "flex"; importButton.style.alignItems = "center"; importButton.style.justifyContent = "center"; importButton.innerHTML = "Import"; importButton.onclick = function() { // Send title and image URL to Flutter using the JavascriptChannel var data = { "title": title, "imageUrl": imageUrl }; flutter_inappwebview.postMessage(JSON.stringify(data)); }; imageWidget.appendChild(importButton); }); '''; _controller.runJavaScript(script); } // create a method to handle the import button click void _importImage(String imageUrl, String imageName) async { // get the image data from the url using http stream print("opening stream"); http.StreamedResponse response = await http.Client().send(http.Request('GET', Uri.parse(imageUrl))); print("Reading stream"); // get the byte data from the response stream List byteData = await response.stream.toBytes(); print("decoding QR"); // scan the image data using qr utils String? qrData = await QrUtils.scanImageFromData(byteData); print("Showing data"); // do something with the qr data, such as showing a dialog if (qrData != null) { var device = NuxDeviceControl.instance().device; var preset = device.setupDetachedPresetFromQRData(qrData); var saveDialog = SavePresetDialog( customName: imageName, customPreset: preset, device: device, confirmColor: Theme.of(context).hintColor); showDialog( context: context, builder: (BuildContext context) => saveDialog.buildDialog(device, context), ); } } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () async { if (_fromAppBar) return true; if (await _controller.canGoBack()) { _controller.goBack(); return false; } return true; }, child: SafeArea( child: Scaffold( appBar: AppBar( title: const Text('Mighty Patches'), leading: IconButton( icon: Icon(Icons.adaptive.arrow_back), onPressed: () { // Set the flag to true before popping the navigation _fromAppBar = true; Navigator.of(context).pop(); }, ), actions: [ IconButton(onPressed: _home, icon: const Icon(Icons.home)) ], ), body: WebViewWidget(controller: _controller)), ), ); } } */ ================================================ FILE: lib/UI/pages/presetEditor.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/audio/setlist_player/setlistPlayerState.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import '../popups/savePreset.dart'; import '../utils.dart'; import '../widgets/presets/channelSelector.dart'; import '../../bluetooth/devices/NuxDevice.dart'; import '../widgets/presets/trackEventsBlockInfo.dart'; import '../widgets/rounded_icon_button.dart'; class PresetEditor extends StatefulWidget { const PresetEditor({super.key}); @override _PresetEditorState createState() => _PresetEditorState(); } class _PresetEditorState extends State { late NuxDevice device; @override void initState() { super.initState(); device = NuxDeviceControl.instance().device; device.addListener(onDeviceDataChanged); NuxDeviceControl.instance().addListener(onDeviceChanged); SetlistPlayerState.instance().addListener(onJamTracksStateChange); } @override void dispose() { super.dispose(); device.removeListener(onDeviceDataChanged); NuxDeviceControl.instance().removeListener(onDeviceChanged); SetlistPlayerState.instance().removeListener(onJamTracksStateChange); } void onDeviceChanged() { if (device != NuxDeviceControl.instance().device) { device.removeListener(onDeviceDataChanged); device = NuxDeviceControl.instance().device; device.addListener(onDeviceDataChanged); } setState(() {}); } void onJamTracksStateChange() { setState(() {}); } void savePresetToDevice() { if (device.deviceControl.isConnected) { AlertDialogs.showConfirmDialog(context, title: "Save preset to device", cancelButton: "Cancel", confirmButton: "Save", confirmColor: Colors.red, description: "Are you sure?", onConfirm: (val) { if (val) device.saveNuxPreset(); }); } } void onDeviceDataChanged() { setState(() {}); } Widget wrapContainer(bool isExpanded, List children) { if (isExpanded) { return ConstrainedBox( constraints: const BoxConstraints(minHeight: 592), child: Column(children: children), ); } else { return ListView(children: children); } } @override Widget build(BuildContext context) { var layout = getEditorLayoutMode(MediaQuery.of(context)); bool uploadPresetEnabled = device.deviceControl.isConnected && device.presetSaveSupport; Widget ui = SafeArea( child: wrapContainer( layout == EditorLayoutMode.expand, [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: ButtonTheme( minWidth: 55, height: 45, buttonColor: Colors.blue, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ RoundedIconButton( onPressed: NuxDeviceControl.instance().changes.canUndo ? () { var changes = NuxDeviceControl.instance().changes; if (changes.canUndo) changes.undo(); setState(() {}); } : null, tooltip: "Undo", icon: const Icon(Icons.undo), ), const SizedBox( width: 2, ), RoundedIconButton( onPressed: NuxDeviceControl.instance().changes.canRedo ? () { var changes = NuxDeviceControl.instance().changes; if (changes.canRedo) changes.redo(); setState(() {}); } : null, icon: const Icon(Icons.redo), tooltip: "Redo", //padding: EdgeInsets.zero, ), ], ), Row( children: [ ToggleButtons( constraints: const BoxConstraints( minWidth: 55, maxWidth: 55, minHeight: 45, maxHeight: 45), isSelected: [ !NuxDeviceControl.instance().changes.canUndo ], selectedBorderColor: Colors.transparent, borderColor: Colors.blue, borderRadius: BorderRadius.circular(3), color: Colors.white, fillColor: Colors.blue, disabledColor: Colors.grey, onPressed: NuxDeviceControl.instance().changes.canUndo || NuxDeviceControl.instance().changes.canRedo ? (val) { var changes = NuxDeviceControl.instance().changes; if (changes.canUndo) { //we can go back (that's bad though) while (changes.canUndo) { changes.undo(); } } else { while (changes.canRedo) { changes.redo(); } } setState(() {}); } : null, children: const [ Tooltip( message: "Switch before/after", child: Icon(Icons.compare)) ], ) ], ), Row( children: [ Row( mainAxisSize: MainAxisSize.min, children: [ RoundedIconButton( tooltip: "Save to device", onPressed: !uploadPresetEnabled ? null : savePresetToDevice, icon: const Icon(Icons.save_alt), ), const SizedBox( width: 2, ), RoundedIconButton( tooltip: "Save as preset", icon: const Icon(Icons.playlist_add), onPressed: () { var saveDialog = SavePresetDialog( device: device, confirmColor: Theme.of(context).hintColor); showDialog( context: context, builder: (BuildContext context) => saveDialog.buildDialog(device, context), ); }, ) ], ), ], ) ], ), ), ), if (layout == EditorLayoutMode.expand) Flexible(child: ChannelSelector(device: device)) else ChannelSelector(device: device) ], ), ); var sps = SetlistPlayerState.instance(); if (sps.state != PlayerState.play || (sps.automation?.presetChangeEventsAvailable == false)) { return ui; } else { return TrackEventsBlockInfo( onBypass: () { setState(() {}); }, child: ui, ); } } } ================================================ FILE: lib/UI/pages/settings.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:wakelock_plus/wakelock_plus.dart'; import '../../bluetooth/NuxDeviceControl.dart'; import '../../bluetooth/bleMidiHandler.dart'; import '../../bluetooth/ble_controllers/BLEController.dart'; import '../../bluetooth/devices/NuxDevice.dart'; import '../../bluetooth/devices/features/tuner.dart'; import '../../platform/simpleSharedPrefs.dart'; import '../mightierIcons.dart'; import '../widgets/deviceList.dart'; import 'DebugConsolePage.dart'; import 'developerPage.dart'; import 'midiControllers.dart'; import 'settings_advanced.dart'; import 'tunerPage.dart'; enum TimeUnit { BPM, Seconds } const _timeUnit = ["BPM", "Seconds"]; class Settings extends StatefulWidget { static bool devMode = false; static String output = ""; const Settings({Key? key}) : super(key: key); static void print(String value) { if (output.isNotEmpty) output += "\n"; output += value; } @override State createState() => _SettingsState(); } class _SettingsState extends State { late final BLEMidiHandler midiHandler; String _version = ""; int devCounter = 0; @override void initState() { super.initState(); NuxDeviceControl.instance().addListener(_deviceChanged); midiHandler = BLEMidiHandler.instance(); PackageInfo.fromPlatform().then((PackageInfo packageInfo) { setState(() { _version = packageInfo.version; }); }); } @override void dispose() { NuxDeviceControl.instance().removeListener(_deviceChanged); super.dispose(); } void _deviceChanged() { setState(() {}); } @override Widget build(BuildContext context) { final NuxDevice device = NuxDeviceControl.instance().device; List items = Settings.output.split('\n'); return SafeArea( child: ListView( children: [ if (kDebugMode) ConstrainedBox( constraints: const BoxConstraints(maxHeight: 200), child: ListView.builder( shrinkWrap: true, itemBuilder: (context, index) { return Text(items[index]); }, itemCount: items.length, ), ), ListTileTheme( minLeadingWidth: 0, iconColor: Colors.white, child: Column( children: [ SwitchListTile( title: const Text("Keep Screen On"), value: SharedPrefs() .getValue(SettingsKeys.screenAlwaysOn, false), onChanged: (val) { setState(() { WakelockPlus.toggle(enable: val); SharedPrefs().setValue(SettingsKeys.screenAlwaysOn, val); }); }, ), ListTile( title: const Text("Delay Time Unit"), subtitle: Text(_timeUnit[SharedPrefs() .getValue(SettingsKeys.timeUnit, TimeUnit.BPM.index)]), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { var dialog = AlertDialogs.showOptionDialog(context, confirmButton: "OK", cancelButton: "Cancel", title: "Delay Time Unit", confirmColor: Theme.of(context).hintColor, value: SharedPrefs().getValue( SettingsKeys.timeUnit, TimeUnit.BPM.index), options: _timeUnit, onConfirm: (changed, newValue) { if (changed) { setState(() { SharedPrefs() .setValue(SettingsKeys.timeUnit, newValue); }); } }); showDialog( context: context, builder: (BuildContext context) => dialog, ); }, ), ListTile( enabled: !device.deviceControl.isConnected, title: const Text("Device"), subtitle: Text(device.productName), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { var dialog = AlertDialogs.showOptionDialog(context, confirmButton: "OK", cancelButton: "Cancel", title: "Select Device", confirmColor: Theme.of(context).hintColor, value: NuxDeviceControl.instance().deviceIndex, options: NuxDeviceControl.instance().deviceNameList, onConfirm: (changed, newValue) { if (changed) { NuxDeviceControl.instance().deviceIndex = newValue; setState(() {}); } }); showDialog( context: context, builder: (BuildContext context) => dialog, ); }, ), if (device.getAvailableVersions() > 1) ListTile( enabled: !device.deviceControl.isConnected, title: const Text("Firmware Version"), subtitle: Text( device.getProductNameVersion(device.productVersion)), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { var dialog = AlertDialogs.showOptionDialog(context, confirmButton: "OK", cancelButton: "Cancel", title: "Select Version", confirmColor: Theme.of(context).hintColor, value: NuxDeviceControl.instance().deviceFirmwareVersion, options: NuxDeviceControl.instance().deviceVersionsList, onConfirm: (changed, newValue) { if (changed) { NuxDeviceControl.instance().deviceFirmwareVersion = newValue; setState(() {}); } }); showDialog( context: context, builder: (BuildContext context) => dialog, ); }, ), //Automatically set matching cabinet when changing an amp CheckboxListTile( title: const Text("Set matching cabinets automatically"), value: SharedPrefs().getInt(SettingsKeys.changeCabs, 1) != 0, onChanged: (value) { setState(() { if (value != null) { SharedPrefs() .setInt(SettingsKeys.changeCabs, value ? 1 : 0); } }); }), const Divider(), if (device.deviceControl.isConnected && device is Tuner && (device as Tuner).tunerAvailable) ListTile( leading: const Icon(MightierIcons.tuner), title: const Text("Tuner"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => TunerPage( device: device, ))); }, ), device.getSettingsWidget(), ListTile( title: const Text("Remote Control"), subtitle: const Text("Use a MIDI/HID device to control the amp"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const MidiControllers())); }, ), ], ), ), if (midiHandler.permissionGranted) StreamBuilder( stream: midiHandler.status, builder: (BuildContext context, snapshot) { return StreamBuilder( builder: (BuildContext context, snapshot) { var btOn = midiHandler.bleState == BleState.on; if (!btOn) { return const ListTile( title: Text("Please, turn Bluetooth on!"), ); } bool scanning = midiHandler.isScanning; bool connected = NuxDeviceControl.instance().isConnected; return Column( children: [ Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( border: Border.all(color: Colors.grey)), height: 150, child: DeviceList(), ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ElevatedButton( onPressed: connected || scanning ? null : () { midiHandler.startScanning(true); }, child: const Text("Scan"), ), ElevatedButton( onPressed: connected || !scanning ? null : () { midiHandler.stopScanning(); }, child: const Text("Stop Scanning"), ), ElevatedButton( onPressed: !connected ? null : () { midiHandler.disconnectDevice(); setState(() {}); }, child: const Text("Disconnect"), ), ], ) ], ); }, stream: midiHandler.isScanningStream); }), if (!midiHandler.permissionGranted) ListTile( title: const Text( "Please, grant location permission", style: TextStyle(color: Colors.orange), ), onTap: () async { AlertDialogs.showLocationPrompt(context, true, () async { await Future.delayed(const Duration(milliseconds: 1000)); setState(() {}); }); }, ), const Divider(), ListTile( title: const Text("Advanced Settings"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const AdvancedSettings())); }, ), ListTile( title: const Text("App Version"), trailing: Text(_version), onTap: () { devCounter++; if (devCounter == 7) { Settings.devMode = true; SharedPrefs().setInt(SettingsKeys.hiddenSources, 1); setState(() {}); } }, ), if (Settings.devMode) ElevatedButton( onPressed: () => device.communication.fillTestData(), child: const Text("Fill test data")), if (Settings.devMode) ListTile( title: const Text("Debug Console"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const DebugConsole())); }), if (Settings.devMode) ListTile( title: const Text("MIDI Commands Utility"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const DeveloperPage())); }), // ListTile( // title: Text("More Info"), // onTap: () { // showAboutDialog( // context: context, // applicationIcon: // Icon(MightierIcons.amp, color: Colors.blue, size: 30), // applicationVersion: _version, // applicationLegalese: "© 2021 Dian Iliev (Tuntori)", // ); // }, // ), ], ), ); } } ================================================ FILE: lib/UI/pages/settings_advanced.dart ================================================ import 'package:flutter/material.dart'; import '../../bluetooth/NuxDeviceControl.dart'; import '../../platform/platformUtils.dart'; import '../../platform/simpleSharedPrefs.dart'; import 'calibration.dart'; class AdvancedSettings extends StatefulWidget { const AdvancedSettings({super.key}); @override State createState() => _AdvancedSettingsState(); } class _AdvancedSettingsState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Advanced Settings"), ), body: ListView( children: [ ListTile( enabled: NuxDeviceControl().isConnected, title: const Text("Calibrate BT Audio Latency"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => const Calibration())); }, ), if (PlatformUtils.isAndroid) CheckboxListTile( title: const Text("Use legacy waveform decoder"), subtitle: const Text( "Enable this if you experience crashes when editing tracks"), value: SharedPrefs().getInt(SettingsKeys.legacyDecoder, 0) != 0, onChanged: (value) { setState(() { if (value != null) { SharedPrefs() .setInt(SettingsKeys.legacyDecoder, value ? 1 : 0); } }); }), CheckboxListTile( title: const Text("Hide non-applicable presets"), value: SharedPrefs() .getInt(SettingsKeys.hideNotApplicablePresets, 0) != 0, onChanged: (value) { if (value != null) { SharedPrefs().setInt( SettingsKeys.hideNotApplicablePresets, value ? 1 : 0); } setState(() {}); NuxDeviceControl().forceNotifyListeners(); }), ], )); } } ================================================ FILE: lib/UI/pages/tunerPage.dart ================================================ import 'dart:async'; import 'package:flutter/material.dart'; import 'dart:math' as math; import '../../bluetooth/devices/NuxDevice.dart'; import '../../bluetooth/devices/features/tuner.dart'; import '../../midi/ControllerConstants.dart'; import '../../midi/MidiControllerManager.dart'; class TunerPage extends StatefulWidget { final NuxDevice device; const TunerPage({super.key, required this.device}) : assert(device is Tuner); static const indicatorsAmount = 21; //how many cents is half of the scale static const scaleSize = 50; static const colors = [ Colors.white, Color.fromARGB(255, 119, 202, 29), Colors.yellow, Colors.red ]; static const colorsInactive = [ Color(0x32FFFFFF), Color.fromARGB(50, 119, 202, 29), Color(0x32FFEB3B), Color(0x32F44336) ]; static List notes = [ "A ", "A♯", "B ", "C ", "C♯", "D ", "D♯", "E ", "F ", "F♯", "G ", "G♯" ]; @override State createState() => _TunerPageState(); } class _TunerPageState extends State { late Tuner _tuner; late TunerData data = TunerData(); StreamSubscription? _subscription; StreamSubscription? _hotkeySub; bool _tunerEnabled = false; bool _validDetection = false; Timer? _timeout; final List> _modeItems = []; final List> _referenceItems = []; @override void initState() { super.initState(); _tunerEnabled = false; _tuner = widget.device as Tuner; _subscription = _tuner.getTunerDataStream().listen(onData); _hotkeySub = MidiControllerManager() .controllerStream .listen(_onMidiControllerMessage); //if not requesting 2 times, the device does not answer _tuner.tunerRequestSettings(); _tuner.tunerRequestSettings(); for (var mode in TunerMode.values) { _modeItems.add(DropdownMenuItem( value: mode, child: Text(Tuner.modesString[mode.index]))); } for (int i = 0; i < 21; i++) { _referenceItems .add(DropdownMenuItem(value: i, child: Text("${430 + i} Hz"))); } } @override void dispose() { _timeout?.cancel(); _subscription?.cancel(); _hotkeySub?.cancel(); _tuner.tunerEnable(false); super.dispose(); } void _onMidiControllerMessage(HotkeyControl event) { if (event == HotkeyControl.ToggleTuner) { Navigator.maybePop(context); } } void onData(TunerData event) { if (!_tunerEnabled) { _tuner.tunerEnable(true); _tunerEnabled = true; } else { _validDetection = true; } data = event; setState(() {}); _timeout?.cancel(); _timeout = Timer(const Duration(seconds: 1), _onTimeout); } void _onTimeout() { if (data.mode == TunerMode.chromatic && data.note == 0 && data.cents == 50) { setState( () { _validDetection = false; }, ); } } Widget _indicator() { return LayoutBuilder( builder: (context, constraints) { var width = (constraints.maxWidth / TunerPage.indicatorsAmount) * 0.7; var height = constraints.maxHeight; int centralIndex = (TunerPage.indicatorsAmount / 2).floor(); int activeIndex = (math.max( math.min((data.cents - 50), TunerPage.scaleSize), -TunerPage.scaleSize) * centralIndex / TunerPage.scaleSize) .round() + centralIndex; List indicators = []; for (int i = 0; i < TunerPage.indicatorsAmount; i++) { int distance = (centralIndex - i).abs(); bool central = i == centralIndex; int colorIndex = 3; if (distance == 0) { colorIndex = 0; } else if (distance < centralIndex / 10 || distance == 1) { colorIndex = 1; } else if (distance < centralIndex / 2) { colorIndex = 2; } bool active = _validDetection && (data.note != 0 || data.stringNumber != 0 || data.cents != 0); Color color = active && i == activeIndex ? TunerPage.colors[colorIndex] : TunerPage.colorsInactive[colorIndex]; indicators.add(Container( width: central ? width * 1.5 : width, height: central ? height : height * 0.7, // - distance * 2, color: color, )); } return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: indicators, ); }, ); } Widget _noteDisplay() { String wholeNote = TunerPage.notes[data.note].characters.first; String sharp = TunerPage.notes[data.note].characters.last; String stringNumber = ""; if (!_validDetection || (data.note == 0 && data.stringNumber == 0 && data.cents == 0)) { wholeNote = "-"; sharp = " "; } else if (data.mode == TunerMode.bass && data.stringNumber == 5) { stringNumber = "L"; } else if (data.stringNumber > 0 && data.mode != TunerMode.chromatic) { stringNumber = data.stringNumber.toString(); } return Stack( alignment: Alignment.topCenter, children: [ Transform.translate( offset: const Offset(-47, 42), child: Text( stringNumber, style: const TextStyle(fontSize: 55, fontWeight: FontWeight.bold), ), ), Text( wholeNote, style: const TextStyle(fontSize: 100), ), Transform.translate( offset: const Offset(44, -14), child: Text( sharp, style: const TextStyle(fontSize: 50), ), ), ], ); } @override Widget build(BuildContext context) { bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; late List tunerWidgets; if (isPortrait) { tunerWidgets = [ Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: SizedBox(height: 100, child: _indicator()), ), _noteDisplay(), ]; } else { tunerWidgets = [ Row( children: [ Expanded( flex: 2, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: SizedBox(height: 100, child: _indicator()), ), ), Expanded(flex: 1, child: _noteDisplay()), IconButton( onPressed: () { _tuner.tunerMute(!data.muted); }, iconSize: 56, icon: Icon(data.muted ? Icons.volume_off : Icons.volume_up)) ], ) ]; } return Scaffold( appBar: AppBar(title: const Text("Tuner")), body: Padding( padding: const EdgeInsets.all(8.0), child: Column(children: [ ...tunerWidgets, ListTile( title: const Text("Mode"), trailing: DropdownButton( value: data.mode, items: _modeItems, onChanged: (index) { setState(() { data.clear(); _tuner.tunerSetMode(index!); }); }), ), ListTile( title: const Text("Reference"), trailing: DropdownButton( value: data.referencePitch, items: _referenceItems, onChanged: (index) { setState(() { _tuner.tunerSetReferencePitch(index!); }); }), ), if (isPortrait) IconButton( onPressed: () { _tuner.tunerMute(!data.muted); }, iconSize: 56, icon: Icon(data.muted ? Icons.volume_off : Icons.volume_up)) ]), ), ); } } ================================================ FILE: lib/UI/popups/alertDialogs.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; class AlertDialogs { static TextEditingController? nameCtrl; static final _inputFormKey = GlobalKey(); static showInfoDialog(BuildContext context, {required String title, required String description, required String confirmButton, Function()? onConfirm, Color? confirmColor}) { // set up the buttons Widget continueButton = TextButton( child: Text( confirmButton, style: TextStyle(color: confirmColor), ), onPressed: () { Navigator.of(context).pop(); onConfirm?.call(); }, ); // set up the AlertDialog AlertDialog alert = AlertDialog( title: Text(title), content: Text(description), actions: [ continueButton, ], ); // show the dialog showDialog( context: context, builder: (BuildContext context) { return alert; }, ); } static showConfirmDialog(BuildContext context, {required String title, required String description, required String confirmButton, required String cancelButton, Function(bool)? onConfirm, Color? confirmColor}) { // set up the buttons Widget cancel = TextButton( child: Text(cancelButton), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); onConfirm?.call(false); }, ); Widget continueButton = TextButton( child: Text( confirmButton, style: TextStyle(color: confirmColor), ), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); onConfirm?.call(true); }, ); // set up the AlertDialog AlertDialog alert = AlertDialog( title: Text(title), content: Text(description), actions: [ cancel, continueButton, ], ); // show the dialog showDialog( context: context, builder: (BuildContext context) { return alert; }, ); } static showInputDialog(BuildContext context, {required String title, required String description, String confirmButton = "OK", String cancelButton = "Cancel", required String value, bool selectAll = false, Function(String)? onConfirm, bool Function(String)? validation, TextInputType? keyboardType, String validationErrorMessage = "", Color? confirmColor}) { final nameCtrl = TextEditingController(text: value); if (selectAll) { nameCtrl.selection = TextSelection(baseOffset: 0, extentOffset: value.length); } // set up the buttons Widget cancel = TextButton( child: Text(cancelButton), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); }, ); Widget continueButton = TextButton( child: Text( confirmButton, style: TextStyle(color: confirmColor), ), onPressed: () { if (_inputFormKey.currentState!.validate()) { Navigator.of(context, rootNavigator: true).pop(); onConfirm?.call(nameCtrl.text); } else { //error } }, ); // set up the AlertDialog AlertDialog alert = AlertDialog( title: Text(title), content: Form( autovalidateMode: AutovalidateMode.onUserInteraction, key: _inputFormKey, child: TextFormField( decoration: InputDecoration(labelText: description), controller: nameCtrl, autofocus: true, keyboardType: keyboardType, //style: TextStyle(color: Colors.black), validator: (value) { if (value == null || value.isEmpty) { return 'Please enter name'; } if (validation != null && !validation(value)) { return validationErrorMessage; } return null; }, ), ), actions: [ cancel, continueButton, ], ); // show the dialog showDialog( context: context, builder: (BuildContext context) { return alert; }, ); } static showOptionDialog(BuildContext context, {required String title, required String confirmButton, required String cancelButton, required List options, required int value, required Function(bool, int) onConfirm, Function(int)? onSelectionChanged, Color? confirmColor}) { int selected = value; // set up the buttons return StatefulBuilder(builder: (context, setState) { Widget continueButton = TextButton( child: Text( confirmButton, style: TextStyle(color: confirmColor), ), onPressed: () { Navigator.of(context).pop(); onConfirm.call(true, selected); }, ); Widget closeButton = TextButton( child: Text(cancelButton), onPressed: () { Navigator.of(context).pop(); onConfirm.call(false, 0); }, ); var widgets = []; for (int i = 0; i < options.length; i++) { widgets.add( RadioListTile( value: i, groupValue: selected, title: Text(options[i]), onChanged: (currentUser) { setState(() { selected = i; onSelectionChanged?.call(selected); }); }, selected: selected == i, activeColor: Theme.of(context).hintColor, ), ); } // set up the AlertDialog AlertDialog alert = AlertDialog( title: Text(title), content: SizedBox( width: double.maxFinite, child: ListTileTheme( iconColor: Colors.white, child: ListView( shrinkWrap: true, children: widgets, ), ), ), actions: [ closeButton, continueButton, ], ); return alert; }); } static showLocationPrompt( BuildContext context, bool skipPrompt, Function? onPromptFinished) { if (skipPrompt) { _askLocation(onPromptFinished); return; } AlertDialogs.showConfirmDialog(context, title: "Location is required for Bluetooth", description: "Please, consider granting location permission. It is required for Bluetooth connection to work.", confirmButton: "Grant", cancelButton: "Keep denying", onConfirm: (val) { if (val) _askLocation(onPromptFinished); }); } static _askLocation(Function? onPromptFinished) async { var status = await Permission.location.request(); if (status.isPermanentlyDenied) await openAppSettings(); onPromptFinished?.call(); } } ================================================ FILE: lib/UI/popups/changeCategory.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import '../widgets/scrollParent.dart'; import '../../platform/presetsStorage.dart'; class ChangeCategoryDialog { static final _formKey = GlobalKey(); final categoryCtrl = TextEditingController(); final parentScroll = ScrollController(); String category; String name; final Color? confirmColor; Function(String) onCategoryChange; ChangeCategoryDialog( {required this.category, required this.name, required this.onCategoryChange, this.confirmColor}) { categoryCtrl.text = category; } Widget buildDialog(BuildContext context) { List categories = PresetsStorage().getCategories(); final height = MediaQuery.of(context).size.height * 0.25; final node = FocusScope.of(context); return StatefulBuilder( builder: (context, setState) { return AlertDialog( title: const Text('Change Preset Category'), content: SizedBox( width: double.maxFinite, child: SingleChildScrollView( reverse: true, controller: parentScroll, child: Form( autovalidateMode: AutovalidateMode.onUserInteraction, key: _formKey, child: Column( children: [ Text("Categories", style: TextStyle(color: Theme.of(context).hintColor)), const SizedBox( height: 10, ), Container( height: height, decoration: BoxDecoration( border: Border.all(color: Colors.grey[300]!), ), child: ScrollParent( controller: parentScroll, child: ListTileTheme( child: ListView.builder( physics: const ClampingScrollPhysics(), itemBuilder: (context, index) { return ListTile( title: Text(categories[index]), onTap: () { setState(() { categoryCtrl.text = categories[index]; }); }, ); }, itemCount: categories.length, ), ), ), ), TextFormField( decoration: const InputDecoration(labelText: "Category"), controller: categoryCtrl, validator: (value) { if (value == null || value.isEmpty) { return 'Please enter preset category'; } if (PresetsStorage().findPreset(name, value) != null) { return 'The category already contains a preset with this name!'; } return null; }, onEditingComplete: () => node.unfocus(), ), ], ), ), ), ), actions: [ TextButton( child: const Text("Cancel"), onPressed: () { Navigator.of(context).pop(); }, ), TextButton( onPressed: () { if (_formKey.currentState!.validate()) { //call change success onCategoryChange(categoryCtrl.value.text); Navigator.of(context).pop(); } }, child: Text( 'Change', style: TextStyle(color: confirmColor), ), ), ], ); }, ); } } ================================================ FILE: lib/UI/popups/exportQRCode.dart ================================================ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/platform/fileSaver.dart'; import 'package:path_provider/path_provider.dart'; import 'package:screenshot/screenshot.dart'; import 'package:path/path.dart' as path; import 'package:share_plus/share_plus.dart'; import '../../bluetooth/devices/NuxDevice.dart'; import '../../platform/platformUtils.dart'; class QRExportDialog { final Image qrImage; final String presetName; final NuxDevice device; QRExportDialog(this.qrImage, this.presetName, this.device); Widget buildDialog(BuildContext context) { ScreenshotController screenshotController = ScreenshotController(); return AlertDialog( title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context).pop()), const Text("Share QR Code", style: TextStyle(color: Colors.white)), ], ), insetPadding: EdgeInsets.zero, contentPadding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10), content: FittedBox( child: Column( mainAxisSize: MainAxisSize.min, children: [ Screenshot( controller: screenshotController, child: ColoredBox( color: Colors.white, child: Padding( padding: const EdgeInsets.symmetric(vertical: 10.0), child: Column( mainAxisSize: MainAxisSize.min, children: [ Text( device.getProductNameForQR(device.productVersion), style: const TextStyle( color: Colors.black, fontWeight: FontWeight.bold), ), qrImage, Text(presetName, style: const TextStyle( color: Colors.black, fontWeight: FontWeight.bold)) ], ), ), ), ), const SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ if (!PlatformUtils.isIOS) ElevatedButton.icon( onPressed: () async { //var path = '$directory'; //fileSave var data = await screenshotController.capture(); if (data != null) { saveFile("image/png", presetName, data); } }, icon: const Icon( Icons.save_alt, color: Colors.white, ), label: const Text("Save")), const SizedBox( width: 10, ), ElevatedButton.icon( onPressed: () async { Directory? storageDirectory; if (PlatformUtils.isAndroid) { storageDirectory = await getExternalStorageDirectory(); } else if (PlatformUtils.isIOS) { storageDirectory = await getApplicationDocumentsDirectory(); } var tracksPath = path.join(storageDirectory?.path ?? "", ""); //var path = '$directory'; await screenshotController.captureAndSave(tracksPath, fileName: "preset.png"); Share.shareXFiles([XFile('$tracksPath/preset.png')], text: 'QR Code', sharePositionOrigin: Rect.fromCenter( center: const Offset(100, 100), width: 100, height: 100)); }, icon: Icon( Icons.adaptive.share, color: Colors.white, ), label: const Text("Share")) ], ), ], ), )); } } ================================================ FILE: lib/UI/popups/hotkeyInput.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/midi/ControllerConstants.dart'; import 'package:mighty_plug_manager/midi/MidiControllerManager.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; class HotkeyInputDialog { late BuildContext _context; late TextEditingController controller; static const None = "None"; int? _hotkeyCode; late final MidiController _midiController; late HotkeyControl _control; late int _index; late int _subindex; bool _sliderMode = false; //slider mode vars int _previousCode = -1; int? previousSliderValue; bool _invert = false; _applyHotkey() { if (_hotkeyCode != null) { do { bool ignoreLowByte = _control == HotkeyControl.ParameterSet; var hk = _midiController.getHotkeyByCode(_hotkeyCode!, ignoreLowByte); if (hk != null) { _midiController.removeHotkey(hk); } else { break; } } while (_control == HotkeyControl.ParameterSet); _midiController.assignHotkey( _control, _index, _subindex, _hotkeyCode!, controller.text, _invert); MidiControllerManager().saveConfig(); } else { _midiController.removeHotkeyByFunction(_control, _index, _subindex); MidiControllerManager().saveConfig(); } Navigator.of(_context).pop(); } _onControllerData( MidiController ctrl, int code, int? sliderValue, String name) { if (_midiController.id != ctrl.id) return; if (_sliderMode) { if (sliderValue == null) return; if (_invert) sliderValue = 127 - sliderValue; code &= 0xffffff00; if (code == _previousCode && previousSliderValue != sliderValue) { //valid adjustment name = name.substring(0, name.length - 2); name += sliderValue.toRadixString(16).padLeft(2, '0'); controller.text = name; _hotkeyCode = code; } _previousCode = code; previousSliderValue = sliderValue; } else { controller.text = name; _hotkeyCode = code; } } Widget buildDialog(BuildContext context, {required MidiController midiController, required HotkeyControl ctrl, required int ctrlIndex, required int ctrlSubIndex, required String hotkeyName, required bool sliderMode}) { _midiController = midiController; _context = context; _control = ctrl; _index = ctrlIndex; _subindex = ctrlSubIndex; _sliderMode = sliderMode; var hk = _midiController.getHotkeyByFunction(ctrl, ctrlIndex, ctrlSubIndex); controller = TextEditingController(text: hk == null ? None : hk.hotkeyName); _invert = hk?.invertSlider ?? false; MidiControllerManager().overrideOnData(_onControllerData); return FocusScope( autofocus: true, onKey: (node, event) { if (event.runtimeType.toString() == 'RawKeyDownEvent' && event.logicalKey.keyId != 0x100001005) { MidiControllerManager().onHIDData(event); } return KeyEventResult.skipRemainingHandlers; }, child: StatefulBuilder(builder: (context, setState) { return AlertDialog( contentPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context).pop()), const Text('Set hotkey'), ], ), content: Column(mainAxisSize: MainAxisSize.min, children: [ if (sliderMode) Text( "Adjust the pedal/knob/slider you wish to assign to $hotkeyName") else Text("Press the control you wish to assign to $hotkeyName"), if (sliderMode) CheckboxListTile( title: const Text("Invert"), value: _invert, onChanged: (value) { setState(() { _invert = value!; }); }), AbsorbPointer( child: TextField( controller: controller, readOnly: true, autofocus: false, ), ) ]), actions: [ TextButton( onPressed: () { controller.text = None; _hotkeyCode = null; }, child: const Text("Clear")), TextButton( onPressed: () => Navigator.of(context).pop(), child: const Text("Cancel")), TextButton( onPressed: _applyHotkey, child: Text( "OK", style: TextStyle(color: Theme.of(context).hintColor), )) ], actionsAlignment: MainAxisAlignment.spaceBetween, ); }), ); } } ================================================ FILE: lib/UI/popups/midiControlInfo.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import '../../bluetooth/devices/effects/MidiControllerHandles.dart'; class MidiControlInfoDialog { Widget buildDialog(BuildContext context, {required List effects, required ControllerHandleId handleId}) { return AlertDialog( contentPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context).pop()), const Text('Control Info'), ], ), content: Container( height: 400, width: 300, decoration: BoxDecoration( border: Border.all(color: Colors.grey[300]!), ), child: ListView.builder( itemBuilder: (context, index) { String paramName = "N/A"; for (var param in effects[index].parameters) { if (param.midiControllerHandle != null && param.midiControllerHandle!.id == handleId) { paramName = param.name; } } return ListTile( title: Text(effects[index].name), trailing: Text(paramName), ); }, itemCount: effects.length, ), ), ); } } ================================================ FILE: lib/UI/popups/savePreset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import '../../bluetooth/devices/presets/Preset.dart'; import '../widgets/scrollParent.dart'; import '../../bluetooth/devices/NuxDevice.dart'; import '../../platform/presetsStorage.dart'; import 'alertDialogs.dart'; class SavePresetDialog { static final _formKey = GlobalKey(); final categoryCtrl = TextEditingController(); final nameCtrl = TextEditingController(); final parentScroll = ScrollController(); final String? customName; final Preset? customPreset; final NuxDevice device; final Color? confirmColor; late NuxDeviceControl deviceControl; SavePresetDialog( {required this.device, this.confirmColor, this.customName, this.customPreset}) { deviceControl = device.deviceControl; categoryCtrl.text = deviceControl.presetCategory; if (customName != null) { nameCtrl.text = customName!; } else { nameCtrl.text = deviceControl.presetName; } } Widget buildDialog(NuxDevice device, BuildContext context) { List categories = PresetsStorage().getCategories(); var isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; final height = MediaQuery.of(context).size.height * 0.25; final node = FocusScope.of(context); return StatefulBuilder( builder: (context, setState) { var dialog = AlertDialog( title: const Text('Save preset'), content: SizedBox( width: double.maxFinite, child: SingleChildScrollView( reverse: true, controller: parentScroll, child: Form( autovalidateMode: AutovalidateMode.onUserInteraction, key: _formKey, child: Column( children: [ Text("Categories", style: TextStyle(color: Theme.of(context).hintColor)), const SizedBox( height: 10, ), Container( height: height, decoration: BoxDecoration( border: Border.all(color: Colors.grey[300]!), ), child: ScrollParent( controller: parentScroll, child: ListTileTheme( child: ListView.builder( physics: const ClampingScrollPhysics(), itemBuilder: (context, index) { return ListTile( title: Text(categories[index]), onTap: () { setState(() { categoryCtrl.text = categories[index]; }); }, ); }, itemCount: categories.length, ), ), ), ), TextFormField( decoration: const InputDecoration(labelText: "Category"), controller: categoryCtrl, validator: (value) { if (value == null || value.isEmpty) { return 'Please enter preset category'; } return null; }, onEditingComplete: () => node.nextFocus(), ), TextFormField( decoration: const InputDecoration(labelText: "Name"), controller: nameCtrl, validator: (value) { if (value == null || value.isEmpty) { return 'Please enter preset name'; } return null; }, onEditingComplete: () => node.unfocus(), ), ], ), ), ), ), actions: [ TextButton( child: const Text("Cancel"), onPressed: () { Navigator.of(context).pop(); }, ), TextButton( onPressed: () { if (_formKey.currentState!.validate()) { //save and pop if (PresetsStorage().presetExists( nameCtrl.value.text, categoryCtrl.value.text)) { //overwriting preset AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Overwrite existing preset?", cancelButton: "Cancel", confirmButton: "Overwrite", confirmColor: Colors.red, onConfirm: (overwrite) { if (overwrite) { savePreset(context); Navigator.of(context).pop(); } }); } else { savePreset(context); Navigator.of(context).pop(); } } }, child: Text( 'Save', style: TextStyle(color: confirmColor), ), ), ], ); if (isPortrait) { return dialog; } else { return SingleChildScrollView( child: dialog, ); } }, ); } savePreset(context) { var preset = device.presetToJson(customPreset: customPreset); if (customPreset == null) { deviceControl.presetName = nameCtrl.value.text; deviceControl.presetCategory = categoryCtrl.value.text; } String uuid = PresetsStorage() .savePreset(preset, nameCtrl.value.text, categoryCtrl.value.text); if (customPreset == null) { deviceControl.presetUUID = uuid; } } } ================================================ FILE: lib/UI/popups/selectPreset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import '../widgets/presets/preset_list/presetList.dart'; class SelectPresetDialog { Widget buildDialog(BuildContext context, {required bool noneOption}) { return AlertDialog( contentPadding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context, rootNavigator: true).pop()), const Text('Select preset'), ], ), actions: [], content: Scaffold( body: ListView( shrinkWrap: true, scrollDirection: Axis.vertical, children: [ if (noneOption) ListTile( title: const Center(child: Text("None")), onTap: () => Navigator.of(context, rootNavigator: true).pop(false), ), PresetList( simplified: true, onTap: (preset) { Navigator.of(context, rootNavigator: true).pop(preset); }), ]), ), ); } } ================================================ FILE: lib/UI/popups/selectTrack.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/models/jamTrack.dart'; import 'package:mighty_plug_manager/audio/trackdata/trackData.dart'; import 'package:mighty_plug_manager/audio/tracksPage.dart'; class SelectTrackDialog { bool _multiselect = false; Map _selected = {}; Widget buildDialog(BuildContext context) { return StatefulBuilder(builder: (context, setState) { return AlertDialog( contentPadding: const EdgeInsets.only(bottom: 20), title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context).pop()), Expanded( child: _multiselect ? Text("${_selected.length} selected") : const Text('Select Track')), if (_multiselect) ElevatedButton( child: const Text("Add"), onPressed: () { List tracks = []; for (int i = 0; i < _selected.length; i++) { tracks.add(TrackData().tracks[_selected.keys.elementAt(i)]); } Navigator.of(context).pop(tracks); }, ) ], ), content: TracksPage( selectorOnly: true, onSelectedTrack: (track) { Navigator.of(context).pop(track); }, multiSelectState: (bool state, Map selected) { _multiselect = state; _selected = selected; setState(() {}); }, ), ); }); } } ================================================ FILE: lib/UI/theme.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; class AppThemeConfig { static double dragHandlesWidth = 56; static Color contextMenuIconColor = Colors.white; static bool allowRotation = true; static TextStyle ListTileHeaderStyle = const TextStyle(color: Colors.lightBlue, fontWeight: FontWeight.bold); static double toggleButtonHeight(bool hasLongNames) { if (hasLongNames) return 48; return 40; } } ThemeData getTheme() { return ThemeData( brightness: Brightness.dark, colorScheme: ColorScheme( brightness: Brightness.dark, primary: Colors.blue, //buttons onPrimary: Colors.white, //text on buttons secondary: Colors.white, onSecondary: Colors.grey, error: Colors.red, onError: Colors.white, background: Colors.grey, onBackground: Colors.grey, surface: Colors.grey[700]!, //appbar onSurface: Colors.white, //titlebar text ), //canvasColor: Colors.white, scaffoldBackgroundColor: Colors.grey[900], //primary color is AppBar bg color primaryColor: Colors.grey[800], //accentColor: Colors.white, //unselected labels hintColor: Colors.blue[300], disabledColor: Colors.grey[700], unselectedWidgetColor: Colors.white, inputDecorationTheme: InputDecorationTheme( labelStyle: const TextStyle(color: Colors.white), focusedBorder: const UnderlineInputBorder( borderSide: BorderSide(color: Colors.white)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey[600]!))), checkboxTheme: CheckboxThemeData(fillColor: MaterialStateColor.resolveWith((states) { return Colors.white; }), checkColor: MaterialStateColor.resolveWith((states) { return Colors.black; })), bottomNavigationBarTheme: BottomNavigationBarThemeData( type: BottomNavigationBarType.fixed, backgroundColor: Colors.grey[800], selectedItemColor: Colors.white, unselectedItemColor: Colors.grey[500], selectedIconTheme: const IconThemeData( size: 40, ), unselectedIconTheme: const IconThemeData( size: 30, ), ), textButtonTheme: TextButtonThemeData(style: ButtonStyle(foregroundColor: MaterialStateColor.resolveWith((states) { if (states.contains(MaterialState.disabled)) return Colors.grey[700]!; return Colors.grey[300]!; }))), elevatedButtonTheme: ElevatedButtonThemeData( style: ButtonStyle( backgroundColor: MaterialStateColor.resolveWith((states) { if (states.contains(MaterialState.disabled)) return Colors.grey[700]!; return Colors.blue; }), foregroundColor: MaterialStateColor.resolveWith((states) { if (states.contains(MaterialState.disabled)) return Colors.grey; return Colors.white; }), )), dialogTheme: DialogTheme( contentTextStyle: const TextStyle(color: Colors.white), backgroundColor: Colors.grey[800], //shape: RoundedRectangleBorder( // borderRadius: BorderRadius.all(Radius.circular(10))), ), toggleButtonsTheme: ToggleButtonsThemeData( color: Colors.grey[600], selectedColor: Colors.white, borderColor: Colors.grey[800], selectedBorderColor: Colors.grey[800], fillColor: Colors.transparent, borderWidth: 2, borderRadius: const BorderRadius.all(Radius.circular(12)), ), popupMenuTheme: PopupMenuThemeData(color: Colors.grey[700]), dividerTheme: const DividerThemeData(color: Colors.grey, indent: 15, endIndent: 15), ); } ================================================ FILE: lib/UI/toneshare/cloud_authentication.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/toneshare/cloud_login.dart'; import 'package:mighty_plug_manager/UI/toneshare/cloud_signup.dart'; enum AuthPage { signIn, signUp } class CloudAuthentication extends StatefulWidget { const CloudAuthentication({super.key}); @override State createState() => _CloudAuthenticationState(); } class _CloudAuthenticationState extends State { AuthPage _pageMode = AuthPage.signIn; void _showSignup() { setState(() { _pageMode = AuthPage.signUp; }); } void _showSignIn() { setState(() { _pageMode = AuthPage.signIn; }); } @override Widget build(BuildContext context) { if (_pageMode == AuthPage.signIn) { return SignInForm(onSignUpTap: _showSignup); } else { return SignUpForm(onSignInTap: _showSignIn); } } } ================================================ FILE: lib/UI/toneshare/cloud_login.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/modules/cloud/cloudManager.dart'; import 'package:pocketbase/pocketbase.dart'; import 'toneshare_main.dart'; class SignInForm extends StatefulWidget { final void Function() onSignUpTap; const SignInForm({super.key, required this.onSignUpTap}); @override _SignInFormState createState() => _SignInFormState(); } class _SignInFormState extends State { final _formKey = GlobalKey(); final _emailController = TextEditingController(); final _passwordController = TextEditingController(); String _errorMessage = ''; bool _validateAndSaveForm() { final form = _formKey.currentState; if (form?.validate() ?? false) { form?.save(); return true; } return false; } void _signInWithEmailAndPassword() async { if (_validateAndSaveForm()) { setState(() { _errorMessage = ""; }); try { ToneShare.startLoading(context); var result = await CloudManager.instance.signIn( email: _emailController.text.trim(), password: _passwordController.text.trim()); print(result); } on ClientException catch (e) { if (e.isAbort) { _errorMessage = "No internet connection"; } else { _errorMessage = e.response["message"]; //"Wrong credentials or account not verified"; } setState(() {}); } finally { ToneShare.stopLoading(context); } } } void _signInWithGoogle() async { // try { // // Trigger the authentication flow // final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); // // Obtain the auth details from the request // final GoogleSignInAuthentication? googleAuth = // await googleUser?.authentication; // // Create a new credential // final AuthCredential credential = GoogleAuthProvider.credential( // idToken: googleAuth?.idToken, // accessToken: googleAuth?.accessToken, // ); // await FirebaseAuth.instance.signInWithCredential(credential); // } on FirebaseAuthException catch (e) { // setState(() { // _errorMessage = e.message ?? "Unknown Error"; // }); // } } @override Widget build(BuildContext context) { return Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ TextFormField( controller: _emailController, keyboardType: TextInputType.emailAddress, decoration: const InputDecoration( labelText: 'Email', ), validator: (value) { if (value?.isEmpty ?? true) { return 'Please enter your email'; } return null; }, ), const SizedBox(height: 16), TextFormField( controller: _passwordController, obscureText: true, decoration: const InputDecoration( labelText: 'Password', ), validator: (value) { if (value?.isEmpty ?? true) { return 'Please enter your password'; } return null; }, ), const SizedBox(height: 16), Text( _errorMessage, style: const TextStyle(color: Colors.red), ), const SizedBox(height: 16), ElevatedButton( onPressed: _signInWithEmailAndPassword, child: const Text('Sign In'), ), const SizedBox(height: 16), ElevatedButton( onPressed: _signInWithGoogle, child: const Text('Sign in with Google'), ), const SizedBox(height: 16), GestureDetector( onTap: widget.onSignUpTap, child: const Text('Don\'t have an account? Sign up'), ), ], ), ); } } ================================================ FILE: lib/UI/toneshare/cloud_signup.dart ================================================ import 'package:flutter/material.dart'; import 'package:pocketbase/pocketbase.dart'; import '../../modules/cloud/cloudManager.dart'; import 'toneshare_main.dart'; class SignUpForm extends StatefulWidget { final void Function() onSignInTap; const SignUpForm({super.key, required this.onSignInTap}); @override _SignUpFormState createState() => _SignUpFormState(); } class _SignUpFormState extends State { final _formKey = GlobalKey(); final _emailController = TextEditingController(); final _passwordController = TextEditingController(); String _errorMessage = ''; bool _validateAndSaveForm() { final form = _formKey.currentState; if (form?.validate() ?? false) { form?.save(); return true; } return false; } void _signUpWithEmailAndPassword() async { if (_validateAndSaveForm()) { setState(() { _errorMessage = ""; }); try { ToneShare.startLoading(context); var result = await CloudManager.instance.register( email: _emailController.text.trim(), password: _passwordController.text.trim()); print(result); } on ClientException catch (e) { if (e.isAbort) { _errorMessage = "No internet connection"; } else { Map data = e.response["data"]; if (data.containsKey("email") && data["email"]["code"] == "validation_invalid_email") { _errorMessage = data["email"]["message"]; } else { _errorMessage = e.response["message"]; } //"Wrong credentials or account not verified"; } setState(() {}); } finally { ToneShare.stopLoading(context); } } } void _signUpWithGoogle() async { // try { // // Trigger the authentication flow // final GoogleSignUpAccount? googleUser = await GoogleSignUp().SignUp(); // // Obtain the auth details from the request // final GoogleSignUpAuthentication? googleAuth = // await googleUser?.authentication; // // Create a new credential // final AuthCredential credential = GoogleAuthProvider.credential( // idToken: googleAuth?.idToken, // accessToken: googleAuth?.accessToken, // ); // await FirebaseAuth.instance.SignUpWithCredential(credential); // } on FirebaseAuthException catch (e) { // setState(() { // _errorMessage = e.message ?? "Unknown Error"; // }); // } } @override Widget build(BuildContext context) { return Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ TextFormField( controller: _emailController, keyboardType: TextInputType.emailAddress, decoration: const InputDecoration( labelText: 'Email', ), validator: (value) { if (value?.isEmpty ?? true) { return 'Please enter your email'; } return null; }, ), const SizedBox(height: 16), TextFormField( controller: _passwordController, obscureText: true, decoration: const InputDecoration( labelText: 'Password', ), validator: (value) { if (value?.isEmpty ?? true) { return 'Please enter your password'; } return null; }, ), const SizedBox(height: 16), Text( _errorMessage, style: const TextStyle(color: Colors.red), ), const SizedBox(height: 16), ElevatedButton( onPressed: _signUpWithEmailAndPassword, child: const Text('Sign Up'), ), ElevatedButton( onPressed: _signUpWithGoogle, child: const Text('Sign in with Google'), ), ElevatedButton( onPressed: () => CloudManager.instance .requestValidation(_emailController.text.trim()), child: const Text('Validado'), ), const SizedBox(height: 16), GestureDetector( onTap: widget.onSignInTap, child: const Text('Already have an account? Sign in'), ), ], ), ); } } ================================================ FILE: lib/UI/toneshare/share_preset.dart ================================================ import 'package:flutter/material.dart'; class PresetForm extends StatefulWidget { @override _PresetFormState createState() => _PresetFormState(); } class _PresetFormState extends State { final _formKey = GlobalKey(); final List _instrumentOptions = [ "Electric guitar", "Bass guitar", "Acoustic guitar", ]; final List _genreOptions = [ "Rock", "Blues", "Pop", "Other", ]; String _name = ""; String _description = ""; String? _instrument; String? _genre; void _submitForm() { if (_formKey.currentState?.validate() ?? false) { // TODO: handle form submission } } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Create Preset"), ), body: Padding( padding: const EdgeInsets.all(16.0), child: Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ TextFormField( initialValue: _name, decoration: const InputDecoration( labelText: "Name", hintText: "Enter preset name", ), validator: (value) { if (value?.isEmpty ?? true) { return "Please enter a name"; } return null; }, onChanged: (value) => _name = value, ), const SizedBox(height: 16.0), TextFormField( initialValue: _description, decoration: const InputDecoration( labelText: "Description", hintText: "Enter preset description", ), maxLines: 3, onChanged: (value) => _description = value, ), const SizedBox(height: 16.0), DropdownButtonFormField( decoration: const InputDecoration( labelText: "Instrument", ), value: _instrument, items: _instrumentOptions .map((instrument) => DropdownMenuItem( value: instrument, child: Text(instrument), )) .toList(), onChanged: (value) => setState(() => _instrument = value ?? ""), ), const SizedBox(height: 16.0), DropdownButtonFormField( decoration: const InputDecoration( labelText: "Genre", ), value: _genre, items: _genreOptions .map((genre) => DropdownMenuItem( value: genre, child: Text(genre), )) .toList(), onChanged: (value) => setState(() => _genre = value ?? ""), ), const SizedBox(height: 32.0), Center( child: ElevatedButton( onPressed: _submitForm, child: const Text("Upload"), ), ), ], ), ), ), ); } } ================================================ FILE: lib/UI/toneshare/toneshare_home.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/modules/cloud/cloudManager.dart'; import '../widgets/common/searchTextField.dart'; class ToneShareHome extends StatefulWidget { ToneShareHome({super.key}); @override State createState() => _ToneShareHomeState(); } class _ToneShareHomeState extends State { final TextEditingController searchCtrl = TextEditingController(text: ""); List? data; @override void initState() { super.initState(); //searchCtrl.addListener(_search); } void _search(String? query) async { if (query == null || query.isEmpty) return; final response = null; /*await Supabase.instance.client .from("presets") .select("*") .textSearch("name", query, type: TextSearchType.websearch);*/ if (response != null) { // Process results //final results = response.data; // Do something with the results data = response; } setState(() {}); } @override void dispose() { // TODO: implement dispose super.dispose(); //searchCtrl.removeListener(() {}); } @override Widget build(BuildContext context) { return Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ ElevatedButton( child: const Text("Sync"), onPressed: CloudManager.instance.syncPresets), SearchTextField(controller: searchCtrl, onSearch: _search), Expanded( child: ListView.builder( itemCount: data?.length ?? 0, itemBuilder: (context, index) { return ListTile( title: Text(data![index]["name"]), ); }, )), ElevatedButton( child: const Text("Sign Out"), onPressed: CloudManager.instance.signOut) ], ); } } ================================================ FILE: lib/UI/toneshare/toneshare_main.dart ================================================ import 'package:flutter/material.dart'; import '../../modules/cloud/cloudManager.dart'; import 'cloud_authentication.dart'; import 'toneshare_home.dart'; class ToneShare extends StatefulWidget { const ToneShare({super.key}); @override State createState() => _ToneShareState(); static Future startLoading(BuildContext context) async { return await showDialog( context: context, barrierDismissible: false, builder: (BuildContext context) { return const SimpleDialog( elevation: 0.0, backgroundColor: Colors.black45, // can change this to your prefered color children: [ Center( child: CircularProgressIndicator.adaptive(), ) ], ); }, ); } static Future stopLoading(BuildContext context) async { Navigator.of(context).pop(); } } class _ToneShareState extends State { @override void initState() { super.initState(); CloudManager.instance.addListener(_onAuthChange); } @override void dispose() { super.dispose(); CloudManager.instance.removeListener(_onAuthChange); } void _onAuthChange() { setState(() {}); } @override Widget build(BuildContext context) { Widget page; if (CloudManager.instance.signedIn) { page = ToneShareHome(); } else { page = const CloudAuthentication(); } return SafeArea( child: Scaffold( body: page, )); } } ================================================ FILE: lib/UI/utils.dart ================================================ import 'package:flutter/widgets.dart'; enum LayoutMode { navBar, drawer } enum EditorLayoutMode { scroll, expand } LayoutMode getLayoutMode(MediaQueryData mediaQuery) { final screenWidth = mediaQuery.size.width; final screenHeight = mediaQuery.size.height; if (screenHeight > 650) return LayoutMode.navBar; if (screenWidth >= 500) return LayoutMode.drawer; return LayoutMode.navBar; } EditorLayoutMode getEditorLayoutMode(MediaQueryData mediaQuery) { final screenHeight = mediaQuery.size.height; if (screenHeight <= 580) return EditorLayoutMode.scroll; return EditorLayoutMode.expand; } ================================================ FILE: lib/UI/widgets/MidiDeviceTile.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; class MidiControllerTile extends StatelessWidget { final MidiController controller; final Function() onTap; final Function() onSettings; const MidiControllerTile( {Key? key, required this.controller, required this.onTap, required this.onSettings}) : super(key: key); @override Widget build(BuildContext context) { IconData icon; switch (controller.type) { case ControllerType.Hid: icon = Icons.keyboard_alt_outlined; break; case ControllerType.MidiUsb: icon = Icons.usb; break; case ControllerType.MidiBle: icon = Icons.bluetooth; break; } return ListTile( title: Text(controller.name), onTap: onTap, trailing: Row( mainAxisSize: MainAxisSize.min, children: [ if (controller.connected) IconButton( icon: const Icon(Icons.settings), onPressed: onSettings, ), Icon( icon, color: controller.connected ? Colors.blue : Colors.grey, ), ], ), ); } } ================================================ FILE: lib/UI/widgets/ModeControl.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import 'package:tinycolor2/tinycolor2.dart'; import '../../bluetooth/devices/value_formatters/SwitchFormatters.dart'; class ModeControl extends StatelessWidget { final bool enabled; final double value; final Parameter parameter; final Color effectColor; final ValueChanged? onChanged; const ModeControl( {Key? key, required this.parameter, required this.value, required this.enabled, required this.effectColor, required this.onChanged}) : super(key: key); String getText() { return (parameter.formatter as SwitchFormatter).labelTitle; } List getElementsCount() { return (parameter.formatter as SwitchFormatter).labelValues; } List getElementValues() { return (parameter.formatter as SwitchFormatter).midiValues; } int getIndexByValue(int midiValue) { //find element that is closest to the value var list = (parameter.formatter as SwitchFormatter).midiValues; int closestValue = 255; int selected = -1; for (int i = 0; i < list.length; i++) { int diff = (list[i] - midiValue).abs(); if (diff < closestValue) { closestValue = diff; selected = i; } } return selected; } Widget getButtonItem(String text) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: Text( text, style: const TextStyle(fontSize: 20), ), ); } @override Widget build(BuildContext context) { return ConstrainedBox( constraints: const BoxConstraints(maxHeight: 45), child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { //width = constraints.maxWidth - 1; var color = enabled ? effectColor : TinyColor.fromColor(effectColor).desaturate(80).color; var elements = getElementsCount(); var active = List.filled(elements.length, false); var index = getIndexByValue(value.round()); active[index] = true; return ListTile( contentPadding: const EdgeInsets.symmetric(horizontal: 5), dense: true, title: Text(getText(), style: const TextStyle(color: Colors.white, fontSize: 20)), trailing: ToggleButtons( isSelected: active, fillColor: TinyColor.fromColor(color).darken(15).color, borderColor: color, selectedBorderColor: color, color: color, selectedColor: Colors.white, onPressed: (int newIndex) { var val = getElementValues()[newIndex]; onChanged?.call(val.toDouble()); }, children: [ for (var i = 0; i < elements.length; i++) getButtonItem(elements[i]), ], ), ); })); } } ================================================ FILE: lib/UI/widgets/NuxAppBar.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import 'package:mighty_plug_manager/midi/MidiControllerManager.dart'; import '../../bluetooth/ble_controllers/BLEController.dart'; import '../../bluetooth/devices/features/tuner.dart'; import '../../midi/ControllerConstants.dart'; import '../mightierIcons.dart'; import '../pages/tunerPage.dart'; import 'common/blinkWidget.dart'; class MAAppBar extends StatefulWidget implements PreferredSizeWidget { final double? elevation; final bool showExpandButton; final bool expanded; final Function(bool)? onExpandStateChanged; const MAAppBar({ this.elevation, this.showExpandButton = false, this.onExpandStateChanged, this.expanded = true, Key? key, }) : super(key: key); @override Size get preferredSize => const Size.fromHeight(46); @override State createState() => _NuxAppBarState(); } class _NuxAppBarState extends State { static const batteryKey = "batteryValue"; int? batteryValue; StreamSubscription? _hotkeySub; @override void initState() { super.initState(); batteryValue = PageStorage.of(context) .readState(context, identifier: batteryKey) as int?; _hotkeySub = MidiControllerManager() .controllerStream .listen(_onMidiControllerMessage); } @override void dispose() { // TODO: implement dispose super.dispose(); _hotkeySub?.cancel(); } void _onMidiControllerMessage(HotkeyControl event) { if (ModalRoute.of(context)?.isCurrent == false) { return; } if (event == HotkeyControl.ToggleTuner) { var dev = NuxDeviceControl().device; if (dev is Tuner) { var tuner = dev as Tuner; if (tuner.tunerAvailable) { Navigator.of(context).push(MaterialPageRoute( builder: (context) => TunerPage( device: dev, ))); } } } } @override Widget build(BuildContext context) { var devControl = NuxDeviceControl.instance(); return Row( mainAxisSize: MainAxisSize.min, children: [ if (widget.showExpandButton) Container( height: kToolbarHeight, width: kToolbarHeight, color: Theme.of(context).primaryColor, child: IconButton( icon: Icon( widget.expanded ? Icons.arrow_left : Icons.arrow_right, size: 32, ), onPressed: () { widget.onExpandStateChanged?.call(!widget.expanded); }, ), ), if (widget.expanded) Expanded( child: AppBar( elevation: widget.elevation, title: const AppBarTitle(), titleSpacing: widget.showExpandButton ? 0 : null, centerTitle: widget.showExpandButton ? false : null, actions: [ //battery percentage StreamBuilder( stream: devControl.batteryPercentage, builder: (context, batteryPercentage) { if (devControl.isConnected && (batteryPercentage.data != 0 || batteryValue != null) && devControl.device.batterySupport) { if (batteryPercentage.hasData) { batteryValue = batteryPercentage.data; } if (batteryValue != null) { PageStorage.of(context).writeState( context, batteryValue, identifier: batteryKey); } return Stack( alignment: Alignment.center, children: [ Transform.rotate( angle: pi / 2, child: const Icon( Icons.battery_full, size: 40, )), Text( "$batteryValue%", style: const TextStyle( color: Colors.black, fontSize: 12, fontWeight: FontWeight.bold), ) ], ); } return const SizedBox(); }, ), const SizedBox(width: 8), if (!widget.showExpandButton) StreamBuilder( stream: devControl.connectStatus, builder: (context, AsyncSnapshot snapshot) { if (snapshot.data != DeviceConnectionState.disconnected && devControl.device is Tuner && (devControl.device as Tuner).tunerAvailable) { return IconButton( icon: const Icon(MightierIcons.tuner), onPressed: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => TunerPage( device: devControl.device, ))); }); } return const SizedBox(); }, ), StreamBuilder( stream: BLEMidiHandler.instance().status, builder: (context, snapshot) { IconData icon = Icons.bluetooth_disabled; Color color = Colors.grey; var status = BLEMidiHandler.instance().currentStatus; switch (status) { case MidiSetupStatus.bluetoothOff: icon = Icons.bluetooth_disabled; break; case MidiSetupStatus.deviceIdle: case MidiSetupStatus.deviceConnecting: icon = Icons.bluetooth; break; case MidiSetupStatus .deviceFound: //note device found is issued //during search only, but here it means nothing //so keep search status case MidiSetupStatus.deviceSearching: icon = Icons.bluetooth_searching; return const BlinkWidget( interval: 500, children: [ Icon( Icons.bluetooth_searching, color: Colors.grey, ), Icon(Icons.bluetooth_searching) ], ); case MidiSetupStatus.deviceConnected: icon = Icons.bluetooth_connected; color = Colors.white; batteryValue = null; break; case MidiSetupStatus.deviceDisconnected: icon = Icons.bluetooth; break; case MidiSetupStatus.unknown: icon = Icons.bluetooth_disabled; break; } return Icon(icon, color: color); }, ), const SizedBox( width: 15, ) ], ), ) ], ); } } class AppBarTitle extends StatelessWidget { const AppBarTitle({super.key}); @override Widget build(BuildContext context) { return ValueListenableBuilder( builder: (BuildContext context, value, Widget? child) { if (value is String && value.trim() != "") { return Text("$value - Mightier Amp"); } return const Text("Mightier Amp"); }, valueListenable: NuxDeviceControl.instance().presetNameNotifier, ); } } ================================================ FILE: lib/UI/widgets/VolumeDrawer.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../../bluetooth/NuxDeviceControl.dart'; import '../../platform/simpleSharedPrefs.dart'; import 'thickSlider.dart'; const _kBottomDrawerPickHeight = 50.0; const _kBottomDrawerHiddenHeight = 60.0; const _kBottomDrawerHiddenPadding = 8.0; class BottomDrawer extends StatelessWidget { final bool isBottomDrawerOpen; final Function(bool) onExpandChange; final Widget child; const BottomDrawer({ Key? key, required this.isBottomDrawerOpen, required this.onExpandChange, required this.child, }) : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { onExpandChange(!isBottomDrawerOpen); }, onVerticalDragUpdate: (details) { if (details.delta.dy < -5) { //open onExpandChange(true); } else if (details.delta.dy > 5) { //close onExpandChange(false); } }, child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( width: _kBottomDrawerPickHeight, decoration: BoxDecoration( color: Theme.of(context).bottomNavigationBarTheme.backgroundColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(15)), ), child: Icon( isBottomDrawerOpen ? Icons.keyboard_arrow_down : Icons.keyboard_arrow_up, size: 24, color: Colors.grey, ), ), AnimatedContainer( padding: const EdgeInsets.all(_kBottomDrawerHiddenPadding), color: Theme.of(context).bottomNavigationBarTheme.backgroundColor, duration: const Duration(milliseconds: 100), height: isBottomDrawerOpen ? _kBottomDrawerHiddenHeight : 0, child: child, ), ], ), ); } } class VolumeSlider extends StatelessWidget { final String label; const VolumeSlider({Key? key, this.label = "Volume"}) : super(key: key); @override Widget build(BuildContext context) { return ValueListenableBuilder( valueListenable: NuxDeviceControl.instance().masterVolumeNotifier, builder: (context, value, child) { final device = NuxDeviceControl.instance().device; final volumeFormatter = device.fakeMasterVolume ? ValueFormatters.percentage : device.decibelFormatter!; return ThickSlider( activeColor: Colors.blue, value: NuxDeviceControl.instance().masterVolume, skipEmitting: 3, label: label, labelFormatter: volumeFormatter.toLabel, min: volumeFormatter.min.toDouble(), max: volumeFormatter.max.toDouble(), handleVerticalDrag: false, onChanged: _onVolumeChanged, onDragEnd: _onVolumeDragEnd, ); }, ); } void _onVolumeDragEnd(value) { NuxDeviceControl.instance().masterVolume = value; if (NuxDeviceControl.instance().device.fakeMasterVolume) { SharedPrefs().setValue( SettingsKeys.masterVolume, NuxDeviceControl.instance().masterVolume, ); } } void _onVolumeChanged(value, bool skip) { if (!skip) { NuxDeviceControl.instance().masterVolume = value; } } } ================================================ FILE: lib/UI/widgets/app_drawer.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/mightierIcons.dart'; import 'package:mighty_plug_manager/UI/widgets/NuxAppBar.dart'; import 'package:mighty_plug_manager/UI/widgets/VolumeDrawer.dart'; final _tiles = [ const TileModel(0, 'Editor', MightierIcons.sliders), const TileModel(1, 'Presets', Icons.list), const TileModel(2, 'Drums', MightierIcons.drum), const TileModel(3, 'Jam Tracks', Icons.queue_music), const TileModel(4, 'Settings', Icons.settings), ]; class AppDrawer extends StatefulWidget { final void Function(int) onSwitchPageIndex; final int currentIndex; final int totalTabs; const AppDrawer({ required this.onSwitchPageIndex, required this.currentIndex, required this.totalTabs, Key? key, }) : super(key: key); @override State createState() => _AppDrawerState(); } class _AppDrawerState extends State { static const expandedState = "expandedState"; bool isExpanded = false; bool isBottomDrawerOpen = false; bool expandChildren = false; @override void initState() { super.initState(); isExpanded = PageStorage.of(context) .readState(context, identifier: expandedState) as bool? ?? false; expandChildren = isExpanded; } void _onExpandChange(bool expand) { isExpanded = expand; PageStorage.of(context) .writeState(context, isExpanded, identifier: expandedState); if (isExpanded == false) expandChildren = false; setState(() {}); } @override Widget build(BuildContext context) { return GestureDetector( onHorizontalDragUpdate: (details) { if (details.delta.dx > 5) { //open _onExpandChange(true); } else if (details.delta.dx < -5) { //close _onExpandChange(false); } }, child: AnimatedContainer( color: Colors.grey[850], onEnd: () { if (isExpanded) expandChildren = true; setState(() {}); }, duration: const Duration(milliseconds: 200), width: isExpanded ? 230 : 56, child: SafeArea( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ MAAppBar( elevation: 0, expanded: expandChildren, showExpandButton: true, onExpandStateChanged: _onExpandChange, ), Expanded( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _DrawerTile( tileIndex: 0, onSwitchPageIndex: widget.onSwitchPageIndex, currentIndex: widget.currentIndex, expanded: expandChildren, ), _DrawerTile( tileIndex: 1, onSwitchPageIndex: widget.onSwitchPageIndex, currentIndex: widget.currentIndex, expanded: expandChildren, ), _DrawerTile( tileIndex: 2, onSwitchPageIndex: widget.onSwitchPageIndex, currentIndex: widget.currentIndex, expanded: expandChildren, ), _DrawerTile( tileIndex: 3, onSwitchPageIndex: widget.onSwitchPageIndex, currentIndex: widget.currentIndex, expanded: expandChildren, ), _DrawerTile( tileIndex: 4, onSwitchPageIndex: widget.onSwitchPageIndex, currentIndex: widget.currentIndex, expanded: expandChildren, ), ], ), ), ), if (isExpanded) BottomDrawer( isBottomDrawerOpen: isBottomDrawerOpen, onExpandChange: (val) => setState(() { isBottomDrawerOpen = val; }), child: const VolumeSlider(), ), ], ), ), ), ); } } class _DrawerTile extends StatelessWidget { final int tileIndex; final int currentIndex; final bool expanded; final void Function(int p1) onSwitchPageIndex; const _DrawerTile( {Key? key, required this.onSwitchPageIndex, required this.currentIndex, required this.tileIndex, required this.expanded}) : super(key: key); @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; final color = tileIndex == currentIndex ? colorScheme.primary : colorScheme.secondary; if (expanded) { return ListTile( selected: tileIndex == currentIndex, title: Text( _tiles.elementAt(tileIndex).title, // textAlign: TextAlign.right, ), leading: Icon( _tiles.elementAt(tileIndex).icon, ), minLeadingWidth: 10, onTap: () => onSwitchPageIndex(tileIndex), ); } else { return Padding( padding: const EdgeInsets.all(4), child: IconButton( onPressed: () => onSwitchPageIndex(tileIndex), icon: Icon( _tiles.elementAt(tileIndex).icon, color: color, )), ); } } } @immutable class TileModel { final int index; final String title; final IconData icon; const TileModel(this.index, this.title, this.icon); } ================================================ FILE: lib/UI/widgets/bottomBar.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/mightierIcons.dart'; class BottomBar extends StatefulWidget { final void Function(int) onTap; final int index; const BottomBar({ Key? key, required this.index, required this.onTap, }) : super(key: key); @override State createState() => _BottomBarState(); } class _BottomBarState extends State { @override Widget build(BuildContext context) { return BottomNavigationBar( currentIndex: widget.index, onTap: widget.onTap, items: const [ BottomNavigationBarItem( icon: Icon(MightierIcons.sliders), label: "Editor", ), BottomNavigationBarItem( icon: Icon(Icons.list), label: "Presets", ), BottomNavigationBarItem( icon: Icon(MightierIcons.drum), label: "Drums", ), BottomNavigationBarItem( icon: Icon(Icons.queue_music), label: "JamTracks", ), BottomNavigationBarItem( icon: Icon(Icons.settings), label: "Settings", ), ], ); } } ================================================ FILE: lib/UI/widgets/circular_button.dart ================================================ import 'package:flutter/material.dart'; class CircularButton extends StatelessWidget { final IconData icon; final Color backgroundColor; final void Function()? onPressed; final double iconSize; final double iconPadding; const CircularButton( {super.key, required this.icon, required this.backgroundColor, this.onPressed, this.iconPadding = 20, this.iconSize = 28}); @override Widget build(BuildContext context) { return ElevatedButton( onPressed: onPressed, style: ElevatedButton.styleFrom( shape: const CircleBorder(), padding: EdgeInsets.all(iconPadding), backgroundColor: backgroundColor, foregroundColor: Colors.white, ), child: Icon( icon, size: iconSize, ), ); } } ================================================ FILE: lib/UI/widgets/common/blinkWidget.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; class BlinkWidget extends StatefulWidget { final List children; final int interval; const BlinkWidget({required this.children, this.interval = 500, Key? key}) : super(key: key); @override State createState() => _BlinkWidgetState(); } class _BlinkWidgetState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; int _currentWidget = 0; @override initState() { super.initState(); _controller = AnimationController( duration: Duration(milliseconds: widget.interval), vsync: this); _controller.addStatusListener((status) { if (status == AnimationStatus.completed) { setState(() { if (++_currentWidget == widget.children.length) { _currentWidget = 0; } }); _controller.forward(from: 0.0); } }); _controller.forward(); } @override dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Container( child: widget.children[_currentWidget], ); } } ================================================ FILE: lib/UI/widgets/common/customPopupMenu.dart ================================================ // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; // Examples can assume: // enum Commands { heroAndScholar, hurricaneCame } // dynamic _heroAndScholar; // dynamic _selection; // BuildContext context; // void setState(VoidCallback fn) { } const Duration _kMenuDuration = Duration(milliseconds: 300); const double _kBaselineOffsetFromBottom = 20.0; const double _kMenuCloseIntervalEnd = 2.0 / 3.0; const double _kMenuHorizontalPadding = 0.0; //16.0; const double _kMenuItemHeight = 48.0; const double _kMenuDividerHeight = 16.0; const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep; const double _kMenuMinWidth = 2.0 * _kMenuWidthStep; const double _kMenuVerticalPadding = 0.0; //8.0; const double _kMenuWidthStep = 56.0; const double _kMenuScreenPadding = 8.0; /// A base class for entries in a material design popup menu. /// /// The popup menu widget uses this interface to interact with the menu items. /// To show a popup menu, use the [showMenu] function. To create a button that /// shows a popup menu, consider using [PopupMenuButton]. /// /// The type `T` is the type of the value(s) the entry represents. All the /// entries in a given menu must represent values with consistent types. /// /// A [PopupMenuEntry] may represent multiple values, for example a row with /// several icons, or a single entry, for example a menu item with an icon (see /// [PopupMenuItem]), or no value at all (for example, [PopupMenuDivider]). /// /// See also: /// /// * [PopupMenuItem], a popup menu entry for a single value. /// * [PopupMenuDivider], a popup menu entry that is just a horizontal line. /// * [CheckedPopupMenuItem], a popup menu item with a checkmark. /// * [showMenu], a method to dynamically show a popup menu at a given location. /// * [PopupMenuButton], an [IconButton] that automatically shows a menu when /// it is tapped. abstract class PopupMenuEntry extends StatefulWidget { /// Abstract const constructor. This constructor enables subclasses to provide /// const constructors so that they can be used in const expressions. const PopupMenuEntry({Key? key}) : super(key: key); /// The amount of vertical space occupied by this entry. /// /// This value is used at the time the [showMenu] method is called, if the /// `initialValue` argument is provided, to determine the position of this /// entry when aligning the selected entry over the given `position`. It is /// otherwise ignored. double get height; /// Whether this entry represents a particular value. /// /// This method is used by [showMenu], when it is called, to align the entry /// representing the `initialValue`, if any, to the given `position`, and then /// later is called on each entry to determine if it should be highlighted (if /// the method returns true, the entry will have its background color set to /// the ambient [ThemeData.highlightColor]). If `initialValue` is null, then /// this method is not called. /// /// If the [PopupMenuEntry] represents a single value, this should return true /// if the argument matches that value. If it represents multiple values, it /// should return true if the argument matches any of them. bool represents(T value); } /// A thin horizontal line, with padding on either side. /// /// In the material design language, this represents a divider. Dividers can be /// used in lists, [Drawer]s, and elsewhere to separate content. /// /// To create a divider between [ListTile] items, consider using /// [ListTile.divideTiles], which is optimized for this case. /// /// {@youtube 560 315 https://www.youtube.com/watch?v=_liUC641Nmk} /// /// The box's total height is controlled by [height]. The appropriate /// padding is automatically computed from the height. /// /// {@tool dartpad --template=stateless_widget_scaffold} /// /// This sample shows how to display a Divider between an orange and blue box /// inside a column. The Divider is 20 logical pixels in height and contains a /// vertically centered black line that is 5 logical pixels thick. The black /// line is indented by 20 logical pixels. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/divider.png) /// /// ```dart /// Widget build(BuildContext context) { /// return Center( /// child: Column( /// children: [ /// Expanded( /// child: Container( /// color: Colors.amber, /// child: const Center( /// child: Text('Above'), /// ), /// ), /// ), /// const Divider( /// color: Colors.black, /// height: 20, /// thickness: 5, /// indent: 20, /// endIndent: 0, /// ), /// Expanded( /// child: Container( /// color: Colors.blue, /// child: const Center( /// child: Text('Below'), /// ), /// ), /// ), /// ], /// ), /// ); /// } /// ``` /// {@end-tool} /// See also: /// /// * [PopupMenuDivider], which is the equivalent but for popup menus. /// * [ListTile.divideTiles], another approach to dividing widgets in a list. /// * class LabeledDivider extends StatelessWidget { /// Creates a material design divider. /// /// The [height], [thickness], [indent], and [endIndent] must be null or /// non-negative. const LabeledDivider( {Key? key, this.height, this.thickness, this.indent, this.insideIndent, this.color, required this.text}) : assert(height == null || height >= 0.0), assert(thickness == null || thickness >= 0.0), assert(indent == null || indent >= 0.0), assert(insideIndent == null || insideIndent >= 0.0), super(key: key); /// The divider's height extent. /// /// The divider itself is always drawn as a horizontal line that is centered /// within the height specified by this value. /// /// If this is null, then the [DividerThemeData.space] is used. If that is /// also null, then this defaults to 16.0. final double? height; /// The thickness of the line drawn within the divider. /// /// A divider with a [thickness] of 0.0 is always drawn as a line with a /// height of exactly one device pixel. /// /// If this is null, then the [DividerThemeData.thickness] is used. If /// that is also null, then this defaults to 0.0. final double? thickness; /// The amount of empty space to the leading edge of the divider. /// /// If this is null, then the [DividerThemeData.indent] is used. If that is /// also null, then this defaults to 0.0. final double? indent; /// The amount of empty space to the trailing edge of the divider. /// /// If this is null, then the [DividerThemeData.endIndent] is used. If that is /// also null, then this defaults to 0.0. final double? insideIndent; /// The color to use when painting the line. /// /// If this is null, then the [DividerThemeData.color] is used. If that is /// also null, then [ThemeData.dividerColor] is used. /// /// {@tool snippet} /// /// ```dart /// Divider( /// color: Colors.deepOrange, /// ) /// ``` /// {@end-tool} final Color? color; final String text; @override Widget build(BuildContext context) { final DividerThemeData dividerTheme = DividerTheme.of(context); final double height = this.height ?? dividerTheme.space ?? 16.0; final double thickness = this.thickness ?? dividerTheme.thickness ?? 1.0; final double indent = this.indent ?? dividerTheme.indent ?? 6.0; final double insideIndent = this.insideIndent ?? dividerTheme.endIndent ?? 4.0; return Container( color: Theme.of(context).popupMenuTheme.color, height: height, child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Container( margin: EdgeInsetsDirectional.only(start: indent, end: insideIndent), height: thickness, color: color, ), ), Text(text, style: TextStyle(color: color)), Expanded( child: Container( margin: EdgeInsetsDirectional.only(start: insideIndent, end: indent), height: thickness, color: color, ), ), ], ), ); } } /// A horizontal divider in a material design popup menu. /// /// This widget adapts the [Divider] for use in popup menus. /// /// See also: /// /// * [PopupMenuItem], for the kinds of items that this widget divides. /// * [showMenu], a method to dynamically show a popup menu at a given location. /// * [PopupMenuButton], an [IconButton] that automatically shows a menu when /// it is tapped. // ignore: prefer_void_to_null, https://github.com/dart-lang/sdk/issues/34416 class PopupMenuDivider extends PopupMenuEntry { /// Creates a horizontal divider for a popup menu. /// /// By default, the divider has a height of 16 logical pixels. const PopupMenuDivider( {Key? key, this.height = _kMenuDividerHeight, required this.text, this.color}) : super(key: key); /// The height of the divider entry. /// /// Defaults to 16 pixels. @override final double height; final String text; final Color? color; @override bool represents(void value) => false; @override State createState() => _PopupMenuDividerState(); } class _PopupMenuDividerState extends State { @override Widget build(BuildContext context) => LabeledDivider( color: widget.color, height: widget.height, text: widget.text, ); } /// An item in a material design popup menu. /// /// To show a popup menu, use the [showMenu] function. To create a button that /// shows a popup menu, consider using [PopupMenuButton]. /// /// To show a checkmark next to a popup menu item, consider using /// [CheckedPopupMenuItem]. /// /// Typically the [child] of a [PopupMenuItem] is a [Text] widget. More /// elaborate menus with icons can use a [ListTile]. By default, a /// [PopupMenuItem] is 48 pixels high. If you use a widget with a different /// height, it must be specified in the [height] property. /// /// {@tool sample} /// /// Here, a [Text] widget is used with a popup menu item. The `WhyFarther` type /// is an enum, not shown here. /// /// ```dart /// const PopupMenuItem( /// value: WhyFarther.harder, /// child: Text('Working a lot harder'), /// ) /// ``` /// {@end-tool} /// /// See the example at [PopupMenuButton] for how this example could be used in a /// complete menu, and see the example at [CheckedPopupMenuItem] for one way to /// keep the text of [PopupMenuItem]s that use [Text] widgets in their [child] /// slot aligned with the text of [CheckedPopupMenuItem]s or of [PopupMenuItem] /// that use a [ListTile] in their [child] slot. /// /// See also: /// /// * [PopupMenuDivider], which can be used to divide items from each other. /// * [CheckedPopupMenuItem], a variant of [PopupMenuItem] with a checkmark. /// * [showMenu], a method to dynamically show a popup menu at a given location. /// * [PopupMenuButton], an [IconButton] that automatically shows a menu when /// it is tapped. class PopupMenuItem extends PopupMenuEntry { /// Creates an item for a popup menu. /// /// By default, the item is [enabled]. /// /// The `height` and `enabled` arguments must not be null. const PopupMenuItem({ Key? key, required this.value, this.enabled = true, this.height = _kMenuItemHeight, this.backgroundColor, required this.child, }) : super(key: key); /// The value that will be returned by [showMenu] if this entry is selected. final T value; /// Whether the user is permitted to select this entry. /// /// Defaults to true. If this is false, then the item will not react to /// touches. final bool enabled; /// The height of the entry. /// /// Defaults to 48 pixels. @override final double height; /// The widget background color /// /// Defaults to white. final Color? backgroundColor; /// The widget below this widget in the tree. /// /// Typically a single-line [ListTile] (for menus with icons) or a [Text]. An /// appropriate [DefaultTextStyle] is put in scope for the child. In either /// case, the text should be short enough that it won't wrap. final Widget child; @override bool represents(T value) => value == this.value; @override PopupMenuItemState> createState() => PopupMenuItemState>(); } /// The [State] for [PopupMenuItem] subclasses. /// /// By default this implements the basic styling and layout of Material Design /// popup menu items. /// /// The [buildChild] method can be overridden to adjust exactly what gets placed /// in the menu. By default it returns [PopupMenuItem.child]. /// /// The [handleTap] method can be overridden to adjust exactly what happens when /// the item is tapped. By default, it uses [Navigator.pop] to return the /// [PopupMenuItem.value] from the menu route. /// /// This class takes two type arguments. The second, `W`, is the exact type of /// the [Widget] that is using this [State]. It must be a subclass of /// [PopupMenuItem]. The first, `T`, must match the type argument of that widget /// class, and is the type of values returned from this menu. class PopupMenuItemState> extends State { /// The menu item contents. /// /// Used by the [build] method. /// /// By default, this returns [PopupMenuItem.child]. Override this to put /// something else in the menu entry. @protected Widget buildChild() => widget.child; /// The handler for when the user selects the menu item. /// /// Used by the [InkWell] inserted by the [build] method. /// /// By default, uses [Navigator.pop] to return the [PopupMenuItem.value] from /// the menu route. @protected void handleTap() { Navigator.pop(context, widget.value); } @override Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); TextStyle style = theme.textTheme.titleMedium!; if (!widget.enabled) style = style.copyWith(color: theme.disabledColor); Widget item = AnimatedDefaultTextStyle( style: style, duration: kThemeChangeDuration, child: Baseline( baseline: widget.height - _kBaselineOffsetFromBottom, baselineType: style.textBaseline!, child: buildChild(), ), ); if (!widget.enabled) { final bool isDark = theme.brightness == Brightness.dark; item = IconTheme.merge( data: IconThemeData(opacity: isDark ? 0.5 : 0.38), child: item, ); } return InkWell( onTap: widget.enabled ? handleTap : null, child: Container( color: widget.backgroundColor ?? Theme.of(context).popupMenuTheme.color, height: widget.height, padding: const EdgeInsets.symmetric(horizontal: _kMenuHorizontalPadding), child: item, ), ); } } /// An item with a checkmark in a material design popup menu. /// /// To show a popup menu, use the [showMenu] function. To create a button that /// shows a popup menu, consider using [PopupMenuButton]. /// /// A [CheckedPopupMenuItem] is 48 pixels high, which matches the default height /// of a [PopupMenuItem]. The horizontal layout uses a [ListTile]; the checkmark /// is an [Icons.done] icon, shown in the [ListTile.leading] position. /// /// {@tool sample} /// /// Suppose a `Commands` enum exists that lists the possible commands from a /// particular popup menu, including `Commands.heroAndScholar` and /// `Commands.hurricaneCame`, and further suppose that there is a /// `_heroAndScholar` member field which is a boolean. The example below shows a /// menu with one menu item with a checkmark that can toggle the boolean, and /// one menu item without a checkmark for selecting the second option. (It also /// shows a divider placed between the two menu items.) /// /// ```dart /// PopupMenuButton( /// onSelected: (Commands result) { /// switch (result) { /// case Commands.heroAndScholar: /// setState(() { _heroAndScholar = !_heroAndScholar; }); /// break; /// case Commands.hurricaneCame: /// // ...handle hurricane option /// break; /// // ...other items handled here /// } /// }, /// itemBuilder: (BuildContext context) => >[ /// CheckedPopupMenuItem( /// checked: _heroAndScholar, /// value: Commands.heroAndScholar, /// child: const Text('Hero and scholar'), /// ), /// const PopupMenuDivider(), /// const PopupMenuItem( /// value: Commands.hurricaneCame, /// child: ListTile(leading: Icon(null), title: Text('Bring hurricane')), /// ), /// // ...other items listed here /// ], /// ) /// ``` /// {@end-tool} /// /// In particular, observe how the second menu item uses a [ListTile] with a /// blank [Icon] in the [ListTile.leading] position to get the same alignment as /// the item with the checkmark. /// /// See also: /// /// * [PopupMenuItem], a popup menu entry for picking a command (as opposed to /// toggling a value). /// * [PopupMenuDivider], a popup menu entry that is just a horizontal line. /// * [showMenu], a method to dynamically show a popup menu at a given location. /// * [PopupMenuButton], an [IconButton] that automatically shows a menu when /// it is tapped. class CheckedPopupMenuItem extends PopupMenuItem { /// Creates a popup menu item with a checkmark. /// /// By default, the menu item is [enabled] but unchecked. To mark the item as /// checked, set [checked] to true. /// /// The `checked` and `enabled` arguments must not be null. const CheckedPopupMenuItem({ Key? key, required T value, this.checked = false, bool enabled = true, required Widget child, }) : super( key: key, value: value, enabled: enabled, child: child, ); /// Whether to display a checkmark next to the menu item. /// /// Defaults to false. /// /// When true, an [Icons.done] checkmark is displayed. /// /// When this popup menu item is selected, the checkmark will fade in or out /// as appropriate to represent the implied new state. final bool checked; /// The widget below this widget in the tree. /// /// Typically a [Text]. An appropriate [DefaultTextStyle] is put in scope for /// the child. The text should be short enough that it won't wrap. /// /// This widget is placed in the [ListTile.title] slot of a [ListTile] whose /// [ListTile.leading] slot is an [Icons.done] icon. @override Widget get child => super.child; @override _CheckedPopupMenuItemState createState() => _CheckedPopupMenuItemState(); } class _CheckedPopupMenuItemState extends PopupMenuItemState> with SingleTickerProviderStateMixin { static const Duration _fadeDuration = Duration(milliseconds: 150); late AnimationController _controller; Animation get _opacity => _controller.view; @override void initState() { super.initState(); _controller = AnimationController(duration: _fadeDuration, vsync: this) ..value = widget.checked ? 1.0 : 0.0 ..addListener(() => setState(() {/* animation changed */})); } @override void handleTap() { // This fades the checkmark in or out when tapped. if (widget.checked) { _controller.reverse(); } else { _controller.forward(); } super.handleTap(); } @override Widget buildChild() { return ListTile( enabled: widget.enabled, leading: FadeTransition( opacity: _opacity, child: Icon(_controller.isDismissed ? null : Icons.done), ), title: widget.child, ); } } class _PopupMenu extends StatelessWidget { const _PopupMenu({ Key? key, required this.route, this.semanticLabel = "", this.controller, }) : super(key: key); final _PopupMenuRoute route; final String semanticLabel; final ScrollController? controller; @override Widget build(BuildContext context) { final double unit = 1.0 / (route.items.length + 1.5); // 1.0 for the width and 0.5 for the last item's fade. final List children = []; for (int i = 0; i < route.items.length; i += 1) { final double start = (i + 1) * unit; final double end = (start + 1.5 * unit).clamp(0.0, 1.0); final CurvedAnimation opacity = CurvedAnimation( parent: route.animation!, curve: Interval(start, end), ); Widget item = route.items[i]; if (route.initialValue != null && route.items[i].represents(route.initialValue)) { item = ColoredBox( color: Theme.of(context).highlightColor, child: item, ); } children.add(FadeTransition( opacity: opacity, child: item, )); } final CurveTween opacity = CurveTween(curve: const Interval(0.0, 1.0 / 3.0)); final CurveTween width = CurveTween(curve: Interval(0.0, unit)); final CurveTween height = CurveTween(curve: Interval(0.0, unit * route.items.length)); final Widget child = ConstrainedBox( constraints: const BoxConstraints( minWidth: _kMenuMinWidth, maxWidth: _kMenuMaxWidth, ), child: IntrinsicWidth( stepWidth: _kMenuWidthStep, child: Semantics( scopesRoute: true, namesRoute: true, explicitChildNodes: true, label: semanticLabel, child: SingleChildScrollView( controller: controller, padding: const EdgeInsets.symmetric(vertical: _kMenuVerticalPadding), child: ListBody(children: children), ), ), ), ); return AnimatedBuilder( animation: route.animation!, builder: (BuildContext context, Widget? child) { return Opacity( opacity: opacity.evaluate(route.animation!), child: Material( type: MaterialType.transparency, elevation: route.elevation, child: Align( alignment: AlignmentDirectional.topEnd, widthFactor: width.evaluate(route.animation!), heightFactor: height.evaluate(route.animation!), child: child, ), ), ); }, child: child, ); } } // Positioning of the menu on the screen. class _PopupMenuRouteLayout extends SingleChildLayoutDelegate { _PopupMenuRouteLayout( this.position, this.selectedItemOffset, this.textDirection); // Rectangle of underlying button, relative to the overlay's dimensions. final RelativeRect position; // The distance from the top of the menu to the middle of selected item. // // This will be null if there's no item to position in this way. final double selectedItemOffset; // Whether to prefer going to the left or to the right. final TextDirection textDirection; // We put the child wherever position specifies, so long as it will fit within // the specified parent size padded (inset) by 8. If necessary, we adjust the // child's position so that it fits. @override BoxConstraints getConstraintsForChild(BoxConstraints constraints) { // The menu can be at most the size of the overlay minus 8.0 pixels in each // direction. return BoxConstraints.loose(constraints.biggest - const Offset(_kMenuScreenPadding * 2.0, _kMenuScreenPadding * 2.0) as Size); } @override Offset getPositionForChild(Size size, Size childSize) { // size: The size of the overlay. // childSize: The size of the menu, when fully open, as determined by // getConstraintsForChild. // Find the ideal vertical position. double y; y = position.top + (size.height - position.top - position.bottom) / 2.0 - selectedItemOffset; // Find the ideal horizontal position. double x; if (position.left > position.right) { // Menu button is closer to the right edge, so grow to the left, aligned to the right edge. x = size.width - position.right - childSize.width; } else if (position.left < position.right) { // Menu button is closer to the left edge, so grow to the right, aligned to the left edge. x = position.left; } else { // Menu button is equidistant from both edges, so grow in reading direction. switch (textDirection) { case TextDirection.rtl: x = size.width - position.right - childSize.width; break; case TextDirection.ltr: x = position.left; break; } } // Avoid going outside an area defined as the rectangle 8.0 pixels from the // edge of the screen in every direction. if (x < _kMenuScreenPadding) { x = _kMenuScreenPadding; } else if (x + childSize.width > size.width - _kMenuScreenPadding) { x = size.width - childSize.width - _kMenuScreenPadding; } if (y < _kMenuScreenPadding) { y = _kMenuScreenPadding; } else if (y + childSize.height > size.height - _kMenuScreenPadding) { y = size.height - childSize.height - _kMenuScreenPadding; } return Offset(x, y); } @override bool shouldRelayout(_PopupMenuRouteLayout oldDelegate) { return position != oldDelegate.position; } } class _PopupMenuRoute extends PopupRoute { _PopupMenuRoute({ required this.position, required this.items, this.initialValue, this.elevation = 8, required this.theme, required this.barrierLabel, required this.semanticLabel, }); final RelativeRect position; final List> items; final dynamic initialValue; final double elevation; final ThemeData theme; final String semanticLabel; @override Animation createAnimation() { return CurvedAnimation( parent: super.createAnimation(), curve: Curves.linear, reverseCurve: const Interval(0.0, _kMenuCloseIntervalEnd), ); } @override Duration get transitionDuration => _kMenuDuration; @override bool get barrierDismissible => true; @override Color? get barrierColor => null; @override final String barrierLabel; ScrollController? scrollController; @override Widget buildPage(BuildContext context, Animation animation, Animation secondaryAnimation) { double selectedItemOffset = 0; double scrollItemOffset = 0; if (initialValue != null) { double y = _kMenuVerticalPadding; for (PopupMenuEntry entry in items) { if (entry.represents(initialValue)) { selectedItemOffset = y + entry.height / 2.0; scrollItemOffset = y - entry.height / 2.0; break; } y += entry.height; } } scrollController = ScrollController(initialScrollOffset: scrollItemOffset); Widget menu = _PopupMenu( route: this, semanticLabel: semanticLabel, controller: scrollController); menu = Theme(data: theme, child: menu); return SafeArea( child: Builder( builder: (BuildContext context) { return CustomSingleChildLayout( delegate: _PopupMenuRouteLayout( position, selectedItemOffset, Directionality.of(context), ), child: menu, ); }, ), ); } } /// Show a popup menu that contains the `items` at `position`. /// /// `items` should be non-null and not empty. /// /// If `initialValue` is specified then the first item with a matching value /// will be highlighted and the value of `position` gives the rectangle whose /// vertical center will be aligned with the vertical center of the highlighted /// item (when possible). /// /// If `initialValue` is not specified then the top of the menu will be aligned /// with the top of the `position` rectangle. /// /// In both cases, the menu position will be adjusted if necessary to fit on the /// screen. /// /// Horizontally, the menu is positioned so that it grows in the direction that /// has the most room. For example, if the `position` describes a rectangle on /// the left edge of the screen, then the left edge of the menu is aligned with /// the left edge of the `position`, and the menu grows to the right. If both /// edges of the `position` are equidistant from the opposite edge of the /// screen, then the ambient [Directionality] is used as a tie-breaker, /// preferring to grow in the reading direction. /// /// The positioning of the `initialValue` at the `position` is implemented by /// iterating over the `items` to find the first whose /// [PopupMenuEntry.represents] method returns true for `initialValue`, and then /// summing the values of [PopupMenuEntry.height] for all the preceding widgets /// in the list. /// /// The `elevation` argument specifies the z-coordinate at which to place the /// menu. The elevation defaults to 8, the appropriate elevation for popup /// menus. /// /// The `context` argument is used to look up the [Navigator] and [Theme] for /// the menu. It is only used when the method is called. Its corresponding /// widget can be safely removed from the tree before the popup menu is closed. /// /// The `semanticLabel` argument is used by accessibility frameworks to /// announce screen transitions when the menu is opened and closed. If this /// label is not provided, it will default to /// [MaterialLocalizations.popupMenuLabel]. /// /// See also: /// /// * [PopupMenuItem], a popup menu entry for a single value. /// * [PopupMenuDivider], a popup menu entry that is just a horizontal line. /// * [CheckedPopupMenuItem], a popup menu item with a checkmark. /// * [PopupMenuButton], which provides an [IconButton] that shows a menu by /// calling this method automatically. /// * [SemanticsConfiguration.namesRoute], for a description of edge triggered /// semantics. Future showMenu({ required BuildContext context, required RelativeRect position, required List> items, T? initialValue, double elevation = 8.0, String semanticLabel = "", }) { assert(items.isNotEmpty); assert(debugCheckHasMaterialLocalizations(context)); String label = semanticLabel; switch (defaultTargetPlatform) { case TargetPlatform.iOS: label = semanticLabel; break; case TargetPlatform.android: case TargetPlatform.fuchsia: label = semanticLabel.isNotEmpty ? semanticLabel : MaterialLocalizations.of(context).popupMenuLabel; break; default: label = semanticLabel; } return Navigator.push( context, _PopupMenuRoute( position: position, items: items, initialValue: initialValue, elevation: elevation, semanticLabel: label, theme: Theme.of(context), barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, )); } /// Signature for the callback invoked when a menu item is selected. The /// argument is the value of the [PopupMenuItem] that caused its menu to be /// dismissed. /// /// Used by [PopupMenuButton.onSelected]. typedef PopupMenuItemSelected = void Function(T value); /// Signature for the callback invoked when a [PopupMenuButton] is dismissed /// without selecting an item. /// /// Used by [PopupMenuButton.onCanceled]. typedef PopupMenuCanceled = void Function(); /// Signature used by [PopupMenuButton] to lazily construct the items shown when /// the button is pressed. /// /// Used by [PopupMenuButton.itemBuilder]. typedef PopupMenuItemBuilder = List> Function( BuildContext context); /// Displays a menu when pressed and calls [onSelected] when the menu is dismissed /// because an item was selected. The value passed to [onSelected] is the value of /// the selected menu item. /// /// One of [child] or [icon] may be provided, but not both. If [icon] is provided, /// then [PopupMenuButton] behaves like an [IconButton]. /// /// If both are null, then a standard overflow icon is created (depending on the /// platform). /// /// {@tool sample} /// /// This example shows a menu with four items, selecting between an enum's /// values and setting a `_selection` field based on the selection. /// /// ```dart /// // This is the type used by the popup menu below. /// enum WhyFarther { harder, smarter, selfStarter, tradingCharter } /// /// // This menu button widget updates a _selection field (of type WhyFarther, /// // not shown here). /// PopupMenuButton( /// onSelected: (WhyFarther result) { setState(() { _selection = result; }); }, /// itemBuilder: (BuildContext context) => >[ /// const PopupMenuItem( /// value: WhyFarther.harder, /// child: Text('Working a lot harder'), /// ), /// const PopupMenuItem( /// value: WhyFarther.smarter, /// child: Text('Being a lot smarter'), /// ), /// const PopupMenuItem( /// value: WhyFarther.selfStarter, /// child: Text('Being a self-starter'), /// ), /// const PopupMenuItem( /// value: WhyFarther.tradingCharter, /// child: Text('Placed in charge of trading charter'), /// ), /// ], /// ) /// ``` /// {@end-tool} /// /// See also: /// /// * [PopupMenuItem], a popup menu entry for a single value. /// * [PopupMenuDivider], a popup menu entry that is just a horizontal line. /// * [CheckedPopupMenuItem], a popup menu item with a checkmark. /// * [showMenu], a method to dynamically show a popup menu at a given location. class PopupMenuButton extends StatelessWidget { /// Creates a button that shows a popup menu. /// /// The [itemBuilder] argument must not be null. const PopupMenuButton({ Key? key, required this.itemBuilder, this.initialValue, this.onSelected, this.onCanceled, this.tooltip, this.elevation = 8.0, this.padding = const EdgeInsets.all(8.0), this.child, this.icon, this.offset = Offset.zero, this.enabled = true, }) : assert(!(child != null && icon != null)), // fails if passed both parameters super(key: key); /// Called when the button is pressed to create the items to show in the menu. final PopupMenuItemBuilder itemBuilder; /// The value of the menu item, if any, that should be highlighted when the menu opens. final T? initialValue; /// Called when the user selects a value from the popup menu created by this button. /// /// If the popup menu is dismissed without selecting a value, [onCanceled] is /// called instead. final PopupMenuItemSelected? onSelected; /// Called when the user dismisses the popup menu without selecting an item. /// /// If the user selects a value, [onSelected] is called instead. final PopupMenuCanceled? onCanceled; /// Text that describes the action that will occur when the button is pressed. /// /// This text is displayed when the user long-presses on the button and is /// used for accessibility. final String? tooltip; /// The z-coordinate at which to place the menu when open. This controls the /// size of the shadow below the menu. /// /// Defaults to 8, the appropriate elevation for popup menus. final double elevation; /// Matches IconButton's 8 dps padding by default. In some cases, notably where /// this button appears as the trailing element of a list item, it's useful to be able /// to set the padding to zero. final EdgeInsetsGeometry padding; /// If provided, the widget used for this button. final Widget? child; /// If provided, the icon used for this button. final Icon? icon; /// The offset applied to the Popup Menu Button. /// /// When not set, the Popup Menu Button will be positioned directly next to /// the button that was used to create it. final Offset offset; /// Whether this popup menu button is interactive. /// /// Must be non-null, defaults to `true` /// /// If `true` the button will respond to presses by displaying the menu. /// /// If `false`, the button is styled with the disabled color from the /// current [Theme] and will not respond to presses or show the popup /// menu and [onSelected], [onCanceled] and [itemBuilder] will not be called. /// /// This can be useful in situations where the app needs to show the button, /// but doesn't currently have anything to show in the menu. final bool enabled; // @override // _PopupMenuButtonState createState() => _PopupMenuButtonState(); void showButtonMenu(BuildContext context) { final RenderBox button = context.findRenderObject() as RenderBox; final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox; final RelativeRect position = RelativeRect.fromRect( Rect.fromPoints( button.localToGlobal(offset, ancestor: overlay), button.localToGlobal(button.size.bottomRight(Offset.zero), ancestor: overlay), ), Offset.zero & overlay.size, ); final List> items = itemBuilder(context); // Only show the menu if there is something to show if (items.isNotEmpty) { showMenu( context: context, elevation: elevation, items: items, initialValue: initialValue, position: position, ).then((T? newValue) { //if (!mounted) return null; if (newValue == null) { onCanceled?.call(); return null; } onSelected?.call(newValue); }); } } Icon _getIcon(TargetPlatform platform) { switch (platform) { case TargetPlatform.android: case TargetPlatform.fuchsia: return const Icon(Icons.more_vert); case TargetPlatform.iOS: return const Icon(Icons.more_horiz); default: return const Icon(Icons.more_vert); } } @override Widget build(BuildContext context) { assert(debugCheckHasMaterialLocalizations(context)); return child != null ? InkWell( onTap: enabled ? () => showButtonMenu(context) : null, child: child, ) : IconButton( icon: icon ?? _getIcon(Theme.of(context).platform), padding: padding, tooltip: tooltip ?? MaterialLocalizations.of(context).showMenuTooltip, onPressed: enabled ? () => showButtonMenu(context) : null, ); } } // class _PopupMenuButtonState extends State> { // } ================================================ FILE: lib/UI/widgets/common/modeControlRegular.dart ================================================ import 'package:flutter/material.dart'; class ModeControlRegular extends StatelessWidget { final List options; final int selected; final void Function(int index)? onSelected; final TextStyle? textStyle; const ModeControlRegular( {super.key, required this.options, required this.selected, this.onSelected, this.textStyle}); Widget _modeButton(String mode) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 14), child: Text(mode, style: textStyle), ); } @override Widget build(BuildContext context) { List active = List.generate(options.length, (i) => i == selected ? true : false); return ToggleButtons( fillColor: Colors.blue, selectedBorderColor: Colors.blue, borderColor: Colors.grey[600], color: Colors.grey, isSelected: active, onPressed: onSelected, children: [ for (var i = 0; i < options.length; i++) _modeButton(options[i]) ], ); } } ================================================ FILE: lib/UI/widgets/common/nestedWillPopScope.dart ================================================ import 'package:flutter/material.dart'; class NestedWillPopScope extends StatefulWidget { const NestedWillPopScope({ Key? key, required this.child, required this.onWillPop, }) : super(key: key); final Widget child; final WillPopCallback onWillPop; @override _NestedWillPopScopeState createState() => _NestedWillPopScopeState(); static _NestedWillPopScopeState? of(BuildContext context) { return context.findAncestorStateOfType<_NestedWillPopScopeState>(); } } class _NestedWillPopScopeState extends State { ModalRoute? _route; _NestedWillPopScopeState? _descendant; set descendant(state) { _descendant = state; updateRouteCallback(); } Future onWillPop() async { bool? willPop; if (_descendant != null) { willPop = await _descendant!.onWillPop(); } if (willPop == null || willPop) { willPop = await widget.onWillPop(); } return willPop; } void updateRouteCallback() { _route?.removeScopedWillPopCallback(onWillPop); _route = ModalRoute.of(context); _route?.addScopedWillPopCallback(onWillPop); } @override void didChangeDependencies() { super.didChangeDependencies(); var parentGuard = NestedWillPopScope.of(context); if (parentGuard != null) { parentGuard.descendant = this; } updateRouteCallback(); } @override void dispose() { _route?.removeScopedWillPopCallback(onWillPop); super.dispose(); } @override Widget build(BuildContext context) => widget.child; } ================================================ FILE: lib/UI/widgets/common/numberPicker.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; typedef TextMapper = String Function(String numberText); class NumberPicker extends StatefulWidget { /// Min value user can pick final int minValue; /// Max value user can pick final int maxValue; /// Currently selected value final int value; /// Called when selected value changes final ValueChanged? onChanged; /// Specifies how many items should be shown - defaults to 3 final int itemCount; /// Step between elements. Only for integer datePicker /// Examples: /// if step is 100 the following elements may be 100, 200, 300... /// if min=0, max=6, step=3, then items will be 0, 3 and 6 /// if min=0, max=5, step=3, then items will be 0 and 3. final int step; /// height of single item in pixels final double itemHeight; /// width of single item in pixels final double itemWidth; /// Direction of scrolling final Axis axis; /// Style of non-selected numbers. If null, it uses Theme's bodyText2 final TextStyle? textStyle; /// Style of non-selected numbers. If null, it uses Theme's headline5 with accentColor final TextStyle? selectedTextStyle; /// Whether to trigger haptic pulses or not final bool haptics; /// Build the text of each item on the picker final TextMapper? textMapper; /// Pads displayed integer values up to the length of maxValue final bool zeroPad; /// display the number in hex format final bool hex; /// Symbol to display instead of zero final String? zeroSymbol; /// Decoration to apply to central box where the selected value is placed final Decoration? decoration; const NumberPicker({ Key? key, required this.minValue, required this.maxValue, required this.value, required this.onChanged, this.itemCount = 3, this.step = 1, this.itemHeight = 50, this.itemWidth = 100, this.axis = Axis.vertical, this.textStyle, this.selectedTextStyle, this.haptics = false, this.decoration, this.hex = false, this.zeroSymbol, this.zeroPad = false, this.textMapper, }) : assert(minValue <= value), assert(value <= maxValue), super(key: key); @override State createState() => _NumberPickerState(); } class _NumberPickerState extends State { late ScrollController _scrollController; @override void initState() { super.initState(); final initialOffset = (widget.value - widget.minValue) ~/ widget.step * itemExtent; _scrollController = ScrollController(initialScrollOffset: initialOffset) ..addListener(_scrollListener); } void _scrollListener() { final indexOfMiddleElement = (_scrollController.offset / itemExtent).round().clamp(0, itemCount - 1); final intValueInTheMiddle = _intValueFromIndex(indexOfMiddleElement + 1); if (widget.value != intValueInTheMiddle) { widget.onChanged?.call(intValueInTheMiddle); if (widget.haptics) { HapticFeedback.selectionClick(); } } Future.delayed( const Duration(milliseconds: 100), () => _maybeCenterValue(), ); } @override void didUpdateWidget(NumberPicker oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.value != widget.value) { _maybeCenterValue(); } } @override void dispose() { _scrollController.dispose(); super.dispose(); } bool get isScrolling => _scrollController.position.isScrollingNotifier.value; double get itemExtent => widget.axis == Axis.vertical ? widget.itemHeight : widget.itemWidth; int get itemCount => (widget.maxValue - widget.minValue) ~/ widget.step + 1; int get listItemsCount => itemCount + 2; @override Widget build(BuildContext context) { return SizedBox( width: widget.axis == Axis.vertical ? widget.itemWidth : widget.itemCount * widget.itemWidth, height: widget.axis == Axis.vertical ? widget.itemCount * widget.itemHeight : widget.itemHeight, child: NotificationListener( onNotification: (not) { if (not.dragDetails?.primaryVelocity == 0) { Future.microtask(() => _maybeCenterValue()); } return true; }, child: Stack( children: [ ListView.builder( itemCount: listItemsCount, scrollDirection: widget.axis, controller: _scrollController, itemExtent: itemExtent, itemBuilder: _itemBuilder, ), _NumberPickerSelectedItemDecoration( axis: widget.axis, itemExtent: itemExtent, decoration: widget.decoration, ), ], ), ), ); } Widget _itemBuilder(BuildContext context, int index) { final themeData = Theme.of(context); final defaultStyle = widget.textStyle ?? themeData.textTheme.bodyMedium; final selectedStyle = widget.selectedTextStyle ?? themeData.textTheme.headlineSmall ?.copyWith(color: themeData.colorScheme.surface); final value = _intValueFromIndex(index); final isExtra = index == 0 || index == listItemsCount - 1; final itemStyle = value == widget.value ? selectedStyle : defaultStyle; final child = isExtra ? const SizedBox.shrink() : Text( _getDisplayedValue(value), style: itemStyle, ); return Container( width: widget.itemWidth, height: widget.itemHeight, alignment: Alignment.center, child: child, ); } String _getDisplayedValue(int value) { String text = ""; if (value == 0 && widget.zeroSymbol != null) return widget.zeroSymbol!; if (widget.hex) { text = value.toRadixString(16).padLeft(2, '0'); return text; } else { String strValue = value.toString(); text = widget.zeroPad ? strValue.padLeft(widget.maxValue.toString().length, '0') : strValue.toString(); } if (widget.textMapper != null) { return widget.textMapper!(text); } else { return text; } } int _intValueFromIndex(int index) { index--; index %= itemCount; return widget.minValue + index * widget.step; } void _maybeCenterValue() { if (_scrollController.hasClients && !isScrolling) { int diff = widget.value - widget.minValue; int index = diff ~/ widget.step; _scrollController.animateTo( index * itemExtent, duration: const Duration(milliseconds: 300), curve: Curves.easeOutCubic, ); } } } class _NumberPickerSelectedItemDecoration extends StatelessWidget { final Axis axis; final double itemExtent; final Decoration? decoration; const _NumberPickerSelectedItemDecoration({ Key? key, required this.axis, required this.itemExtent, required this.decoration, }) : super(key: key); @override Widget build(BuildContext context) { return Center( child: IgnorePointer( child: Container( width: isVertical ? double.infinity : itemExtent, height: isVertical ? itemExtent : double.infinity, decoration: decoration, ), ), ); } bool get isVertical => axis == Axis.vertical; } ================================================ FILE: lib/UI/widgets/common/rounded_icon_button.dart ================================================ import 'package:flutter/material.dart'; class RoundedIconButton extends StatelessWidget { final VoidCallback? onPressed; final Widget icon; final String? tooltip; final double borderRadius; const RoundedIconButton( {Key? key, this.onPressed, required this.icon, this.tooltip, this.borderRadius = 6}) : super(key: key); @override Widget build(BuildContext context) { return Container( decoration: ShapeDecoration( color: onPressed != null ? Colors.blue : Colors.grey[800], shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(borderRadius)), ), child: IconButton( constraints: ButtonTheme.of(context).constraints, icon: icon, onPressed: onPressed, tooltip: tooltip, ), ); } } ================================================ FILE: lib/UI/widgets/common/searchTextField.dart ================================================ import 'package:flutter/material.dart'; class SearchTextField extends StatelessWidget { final TextEditingController controller; final void Function(String?)? onSearch; const SearchTextField({Key? key, required this.controller, this.onSearch}) : super(key: key); @override Widget build(BuildContext context) { return TextField( controller: controller, onSubmitted: onSearch, decoration: InputDecoration( hintText: "Search", hintStyle: const TextStyle(color: Colors.grey), prefixIcon: const Icon( Icons.search, color: Colors.grey, ), suffixIcon: IconButton( onPressed: () { controller.clear(); FocusScope.of(context).unfocus(); }, icon: const Icon(Icons.clear), color: Colors.grey, ), ), ); } } ================================================ FILE: lib/UI/widgets/deviceList.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import '../../bluetooth/bleMidiHandler.dart'; class DeviceList extends StatelessWidget { final BLEMidiHandler midiHandler = BLEMidiHandler.instance(); DeviceList({Key? key}) : super(key: key); bool isConnected(String id) { //check with nux device first if (midiHandler.connectedDevice != null && id == midiHandler.connectedDevice?.id) return true; for (var controller in midiHandler.controllerDevices) { if (controller.id == id) return true; } return false; } @override Widget build(BuildContext context) { return ListView.builder( // Let the ListView know how many items it needs to build itemCount: midiHandler.nuxDevices.length, // Provide a builder function. This is where the magic happens! We'll // convert each item into a Widget based on the type of item it is. itemBuilder: (context, index) { final result = midiHandler.nuxDevices[index]; return ListTile( title: Text(result.name, style: Theme.of(context).textTheme.titleLarge!.copyWith( color: isConnected(result.id) ? Colors.blue : Colors.white)), trailing: const Icon(Icons.bluetooth, color: Colors.white), onTap: () { midiHandler.connectToDevice(result.device); }, ); }, ); } } ================================================ FILE: lib/UI/widgets/fabMenu.dart ================================================ import 'dart:math'; import 'package:flutter/material.dart'; import 'common/nestedWillPopScope.dart'; class Bubble { const Bubble( {required this.title, required this.titleStyle, required this.iconColor, required this.bubbleColor, required this.icon, required this.onPress}); final IconData icon; final Color iconColor; final Color bubbleColor; final Function() onPress; final String title; final TextStyle titleStyle; } class BubbleMenu extends StatelessWidget { const BubbleMenu(this.item, {Key? key}) : super(key: key); final Bubble item; @override Widget build(BuildContext context) { return MaterialButton( shape: const StadiumBorder(), padding: const EdgeInsets.only(top: 11, bottom: 13, left: 32, right: 32), color: item.bubbleColor, splashColor: Colors.grey.withOpacity(0.1), highlightColor: Colors.grey.withOpacity(0.1), elevation: 2, highlightElevation: 2, disabledColor: item.bubbleColor, onPressed: item.onPress, child: Row( mainAxisSize: MainAxisSize.min, children: [ Icon( item.icon, color: item.iconColor, ), const SizedBox( width: 10.0, ), Text( item.title, style: item.titleStyle, ), ], ), ); } } class _DefaultHeroTag { const _DefaultHeroTag(); @override String toString() => ''; } class FloatingActionBubble extends AnimatedWidget { const FloatingActionBubble({ Key? key, required this.items, required this.onPress, required this.iconColor, required this.backGroundColor, required Animation animation, this.herotag, this.iconData, this.animatedIconData, }) : assert((iconData == null && animatedIconData != null) || (iconData != null && animatedIconData == null)), super(key: key, listenable: animation); final List items; final Function() onPress; final AnimatedIconData? animatedIconData; final Object? herotag; final IconData? iconData; final Color iconColor; final Color backGroundColor; get _animation => listenable; Widget buildItem(BuildContext context, int index) { final transform = Matrix4.translationValues( 0, -(_animation.value - 1) * 40 * (items.length - index), 0.0, ); return Transform( transform: transform, child: Opacity( opacity: _animation.value, child: BubbleMenu(items[index]), ), ); } List buildItems(BuildContext context) { var widgets = []; var sb = const SizedBox(height: 12.0); for (int i = 0; i < items.length; i++) { widgets.add(buildItem(context, i)); if (i < items.length - 1) widgets.add(sb); } return widgets; } Future _preventPopIfOpen() async { if (_animation.value > 0.8) { onPress(); return false; } return true; } buildBackgroundWidget() { double val = _animation.value; return IgnorePointer( ignoring: val == 0, child: InkWell( onTap: onPress, child: Opacity( opacity: val, child: const ColoredBox( color: Colors.black54, ), ), ), ); } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: _preventPopIfOpen, child: Stack( alignment: Alignment.bottomRight, children: [ buildBackgroundWidget(), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ Flexible( child: IgnorePointer( ignoring: _animation.value == 0, child: SingleChildScrollView( // physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.symmetric(vertical: 12), child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: buildItems(context), )), ), ), Transform.rotate( angle: _animation.value * pi * 3 / 4, child: FloatingActionButton( heroTag: herotag ?? const _DefaultHeroTag(), backgroundColor: backGroundColor, onPressed: onPress, // iconData is mutually exclusive with animatedIconData // only 1 can be null at the time child: iconData == null ? AnimatedIcon( icon: animatedIconData!, progress: _animation, color: iconColor, ) : Icon( iconData, color: iconColor, ), ), ), ], ), ], ), ); } } ================================================ FILE: lib/UI/widgets/hold_to_repeat.dart ================================================ import 'package:flutter/material.dart'; class HoldToRepeat extends StatefulWidget { final Widget child; final VoidCallback onPressed; final Duration initialDelay; final Duration repeatInterval; const HoldToRepeat({ Key? key, required this.child, required this.onPressed, this.initialDelay = const Duration(milliseconds: 800), this.repeatInterval = const Duration(milliseconds: 200), }) : super(key: key); @override _HoldToRepeatState createState() => _HoldToRepeatState(); } class _HoldToRepeatState extends State { bool _isPressed = false; void _doRepeatingAction() { if (_isPressed) { widget.onPressed(); Future.delayed(widget.repeatInterval, _doRepeatingAction); } } void _onTapDown() { widget.onPressed(); setState(() { _isPressed = true; Future.delayed(widget.initialDelay, () { if (_isPressed) { _doRepeatingAction(); } }); }); Feedback.forTap(context); } void _onTapUp() { setState(() { _isPressed = false; }); } @override Widget build(BuildContext context) { return InkWell( onTapDown: (_) => _onTapDown(), onTapUp: (_) => _onTapUp(), onTapCancel: _onTapUp, child: widget.child, ); } } ================================================ FILE: lib/UI/widgets/presets/EffectChainBar.dart ================================================ import 'dart:math'; import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import '../../../bluetooth/devices/presets/Preset.dart'; import 'EffectChainButton.dart'; class EffectChainBar extends StatelessWidget { static const double effectsChainPadding = 6; final double maxHeight; final NuxDevice device; final Preset preset; final bool reorderable; final void Function(int) onTap; final void Function(int) onDoubleTap; final ReorderCallback onReorder; const EffectChainBar( {Key? key, required this.maxHeight, required this.device, required this.preset, required this.onTap, required this.onDoubleTap, required this.onReorder, required this.reorderable}) : super(key: key); EffectChainButton buildItem(context, index) { var proc = preset.getFXIDFromSlot(index); var effect = device.getProcessorInfoByFXID(proc); bool selected = index == device.selectedSlot; return EffectChainButton( index: index, effectInfo: effect!, color: preset.effectColor(index), enabled: preset.slotEnabled(index), selected: selected, reorderable: reorderable, key: Key(index.toString()), onTap: () => onTap(index), onDoubleTap: () => onDoubleTap(index)); } @override Widget build(BuildContext context) { double constrainHeight = max( min( (MediaQuery.of(context).size.width - effectsChainPadding * 2) / device.effectsChainLength / 0.8, maxHeight), 10); Widget list; if (reorderable) { list = ReorderableList( padding: const EdgeInsets.symmetric(horizontal: effectsChainPadding), shrinkWrap: true, scrollDirection: Axis.horizontal, physics: const NeverScrollableScrollPhysics(), itemCount: device.effectsChainLength, proxyDecorator: (widget, index, animation) { return AnimatedBuilder( animation: animation, builder: (BuildContext context, Widget? child) { final double animValue = Curves.easeInOut.transform(animation.value); final double offset = lerpDouble(0, -15, animValue)!; return Material( color: Colors.transparent, child: Transform.translate( offset: Offset(0, offset), child: widget, ), ); }, ); }, itemBuilder: buildItem, onReorder: (a, b) { if (b > a) b--; onReorder(a, b); }, ); } else { list = ListView.builder( padding: const EdgeInsets.symmetric(horizontal: effectsChainPadding), shrinkWrap: true, scrollDirection: Axis.horizontal, physics: const NeverScrollableScrollPhysics(), itemCount: device.effectsChainLength, itemBuilder: buildItem, ); } return ConstrainedBox( constraints: BoxConstraints(maxHeight: constrainHeight), child: list, ); } } ================================================ FILE: lib/UI/widgets/presets/EffectChainButton.dart ================================================ import 'package:flutter/material.dart'; import '../../../bluetooth/devices/effects/Processor.dart'; class EffectChainButton extends StatelessWidget { final ProcessorInfo effectInfo; final bool enabled; final bool selected; final bool reorderable; final Color color; final GestureTapCallback? onTap; final GestureTapCallback? onDoubleTap; final int index; const EffectChainButton( {Key? key, required this.effectInfo, required this.enabled, required this.selected, required this.color, this.onTap, this.onDoubleTap, required this.index, required this.reorderable}) : super(key: key); @override Widget build(BuildContext context) { Color _color = enabled ? color : Theme.of(context).disabledColor; return ReorderableDragStartListener( index: index, child: AspectRatio( aspectRatio: 0.8, child: FittedBox( fit: BoxFit.fitHeight, child: Semantics( label: effectInfo.longName, selected: selected, child: GestureDetector( onTap: onTap, onHorizontalDragStart: reorderable ? null : (details) {}, onVerticalDragStart: (details) { onDoubleTap?.call(); }, child: Transform.translate( offset: Offset(0, selected ? -5 : 0), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( margin: const EdgeInsets.symmetric(horizontal: 1), padding: const EdgeInsets.all(3), decoration: BoxDecoration( color: selected ? _color : Theme.of(context).scaffoldBackgroundColor, border: Border.all( color: _color, ), borderRadius: const BorderRadius.all(Radius.circular(3))), child: Icon( effectInfo.icon, //size: 30, color: selected ? Colors.black : _color, ), ), ExcludeSemantics( child: Text( effectInfo.shortName, style: TextStyle( fontSize: 10, color: enabled ? null : Theme.of(context).textTheme.bodySmall!.color), ), ), ], ), ), ), ), ), ), ); } } ================================================ FILE: lib/UI/widgets/presets/channelSelector.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) // import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/UI/popups/exportQRCode.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/platform/fileSaver.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:qr_utils/qr_utils.dart'; import '../../../bluetooth/devices/presets/Preset.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../../platform/platformUtils.dart'; import '../../theme.dart'; import '../../utils.dart'; import 'effectSelector.dart'; class ChannelSelector extends StatefulWidget { final NuxDevice device; const ChannelSelector({Key? key, required this.device}) : super(key: key); @override State createState() => _ChannelSelectorState(); } class _ChannelSelectorState extends State { late List _presets; EditorLayoutMode layout = EditorLayoutMode.expand; var qrMenu = [ PopupMenuItem( value: 1, child: Row( children: [ Icon( Icons.qr_code_scanner, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Scan QR"), ], ), ), PopupMenuItem( value: 2, child: Row( children: [ Icon( Icons.qr_code_2, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Import QR Image"), ], ), ), PopupMenuItem( value: 3, child: Row( children: [ Icon( Icons.qr_code_2, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Share QR"), ], ), ), ]; @override void initState() { super.initState(); } List _createButtons(double _width) { var disabledColor = Theme.of(context).disabledColor; List buttons = []; var tooltip = ""; _presets = widget.device.getPresetsList(); int row1 = _width < 330 && _presets.length > 4 ? (_presets.length / 2).ceil() : _presets.length; double width = (_width / row1).floorToDouble(); for (int i = 0; i < _presets.length; i++) { var col = i == widget.device.selectedChannel ? _presets[widget.device.selectedChannel].channelColor : disabledColor; Widget buttonBody; if (widget.device.longChannelNames) { tooltip = _presets[i].channelName; buttonBody = Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( widget.device.getChannelActive(i) ? Icons.circle : Icons.circle_outlined, color: col, size: 32, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 6.0), child: FittedBox( fit: BoxFit.fill, child: Text(_presets[i].channelName)), ), ], ); } else { tooltip = "Channel ${i + 1}"; buttonBody = Stack( alignment: Alignment.center, children: [ Icon( widget.device.getChannelActive(i) ? Icons.circle : Icons.circle_outlined, color: col, size: 32, ), Text( _presets[i].channelName, style: const TextStyle(fontWeight: FontWeight.bold), ), ], ); } var button = GestureDetector( onTap: () { if (widget.device.selectedChannel == i) return; widget.device.setSelectedChannel(i, notifyBT: true, sendFullPreset: false, notifyUI: true); widget.device .getPreset(widget.device.selectedChannel) .setupPresetFromNuxData(); }, onLongPress: () { widget.device.toggleChannelActive(i); }, child: Container( //use container with color to expand hittest area for the gesture detector //better to use the same as the background color to imitate transparency //than to use translucent hittest (slow) color: Theme.of(context).scaffoldBackgroundColor, width: width, height: AppThemeConfig.toggleButtonHeight(widget.device.longChannelNames), child: Semantics( selected: widget.device.selectedChannel == i, label: tooltip, child: ExcludeSemantics(child: buttonBody), ), ), ); buttons.add(button); } return buttons; } qrPopupSelection(pos) async { switch (pos) { case 1: //scan qr var result = await Permission.camera.request(); if (result.isPermanentlyDenied) { //TODO: Explain why camera is needed and open settings } final content = await QrUtils.scanQR; if (content?.isNotEmpty ?? false) { setupFromQRData(content!); setState(() {}); } break; case 2: if (PlatformUtils.isAndroid) { openFile("image/*").then((value) async { final content = await QrUtils.scanImageFromData(value); if (content != null) { setupFromQRData(content); setState(() {}); } else { showQRError(); } }); } else if (PlatformUtils.isIOS) { final content = await QrUtils.scanImage(); if (content != null) { setupFromQRData(content); setState(() {}); } else { showQRError(); } } break; case 3: var qr = widget.device.channelToQR(widget.device.selectedChannel); var name = widget.device.deviceControl.presetName; Image img = await QrUtils.generateQR(qr); if (name.isEmpty) { AlertDialogs.showInputDialog(context, title: "Enter preset name", description: "It will be displayed below the QR code.", value: "", onConfirm: (value) => {showQRExport(img, value)}); } else showQRExport(img, name); } } void showQRExport(Image img, String name) { var qrExport = QRExportDialog(img, name, NuxDeviceControl.instance().device); showDialog( context: context, builder: (BuildContext context) => qrExport.buildDialog(context), ); } void showQRError() { ScaffoldMessenger.of(context).showSnackBar(const SnackBar( backgroundColor: Colors.red, content: Text( "Error decoding QR code!", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontSize: 20), ))); } void setupFromQRData(String qrData) { var result = widget.device.setupFromQRData(qrData); bool success = result == PresetQRError.Ok; NuxDeviceControl.instance().changes.clearHistory(); setState(() {}); var message = QrUtils.QRMessages[result.index]; ScaffoldMessenger.of(context).showSnackBar(SnackBar( backgroundColor: success ? Colors.green : Colors.red, content: Text( message, textAlign: TextAlign.center, style: const TextStyle(color: Colors.white, fontSize: 20), ))); } @override Widget build(BuildContext context) { layout = getEditorLayoutMode(MediaQuery.of(context)); _presets = widget.device.getPresetsList(); return Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8), child: Container( decoration: BoxDecoration( color: Colors.grey[800], border: Border.all(color: Theme.of(context).disabledColor), borderRadius: BorderRadius.circular(6)), child: Row( mainAxisSize: MainAxisSize.max, children: [ PopupMenuButton( itemBuilder: (context) { return qrMenu; }, onSelected: qrPopupSelection, child: const SizedBox( width: 60, child: Column( children: [ Icon( Icons.qr_code_2, size: 32, ), Text( "QR Code", textAlign: TextAlign.center, ) ], ), )), Expanded( child: Container( constraints: const BoxConstraints(minHeight: 60), color: Colors.grey[900], child: LayoutBuilder( builder: (context, constraints) { return Wrap( alignment: WrapAlignment.center, runAlignment: WrapAlignment.center, children: _createButtons(constraints.maxWidth), ); }, ), ), ), Semantics( checked: widget.device .getChannelActive(widget.device.selectedChannel), child: InkWell( onTap: () { widget.device .toggleChannelActive(widget.device.selectedChannel); }, child: SizedBox( width: 60, child: Column( children: [ Icon( widget.device.getChannelActive( widget.device.selectedChannel) ? Icons.check_circle : Icons.circle_outlined, size: 30, ), const Text("Active") ], ), ), ), ) ], ), ), ), if (layout == EditorLayoutMode.expand) Expanded( child: EffectSelector( device: widget.device, preset: _presets[widget.device.selectedChannel]), ) else EffectSelector( device: widget.device, preset: _presets[widget.device.selectedChannel]) ], ); } } ================================================ FILE: lib/UI/widgets/presets/effectEditor.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:undo/undo.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/effects/Processor.dart'; import '../../../bluetooth/devices/presets/Preset.dart'; import 'effectEditors/EqualizerEditor.dart'; import 'effectEditors/SlidersEditor.dart'; class EffectEditor extends StatefulWidget { final Preset preset; final int slot; const EffectEditor({Key? key, required this.preset, required this.slot}) : super(key: key); @override State createState() => _EffectEditorState(); } class _EffectEditorState extends State { @override Widget build(BuildContext context) { var preset = widget.preset; var slot = widget.slot; //get all the parameters for the slot List prc = preset.getEffectsForSlot(slot); //create the widgets to edit them var selected = preset.getSelectedEffectForSlot(slot); switch (prc[selected].editorUI) { case EffectEditorUI.Sliders: return SlidersEditor(preset: widget.preset, slot: widget.slot); case EffectEditorUI.EQ: return EqualizerEditor( eqEffect: prc[selected], enabled: widget.preset.slotEnabled(widget.slot), onChanged: (parameter, value, skip) { setState(() { widget.preset.setParameterValue(parameter, value, notify: !skip); }); }, onChangedFinal: _updateSliderValue, ); } } void _updateSliderValue( Parameter parameter, double newValue, double oldValue) { var device = NuxDeviceControl().device; var slot = device.selectedSlot; NuxDeviceControl.instance().changes.add( Change<({double value, int selectedSlot})>( (value: oldValue, selectedSlot: slot), () { var currentSlot = device.selectedSlot; if (slot != currentSlot) { device.selectedSlot = slot; } widget.preset.setParameterValue(parameter, newValue); }, (oldVal) { var currentSlot = device.selectedSlot; if (oldVal.selectedSlot != currentSlot) { device.selectedSlot = oldVal.selectedSlot; } widget.preset.setParameterValue(parameter, oldVal.value); })); NuxDeviceControl.instance().undoStackChanged(); } } ================================================ FILE: lib/UI/widgets/presets/effectEditors/EqualizerEditor.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/verticalThickSlider.dart'; import 'package:tinycolor2/tinycolor2.dart'; import '../../../../bluetooth/devices/effects/Processor.dart'; import '../../../utils.dart'; class EqualizerEditor extends StatefulWidget { final Processor eqEffect; final bool enabled; final Function(Parameter, double value, bool skip)? onChanged; final Function(Parameter, double, double)? onChangedFinal; const EqualizerEditor( {required this.eqEffect, required this.enabled, required this.onChanged, required this.onChangedFinal, Key? key}) : super(key: key); @override State createState() => _EqualizerEditorState(); } class _EqualizerEditorState extends State { double _oldValue = 0; final _sliderWidth = 47; @override Widget build(BuildContext context) { return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { var screenWidth = constraints.maxWidth; var layout = getEditorLayoutMode(MediaQuery.of(context)); List params = widget.eqEffect.parameters; List sliders = []; for (int i = 0; i < params.length; i++) { var param = params[i]; Color color = (i == 0 && params.length > 6) ? Colors.amber : Colors.blue; if (!widget.enabled) { color = TinyColor.fromColor(color).desaturate(80).color; } var slider = VerticalThickSlider( min: param.formatter.min.toDouble(), max: param.formatter.max.toDouble(), width: _sliderWidth.toDouble(), activeColor: color, label: param.name, handleHorizontalDrag: false, labelFormatter: (double val) { return val.toStringAsFixed(1); }, value: param.value, onChanged: (val, bool skip) { widget.onChanged?.call(param, val, skip); }, onDragStart: (val) { _oldValue = val; }, onDragEnd: (val) { widget.onChangedFinal?.call(param, val, _oldValue); }, ); sliders.add(slider); } Widget slidersContainer; if (_sliderWidth * params.length < screenWidth) { slidersContainer = Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: sliders, ); } else { slidersContainer = Scrollbar( child: ListView( primary: true, scrollDirection: Axis.horizontal, shrinkWrap: true, children: sliders, ), ); } if (layout == EditorLayoutMode.expand) { return Column( children: [ Expanded(child: slidersContainer), const SizedBox( height: 30, ) ], ); } else { return SizedBox( height: 200, child: slidersContainer, ); } }); } } ================================================ FILE: lib/UI/widgets/presets/effectEditors/SlidersEditor.dart ================================================ import 'package:flutter/material.dart'; import 'package:tinycolor2/tinycolor2.dart'; import 'package:undo/undo.dart'; import 'package:url_launcher/url_launcher_string.dart'; import '../../../../bluetooth/NuxDeviceControl.dart'; import '../../../../bluetooth/devices/NuxConstants.dart'; import '../../../../bluetooth/devices/effects/Processor.dart'; import '../../../../bluetooth/devices/presets/Preset.dart'; import '../../../../utilities/DelayTapTimer.dart'; import '../../../../bluetooth/devices/value_formatters/TempoFormatter.dart'; import '../../../../bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../../../popups/alertDialogs.dart'; import '../../../utils.dart'; import '../../ModeControl.dart'; import '../../thickSlider.dart'; class SlidersEditor extends StatefulWidget { final Preset preset; final int slot; const SlidersEditor({Key? key, required this.preset, required this.slot}) : super(key: key); @override State createState() => _SlidersEditorState(); } class _SlidersEditorState extends State { double _oldValue = 0; ThickSlider _createSlider(Parameter param, bool handleVerticalDrag) { bool enabled = widget.preset.slotEnabled(widget.slot); return ThickSlider( value: param.value, parameter: param, min: param.formatter.min.toDouble(), max: param.formatter.max.toDouble(), label: param.name, labelFormatter: (val) => param.label, activeColor: enabled ? widget.preset.effectColor(widget.slot) : TinyColor.fromColor(widget.preset.effectColor(widget.slot)) .desaturate(80) .color, onChanged: (value, bool skip) { setState(() { widget.preset.setParameterValue(param, value, notify: !skip); }); }, onDragStart: (val) { _oldValue = val; }, onDragEnd: (val) { _updateParameterValue(param, val); }, handleVerticalDrag: handleVerticalDrag, ); } void _updateParameterValue(Parameter param, double val) { var device = NuxDeviceControl.instance().device; var slot = device.selectedSlot; NuxDeviceControl.instance().changes.add( Change<({double parameter, int selectedSlot})>( (parameter: _oldValue, selectedSlot: slot), () { var currentSlot = device.selectedSlot; if (slot != currentSlot) { device.selectedSlot = slot; } widget.preset.setParameterValue(param, val); }, (oldVal) { var currentSlot = device.selectedSlot; if (oldVal.selectedSlot != currentSlot) { device.selectedSlot = oldVal.selectedSlot; } widget.preset.setParameterValue(param, oldVal.parameter); })); NuxDeviceControl.instance().undoStackChanged(); } ModeControl _createModeControl(Parameter param) { bool enabled = widget.preset.slotEnabled(widget.slot); return ModeControl( value: param.value, parameter: param, onChanged: (val) { _oldValue = param.value; _updateParameterValue(param, val); }, effectColor: widget.preset.effectColor(widget.slot), enabled: enabled, ); } Widget _createTapTempo(Parameter param) { bool enabled = widget.preset.slotEnabled(widget.slot); return RawMaterialButton( onPressed: () { DelayTapTimer.addClickTime(); var result = DelayTapTimer.calculate(); if (result != false) { setState(() { var newValue = (param.formatter as TempoFormatter) .timeToPercentage(result / 1000); widget.preset.setParameterValue(param, newValue); _oldValue = param.value; _updateParameterValue(param, newValue); }); } }, elevation: 2.0, fillColor: enabled ? TinyColor.fromColor(widget.preset.effectColor(widget.slot)) .darken(15) .color : TinyColor.fromColor(widget.preset.effectColor(widget.slot)) .desaturate(80) .darken(15) .color, padding: const EdgeInsets.all(15.0), shape: const CircleBorder(), child: const Padding( padding: EdgeInsets.all(10.0), child: Text( "Tap", style: TextStyle(color: Colors.white, fontSize: 20), ), ), ); } Widget _createCabinetRename(Cabinet cab) { return Column( children: [ const SizedBox(height: 12), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ElevatedButton.icon( onPressed: () { var dev = NuxDeviceControl.instance().device; AlertDialogs.showInputDialog(context, title: "Set cabinet name", description: "", value: cab.name, onConfirm: (value) { dev.renameCabinet(cab.nuxIndex, value); }); }, icon: const Icon(Icons.drive_file_rename_outline), label: const Text("Rename Cabinet")), ElevatedButton.icon( onPressed: () { var dev = NuxDeviceControl.instance().device; dev.renameCabinet(cab.nuxIndex, cab.cabName); }, icon: const Icon(Icons.restart_alt), label: const Text("Reset Name")) ], ), InkWell( onTap: () async { var url = AppConstants.patcherUrl; await canLaunchUrlString(url) ? await launchUrlString(url, mode: LaunchMode.externalApplication) : throw 'Could not launch $url'; }, child: SizedBox( height: 50, child: Center( child: RichText( text: const TextSpan( style: TextStyle(fontSize: 18, color: Colors.white), children: [ TextSpan(text: "Use "), TextSpan( text: "NUX IR Patcher", style: TextStyle( color: Colors.lightBlue, decoration: TextDecoration.underline), ), TextSpan(text: " to import custom IRs") ], )), ), ), ) ], ); } @override Widget build(BuildContext context) { var preset = widget.preset; var slot = widget.slot; var dev = NuxDeviceControl.instance().device; var sliders = []; var isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; var layout = getEditorLayoutMode(MediaQuery.of(context)); var handleVerticalDrag = isPortrait && layout != EditorLayoutMode.scroll; //get all the parameters for the slot List prc = preset.getEffectsForSlot(slot); //create the widgets to edit them var selected = preset.getSelectedEffectForSlot(slot); List params = prc[selected].parameters; if (params.isNotEmpty) { for (int i = 0; i < params.length; i++) { Widget widget; switch (params[i].formatter.inputType) { case InputType.SliderInput: widget = Flexible( fit: FlexFit.loose, child: _createSlider(params[i], handleVerticalDrag)); break; case InputType.SwitchInput: widget = _createModeControl(params[i]); break; } sliders.add(widget); //add tap tempo button if (params[i].formatter is TempoFormatter) { sliders.add(_createTapTempo(params[i])); } //add cabinet rename if supported if (dev.cabinetSupport && dev.cabinetSlotIndex == slot && dev.hackableIRs) { sliders.add(_createCabinetRename(prc[selected] as Cabinet)); } } sliders.add(const SizedBox( height: 20, )); } return Column(mainAxisSize: MainAxisSize.min, children: sliders); } } ================================================ FILE: lib/UI/widgets/presets/effectSelector.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:core'; import 'dart:math'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/presets/EffectChainBar.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import 'package:undo/undo.dart'; import '../../../bluetooth/NuxDeviceControl.dart'; import '../../../bluetooth/devices/NuxDevice.dart'; import '../../../bluetooth/devices/NuxFXID.dart'; import '../../utils.dart'; import 'effectEditor.dart'; import 'package:tinycolor2/tinycolor2.dart'; import '../../../bluetooth/devices/effects/Processor.dart'; import '../../../bluetooth/devices/presets/Preset.dart'; import '../common/customPopupMenu.dart' as custom; class EffectSelector extends StatefulWidget { final Preset preset; final NuxDevice device; const EffectSelector({Key? key, required this.preset, required this.device}) : super(key: key); @override State createState() => _EffectSelectorState(); } class _EffectSelectorState extends State { int get _selectedSlot => widget.device.selectedSlot; set _selectedSlot(val) => widget.device.selectedSlot = val; late Preset _preset; late List> _effectItems; String _selectedEffectName = ""; late Color _effectColor; @override void initState() { super.initState(); } void setSelectedEffect(dynamic index) { //the index param is always int, it's dynamic because the menu widget requires that setState(() { var device = NuxDeviceControl.instance().device; var effectSlot = _selectedSlot; //put new effect in stack var oldEffect = ( slot: _selectedSlot, index: _preset.getSelectedEffectForSlot(_selectedSlot), ); List> totalChanges = []; totalChanges.add(Change(oldEffect, () { if (_selectedSlot != effectSlot) _selectedSlot = effectSlot; _preset.setSelectedEffectForSlot(effectSlot, index, true); }, (oldVal) { if (_selectedSlot != oldVal.slot) _selectedSlot = oldVal.slot; _preset.setSelectedEffectForSlot(oldVal.slot, oldVal.index, true); })); if (device.cabinetSupport && SharedPrefs().getInt(SettingsKeys.changeCabs, 1) == 1) { if (_selectedSlot == device.amplifierSlotIndex) { //get the cabinet for this amp and set it Processor amp = _preset.getEffectsForSlot(_selectedSlot)[index]; if (amp is Amplifier) { var proc = _preset.getFXIDFromSlot(device.cabinetSlotIndex); var cabIndex = _preset.getEffectArrayIndexFromNuxIndex(proc, amp.defaultCab); var oldEffect = ( slot: device.cabinetSlotIndex, index: _preset.getSelectedEffectForSlot(device.cabinetSlotIndex) ); totalChanges.add(Change( oldEffect, () => _preset.setSelectedEffectForSlot( device.cabinetSlotIndex, cabIndex, true), (oldVal) => _preset.setSelectedEffectForSlot( oldVal.slot, oldVal.index, true))); } } } if (totalChanges.length == 1) { NuxDeviceControl.instance().changes.add(totalChanges[0]); } else { NuxDeviceControl.instance().changes.addGroup(totalChanges); } NuxDeviceControl.instance().undoStackChanged(); }); } @override Widget build(BuildContext context) { var layout = getEditorLayoutMode(MediaQuery.of(context)); _preset = widget.preset; _effectColor = _preset.effectColor(_selectedSlot); var _effectColorBright = TinyColor.fromColor(_effectColor).brighten(20).color; var proc = _preset.getFXIDFromSlot(_selectedSlot); var effectInfo = widget.device.getProcessorInfoByFXID(proc)!; //create effect models dropdown list List effects = _preset.getEffectsForSlot(_selectedSlot); //effect color for popup menu. Make sure it's contrasty to the text var popupEffectColor = _effectColor; //try to darken up to 2 times until the color is not light anymore for (int i = 0; i < 2; i++) { if (TinyColor.fromColor(popupEffectColor).isLight()) { popupEffectColor = TinyColor.fromColor(popupEffectColor).darken(15).color; } } _selectedEffectName = _preset .getEffectsForSlot( _selectedSlot)[_preset.getSelectedEffectForSlot(_selectedSlot)] .name; //create popup menu _effectItems = >[]; for (int f = 0; f < effects.length; f++) { if (effects[f].isSeparator == true) { _effectItems.add(custom.PopupMenuDivider( text: effects[f].category, color: Colors.grey, )); } _effectItems.add(custom.PopupMenuItem( value: f, backgroundColor: f == _preset.getSelectedEffectForSlot(_selectedSlot) ? popupEffectColor : null, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Text( "${f + 1}. ${effects[f].name}", ), ), )); } var effectSelectButton = Container( decoration: BoxDecoration( border: Border.all( color: Colors.grey, width: 1, ), borderRadius: BorderRadius.circular(8)), child: Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ Icon( effectInfo.icon, color: _effectColorBright, ), const SizedBox( width: 5, ), Text( effectInfo.longName, style: TextStyle( color: _effectColorBright, fontWeight: FontWeight.bold), ), if (_effectItems.length > 1) const SizedBox(height: 1, width: 8), if (_effectItems.length > 1) Text(_selectedEffectName) ], ), ), ); return Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ EffectChainBar( maxHeight: 60, device: widget.device, preset: _preset, reorderable: widget.device.reorderableFXChain, onTap: (i) { setState(() { _selectedSlot = i; }); }, onDoubleTap: (int i) { if (_preset.slotSwitchable(i)) { bool state = _preset.slotEnabled(i); _setSlotEnabledState(i, !state); } }, onReorder: (from, to) { var old = from + to * 100; setState(() { NuxDeviceControl.instance().changes.add(Change(old, () { //get type of old slot var selectedType = _preset.getFXIDFromSlot(_selectedSlot); _preset.swapProcessorSlots(from, to, true); _selectSlotByFXID(selectedType); }, (oldVal) { //get type of old slot var selectedType = _preset.getFXIDFromSlot(_selectedSlot); int from = oldVal % 100; int to = (oldVal / 100).floor(); //positions are swapped on undo _preset.swapProcessorSlots(to, from, true); _selectSlotByFXID(selectedType); })); NuxDeviceControl.instance().undoStackChanged(); }); }), const SizedBox( height: 8, ), Padding( padding: const EdgeInsets.only(left: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_effectItems.length > 1) custom.PopupMenuButton( itemBuilder: (context) => _effectItems, onSelected: setSelectedEffect, initialValue: _preset.getSelectedEffectForSlot(_selectedSlot), child: effectSelectButton, ) else ExcludeSemantics(child: effectSelectButton), const SizedBox( width: 1, height: 48), //used to even out sizes when switch is not visible Row( children: [ if (_effectItems.length > 1) IconButton( tooltip: "Previous effect", onPressed: () { var effect = _preset.getSelectedEffectForSlot(_selectedSlot) - 1; if (effect < 0) effect = effects.length - 1; setSelectedEffect(effect); }, icon: Transform.rotate( angle: pi, child: Icon(Icons.play_arrow, color: _effectColorBright)), iconSize: 30, ), if (_effectItems.length > 1) IconButton( tooltip: "Next effect", onPressed: () { var effect = _preset.getSelectedEffectForSlot(_selectedSlot) + 1; if (effect > effects.length - 1) effect = 0; setSelectedEffect(effect); }, icon: Icon(Icons.play_arrow, color: _effectColorBright), iconSize: 30, ), if (_preset.slotSwitchable(_selectedSlot)) Tooltip( message: "Toggle ${effectInfo.longName}", child: Switch( value: _preset.slotEnabled(_selectedSlot), onChanged: (val) { _setSlotEnabledState(_selectedSlot, val); }, activeColor: _effectColorBright, inactiveThumbColor: Colors.grey, inactiveTrackColor: Colors.grey[700], ), ), ], ), ], ), ), if (layout == EditorLayoutMode.expand) Expanded( child: EffectEditor( preset: _preset, slot: _selectedSlot, )) else EffectEditor( preset: _preset, slot: _selectedSlot, ) ], ); } void _setSlotEnabledState(int slot, bool value) { setState(() { NuxDeviceControl.instance().changes.add(Change( !value, () => _preset.setSlotEnabled(slot, value, true), (oldVal) => _preset.setSlotEnabled(slot, oldVal, true))); NuxDeviceControl.instance().undoStackChanged(); }); } void _selectSlotByFXID(NuxFXID type) { for (int i = 0; i < widget.device.effectsChainLength; i++) { if (_preset.getFXIDFromSlot(i) == type) _selectedSlot = i; } } } ================================================ FILE: lib/UI/widgets/presets/preset_list/presetEffectPreview.dart ================================================ import 'package:flutter/material.dart'; import '../../../../bluetooth/devices/NuxDevice.dart'; import '../../../../bluetooth/devices/effects/Processor.dart'; class PresetEffectPreview extends StatelessWidget { final Map preset; final NuxDevice device; final bool enabled; static const TextStyle _ampActive = TextStyle(color: Color.fromARGB(255, 158, 158, 158), fontSize: 14); static const TextStyle _ampInactive = TextStyle(color: Color.fromARGB(255, 90, 90, 90), fontSize: 14); const PresetEffectPreview( {super.key, required this.preset, required this.device, required this.enabled}); List _buildEffectsPreview( Map preset, NuxDevice dev) { var widgets = []; //int presetVersion = preset["version"] ?? 0; var pVersion = preset["version"] ?? 0; for (int i = 0; i < dev.processorList.length; i++) { ProcessorInfo pi = dev.processorList[i]; Color color = pi.color; if (!enabled) color = color.withAlpha(128); var textStyle = enabled ? _ampActive : _ampInactive; if (preset.containsKey(pi.keyName)) { //special case for amp if (pi.keyName == "amp") { var name = dev.getAmpNameByNuxIndex(preset[pi.keyName]["fx_type"], pVersion); widgets.insert( 0, Padding( padding: const EdgeInsets.only(right: 8.0), child: Text(name, style: textStyle), )); } else if (pi.keyName == "cabinet") { continue; } else { bool fxEnabled = preset[pi.keyName]["enabled"]; widgets.add(Icon( pi.icon, color: fxEnabled ? color : Colors.grey, size: 16, )); } } } return widgets; } @override Widget build(BuildContext context) { return Row( children: _buildEffectsPreview(preset, device), ); } } ================================================ FILE: lib/UI/widgets/presets/preset_list/presetItem.dart ================================================ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/presets/preset_list/presetEffectPreview.dart'; import 'package:tinycolor2/tinycolor2.dart'; import '/bluetooth/NuxDeviceControl.dart'; import '/bluetooth/devices/NuxDevice.dart'; import '/UI/toneshare/share_preset.dart'; import 'presets_popup_menus.dart'; class PresetItem extends StatelessWidget { final Map item; final NuxDevice device; final bool simplified; final bool hideNotApplicable; final void Function()? onTap; final void Function(PresetItemActions, Map)? onPopupMenuTap; const PresetItem( {Key? key, required this.item, required this.device, required this.simplified, this.onTap, this.onPopupMenuTap, required this.hideNotApplicable}) : super(key: key); Widget? _createPresetTrailingWidget( Map item, BuildContext context) { //create trailing widget based on whether the preset is new Widget? trailingWidget; late Widget pmb; if (!simplified) { pmb = PopupMenuButton( child: const Padding( padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return PresetsPopupMenus.popupMenuPreset; }, onSelected: (pos) { onPopupMenuTap?.call(pos as PresetItemActions, item); }, ); } if (simplified) { trailingWidget = null; } else if (kDebugMode && false) { trailingWidget = Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( onPressed: () { Navigator.of(context).push( MaterialPageRoute(builder: (context) => PresetForm()), ); }, icon: Icon(Icons.adaptive.share)), pmb ], ); } else { trailingWidget = pmb; } return trailingWidget; } Widget _iconLabel(String label, Color color) { var items = label.split("|"); List widgets = []; for (var item in items) { if (item != '-') { widgets.add(Text( item, textAlign: TextAlign.center, style: TextStyle(fontSize: 14, color: color), )); } else { widgets.add(SizedBox( width: 36, child: Divider( indent: 0, endIndent: 0, thickness: 2, height: 4, color: color, ), )); } } return Column( crossAxisAlignment: CrossAxisAlignment.center, children: widgets, ); } @override Widget build(BuildContext context) { var pVersion = item["version"] ?? 0; var devVersion = device.productVersion; bool enabled = true; enabled = item["product_id"] == device.presetClass; if (!enabled && hideNotApplicable) return const SizedBox.shrink(); bool selected = item["uuid"] == device.deviceControl.presetUUID; bool newItem = item.containsKey("new"); var dev = NuxDeviceControl.instance() .getDeviceFromPresetClass(item["product_id"]) ?? device; Color color = dev.getPreset(0).channelColorsList[item["channel"]]; if (!enabled) color = TinyColor.fromColor(color).desaturate(90).color; int alpha = selected && !simplified ? 105 : 0; return ColoredBox( color: Color.fromARGB(alpha, 8, 102, 232), child: ListTile( enabled: enabled, minLeadingWidth: 0, contentPadding: const EdgeInsets.fromLTRB(0, 0, 0, 0), leading: Container( margin: const EdgeInsets.only(left: 4), decoration: BoxDecoration( border: Border.all(color: color, width: 1.5), borderRadius: const BorderRadius.all(Radius.circular(5))), width: 45, height: 45, child: Stack( alignment: Alignment.center, children: [ FittedBox( fit: BoxFit.fitWidth, child: Padding( padding: const EdgeInsets.all(3.0), child: _iconLabel(dev.productIconLabel, color), ), ), if (newItem) Transform( transform: Matrix4.translationValues(22, -20, 0), child: const Icon( Icons.circle, color: Colors.blue, size: 16, ), ), if (enabled && pVersion != devVersion) Transform( transform: Matrix4.translationValues(18, 15, 0), child: const Icon( Icons.warning, color: Colors.amber, size: 20, ), ) ], ), ), title: Text(item["name"], style: TextStyle(color: enabled ? Colors.white : Colors.grey[600])), subtitle: PresetEffectPreview(device: dev, preset: item, enabled: enabled), trailing: _createPresetTrailingWidget(item, context), onTap: onTap), ); } } ================================================ FILE: lib/UI/widgets/presets/preset_list/presetList.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/drag_and_drop_lists.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/presets/preset_list/preset_widget.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import '../../../mainTabs.dart'; import '/utilities/string_extensions.dart'; import '../../search_field.dart'; import '/audio/setlist_player/setlistPlayerState.dart'; import '/audio/trackdata/trackData.dart'; import '/bluetooth/NuxDeviceControl.dart'; import '/bluetooth/devices/NuxDevice.dart'; import '/platform/presetsStorage.dart'; import '/platform/fileSaver.dart'; import '/platform/platformUtils.dart'; import '/UI/popups/alertDialogs.dart'; import '../trackEventsBlockInfo.dart'; import 'presetListMethods.dart'; import 'presets_popup_menus.dart'; class PresetList extends StatefulWidget { final void Function(dynamic)? onTap; final bool simplified; final TabVisibilityEventHandler? visibilityEventHandler; const PresetList( {Key? key, this.onTap, this.simplified = false, this.visibilityEventHandler}) : super(key: key); @override State createState() => _PresetListState(); } class _PresetListState extends State with AutomaticKeepAliveClientMixin { NuxDevice get device => NuxDeviceControl.instance().device; List get _lists => PresetsStorage().presetsData; Map devices = {}; bool _showSearch = false; final TextEditingController _searchText = TextEditingController(text: ""); late ScrollController _scrollController; @override void initState() { super.initState(); if (widget.visibilityEventHandler != null) { widget.visibilityEventHandler!.onTabSelected = _onTabSelected; widget.visibilityEventHandler!.onTabDeselected = _onTabDeselected; } _registerListeners(); _searchText.addListener(refreshPresets); _scrollController = ScrollController(); } @override void dispose() { super.dispose(); _onTabDeselected(); _searchText.removeListener(refreshPresets); } void _registerListeners() { NuxDeviceControl.instance().addListener(refreshPresets); PresetsStorage().addListener(refreshPresets); NuxDeviceControl.instance().presetNameNotifier.addListener(refreshPresets); if (!widget.simplified) { SetlistPlayerState.instance().addListener(refreshPresets); } } void _onTabSelected() { _registerListeners(); if (mounted) { setState(() {}); } } void _onTabDeselected() { print("on deselected"); NuxDeviceControl.instance().removeListener(refreshPresets); PresetsStorage().removeListener(refreshPresets); NuxDeviceControl.instance() .presetNameNotifier .removeListener(refreshPresets); if (!widget.simplified) { SetlistPlayerState.instance().removeListener(refreshPresets); } } void refreshPresets() { setState(() {}); } void _openToneShare() { //Navigator.of(context) // .push(MaterialPageRoute(builder: (context) => const ToneShare())); //Navigator.of(context) // .push(MaterialPageRoute(builder: (context) => MightyPatchesPage())); } Widget _mainPopupMenu() { return PopupMenuButton( child: const Padding( padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return PresetsPopupMenus.presetsMenu; }, onSelected: (pos) { mainMenuActions(pos); }, ); } Widget? _createHeader() { if (_showSearch) { return SearchField( textEditingController: _searchText, onCloseSearch: () { _searchText.clear(); _showSearch = false; setState(() {}); }, ); } else if (!widget.simplified) { return ListTile( // shape: RoundedRectangleBorder( // borderRadius: BorderRadius.circular(20), // side: BorderSide(color: Colors.grey)), contentPadding: const EdgeInsets.only(left: 16, right: 0), title: const Text("Presets"), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ /*if (kDebugMode) IconButton( onPressed: _openToneShare, icon: const Icon( Icons.cloud_download, size: 28, )),*/ IconButton( onPressed: () { _showSearch = true; setState(() {}); }, icon: const Icon( Icons.search, size: 28, )), _mainPopupMenu() ], ), ); } return null; } Widget _createDragDropList( List list, Widget? header, bool sliverList, {bool disableScrolling = false}) { return DragAndDropLists( scrollController: _scrollController, sliverList: sliverList, key: const PageStorageKey("presets"), children: list, disableScrolling: disableScrolling, headerWidget: header, lastListTargetSize: 60, contentsWhenEmpty: const SliverFillRemaining( child: Center( child: Text("Empty"), ), ), onItemReorder: _onItemReorder, onListReorder: _onListReorder, itemGhost: (item) { return Row( mainAxisSize: MainAxisSize.min, children: [ const Icon( Icons.keyboard_arrow_right, size: 30, color: Colors.grey, ), Expanded(child: Opacity(opacity: 0.4, child: item)) ], ); }, itemGhostOpacity: 1, itemDragOffset: const Offset(30, 0), // listGhost is mandatory when using expansion tiles to prevent multiple widgets using the same globalkey listGhost: Container( color: Colors.blue, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Center( child: Container( padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 100.0), decoration: BoxDecoration( border: Border.all(color: Colors.white), borderRadius: BorderRadius.circular(7.0), ), child: const Icon( Icons.add_box, color: Colors.white, ), ), ), ), ), ); } Widget _createPresetTree(Widget? header, bool hideNonApplicable) { List list = List.generate( _lists.length, (index) => _buildList(index, hideNonApplicable)); return SafeArea( child: CustomScrollView( slivers: [ if (header != null) SliverAppBar( backgroundColor: Theme.of(context).scaffoldBackgroundColor, title: header, titleSpacing: 0, floating: true, snap: true, ), _createDragDropList(list, header, true) ], ), ); } Widget _createPresetTreeSimple(bool hideNonApplicable) { List list = List.generate( _lists.length, (index) => _buildList(index, hideNonApplicable)); return _createDragDropList(list, null, false, disableScrolling: true); } Widget _createSearchResultsList(Widget? header, bool hideNonApplicable) { List presetList = []; var searchText = _searchText.text.trim(); for (var l in _lists) { var presets = l["presets"]; for (var p in presets) { if (p["name"].toString().containsIgnoreCase(searchText)) { presetList.add(p); } } } presetList.sort((a, b) => a["name"].compareTo(b["name"])); return SafeArea( child: CustomScrollView( slivers: [ SliverAppBar( backgroundColor: Theme.of(context).scaffoldBackgroundColor, title: header, titleSpacing: 0, floating: true, snap: true, ), if (presetList.isEmpty) const SliverFillRemaining( child: Center(child: Text("No Results")), ), if (presetList.isNotEmpty) SliverList.builder( itemBuilder: (context, index) { return _presetWidget(presetList[index], hideNonApplicable); }, itemCount: presetList.length, // prototypeItem: const ListTile( // subtitle: SizedBox.shrink(), // ), ) ], ), ); } @override Widget build(BuildContext context) { super.build(context); bool hideNonApplicable = SharedPrefs().getInt(SettingsKeys.hideNotApplicablePresets, 0) == 1; Widget? header = _createHeader(); if (widget.simplified) return _createPresetTreeSimple(hideNonApplicable); Widget ui; if (_searchText.text.isEmpty) { ui = _createPresetTree(header, hideNonApplicable); } else { ui = _createSearchResultsList(header, hideNonApplicable); } var sps = SetlistPlayerState.instance(); if (sps.state != PlayerState.play || (sps.automation?.presetChangeEventsAvailable == false)) { return ui; } else { return TrackEventsBlockInfo( child: ui, onBypass: () { setState(() {}); }, ); } } void _categoryMenu(CategoryMenuActions action, String item) { switch (action) { case CategoryMenuActions.Delete: _deleteCategory(item); break; case CategoryMenuActions.Rename: _renameCategory(item); break; case CategoryMenuActions.Export: _exportCategory(item); break; } } _buildList(int outerIndex, bool hideNonApplicable) { Map category = _lists[outerIndex]; List presets = category["presets"]; return DragAndDropListExpansion( canDrag: !widget.simplified, title: Text(category["name"]), titleColor: Colors.grey[700], titleColorExpanded: Colors.grey[600], itemsBackgroundColor: Colors.grey[900]!, trailing: widget.simplified ? null : PopupMenuButton( child: const Padding( padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return PresetsPopupMenus.popupMenuCategory; }, onSelected: (pos) { _categoryMenu(pos as CategoryMenuActions, category["name"]); }, ), children: List.generate(presets.length, (index) => _buildPresetItem(presets[index], hideNonApplicable)), listKey: ObjectKey(category), ); } Widget _presetWidget(Map item, bool hideNonApplicable) { return PresetWidget( simplified: widget.simplified, device: device, hideNonApplicable: hideNonApplicable, onTap: widget.onTap, preset: item); } _buildPresetItem(Map item, bool hideNonApplicable) { return DragAndDropItem( canDrag: !widget.simplified, feedbackWidget: ListTile( tileColor: const Color.fromARGB(127, 127, 127, 127), title: Text(item["name"]), ), child: _presetWidget(item, hideNonApplicable), ); } _onItemReorder( int oldItemIndex, int oldListIndex, int newItemIndex, int newListIndex) { if (PresetsStorage().reorderPresets( oldItemIndex, oldListIndex, newItemIndex, newListIndex)) { setState(() {}); } else { ScaffoldMessenger.of(context).showSnackBar(const SnackBar( backgroundColor: Colors.deepOrange, content: Text( "Destination category contains preset with the same name!", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontSize: 20), ))); } } _onListReorder(int oldListIndex, int newListIndex) { setState(() { PresetsStorage().reorderCategories(oldListIndex, newListIndex); }); } @override bool get wantKeepAlive => true; /// ///Actions /// /// void mainMenuActions(action) { switch (action) { case PresetsTopMenuActions.ExportAll: _exportCategory(""); break; case PresetsTopMenuActions.Import: _importPresets(); break; } } /// /// Preset actions /// /// void _deleteCategory(String category) { AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Are you sure you want to delete category $category?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) { if (delete) { PresetsStorage().deleteCategory(category).then((List uuids) { TrackData().removeMultiplePresetsInstances(uuids); setState(() {}); }); } }); } void _renameCategory(String category) { AlertDialogs.showInputDialog(context, title: "Rename", description: "Enter category name:", cancelButton: "Cancel", confirmButton: "Rename", value: category, validation: (String newName) { return !PresetsStorage().getCategories().contains(newName); }, validationErrorMessage: "Name already taken!", confirmColor: Theme.of(context).hintColor, onConfirm: (newName) { PresetsStorage() .renameCategory(category, newName) .then((value) => setState(() {})); }); } //if category is empty string it exports all categories void _exportCategory(String category) { String? data = PresetsStorage().presetsToJson(category); if (category.isEmpty) { category = "Backup"; } if (data != null) { if (!PlatformUtils.isIOS) { saveFileString("application/octet-stream", "$category.nuxpreset", data); } else { PresetListMethods.saveFileIos(category, data, context); } } else { ScaffoldMessenger.of(context).showSnackBar(const SnackBar( backgroundColor: Colors.deepOrange, content: Text( "Cannot export empty category!", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontSize: 20), ))); } } void _importPresets() { if (PlatformUtils.isAndroid) { openFileString("application/octet-stream").then(_onFileRead); } else { FilePicker().readFile().then((value) { if (value != null) _onFileRead(value); }); } } void _onFileRead(String value) { PresetsStorage().presetsFromJson(value).then((value) { setState(() {}); String label = value == 1 ? "Imported 1 preset" : "Imported $value presets"; ScaffoldMessenger.of(context).showSnackBar(SnackBar( backgroundColor: Colors.green, content: Text( label, textAlign: TextAlign.center, style: const TextStyle(color: Colors.white, fontSize: 20), ))); }).catchError((error) { AlertDialogs.showInfoDialog(context, title: "Error", description: "The selected file is not a valid preset file!", confirmButton: "OK"); }); } } ================================================ FILE: lib/UI/widgets/presets/preset_list/presetListMethods.dart ================================================ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:qr_utils/qr_utils.dart'; import '../../../../bluetooth/NuxDeviceControl.dart'; import '../../../../platform/fileSaver.dart'; import '../../../../platform/platformUtils.dart'; import '../../../../platform/presetsStorage.dart'; import '../../../popups/alertDialogs.dart'; import '../../../popups/exportQRCode.dart'; class PresetListMethods { static void exportQR(Map preset, BuildContext context) { var dev = NuxDeviceControl.instance() .getDeviceFromPresetClass(preset["product_id"]); var pVersion = preset["version"] ?? 0; if (dev != null) { int? originalVersion; if (dev.productVersion != pVersion) { originalVersion = dev.productVersion; dev.setFirmwareVersionByIndex(pVersion); } var qr = dev.jsonToQR(preset); if (qr != null) { QrUtils.generateQR(qr).then((Image img) { var qrExport = QRExportDialog(img, preset["name"], dev); showDialog( context: context, builder: (BuildContext context) => qrExport.buildDialog(context), ).then((value) { if (originalVersion != null) { dev.setFirmwareVersionByIndex(originalVersion); } }); }); } } } static void saveFileIos(String name, String data, BuildContext context) { AlertDialogs.showInputDialog(context, title: "Backup", description: "Enter backup name:", cancelButton: "Cancel", confirmButton: "Backup", value: name, validation: (String newName) { RegExp regex = RegExp(r'[<>:"/\\|?*\x00-\x1F\x7F]+'); return !regex.hasMatch(newName); }, validationErrorMessage: "The file name contains invalid characters.", confirmColor: Theme.of(context).hintColor, onConfirm: (newName) async { await FilePicker().saveFile(newName, data); }); } static void exportPreset(Map preset, BuildContext context) { var category = PresetsStorage().findCategoryOfPreset(preset); if (category != null) { String? data = PresetsStorage().presetToJson(category["name"], preset["name"]); if (data != null) { if (!PlatformUtils.isIOS) { saveFileString( "application/octet-stream", "${preset["name"]}.nuxpreset", data); } else { PresetListMethods.saveFileIos(preset["name"], data, context); } } } } } ================================================ FILE: lib/UI/widgets/presets/preset_list/preset_widget.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import '../../../../audio/trackdata/trackData.dart'; import '../../../../bluetooth/NuxDeviceControl.dart'; import '../../../../platform/presetsStorage.dart'; import '../../../popups/alertDialogs.dart'; import '../../../popups/changeCategory.dart'; import 'presetItem.dart'; import 'presetListMethods.dart'; import 'presets_popup_menus.dart'; class PresetWidget extends StatefulWidget { final bool simplified; final NuxDevice device; final bool hideNonApplicable; final Map preset; final void Function(dynamic)? onTap; const PresetWidget( {super.key, required this.simplified, required this.device, required this.hideNonApplicable, required this.preset, this.onTap}); @override State createState() => _PresetWidgetState(); } class _PresetWidgetState extends State { Widget _presetWidget(Map item, bool hideNonApplicable) { return PresetItem( device: widget.device, item: item, hideNotApplicable: hideNonApplicable, simplified: widget.simplified, onTap: () { //remove the new marker if exists if (!widget.simplified) { PresetsStorage().clearNewFlag(item); } if (widget.onTap != null) { widget.onTap!(item); } else { var dev = widget.device; if (dev.isPresetSupported(item)) { widget.device.presetFromJson(item, null); } } setState(() {}); }, onPopupMenuTap: (action, item) { switch (action) { case PresetItemActions.Delete: _deletePreset(item); break; case PresetItemActions.Rename: _renamePreset(item); break; case PresetItemActions.ChangeChannel: _changePresetChannel(item); break; case PresetItemActions.Duplicate: _duplicatePreset(item); break; case PresetItemActions.Export: PresetListMethods.exportPreset(item, context); break; case PresetItemActions.ChangeCategory: _changePresetCategory(item); break; case PresetItemActions.ExportQR: PresetListMethods.exportQR(item, context); break; } }, ); } void _deletePreset(Map preset) { bool inUse = TrackData().isPresetInUse(preset["uuid"]!); String description = "Are you sure you want to delete ${preset["name"]}?"; if (inUse) { description += "\n\nThe preset is used in one or more Jamtracks!"; } AlertDialogs.showConfirmDialog(context, title: "Confirm", description: description, cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) { if (delete) { String uuid = preset["uuid"] ?? ""; TrackData().removePresetInstances(uuid); PresetsStorage().deletePreset(preset).then((value) => setState(() {})); } }); } void _renamePreset(Map preset) { var category = PresetsStorage().findCategoryOfPreset(preset); if (category != null) { AlertDialogs.showInputDialog(context, title: "Rename", description: "Enter preset name:", cancelButton: "Cancel", confirmButton: "Rename", value: preset["name"], validationErrorMessage: "Name already taken!", validation: (newName) { return !PresetsStorage().presetExists(newName, category["name"]); }, confirmColor: Theme.of(context).hintColor, onConfirm: (newName) { PresetsStorage() .renamePreset(preset, newName) .then((value) => setState(() {})); }); } } void _changePresetChannel(Map preset) { List channelList = []; int nuxChannel = preset["channel"]; var d = NuxDeviceControl.instance() .getDeviceFromPresetClass(preset["product_id"]); if (d != null) { for (int i = 0; i < d.channelsCount; i++) { channelList.add(d.channelName(i)); } var dialog = AlertDialogs.showOptionDialog(context, confirmButton: "Change", cancelButton: "Cancel", title: "Select Channel", confirmColor: Theme.of(context).hintColor, options: channelList, value: nuxChannel, onConfirm: (changed, newValue) { if (changed) { setState(() { PresetsStorage().changeChannel(preset, newValue); }); } }); showDialog( context: context, builder: (BuildContext context) => dialog, ); } } void _duplicatePreset(Map preset) { var category = PresetsStorage().findCategoryOfPreset(preset); if (category != null) { PresetsStorage() .duplicatePreset(category["name"], preset["name"]) .then((value) { setState(() {}); }); } } void _changePresetCategory(Map preset) { var category = PresetsStorage().findCategoryOfPreset(preset); if (category != null) { var categoryDialog = ChangeCategoryDialog( category: category["name"], name: preset["name"], confirmColor: Theme.of(context).hintColor, onCategoryChange: (newCategory) { setState(() { PresetsStorage().changePresetCategory( category["name"], preset["name"], newCategory); }); }); showDialog( context: context, builder: (BuildContext context) => categoryDialog.buildDialog(context), ); } } @override Widget build(BuildContext context) { return _presetWidget(widget.preset, widget.hideNonApplicable); } } ================================================ FILE: lib/UI/widgets/presets/preset_list/presets_popup_menus.dart ================================================ import 'package:flutter/material.dart'; import '../../../mightierIcons.dart'; import '../../../theme.dart'; enum PresetsTopMenuActions { ExportAll, Import } enum CategoryMenuActions { Delete, Rename, Export } enum PresetItemActions { Delete, Rename, ChangeChannel, Duplicate, Export, ChangeCategory, ExportQR } class PresetsPopupMenus { //mainMenu static final presetsMenu = [ PopupMenuItem( value: PresetsTopMenuActions.ExportAll, child: Row( children: [ Icon( Icons.archive, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Backup All"), ], ), ), PopupMenuItem( value: PresetsTopMenuActions.Import, child: Row( children: [ Icon( Icons.unarchive, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Restore"), ], ), ), ]; //menu for category static final List popupMenuCategory = [ PopupMenuItem( value: CategoryMenuActions.Delete, child: Row( children: [ Icon( Icons.delete, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Delete"), ], ), ), PopupMenuItem( value: CategoryMenuActions.Rename, child: Row( children: [ Icon( Icons.drive_file_rename_outline, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Rename"), ], ), ), PopupMenuItem( value: CategoryMenuActions.Export, child: Row( children: [ Icon( Icons.archive, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Backup Category"), ], ), ) ]; static final List popupMenuPreset = [ PopupMenuItem( value: PresetItemActions.Delete, child: Row( children: [ Icon( Icons.delete, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Delete"), ], ), ), PopupMenuItem( value: PresetItemActions.ChangeChannel, child: Row( children: [ Icon( Icons.circle, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Change Channel"), ], ), ), PopupMenuItem( value: PresetItemActions.ChangeCategory, child: Row( children: [ Icon( MightierIcons.tag, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Change Category"), ], ), ), PopupMenuItem( value: PresetItemActions.Rename, child: Row( children: [ Icon( Icons.drive_file_rename_outline, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Rename"), ], ), ), PopupMenuItem( value: PresetItemActions.Duplicate, child: Row( children: [ Icon( Icons.copy, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Duplicate"), ], ), ), PopupMenuItem( value: PresetItemActions.ExportQR, child: Row( children: [ Icon( Icons.qr_code_2, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Share as QR Code"), ], ), ), PopupMenuItem( value: PresetItemActions.Export, child: Row( children: [ Icon( Icons.archive, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Backup Preset"), ], ), ) ]; } ================================================ FILE: lib/UI/widgets/presets/trackEventsBlockInfo.dart ================================================ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/setlist_player/setlistPlayerState.dart'; class TrackEventsBlockInfo extends StatelessWidget { final Widget child; final Function() onBypass; const TrackEventsBlockInfo( {super.key, required this.child, required this.onBypass}); @override Widget build(BuildContext context) { return Stack( alignment: Alignment.center, children: [ child, ClipRect( child: BackdropFilter( filter: ImageFilter.blur( sigmaX: 2, sigmaY: 2, ), child: Container( color: Colors.black54, )), ), Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisSize: MainAxisSize.min, children: [ const Text( textAlign: TextAlign.center, style: TextStyle(fontSize: 16), "The parameters are driven by the currently playing Jam Track!"), const SizedBox( height: 20, ), ElevatedButton( onPressed: () { SetlistPlayerState.instance() .automation ?.bypassPresetChanges(); onBypass(); }, child: const Text("Bypass"), ) ], ), ) ], ); } } ================================================ FILE: lib/UI/widgets/rounded_icon_button.dart ================================================ import 'package:flutter/material.dart'; class RoundedIconButton extends StatelessWidget { final VoidCallback? onPressed; final Widget icon; final String? tooltip; final double borderRadius; const RoundedIconButton( {Key? key, this.onPressed, required this.icon, this.tooltip, this.borderRadius = 6}) : super(key: key); @override Widget build(BuildContext context) { return Container( decoration: ShapeDecoration( color: onPressed != null ? Colors.blue : Colors.grey[800], shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(borderRadius)), ), child: IconButton( constraints: ButtonTheme.of(context).constraints, icon: icon, onPressed: onPressed, tooltip: tooltip, ), ); } } ================================================ FILE: lib/UI/widgets/scrollParent.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; class ScrollParent extends StatelessWidget { final ScrollController controller; final Widget child; const ScrollParent({Key? key, required this.controller, required this.child}) : super(key: key); @override Widget build(BuildContext context) { return NotificationListener( onNotification: (OverscrollNotification value) { if (value.overscroll < 0 && controller.offset + value.overscroll <= 0) { if (controller.offset != 0) controller.jumpTo(0); return true; } if (controller.offset - value.overscroll >= controller.position.maxScrollExtent) { if (controller.offset != controller.position.maxScrollExtent) { controller.jumpTo(controller.position.maxScrollExtent); } return true; } controller.jumpTo(controller.offset - value.overscroll); return true; }, child: child, ); } } ================================================ FILE: lib/UI/widgets/scrollPicker.dart ================================================ // Copyright (c) 2018, codegrue. All rights reserved. Use of this source code // is governed by the MIT license that can be found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; /// This helper widget manages the scrollable content inside a picker widget. class ScrollPicker extends StatefulWidget { // Constants static const double itemHeight = 50.0; const ScrollPicker({ Key? key, required this.items, required this.initialValue, required this.onChanged, required this.onChangedFinal, this.enabled = true, }) : super(key: key); // Events final ValueChanged onChanged; final Function(int, bool) onChangedFinal; // Variables final List items; final int initialValue; final bool enabled; @override _ScrollPickerState createState() => _ScrollPickerState(initialValue); } class _ScrollPickerState extends State { _ScrollPickerState(this.selectedValue); // Variables double widgetHeight = 0; int selectedValue; bool _isUserGenerated = false; late FixedExtentScrollController scrollController; @override void initState() { super.initState(); scrollController = FixedExtentScrollController(initialItem: selectedValue); } @override Widget build(BuildContext context) { final ThemeData themeData = Theme.of(context); TextStyle defaultStyle = themeData.textTheme.bodyMedium!; TextStyle selectedStyle = themeData.textTheme.bodyLarge!.copyWith(fontSize: 26); if (!_isUserGenerated) { selectedValue = widget.initialValue; scrollController.jumpToItem( widget.initialValue, ); } // return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { widgetHeight = constraints.maxHeight; return IgnorePointer( ignoring: !widget.enabled, child: Opacity( opacity: widget.enabled ? 1 : 0.3, child: Stack( children: [ GestureDetector( onTapUp: _itemTapped, child: NotificationListener( onNotification: (scrollNotification) { if (scrollNotification is UserScrollNotification) { if (scrollNotification.direction != ScrollDirection.idle) { _isUserGenerated = true; } } else if (scrollNotification is ScrollEndNotification) { widget.onChangedFinal(selectedValue, _isUserGenerated); _isUserGenerated = false; } return false; }, child: ListWheelScrollView.useDelegate( childDelegate: ListWheelChildBuilderDelegate( builder: (BuildContext context, int index) { if (index < 0 || index > widget.items.length - 1) { return null; } var value = widget.items[index]; final TextStyle itemStyle = (index == selectedValue) ? selectedStyle : defaultStyle; return Center( child: AnimatedDefaultTextStyle( style: itemStyle, duration: const Duration(milliseconds: 100), child: Text(value), ), ); }), controller: scrollController, itemExtent: ScrollPicker.itemHeight, onSelectedItemChanged: _onSelectedItemChanged, physics: const FixedExtentScrollPhysics(), ), ), ), IgnorePointer( child: Center( child: Container( height: ScrollPicker.itemHeight, decoration: const BoxDecoration( border: Border( top: BorderSide(color: Colors.grey, width: 1.0), bottom: BorderSide(color: Colors.grey, width: 1.0), ), ), ), ), ) ], ), ), ); }, ); } void _itemTapped(TapUpDetails details) { Offset position = details.localPosition; double center = widgetHeight / 2; double changeBy = position.dy - center; double newPosition = scrollController.offset + changeBy; // animate to and center on the selected item scrollController.animateTo(newPosition, duration: const Duration(milliseconds: 500), curve: Curves.easeInOutQuad); } void _onSelectedItemChanged(int index) { if (index != selectedValue) { selectedValue = index; widget.onChanged(selectedValue); } } } ================================================ FILE: lib/UI/widgets/search_field.dart ================================================ import 'package:flutter/material.dart'; class SearchField extends StatelessWidget { final TextEditingController textEditingController; final Function onCloseSearch; const SearchField( {super.key, required this.onCloseSearch, required this.textEditingController}); @override Widget build(BuildContext context) { return ListTile( title: TextField( controller: textEditingController, autofocus: true, decoration: InputDecoration( suffixIconColor: Colors.white, focusColor: Colors.white, //focusedBorder: InputBorder.none, prefixIcon: const Icon(Icons.search), border: InputBorder.none, suffixIcon: IconButton( icon: const Icon(Icons.close), onPressed: () { textEditingController.clear(); onCloseSearch(); }, ), ), )); } } ================================================ FILE: lib/UI/widgets/thickRangeSlider.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:math'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:tinycolor2/tinycolor2.dart'; class SliderRangeValues { double start; double end; SliderRangeValues(this.start, this.end); SliderRangeValues operator *(double value) { return SliderRangeValues(start * value, end * value); } } class ThickRangeSlider extends StatefulWidget { final Color activeColor; final String label; final double min, max; final SliderRangeValues values; final ValueChanged? onDragStart; final Function(SliderRangeValues value, bool skip)? onChanged; final ValueChanged? onDragEnd; final String Function(SliderRangeValues) labelFormatter; final int skipEmitting; final bool enabled; final bool handleVerticalDrag; final double? maxHeight; const ThickRangeSlider( {Key? key, required this.activeColor, required this.label, this.min = 0, this.max = 1, required this.values, this.onDragStart, this.onChanged, this.onDragEnd, this.handleVerticalDrag = true, required this.labelFormatter, this.skipEmitting = 3, this.enabled = true, this.maxHeight}) : super(key: key); @override State createState() => _ThickRangeSliderState(); } class _ThickRangeSliderState extends State { SliderRangeValues factor = SliderRangeValues(0.2, 0.8); //normalized position in 0-1 SliderRangeValues pos = SliderRangeValues(0, 1); int lastTapDown = 0; int emitCounter = 0; double scale = 1; Offset startDragPos = const Offset(0, 0); double width = 0; double height = 0; int handleIndex = 0; // Returns a number between min and max, proportional to value, which must // be between 0.0 and 1.0. double _lerpSingle(double value) { assert(value >= 0.0); assert(value <= 1.0); return value * (widget.max - widget.min) + widget.min; } SliderRangeValues _lerp(SliderRangeValues values) { return SliderRangeValues( _lerpSingle(values.start), _lerpSingle(values.end)); } //same as above, only with custom min and max double _lerp2Single(double value, double min, double max) { assert(value >= 0.0); assert(value <= 1.0); return value * (max - min) + min; } SliderRangeValues _lerp2(SliderRangeValues values, double min, double max) { return SliderRangeValues(_lerp2Single(values.start, min, max), _lerp2Single(values.end, min, max)); } // Returns a number between 0.0 and 1.0, given a value between min and max. double _unlerpSingle(double value) { assert(value <= widget.max); assert(value >= widget.min); return widget.max > widget.min ? (value - widget.min) / (widget.max - widget.min) : 0.0; } SliderRangeValues _unlerp(SliderRangeValues value) { return SliderRangeValues( _unlerpSingle(value.start), _unlerpSingle(value.end)); } @override void initState() { super.initState(); //range check assert(widget.min < widget.max); assert( widget.values.start >= widget.min && widget.values.start <= widget.max); assert(widget.values.end >= widget.min && widget.values.end <= widget.max); assert(widget.values.start <= widget.values.end); assert(widget.skipEmitting > 0); //normalize value to 0-1 factor = _unlerp(widget.values); } void addPercentage(value, width, int index) { if (index != 1) { pos.start += value; pos.start = max(min(pos.start, pos.end), 0); factor.start = pos.start / width; } if (index != 0) { pos.end += value; pos.end = max(min(pos.end, width), pos.start); factor.end = pos.end / width; } } void dragStart(DragStartDetails details) { startDragPos = details.localPosition; widget.onDragStart?.call(widget.values); var startFactor = startDragPos.dx / width; var midPoint = factor.start + (factor.end - factor.start) / 2; handleIndex = startFactor < midPoint ? 0 : 1; return; } void dragUpdate(DragUpdateDetails details) { Offset delta = details.localPosition - startDragPos; startDragPos = details.localPosition; scale = 1; var posAbs = (details.localPosition.dy - height / 2.0).abs(); if (posAbs > height * 1.5) scale = 0.5; if (posAbs > height * 2.5) scale = 0.25; if (posAbs > height * 4) scale = 0.125; if (posAbs > height * 5.5) scale = 0.0625; if (!widget.enabled) return; addPercentage(delta.dx * scale, width, handleIndex); emitCounter++; bool skip = emitCounter % widget.skipEmitting != 0; widget.onChanged?.call(_lerp(factor), skip); } void dragEnd(DragEndDetails details) { if (!widget.enabled) return; scale = 1; //call the last factor value here widget.onChanged?.call(_lerp(factor), false); widget.onDragEnd?.call(_lerp(factor)); SemanticsService.announce( widget.labelFormatter(_lerp(factor)), TextDirection.ltr); } void manualValueEnter() { /* String dialogValue = _lerp(factor).toStringAsFixed(2); AlertDialogs.showInputDialog(context, title: "Enter Value", description: "Enter new value for ${widget.label}", cancelButton: "Cancel", confirmButton: "Set", selectAll: true, keyboardType: TextInputType.number, value: dialogValue, validation: (value) { double? val = double.tryParse(value); if (val == null) return false; double min = 0, max = 0; //Check for range min = widget.min; max = widget.max; if (val < min || val > max) return false; return true; }, validationErrorMessage: "Value not valid", confirmColor: Theme.of(context).hintColor, onConfirm: (value) { var val = double.parse(value); widget.onDragStart?.call(widget.values); widget.onChanged?.call(val, false); widget.onDragEnd?.call(val); }); */ } @override Widget build(BuildContext context) { return ConstrainedBox( constraints: BoxConstraints(maxHeight: widget.maxHeight ?? 50), child: Semantics( slider: true, label: widget.label, value: widget.labelFormatter(_lerp(factor)), enabled: widget.enabled, excludeSemantics: true, child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { width = constraints.maxWidth - 1; height = constraints.maxHeight; factor = _unlerp(widget.values); pos = factor * width; SliderRangeValues positionValues = _lerp2(factor, 0, width); SliderRangeValues positionHandles = _lerp2(factor, 10, width - 10); return GestureDetector( dragStartBehavior: DragStartBehavior.start, onDoubleTap: manualValueEnter, onVerticalDragStart: widget.handleVerticalDrag ? dragStart : null, onVerticalDragUpdate: widget.handleVerticalDrag ? dragUpdate : null, onVerticalDragEnd: widget.handleVerticalDrag ? dragEnd : null, onHorizontalDragStart: dragStart, onHorizontalDragUpdate: dragUpdate, onHorizontalDragEnd: dragEnd, child: Container( color: Colors.transparent, height: height, child: Stack( alignment: Alignment.centerLeft, children: [ Positioned( left: positionValues.start, right: width - positionValues.end, child: Container( height: height * 0.75, color: widget.enabled ? TinyColor.fromColor(widget.activeColor) .darken(15) .color : Colors.grey[800], //width: max(factor * width, 0), ), ), Positioned( left: positionHandles.start - 10, width: 20, height: height * 0.9, child: Container( color: widget.enabled ? widget.activeColor : Colors.grey[700], width: 20)), Positioned( left: positionHandles.end - 10, width: 20, height: height * 0.9, child: Container( color: widget.enabled ? widget.activeColor : Colors.grey[700], width: 20)), Padding( padding: const EdgeInsets.symmetric(horizontal: 6.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( widget.label, style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ), Text( widget.labelFormatter(_lerp(factor)), style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ) ]), ), Center(child: Text(scale < 1 ? "x$scale" : "")) ], ), ), ); }), ), ); } } ================================================ FILE: lib/UI/widgets/thickSlider.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:math'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import 'package:tinycolor2/tinycolor2.dart'; class ThickSlider extends StatefulWidget { final Color activeColor; final String label; final double min, max; final double value; final ValueChanged? onDragStart; final Function(double value, bool skip)? onChanged; final ValueChanged? onDragEnd; final String Function(double) labelFormatter; final int skipEmitting; final bool enabled; final bool handleVerticalDrag; final Parameter? parameter; final double? maxHeight; final bool snapToCenter; const ThickSlider( {Key? key, required this.activeColor, required this.label, this.min = 0, this.max = 1, required this.value, this.snapToCenter = false, this.onDragStart, this.onChanged, this.onDragEnd, this.handleVerticalDrag = true, required this.labelFormatter, this.skipEmitting = 3, this.enabled = true, this.parameter, this.maxHeight}) : super(key: key); @override State createState() => _ThickSliderState(); } class _ThickSliderState extends State { double factor = 0.5; //normalized position in 0-1 double pos = 0; int lastTapDown = 0; int emitCounter = 0; double scale = 1; Offset startDragPos = const Offset(0, 0); double width = 0; double height = 0; bool ownUpdate = false; // Returns a number between min and max, proportional to value, which must // be between 0.0 and 1.0. double _lerp(double value) { assert(value >= 0.0); assert(value <= 1.0); return value * (widget.max - widget.min) + widget.min; } //same as above, only with custom min and max double _lerp2(double value, double min, double max) { assert(value >= 0.0); assert(value <= 1.0); return value * (max - min) + min; } // Returns a number between 0.0 and 1.0, given a value between min and max. double _unlerp(double value) { assert(value <= widget.max); assert(value >= widget.min); return widget.max > widget.min ? (value - widget.min) / (widget.max - widget.min) : 0.0; } //lerp with an optional snap to center double _lerpSnap(double value) { if (widget.snapToCenter) { if (value >= 0.475 && value <= 0.525) return _lerp(0.5); } return _lerp(value); } //lerp with an optional snap to center with min & max double _lerpSnap2(double value, double min, double max) { if (widget.snapToCenter) { if (value >= 0.475 && value <= 0.525) return _lerp2(0.5, min, max); } return _lerp2(value, min, max); } @override void initState() { super.initState(); //range check assert(widget.min < widget.max); assert(widget.value >= widget.min && widget.value <= widget.max); assert(widget.skipEmitting > 0); //normalize value to 0-1 factor = _unlerp(widget.value); } void addPercentage(value, width) { pos += value; pos = max(min(pos, width), 0); factor = pos / width; } void dragStart(DragStartDetails details) { startDragPos = details.localPosition; widget.onDragStart?.call(widget.value); } void dragUpdate(DragUpdateDetails details) { Offset delta = details.localPosition - startDragPos; startDragPos = details.localPosition; scale = 1; var posAbs = (details.localPosition.dy - height / 2.0).abs(); if (posAbs > height * 2) scale = 0.5; if (posAbs > height * 3) scale = 0.25; if (posAbs > height * 4.5) scale = 0.125; if (posAbs > height * 6) scale = 0.0625; if (!widget.enabled) return; addPercentage(delta.dx * scale, width); emitCounter++; bool skip = emitCounter % widget.skipEmitting != 0; widget.onChanged?.call(_lerpSnap(factor), skip); ownUpdate = true; } void dragEnd(DragEndDetails details) { if (!widget.enabled) return; scale = 1; //call the last factor value here widget.onChanged?.call(_lerpSnap(factor), false); widget.onDragEnd?.call(_lerpSnap(factor)); ownUpdate = true; SemanticsService.announce( widget.labelFormatter(_lerpSnap(factor)), TextDirection.ltr); } void manualValueEnter() { String dialogValue = widget.value.toStringAsFixed(2); if (widget.parameter != null) { dialogValue = widget.parameter!.toHumanInput().toStringAsFixed(2); } AlertDialogs.showInputDialog(context, title: "Enter Value", description: "Enter new value for ${widget.label}", cancelButton: "Cancel", confirmButton: "Set", selectAll: true, keyboardType: TextInputType.number, value: dialogValue, validation: (value) { double? val = double.tryParse(value); if (val == null) return false; double min = 0, max = 0; //Check for range if (widget.parameter == null) { min = widget.min; max = widget.max; } else { min = widget.parameter!.formatter.toHumanInput(widget.min); max = widget.parameter!.formatter.toHumanInput(widget.max); if (min > max) { var tmp = max; max = min; min = tmp; } } if (val < min || val > max) return false; return true; }, validationErrorMessage: "Value not valid", confirmColor: Theme.of(context).hintColor, onConfirm: (value) { var val = double.parse(value); if (widget.parameter != null) { //unscale value back val = widget.parameter!.fromHumanInput(val); } factor = _unlerp(val); widget.onDragStart?.call(widget.value); widget.onChanged?.call(val, false); widget.onDragEnd?.call(val); ownUpdate = true; }); } @override Widget build(BuildContext context) { return ConstrainedBox( constraints: BoxConstraints(maxHeight: widget.maxHeight ?? 50), child: Semantics( slider: true, label: widget.label, value: widget.labelFormatter(_lerpSnap(factor)), enabled: widget.enabled, excludeSemantics: true, child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { width = constraints.maxWidth - 1; height = constraints.maxHeight; if (!ownUpdate) { factor = _unlerp(widget.value); } ownUpdate = false; pos = factor * width; return GestureDetector( dragStartBehavior: DragStartBehavior.start, onDoubleTap: manualValueEnter, onVerticalDragStart: widget.handleVerticalDrag ? dragStart : null, onVerticalDragUpdate: widget.handleVerticalDrag ? dragUpdate : null, onVerticalDragEnd: widget.handleVerticalDrag ? dragEnd : null, onHorizontalDragStart: dragStart, onHorizontalDragUpdate: dragUpdate, onHorizontalDragEnd: dragEnd, child: Container( color: Colors.transparent, height: height, child: Stack( alignment: Alignment.centerLeft, children: [ Container( height: height * 0.75, color: widget.enabled ? TinyColor.fromColor(widget.activeColor) .darken(15) .color : Colors.grey[800], width: max(factor * width, 0), ), Positioned( left: _lerpSnap2(factor, 10, width - 10) - 10, width: 20, height: height * 0.9, child: Container( color: widget.enabled ? widget.activeColor : Colors.grey[700], width: 20)), Padding( padding: const EdgeInsets.symmetric(horizontal: 6.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( widget.label, style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ), Text( widget.labelFormatter(_lerpSnap(factor)), style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ) ]), ), Center(child: Text(scale < 1 ? "x$scale" : "")) ], ), ), ); }), ), ); } } ================================================ FILE: lib/UI/widgets/verticalThickSlider.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:math'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import 'package:tinycolor2/tinycolor2.dart'; class VerticalThickSlider extends StatefulWidget { final Color activeColor; final String label; final double min, max; final double value; final double width; final ValueChanged? onDragStart; final Function(double value, bool skip)? onChanged; final ValueChanged? onDragEnd; final String Function(double) labelFormatter; final int skipEmitting; final bool enabled; final bool handleHorizontalDrag; final Parameter? parameter; const VerticalThickSlider( {Key? key, required this.activeColor, required this.label, this.min = 0, this.max = 1, this.width = 50, required this.value, this.onDragStart, this.onChanged, this.onDragEnd, this.handleHorizontalDrag = true, required this.labelFormatter, this.skipEmitting = 3, this.enabled = true, this.parameter}) : super(key: key); @override State createState() => _VerticalThickSliderState(); } class _VerticalThickSliderState extends State { double factor = 0.5; //normalized position in 0-1 double pos = 0; int lastTapDown = 0; int emitCounter = 0; double scale = 1; Offset startDragPos = const Offset(0, 0); double width = 0; double height = 0; // Returns a number between min and max, proportional to value, which must // be between 0.0 and 1.0. double _lerp(double value) { assert(value >= 0.0); assert(value <= 1.0); return value * (widget.max - widget.min) + widget.min; } //same as above, only with custom min and max double _lerp2(double value, double _min, double _max) { assert(value >= 0.0); assert(value <= 1.0); return value * (_max - _min) + _min; } // Returns a number between 0.0 and 1.0, given a value between min and max. double _unlerp(double value) { assert(value <= widget.max); assert(value >= widget.min); return widget.max > widget.min ? (value - widget.min) / (widget.max - widget.min) : 0.0; } @override void initState() { super.initState(); //range check assert(widget.min < widget.max); assert(widget.value >= widget.min && widget.value <= widget.max); assert(widget.skipEmitting >= 0); //normalize value to 0-1 factor = _unlerp(widget.value); } void addPercentage(value, height) { pos += value; pos = max(min(pos, height), 0); factor = pos / height; } void dragStart(DragStartDetails details) { startDragPos = details.localPosition; widget.onDragStart?.call(widget.value); } void dragUpdate(DragUpdateDetails details) { Offset delta = details.localPosition - startDragPos; startDragPos = details.localPosition; scale = 1; var posAbs = (details.localPosition.dx - width / 2.0).abs(); if (posAbs > width) scale = 0.5; if (posAbs > width * 2.5) scale = 0.25; if (posAbs > width * 4) scale = 0.125; if (posAbs > width * 5.5) scale = 0.0625; if (!widget.enabled) return; addPercentage(-delta.dy * scale, height); emitCounter++; bool skip = widget.skipEmitting == 0 || emitCounter % widget.skipEmitting != 0; widget.onChanged?.call(_lerp(factor), skip); } void dragEnd(DragEndDetails details) { if (!widget.enabled) return; scale = 1; //call the last factor value here widget.onChanged?.call(_lerp(factor), false); widget.onDragEnd?.call(_lerp(factor)); } void manualValueEnter() { String dialogValue = _lerp(factor).toStringAsFixed(2); if (widget.parameter != null) { dialogValue = widget.parameter!.toHumanInput().toStringAsFixed(2); } AlertDialogs.showInputDialog(context, title: "Enter Value", description: "Enter new value for ${widget.label}", cancelButton: "Cancel", confirmButton: "Set", selectAll: true, keyboardType: TextInputType.number, value: dialogValue, validation: (value) { double? val = double.tryParse(value); if (val == null) return false; double min = 0, max = 0; //Check for range if (widget.parameter == null) { min = widget.min; max = widget.max; } else { min = widget.parameter!.formatter.toHumanInput(widget.min); max = widget.parameter!.formatter.toHumanInput(widget.max); } if (val < min || val > max) return false; return true; }, validationErrorMessage: "Value not valid", confirmColor: Colors.blue, onConfirm: (value) { var val = double.parse(value); if (widget.parameter != null) { //unscale value back val = widget.parameter!.fromHumanInput(val); } widget.onDragStart?.call(widget.value); widget.onChanged?.call(val, false); widget.onDragEnd?.call(val); }); } @override Widget build(BuildContext context) { return ConstrainedBox( constraints: BoxConstraints(maxWidth: widget.width), child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { width = constraints.maxWidth - 1; height = constraints.maxHeight; factor = _unlerp(widget.value); pos = factor * height; return GestureDetector( dragStartBehavior: DragStartBehavior.start, onDoubleTap: manualValueEnter, onTapDown: (details) { if (!widget.enabled) return; }, onHorizontalDragStart: widget.handleHorizontalDrag ? dragStart : null, onHorizontalDragUpdate: widget.handleHorizontalDrag ? dragUpdate : null, onHorizontalDragEnd: widget.handleHorizontalDrag ? dragEnd : null, onVerticalDragStart: dragStart, onVerticalDragUpdate: dragUpdate, onVerticalDragEnd: dragEnd, child: Container( color: Colors.transparent, height: height, child: Stack( alignment: Alignment.bottomCenter, children: [ Container( height: max(factor * height, 0), color: widget.enabled ? TinyColor.fromColor(widget.activeColor).darken(15).color : Colors.grey[800], width: width * 0.5, ), Positioned( bottom: _lerp2(factor, 10, height - 10) - 10, height: 20, width: width * 0.9, child: Container( color: widget.enabled ? widget.activeColor : Colors.grey[700], height: 20)), Padding( padding: const EdgeInsets.symmetric(vertical: 6.0), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( widget.labelFormatter(_lerp(factor)), style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ), Text( widget.label, style: TextStyle( color: widget.enabled ? Colors.white : Colors.grey[600], fontSize: 20), ) ]), ), Center(child: Text(scale < 1 ? "x$scale" : "")) ], ), ), ); }), ); } } ================================================ FILE: lib/audio/audioEditor.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:io'; import 'dart:math'; import 'package:audio_waveform/audio_waveform.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:just_audio/just_audio.dart'; import 'package:mighty_plug_manager/UI/theme.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/audio/automationController.dart'; import 'package:mighty_plug_manager/audio/online_sources/sourceResolver.dart'; import 'package:mighty_plug_manager/audio/widgets/presetsPanel.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import 'package:page_view_indicators/circle_page_indicator.dart'; import 'models/jamTrack.dart'; import 'models/trackAutomation.dart'; import 'models/waveform_data.dart'; import 'widgets/eventEditor.dart'; import 'widgets/loopPanel.dart'; import 'widgets/painted_waveform.dart'; import 'widgets/speedPanel.dart'; enum EditorState { play, insert, duplicateInsert, insertLoop1, insertLoop2 } class AudioEditor extends StatefulWidget { final JamTrack track; const AudioEditor(this.track, {Key? key}) : super(key: key); @override State createState() => _AudioEditorState(); } class _AudioEditorState extends State { WaveformData? wfData; AudioWaveformDecoder decoder = AudioWaveformDecoder(); late AutomationController automation; final controller = PageController( initialPage: 0, ); final _currentPageNotifier = ValueNotifier(0); NuxDevice device = NuxDeviceControl.instance().device; int currentSample = 0; bool pageLeft = false; int latency = SharedPrefs().getInt(SettingsKeys.latency, 0); //screen stuff double _samplesPerPixel = 0, _msPerSample = 0; //stuff for inserting EditorState state = EditorState.play; dynamic selectedPreset; AutomationEvent? duplicatedEvent; AutomationEventType showType = AutomationEventType.preset; String _resolvedPath = ""; @override void initState() { super.initState(); automation = AutomationController(widget.track, widget.track.automation); WidgetsFlutterBinding.ensureInitialized(); if (AppThemeConfig.allowRotation) { SystemChrome.setPreferredOrientations( [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); } device = NuxDeviceControl.instance().device; decodeAudio(widget.track.path); automation.setAudioFile(widget.track.path, 4); automation.positionStream.listen(playPositionUpdate); automation.playerStateStream.listen(playerStateUpdate); //automation.eventStream.listen(eventUpdate); controller.addListener(() { if (controller.page == null) return; double p = controller.page!; if (p == p.round()) { debugPrint(p.round().toString()); switch (p.round()) { case 0: showType = AutomationEventType.preset; break; case 1: showType = AutomationEventType.loop; break; case 2: break; } setState(() {}); } }); } Future decodeAudio(String path) async { print("Audio path $path"); _resolvedPath = await SourceResolver.getSourceUrl(path); print("Resolved path $_resolvedPath"); bool legacy = Platform.isAndroid && SharedPrefs().getInt(SettingsKeys.legacyDecoder, 0) != 0; await decoder.open(_resolvedPath, legacy); decoder.decode(() { wfData = WaveformData(maxValue: 1, data: decoder.samples); }, () { if (pageLeft) { freeDecoder(); return false; } wfData!.setUpdate(); setState(() {}); return true; }, () { //final update wfData!.setReady(); setState(() {}); freeDecoder(); }); } void freeDecoder() { SourceResolver.releaseUrl(widget.track.path, _resolvedPath); } int sampleToMs(int sample) { var percentage = sample / wfData!.data.length; return (percentage * decoder.duration * 1000).round(); } void playFrom(int sample) { automation.seek(Duration(milliseconds: sampleToMs(sample))); if (automation.playing == false) automation.play(); } void playPositionUpdate(Duration position) { setState(() { var posMs = max(position.inMilliseconds - latency, 0); currentSample = (decoder.samples.length * (posMs / automation.duration.inMilliseconds)) .floor(); }); } void playerStateUpdate(PlayerState state) { //just refresh state so the play button is correct setState(() {}); } void timingData(double samplesPerPixel, double msPerSample) { _samplesPerPixel = samplesPerPixel; _msPerSample = msPerSample; } void stepLeft() { var event = automation.selectedEvent; if (event == null) return; var subtract = Duration(milliseconds: (_samplesPerPixel / _msPerSample).ceil()); if (event.eventTime > subtract) { event.eventTime -= subtract; } else { event.eventTime = const Duration(milliseconds: 0); } automation.sortEvents(); setState(() {}); } void stepRight() { var event = automation.selectedEvent; if (event == null) return; var subtract = Duration(milliseconds: (_samplesPerPixel / _msPerSample).ceil()); var songLength = automation.duration; if (event.eventTime < songLength - subtract) { event.eventTime += subtract; } else { event.eventTime = songLength; } automation.sortEvents(); setState(() {}); } void editEvent(AutomationEvent event, bool noneOption) { var editor = EventEditor(event: event, noneOption: noneOption); editor.buildDialog(context).then((value) { setState(() {}); }); } void duplicateEvent(AutomationEvent event) { state = EditorState.duplicateInsert; duplicatedEvent = event; setState(() {}); } void useLoopPoints(bool enable) { automation.useLoopPoints = enable; if (!automation.hasLoopPoints()) state = EditorState.insertLoop1; setState(() {}); } AutomationEventType? showEventType() { if (showType == AutomationEventType.loop && (!automation.loopEnable || !automation.useLoopPoints)) return null; return showType; } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () async { pageLeft = true; await automation.dispose(); //revert back to orientation change if (AppThemeConfig.allowRotation) { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight ]); } return true; }, child: Scaffold( appBar: AppBar( title: const Text("Song editor"), ), body: Column(children: [ Expanded( flex: 3, child: Stack( alignment: Alignment.center, children: [ PaintedWaveform( sampleData: wfData, currentSample: currentSample, automation: automation, onTimingData: timingData, showType: showEventType(), channelColors: device.presets[0].channelColorsList, onEventSelectionChanged: () { setState(() {}); }, onWaveformTap: (sample) { switch (state) { case EditorState.play: playFrom(sample); break; case EditorState.insert: setState(() { state = EditorState.play; automation .addEvent( Duration(milliseconds: sampleToMs(sample)), AutomationEventType.preset) .setPresetUuid(selectedPreset["uuid"]); }); break; case EditorState.duplicateInsert: if (duplicatedEvent == null) break; setState(() { state = EditorState.play; automation.addEventFromOther(duplicatedEvent!, Duration(milliseconds: sampleToMs(sample))); }); break; case EditorState.insertLoop1: setState(() { state = EditorState.insertLoop2; automation.addEvent( Duration(milliseconds: sampleToMs(sample)), AutomationEventType.loop); }); break; case EditorState.insertLoop2: setState(() { state = EditorState.play; automation.useLoopPoints = true; automation.addEvent( Duration(milliseconds: sampleToMs(sample)), AutomationEventType.loop); }); break; } }, ), if (state != EditorState.play) ColoredBox( color: Colors.grey[700]!, child: const Padding( padding: EdgeInsets.all(8.0), child: Text( "Tap here to insert event", ), )) ], )), //Playback controls Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ MaterialButton( onPressed: () { automation.rewind(); setState(() { currentSample = 0; }); }, height: 70, child: const Icon( Icons.skip_previous, color: Colors.white, size: 50, ), ), MaterialButton( onPressed: () { automation.playPause(); }, height: 70, child: Icon( automation.playerState.playing == false || automation.playerState.processingState == ProcessingState.completed ? Icons.play_arrow : Icons.pause, color: Colors.white, size: 50, ), ), MaterialButton( onPressed: stepLeft, //move event left height: 70, child: const Icon( Icons.chevron_left, color: Colors.white, size: 60, ), ), MaterialButton( onPressed: stepRight, //move event left height: 70, child: const Icon( Icons.chevron_right, color: Colors.white, size: 60, ), ), ], ), Expanded( flex: 2, child: IndexedStack( index: state == EditorState.play ? 0 : 1, alignment: Alignment.center, children: [ PageView( controller: controller, onPageChanged: (int index) { _currentPageNotifier.value = index; //clear selected event automation.selectedEvent = null; }, children: [ PresetsPanel( automation: automation, onDelete: () { if (automation.selectedEvent != null) { automation.removeEvent(automation.selectedEvent!); } setState(() {}); }, onEditEvent: editEvent, onDuplicateEvent: duplicateEvent, onSelectedPreset: (preset) { setState(() { selectedPreset = preset; state = EditorState.insert; }); }), LoopPanel( automation: automation, onUseLoopPoints: useLoopPoints, onLoopEnable: (value) { setState(() { automation.loopEnable = value ?? false; }); }, onLoopTimes: (value) { setState(() { automation.loopTimes = value; }); }, ), SpeedPanel( semitones: automation.pitch, speed: automation.speed, onSpeedChanged: (speed) { setState(() { automation.speed = speed; automation.setSpeed(speed); }); }, onSemitonesChanged: (semitones) { setState(() { automation.pitch = semitones; automation.setPitch(semitones); }); }, ), ], ), ElevatedButton( child: const Text("Cancel"), onPressed: () { if (state == EditorState.insertLoop1 || state == EditorState.insertLoop2) { automation.removeAllLoopEvents(); } state = EditorState.play; setState(() {}); }, ) ], )), Container( height: 30, alignment: Alignment.center, child: state != EditorState.play ? null : CirclePageIndicator( itemCount: 3, currentPageNotifier: _currentPageNotifier, ), ) ]), ), ); } } ================================================ FILE: lib/audio/automationController.dart ================================================ import 'dart:async'; import 'dart:io'; import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:just_audio/just_audio.dart'; import 'package:mighty_plug_manager/audio/models/trackAutomation.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import 'models/jamTrack.dart'; import 'online_sources/sourceResolver.dart'; import '../platform/platformUtils.dart'; enum ABRepeatState { off, addedA, addedB } class AutomationController { final TrackAutomation automation; final JamTrack track; late AudioPlayer player; late AudioPipeline _pipeline; final _enhancer = AndroidLoudnessEnhancer(); final StreamController _positionController = StreamController(); //StreamController _eventController = // StreamController(); List get events => automation.events; AutomationEvent get initialEvent => automation.initialEvent; bool get presetChangeEventsAvailable { if (_presetChangeBypass) return false; for (var event in events) { if (event.type == AutomationEventType.preset) return true; } return false; } //optimisation for searching for the next event int _nextEvent = 0; int _positionReport = 0; int _positionResolution = 1; int _currentLoop = 0; bool _forceLoopDisable = false; bool _presetChangeBypass = false; ABRepeatState _abRepeatState = ABRepeatState.off; ABRepeatState get abRepeatState => _abRepeatState; AutomationController(this.track, this.automation) { if (Platform.isAndroid) { _pipeline = AudioPipeline(androidAudioEffects: [_enhancer]); player = AudioPlayer(audioPipeline: _pipeline); _pipeline.androidAudioEffects.add(_enhancer); _enhancer.setEnabled(true); } else { player = AudioPlayer(); } } void setGain(double gain) { _enhancer.setTargetGain(gain / 10); } Stream get positionStream => _positionController.stream; Duration get duration => player.duration ?? const Duration(); PlayerState get playerState => player.playerState; Stream get playerStateStream => player.playerStateStream; bool get playing => player.playing; Function? onTrackComplete; int _latency = 0; final int _speed = 1; StreamSubscription? _positionSubscription; //loop variables bool get loopEnable => _forceLoopDisable ? false : track.loopEnable; set loopEnable(val) { track.loopEnable = val; _currentLoop = 0; } bool get useLoopPoints => track.useLoopPoints || abRepeatState == ABRepeatState.addedB; set useLoopPoints(val) { track.useLoopPoints = val; _currentLoop = 0; } int get loopTimes => track.loopTimes; set loopTimes(val) { track.loopTimes = val; if (_currentLoop > track.loopTimes) _currentLoop = track.loopTimes; } int get currentLoop => _currentLoop; double get speed => track.speed; set speed(val) => track.speed = val; int get pitch => track.pitch; set pitch(val) => track.pitch = val; //editor use only. don't serialize AutomationEvent? selectedEvent; String _sourceUrl = "", _resolvedUrl = ""; Future setAudioFile(String path, int positionEventSkips) async { _sourceUrl = path; _resolvedUrl = await SourceResolver.getSourceUrl(_sourceUrl); var source = ProgressiveAudioSource(Uri.parse(_resolvedUrl)); await player.setAudioSource(source); if (NuxDeviceControl.instance().isConnected) { _latency = SharedPrefs().getInt(SettingsKeys.latency, 0); } else { _latency = 0; } setSpeed(speed); setPitch(pitch); //force 10ms precision. It's needed for accurate event switch _positionSubscription = player .createPositionStream( steps: 1, minPeriod: const Duration(milliseconds: 5), maxPeriod: const Duration(milliseconds: 5)) .listen(playPositionUpdate); _positionResolution = max(1, positionEventSkips); } void setTrackCompleteEvent(Function onComplete) { onTrackComplete = onComplete; } //stream listener for track position updates void playPositionUpdate(Duration position) { //switch presets here when needed if (_positionReport % _positionResolution == 0) { _positionController.add(position); } _positionReport++; if (position == player.duration) { //check for looping bool looped = false; if (loopEnable && !useLoopPoints) { if (loopTimes == 0 || _currentLoop < loopTimes) { //seek to beginning seek(const Duration(seconds: 0)); looped = true; if (loopTimes > 0) _currentLoop++; } } //call and lose ref to prevent double calling if (!looped) { onTrackComplete?.call(); onTrackComplete = null; } } if (_nextEvent < automation.events.length) { switch (automation.events[_nextEvent].type) { case AutomationEventType.preset: if (automation.events[_nextEvent].eventTime.inMilliseconds <= position.inMilliseconds - _latency * (1 / _speed)) { //set event executeEvent(automation.events[_nextEvent]); //increment expected event _nextEvent++; if (kDebugMode) print("next event $_nextEvent"); } break; case AutomationEventType.loop: //loops should not be compensated for latency if (automation.events[_nextEvent].eventTime.inMilliseconds <= position.inMilliseconds) { //set event if (loopEnable && useLoopPoints) { executeEvent(automation.events[_nextEvent]); } //increment expected event _nextEvent++; if (kDebugMode) print("next event $_nextEvent"); } break; } } } void executeEvent(AutomationEvent event) { var device = NuxDeviceControl.instance().device; switch (event.type) { case AutomationEventType.preset: if (_presetChangeBypass) break; debugPrint("Changing preset ${event.name}"); var preset = event.getPreset(); if (preset != null && preset["product_id"] == device.presetClass) { device.presetFromJson( preset, event.cabinetLevelOverrideEnable ? event.cabinetLevelOverride : null, dontChangeChannel: true); } break; case AutomationEventType.loop: if (kDebugMode) print("loop"); //find previous loop point for (int i = _nextEvent - 1; i >= 0; i--) { if (events[i].type == AutomationEventType.loop) { if (loopTimes == 0 || loopTimes > 0 && _currentLoop < loopTimes) { seek(events[i].eventTime); _nextEvent = i; _currentLoop++; } break; } } break; } //_eventController.add(event); } Future play() async { if (playerState.processingState == ProcessingState.completed) { await player.seek(const Duration(seconds: 0)); } player.play(); seek(player.position); } Future playPause() async { if (playerState.playing == false || playerState.processingState == ProcessingState.completed) { await play(); } else { await player.pause(); } } Future stop() async { if (playerState.playing) { await player.stop(); } } void setSpeed(double speed) { player.setSpeed(speed); } void setPitch(int pitch) { if (PlatformUtils.isIOS) return; double lPitch = pow(2, pitch / 12).toDouble(); player.setPitch(lPitch); } void rewind() { _currentLoop = 0; seek(const Duration(seconds: 0)); } void forceLoopDisable() { _forceLoopDisable = true; } void seek(Duration position) { player.seek(position); _updateActiveEvent(); //check if seek before the first loop and if so - reset the loop counter if (useLoopPoints && loopTimes > 0) { for (int i = 0; i < events.length; i++) { if (events[i].type == AutomationEventType.loop) { if (position < events[i].eventTime) _currentLoop = 0; break; } } } } void sortEvents() { automation.sortEvents(); _updateActiveEvent(); } void _updateActiveEvent() { if (!player.playing) return; var position = player.position; _nextEvent = automation.events.length; //recalculate next event for (int i = 0; i < automation.events.length; i++) { if (position.inMilliseconds - _latency * (1 / _speed) < automation.events[i].eventTime.inMilliseconds) { //this is the first event prior the seek time _nextEvent = i; break; } } if (kDebugMode) print("next event $_nextEvent"); //find previous preset event int prevEvent = -1; for (int i = _nextEvent - 1; i >= 0; i--) { if (automation.events[i].type == AutomationEventType.preset) { prevEvent = i; break; } } //execute the previous if (prevEvent >= 0) { //find last executeEvent(automation.events[prevEvent]); } else { executeEvent(automation.initialEvent); } } AutomationEvent addEvent(Duration atPosition, AutomationEventType type) { //finally make sure the events are sorted var event = AutomationEvent( eventTime: atPosition, type: type, ); automation.events.add(event); selectedEvent = event; sortEvents(); return event; } void addEventFromOther(AutomationEvent other, Duration atPosition) { AutomationEvent ev = AutomationEvent(eventTime: atPosition, type: other.type); ev.setPresetUuid(other.getPresetUuid()); ev.cabinetLevelOverride = other.cabinetLevelOverride; ev.cabinetLevelOverrideEnable = other.cabinetLevelOverrideEnable; automation.events.add(ev); selectedEvent = ev; sortEvents(); } void removeEvent(AutomationEvent event) { if (!automation.events.contains(event)) return; //make sure no reference remains if (selectedEvent == event) selectedEvent = null; automation.events.remove(event); sortEvents(); } void bypassPresetChanges() { _presetChangeBypass = true; } //TODO: make sure there are always 2 loop events void removeAllLoopEvents() { for (int i = events.length - 1; i >= 0; i--) { if (events[i].type == AutomationEventType.loop) events.removeAt(i); } } bool hasLoopPoints() { int loops = 0; for (int i = 0; i < events.length; i++) { if (events[i].type == AutomationEventType.loop) loops++; } //check for errors if (loops > 0 && loops != 2) removeAllLoopEvents(); return loops == 2; } List getLoopPoints() { List loopPoints = []; for (int i = 0; i < events.length; i++) { if (events[i].type == AutomationEventType.loop) loopPoints.add(events[i]); } return loopPoints; } void toggleABRepeat() { switch (abRepeatState) { case ABRepeatState.off: loopEnable = false; removeAllLoopEvents(); addEvent(player.position, AutomationEventType.loop); _abRepeatState = ABRepeatState.addedA; break; case ABRepeatState.addedA: loopTimes = 0; addEvent(player.position, AutomationEventType.loop); var lp = getLoopPoints(); seek(lp[0].eventTime); _abRepeatState = ABRepeatState.addedB; loopEnable = true; break; case ABRepeatState.addedB: loopEnable = false; _abRepeatState = ABRepeatState.off; break; } } Future dispose() async { _positionSubscription?.cancel(); await player.stop(); await player.dispose(); _positionController.close(); SourceResolver.releaseUrl(_sourceUrl, _resolvedUrl); //_eventController.close(); } } ================================================ FILE: lib/audio/models/jamTrack.dart ================================================ import 'package:mighty_plug_manager/audio/models/trackAutomation.dart'; class JamTrack { final TrackAutomation _automation = TrackAutomation(); String _path = ""; String _name = ""; String _uuid = ""; bool _loopEnable = false; bool _useLoopPoints = false; int _loopTimes = 0; double _speed = 1; int _pitch = 0; TrackAutomation get automation => _automation; JamTrack( {required path, required name, required uuid, bool loopEnable = false, bool useLoopPoints = false, int loopTimes = 0, double speed = 1, int pitch = 0, List? automationData}) { _path = path; _name = name; _uuid = uuid; _loopEnable = loopEnable; _useLoopPoints = useLoopPoints; _loopTimes = loopTimes; _speed = speed; _pitch = pitch; if (automationData != null) _automation.fromJson(automationData); } String get name => _name; String get path => _path; set path(val) => _path = val; String get uuid => _uuid; set name(value) => _name = value; bool get loopEnable => _loopEnable; set loopEnable(val) => _loopEnable = val; bool get useLoopPoints => _useLoopPoints; set useLoopPoints(val) => _useLoopPoints = val; int get loopTimes => _loopTimes; set loopTimes(val) => _loopTimes = val; double get speed => _speed; set speed(val) => _speed = val; int get pitch => _pitch; set pitch(val) => _pitch = val; factory JamTrack.fromJson(dynamic json) { return JamTrack( name: json['name'] as String, path: json['path'] as String, uuid: json['uuid'] as String, loopEnable: json['loop_enable'] ?? false, useLoopPoints: json['loop_use_points'] ?? false, loopTimes: json['loop_times'] ?? 0, speed: json['speed'] ?? 1, pitch: json['pitch'] ?? 0, automationData: json["events"]); } Map toJson() { var data = {}; data["path"] = _path; data["name"] = _name; data["uuid"] = _uuid; data["events"] = automation.toJson(); data['loop_enable'] = _loopEnable; data['loop_use_points'] = _useLoopPoints; data['loop_times'] = _loopTimes; data['speed'] = _speed; data['pitch'] = _pitch; return data; } } ================================================ FILE: lib/audio/models/setlist.dart ================================================ import 'package:flutter/foundation.dart'; import 'package:mighty_plug_manager/audio/models/jamTrack.dart'; import 'package:mighty_plug_manager/audio/trackdata/trackData.dart'; class SetlistItem { String trackUuid = ""; JamTrack? trackReference; SetlistItem({required this.trackUuid, required this.trackReference}); } class Setlist { String name = ""; List items = []; Setlist(this.name, List items) { for (int i = 0; i < items.length; i++) { addTrackByUuid(items[i]); } } void addTrackByUuid(String uuid) { JamTrack? track = TrackData().findByUuid(uuid); if (track != null) { items.add(SetlistItem(trackUuid: track.uuid, trackReference: track)); } else { debugPrint("Track with uuid $uuid not found!"); } } void addTrack(JamTrack track) { items.add(SetlistItem(trackUuid: track.uuid, trackReference: track)); } void clear() { items.clear(); } factory Setlist.fromJson(Map json) { return Setlist(json["name"] ?? "Untitled", json["tracks"]); } Map toJson() { var json = {}; var tracks = []; for (int i = 0; i < items.length; i++) { tracks.add(items[i].trackUuid); } json["name"] = name; json["tracks"] = tracks; return json; } } ================================================ FILE: lib/audio/models/trackAutomation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/platform/presetsStorage.dart'; enum AutomationEventType { preset, loop } class AutomationEvent { AutomationEventType type; Duration eventTime; bool cabinetLevelOverrideEnable = false; double cabinetLevelOverride = 0; String get name => _preset == null ? "" : _preset!.containsKey("name") ? _preset!["name"] : ""; int get channel => _preset == null ? 0 : _preset!.containsKey("channel") ? _preset!["channel"] : 0; //uuids for presets per each device String _presetUuid = ""; //values if type is presetChange Map? _preset = {}; AutomationEvent({required this.eventTime, required this.type}); void setPresetUuid(String presetUuid) { _presetUuid = presetUuid; if (presetUuid == "") return; var p = PresetsStorage().findPresetByUuid(presetUuid); if (p != null) { if (p.containsKey("cabinet")) { cabinetLevelOverride = p["cabinet"]["level"]; } _preset = p; } } String getPresetUuid() { return _presetUuid; } void clearPreset() { _preset = null; _presetUuid = ""; } dynamic getPreset() { return _preset; } Map toJson() { Map data = {}; data["type"] = type.index; data["time"] = eventTime.inMilliseconds; data["preset_id"] = _presetUuid; data["cab_override"] = cabinetLevelOverrideEnable; data["cab_level"] = cabinetLevelOverride; return data; } factory AutomationEvent.fromJson(dynamic json) { var type = AutomationEventType.values[json["type"] ?? 0]; Duration time = Duration(milliseconds: json["time"] ?? 0); AutomationEvent event = AutomationEvent(eventTime: time, type: type); event.setPresetUuid(json['preset_id'] ?? ""); event.cabinetLevelOverrideEnable = json["cab_override"] ?? false; event.cabinetLevelOverride = json["cab_level"] ?? 0; return event; } } class TrackAutomation { AutomationEvent _initialEvent = AutomationEvent( eventTime: const Duration(seconds: 0), type: AutomationEventType.preset); final _events = []; List get events => _events; AutomationEvent get initialEvent => _initialEvent; TrackAutomation(); fromJson(List jsonData) { if (jsonData.isNotEmpty) { _initialEvent = AutomationEvent.fromJson(jsonData[0]); } for (int i = 1; i < jsonData.length; i++) { events.add(AutomationEvent.fromJson(jsonData[i])); } } void sortEvents() { _events.sort((a, b) => a.eventTime.compareTo(b.eventTime)); } List toJson() { List> ev = []; ev.add(initialEvent.toJson()); for (int i = 0; i < events.length; i++) { ev.add(events[i].toJson()); } return ev; } } ================================================ FILE: lib/audio/models/waveform_data.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:flutter/painting.dart'; class WaveformData { int maxValue; List data; WaveformData({ required this.maxValue, required this.data, }); Path? _overallPath; Path? _cachedPath; int _oldFromFrame = -1, _oldToFrame = -1; bool _needsUpdate = false; bool _ready = false; bool _initialized = false; bool get needsUpdate => _needsUpdate; bool get ready => _ready; bool get initialized => _initialized; void setUpdate() { _needsUpdate = true; _initialized = true; } void setReady() { setUpdate(); _ready = true; } //calculate X coordinate of line within the chosen samples double verticalLine(Size size, int sample, int fromFrame, int toFrame) { if (sample < 0) sample = 0; if (sample > data.length - 1) sample = data.length - 1; double percentage = (sample - fromFrame) / (toFrame - fromFrame); return size.width * percentage; } Path? path(Size size, {int? toFrame, int fromFrame = 0}) { if (toFrame == _oldToFrame && fromFrame == _oldFromFrame && !_needsUpdate) { return _cachedPath; } _needsUpdate = false; if (fromFrame < 0) fromFrame = 0; toFrame ??= data.length - 1; if (toFrame < fromFrame + 50) toFrame = fromFrame + 50; if (toFrame > data.length - 1) toFrame = data.length - 1; if (toFrame == data.length - 1 && fromFrame == 0) { _oldFromFrame = fromFrame; _oldToFrame = toFrame; _cachedPath = _path(data, size); return _cachedPath; } // buffer so we can't start too far in the waveform, 90% max if (fromFrame > (data.length * 0.98).floor()) { debugPrint("from frame is too far at $fromFrame"); fromFrame = ((data.length) * 0.98).floor(); } _oldFromFrame = fromFrame; _oldToFrame = toFrame; _cachedPath = _path(data.sublist(fromFrame, toFrame), size); return _cachedPath; } Path _path(List samples, Size size) { const upsample = 2; List points = List.filled(size.width.ceil() * upsample + 1, 0); //points.fillRange(0, size.width.ceil() * upsample + 1, 0); final middle = size.height; //final int filter = (samples.length / size.width).floor(); var i = 0.0; final t = size.width * upsample / samples.length; final path = Path(); path.moveTo(0, middle); for (var p = 0, len = samples.length; p < len; p += 1) { var d = samples[p]; // / maxValue; var pos = (t * i).round(); points[pos] += d.toDouble(); i += 1; } var vmax = points.reduce(max); for (var _i = 0; _i < size.width * upsample; _i++) { path.lineTo(_i / upsample, middle - points[_i] / vmax * middle); } //maxPoints.forEach((o) => path.lineTo(o.dx, o.dy)); // back to zero path.lineTo(size.width, middle); // draw the minimums backwards so we can fill the shape when done. //minPoints.reversed // .forEach((o) => path.lineTo(o.dx, middle - (middle - o.dy))); //path.close(); return path; } Path? overallPath(Size size) { //TODO: have a separate flag as this can cause shared usage problems if (!_needsUpdate) return _overallPath; _overallPath = _path(data, size); return _overallPath; } } ================================================ FILE: lib/audio/online_sources/YoutubeSource.dart ================================================ import 'package:mighty_plug_manager/audio/online_sources/onlineSource.dart'; import 'package:mighty_plug_manager/audio/online_sources/onlineTrack.dart'; import 'package:mighty_plug_manager/audio/online_sources/sourceResolver.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart'; class YoutubeSource extends OnlineSource { @override bool get hasSuggestions => false; @override String get name => "Youtube"; @override Future> getSearchResults(String query) async { var yt = YoutubeExplode(); var results = await yt.search.search(query); var songs = []; for (var result in results) { songs.add(OnlineTrack( artist: result.author, title: result.title, hasUrl: false, id: result.id.value, detailsUrl: result.url, thumbnailUrl: result.thumbnails.standardResUrl)); } return songs; } @override Future> getSuggestions(String query) async { return []; } @override Future getTrackUri(OnlineTrack track) async { return "yt:${track.id}"; } @override Future getPreviewUrl(OnlineTrack track) async { var urlCache = SourceResolver.getFromCache(track.id); if (urlCache != null) return urlCache; return getYoutubeUrlFromId(track.id); } static Future getYoutubeUrlFromId(String id) async { var yt = YoutubeExplode(); var manifest = await yt.videos.streamsClient.getManifest(id); var stream = getHighestBitrateMP4(manifest); SourceResolver.addToCache(id, stream.url.toString()); return stream.url.toString(); } static AudioOnlyStreamInfo getHighestBitrateMP4(StreamManifest manifest) { AudioOnlyStreamInfo? stream; for (var s in manifest.audioOnly) { if (stream == null || (s.codec.mimeType == "audio/mp4" && s.size.totalBytes > stream.size.totalBytes)) { stream = s; } } return stream ?? manifest.audioOnly.withHighestBitrate(); } } ================================================ FILE: lib/audio/online_sources/backingTracksCoSource.dart ================================================ import 'package:mighty_plug_manager/audio/online_sources/onlineSource.dart'; import 'package:mighty_plug_manager/audio/online_sources/onlineTrack.dart'; import 'package:html/parser.dart' as html; import 'package:http/http.dart' as http; class BackingTracksCoSource extends OnlineSource { static const baseUrl = "https://www.backingtracks.co"; //static const suggestionsPath = "/static/storage/gbt/search/suggestions/"; static const searchPath = "/search.php?text="; @override bool get hasSuggestions => false; @override String get name => "Backing Tracks Co"; @override Future> getSearchResults(String query) async { //build search url var url = "$baseUrl$searchPath$query"; var result = await http.get(Uri.parse(url)); if (result.statusCode == 200) { var songs = []; var doc = html.parse(result.body); var results = doc.querySelectorAll("div.pl-in"); if (results.isNotEmpty) { for (var i = 0; i < results.length; i++) { var item = results[i]; var url = item.children[1].children[0].attributes['data-url'] ?? ""; songs.add(OnlineTrack( artist: item.children[2].children[0].text.trim(), title: item.children[2].children[1].text.trim(), hasUrl: true, url: url, detailsUrl: "$baseUrl$url")); } return songs; } } return []; } @override Future> getSuggestions(String query) async { return []; } @override Future getTrackUri(OnlineTrack track) async { return track.url; } @override Future getPreviewUrl(OnlineTrack track) async { return track.url; } } ================================================ FILE: lib/audio/online_sources/guitarBackingTracksSource.dart ================================================ import 'dart:convert'; import 'package:mighty_plug_manager/audio/online_sources/onlineSource.dart'; import 'package:mighty_plug_manager/audio/online_sources/onlineTrack.dart'; import 'package:html/parser.dart' as html; import 'package:http/http.dart' as http; class GuitarBackingTracksSource extends OnlineSource { static const baseUrl = "https://www.guitarbackingtrack.com"; static const suggestionsPath = "/static/storage/gbt/search/suggestions/"; static const searchPath = "/search.php?query="; @override bool get hasSuggestions => true; @override String get name => "Guitar Backing Tracks"; @override Future> getSearchResults(String query) async { //build search url var url = "$baseUrl$searchPath$query"; var result = await http.get(Uri.parse(url)); if (result.statusCode == 200) { var songs = []; var doc = html.parse(result.body); var results = doc.querySelectorAll(".gbt-b-section--table-row"); if (results.length > 1) { for (var i = 1; i < results.length; i++) { var item = results[i]; var url = item.children[1].children[0].attributes['href']; songs.add(OnlineTrack( artist: item.children[0].children[0].text.trim(), title: item.children[1].children[0].text.trim(), hasUrl: false, detailsUrl: "$baseUrl$url")); } return songs; } } return []; } @override Future> getSuggestions(String query) async { //build suggestion path query = query.split(' ')[0]; if (query.isNotEmpty) { var url = "$baseUrl$suggestionsPath${query[0]}/$query.js"; var result = await http.get(Uri.parse(url)); if (result.statusCode == 200) { List _res = jsonDecode(result.body)['suggestions']; return _res.map((e) => e.toString()).toList(); } } return []; } @override Future getTrackUri(OnlineTrack track) async { var result = await http.get(Uri.parse(track.detailsUrl)); if (result.statusCode == 200) { var doc = html.parse(result.body); var item = doc.querySelector("audio.js-audio"); if (item != null) { return "$baseUrl${item.attributes["src"].toString()}"; } } return ""; } @override Future getPreviewUrl(OnlineTrack track) async { return getTrackUri(track); } } ================================================ FILE: lib/audio/online_sources/onlineSource.dart ================================================ import 'onlineTrack.dart'; abstract class OnlineSource { String get name; bool get hasSuggestions; Future> getSuggestions(String query); Future> getSearchResults(String query); Future getTrackUri(OnlineTrack track); Future getPreviewUrl(OnlineTrack track); } ================================================ FILE: lib/audio/online_sources/onlineTrack.dart ================================================ class OnlineTrack { String title; String artist; bool hasUrl; String url; String id; String detailsUrl; String thumbnailUrl; OnlineTrack( {required this.title, required this.artist, required this.hasUrl, this.url = "", this.id = "", required this.detailsUrl, this.thumbnailUrl = ""}); } ================================================ FILE: lib/audio/online_sources/sourceResolver.dart ================================================ import 'package:audio_picker/audio_picker.dart'; import 'package:mighty_plug_manager/audio/online_sources/YoutubeSource.dart'; import 'package:mighty_plug_manager/platform/platformUtils.dart'; class SourceResolver { static final Map _pathCache = {}; static Future getSourceUrl(String sourceUri) async { if (sourceUri.startsWith("yt:")) { var id = sourceUri.substring(3); if (_pathCache.containsKey(id)) return _pathCache[id]!; //this is youtube source, parse the url String url = await YoutubeSource.getYoutubeUrlFromId(id); _pathCache[id] = url; return url; } else if (sourceUri.startsWith("iosbm:")) { var url = await AudioPicker().iosBookmarkToUrl(sourceUri); return url; } return sourceUri; } static void releaseUrl(String sourceUrl, String resolvedUrl) { if (PlatformUtils.isIOS) { if (sourceUrl.startsWith("iosbm:")) { AudioPicker().iosReleaseSecurityScope(resolvedUrl); return; } } } static void addToCache(String id, String url) { _pathCache[id] = url; } static String? getFromCache(String id) { return _pathCache[id]; } } ================================================ FILE: lib/audio/setlistPage.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/UI/popups/selectTrack.dart'; import 'package:mighty_plug_manager/UI/theme.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/audio/setlist_player/setlistPlayerState.dart'; import '../UI/pages/jamTracks.dart'; import 'models/setlist.dart'; import 'trackdata/trackData.dart'; class SetlistPage extends StatefulWidget { final Setlist setlist; final bool readOnly; const SetlistPage({Key? key, required this.setlist, required this.readOnly}) : super(key: key); @override State createState() => _SetlistPageState(); } class _SetlistPageState extends State { final animationDuration = const Duration(milliseconds: 200); final SetlistPlayerState playerState = SetlistPlayerState.instance(); //multiselection stuff bool _multiselectMode = false; Offset dragStart = const Offset(0, 0); Map selected = {}; var popupSubmenu = [ PopupMenuItem( value: 0, child: Row( children: [ Icon( Icons.highlight_remove_outlined, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Remove"), ], ), ) ]; void menuActions(BuildContext context, int action, SetlistItem item) async { switch (action) { case 0: //delete AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Are you sure you want to remove ${item.trackReference!.name}?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) { if (delete) { SetlistItem? currentSong = findPlayedTrack(); widget.setlist.items.remove(item); reattachTrackIndex(currentSong); TrackData().saveSetlists().then((value) { setState(() {}); }); } }); break; } } void addTrack() { showDialog( context: context, builder: (BuildContext context) => SelectTrackDialog().buildDialog(context), ).then((value) { if (value == null) return; if (value is List) { for (var element in value) { widget.setlist.addTrack(element); } } else { widget.setlist.addTrack(value); } TrackData().saveSetlists(); setState(() {}); }); } void multiselectHandler(int index) { if (selected.isEmpty || !selected.containsKey(index)) { //fill it first if not created selected[index] = true; _multiselectMode = true; } else { selected.remove(index); if (selected.isEmpty) _multiselectMode = false; } setState(() {}); } void deselectAll() { selected.clear(); _multiselectMode = false; setState(() {}); } SetlistItem? findPlayedTrack() { if (playerState.setlist == widget.setlist) { return widget.setlist.items[playerState.currentTrack]; } return null; } void reattachTrackIndex(SetlistItem? currentSong) { if (currentSong != null) { var index = widget.setlist.items.indexOf(currentSong); if (index > -1) { playerState.currentTrack = index; } else { playerState.clear(); } } } Widget? createTrailingWidget(BuildContext context, int index) { if (widget.readOnly) return null; if (_multiselectMode) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Icon( selected.containsKey(index) ? Icons.check_circle : Icons.brightness_1_outlined, color: selected.containsKey(index) ? null : Colors.grey[800], ), ); } return PopupMenuButton( child: const Padding( padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return popupSubmenu; }, onSelected: (pos) { menuActions(context, pos as int, widget.setlist.items[index]); }, ); } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () async { if (_multiselectMode) { deselectAll(); return false; } return true; }, child: Scaffold( appBar: AppBar( backgroundColor: Colors.grey[850], title: Text(widget.setlist.name)), body: Column( mainAxisSize: MainAxisSize.min, children: [ Expanded( child: ListTileTheme( selectedTileColor: const Color.fromARGB(255, 9, 51, 116), selectedColor: Colors.white, iconColor: Colors.white, child: IndexedStack( index: widget.setlist.items.isNotEmpty ? 0 : 1, children: [ Theme( data: Theme.of(context).copyWith( canvasColor: Colors.grey[700], ), child: ReorderableListView.builder( buildDefaultDragHandles: false, itemCount: widget.setlist.items.length, itemBuilder: (context, index) { return Container( key: Key("$index"), child: InkWell( onTap: () { if (_multiselectMode) { multiselectHandler(index); return; } var track = widget .setlist.items[index].trackReference; if (track != null) { if (playerState.setlist != widget.setlist) { playerState.openSetlist(widget.setlist); } playerState.openTrack(index); } setState(() {}); }, onLongPress: widget.readOnly ? null : () => multiselectHandler(index), child: Row( children: [ if (!widget.readOnly && !_multiselectMode) ReorderableDragStartListener( index: index, child: InkWell( child: SizedBox( width: AppThemeConfig.dragHandlesWidth, height: 48, child: const Icon( Icons.drag_handle, color: Colors.grey, size: 24, ), ), ), ), Expanded( child: ListTile( selected: _multiselectMode && selected.containsKey(index), contentPadding: EdgeInsets.only( left: widget.readOnly || _multiselectMode ? 16 : 0, right: 0), title: Text(widget.setlist.items[index] .trackReference!.name), trailing: createTrailingWidget( context, index), ), ), ], ), ), ); }, onReorder: (int oldIndex, int newIndex) { var currentItem = widget.setlist.items[playerState.currentTrack]; if (oldIndex < newIndex) { // removing the item at oldIndex will shorten the list by 1. newIndex -= 1; } final element = widget.setlist.items.removeAt(oldIndex); widget.setlist.items.insert(newIndex, element); if (playerState.setlist == widget.setlist) { playerState.currentTrack = widget.setlist.items.indexOf(currentItem); } TrackData().saveSetlists(); }), ), Center( child: Text( "No Tracks", style: Theme.of(context).textTheme.bodyLarge, ), ) ], ), ), ), ], ), floatingActionButton: widget.readOnly ? null : FloatingActionButton( backgroundColor: Colors.blue, foregroundColor: Colors.white, onPressed: () { if (_multiselectMode) { //delete mode AlertDialogs.showConfirmDialog( JamTracks.jamtracksNavigator.currentContext!, title: "Confirm", description: "Are you sure you want to remove ${selected.length} items?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) async { if (delete) { SetlistItem? currentSong = findPlayedTrack(); for (int i = selected.length - 1; i >= 0; i--) { var index = selected.keys.elementAt(i); if (playerState.setlist == widget.setlist && playerState.currentTrack == index) {} widget.setlist.items.removeAt(index); } reattachTrackIndex(currentSong); await TrackData().saveSetlists(); deselectAll(); } }); return; } addTrack(); }, child: Icon( _multiselectMode ? Icons.delete : Icons.add, size: 28, ), ), ), ); } } ================================================ FILE: lib/audio/setlist_player/setlistPlayerState.dart ================================================ import 'dart:async'; import 'package:flutter/foundation.dart'; import '../../platform/simpleSharedPrefs.dart'; import '../automationController.dart'; import '../models/setlist.dart'; enum PlayerState { idle, play, pause } class SetlistPlayerState extends ChangeNotifier { static final SetlistPlayerState _setlistPlayerState = SetlistPlayerState._(); SetlistPlayerState._() { gain = SharedPrefs().getValue(SettingsKeys.trackGain, 0.0); } factory SetlistPlayerState.instance() { return _setlistPlayerState; } PlayerState state = PlayerState.idle; final StreamController _positionController = StreamController.broadcast(); Stream get positionStream => _positionController.stream; Setlist? setlist; int currentTrack = 0; Duration currentPosition = const Duration(seconds: 0); bool _autoAdvance = true; bool _inPositionUpdateMode = false; bool _expanded = false; bool get expanded => _expanded; int _pitch = 1; double _speed = 1; double _gain = 0; ABRepeatState get abRepeat => automation?.abRepeatState ?? ABRepeatState.off; int get pitch => _pitch; set pitch(val) { _pitch = val; notifyListeners(); } double get speed => _speed; set speed(val) { _speed = val; notifyListeners(); } double get gain => _gain; set gain(double val) { _gain = val; automation?.setGain(_gain); } AutomationController? get automation => _automation; bool get autoAdvance => _autoAdvance; set autoAdvance(bool val) { _autoAdvance = val; notifyListeners(); } AutomationController? _automation; void openTrack(int setlistIndex) async { currentTrack = setlistIndex; await closeTrack(); await _openTrack(setlistIndex); await play(); notifyListeners(); } void openSetlist(Setlist newSetlist) { setlist = newSetlist; } Future _openTrack(int index) async { if (setlist == null) return; currentPosition = const Duration(milliseconds: 0); currentTrack = index; var track = setlist!.items[index].trackReference; if (track != null) { print("Opening track ${track.name}"); print("Track path: ${track.path}"); _automation = AutomationController(track, track.automation); await _automation?.setAudioFile(track.path, 70); _automation?.setTrackCompleteEvent(_onTrackComplete); _automation?.positionStream.listen(_onPosition); automation?.setGain(_gain); pitch = _automation?.pitch ?? 1; speed = _automation?.speed ?? 1; } } Future play() async { await _automation?.play(); state = PlayerState.play; notifyListeners(); } Future playPause() async { if (setlist == null) return; if (_automation == null) await _openTrack(currentTrack); await _automation?.playPause(); if (_automation!.player.playerState.playing == false) { state = PlayerState.pause; } else { state = PlayerState.play; } debugPrint(state.toString()); notifyListeners(); } Future stop() async { await _automation?.stop(); state = PlayerState.idle; notifyListeners(); } Future clear() async { setlist = null; currentTrack = 0; await stop(); } void previous() async { if (_automation == null) return; if (currentTrack == 0 || _automation!.player.position.inSeconds > 3) { _automation!.rewind(); currentPosition = const Duration(milliseconds: 0); } else if (currentTrack > 0) { await closeTrack(); currentTrack--; await _openTrack(currentTrack); if (state == PlayerState.play) await play(); } notifyListeners(); } void next() async { if (setlist == null) return; if (currentTrack < setlist!.items.length - 1) { await closeTrack(); currentTrack++; await _openTrack(currentTrack); if (state == PlayerState.play) await play(); notifyListeners(); } } Future? closeTrack() { return _automation?.dispose(); } void onTrackRemoved(String trackUuld) { if (setlist == null) return; bool hasItem = setlist!.items.any((element) => element.trackUuid == trackUuld); if (hasItem) { clear(); notifyListeners(); } } void _onPosition(Duration pos) { if (!_inPositionUpdateMode) currentPosition = pos; _positionController.add(pos); } String getMMSS(Duration d) { var m = d.inMinutes.toString().padLeft(2, "0"); var s = d.inSeconds.remainder(60).toString().padLeft(2, "0"); return "$m:$s"; } Duration getDuration() { return _automation?.duration ?? const Duration(seconds: 0); } void setPosition(int positionMS) { if (positionMS < 0) positionMS = 0; var duration = getDuration().inMilliseconds; if (positionMS > duration) positionMS = duration; currentPosition = Duration(milliseconds: positionMS); if (!_inPositionUpdateMode) { _automation?.seek(currentPosition); notifyListeners(); _positionController.add(currentPosition); } } void setPositionUpdateMode(bool enabled) { _inPositionUpdateMode = enabled; if (!enabled) _automation?.seek(currentPosition); } void _onTrackComplete() async { await closeTrack(); if (setlist == null) return; currentPosition = const Duration(milliseconds: 0); if (currentTrack < setlist!.items.length - 1) { currentTrack++; await _openTrack(currentTrack); if (_autoAdvance) { await play(); state = PlayerState.play; } else { state = PlayerState.pause; } } else { currentTrack = 0; await _openTrack(currentTrack); state = PlayerState.pause; } notifyListeners(); } void toggleExpanded() { _expanded = !_expanded; notifyListeners(); } void toggleABRepeat() { if (state != PlayerState.play) return; automation?.toggleABRepeat(); notifyListeners(); } } ================================================ FILE: lib/audio/setlistsPage.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/UI/theme.dart'; import 'package:mighty_plug_manager/audio/trackdata/trackData.dart'; import 'models/setlist.dart'; class Setlists extends StatefulWidget { final Function(Setlist)? onSetlistSelect; final Function()? onAllTracksSelect; const Setlists({Key? key, this.onSetlistSelect, this.onAllTracksSelect}) : super(key: key); @override State createState() => _SetlistsState(); } class _SetlistsState extends State { Offset _position = const Offset(0, 0); @override void initState() { super.initState(); } void createSetlist() { AlertDialogs.showInputDialog(context, title: "New Setlist", description: "Create new setlist", cancelButton: "Cancel", confirmButton: "Create", value: "New Setlist", validation: (name) { if (TrackData().findSetlist(name) != null) return false; return true; }, validationErrorMessage: "A setlist with this name already exists", confirmColor: Theme.of(context).hintColor, onConfirm: (name) { TrackData().addSetlist(name); setState(() {}); }); } var popupSubmenu = [ // PopupMenuItem( // value: 0, // child: Row( // children: [ // Icon( // Icons.view, // color: AppThemeConfig.contextMenuIconColor, // ), // const SizedBox(width: 5), // Text("Open"), // ], // ), // ), PopupMenuItem( value: 1, child: Row( children: [ Icon( Icons.drive_file_rename_outline, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Rename"), ], ), ), PopupMenuItem( value: 2, child: Row( children: [ Icon( Icons.delete, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Delete"), ], ), ) ]; void showContextMenu( BuildContext context, dynamic item, List menu) { final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox; //open menu var rect = RelativeRect.fromRect( _position & const Size(40, 40), // smaller rect, the touch area Offset.zero & overlay.size); showMenu( position: rect, items: menu, context: context, ).then((value) { if (value != null) menuActions(context, value, item); }); } void menuActions(BuildContext context, int action, Setlist item) async { switch (action) { case 1: //rename renameSetlist(context, item); break; case 2: //delete AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Are you sure you want to delete ${item.name}?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) { if (delete) { TrackData().removeSetlist(item).then((value) => setState(() {})); } }); break; } } void renameSetlist(BuildContext context, Setlist setlist) { AlertDialogs.showInputDialog(context, title: "Rename", description: "Enter setlist name:", cancelButton: "Cancel", confirmButton: "Rename", value: setlist.name, validation: (String newName) { if (TrackData().findSetlist(newName) != null) return false; return true; }, validationErrorMessage: "Name already taken!", confirmColor: Theme.of(context).hintColor, onConfirm: (newName) { setlist.name = newName; TrackData().saveSetlists(); setState(() {}); }); } @override Widget build(BuildContext context) { var setlists = TrackData().setlists; if (TrackData().tracks.isEmpty) { return const Center(child: Text("Add some tracks first!")); } return ListTileTheme( iconColor: Colors.white, child: Stack( alignment: Alignment.bottomRight, children: [ Column( children: [ ListTile( contentPadding: EdgeInsets.only( left: AppThemeConfig.dragHandlesWidth, right: 16), title: Text(TrackData().allTracks.name), subtitle: Text("${TrackData().allTracks.items.length} tracks"), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { widget.onAllTracksSelect?.call(); }, ), Expanded( child: Theme( data: Theme.of(context).copyWith( canvasColor: Colors.grey[700], //shadowColor: Colors.grey, ), child: ReorderableListView.builder( padding: const EdgeInsets.only(bottom: 90), itemCount: setlists.length, itemBuilder: (context, index) { return Container( key: Key("$index"), child: InkWell( onTap: () { widget.onSetlistSelect?.call(setlists[index]); }, onTapDown: (details) { _position = details.globalPosition; }, onLongPress: () { showContextMenu( context, setlists[index], popupSubmenu); }, child: Row( children: [ ReorderableDragStartListener( index: index, child: InkWell( child: SizedBox( width: AppThemeConfig.dragHandlesWidth, height: 64, child: const Icon( Icons.drag_handle, color: Colors.grey, size: 24, ), ), ), ), Expanded( child: ListTile( contentPadding: const EdgeInsets.only(right: 0), title: Text(setlists[index].name), subtitle: Text( "${setlists[index].items.length} tracks"), trailing: PopupMenuButton( padding: EdgeInsets.zero, child: const Padding( padding: EdgeInsets.symmetric( horizontal: 16, vertical: 16), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return popupSubmenu; }, onSelected: (pos) { menuActions(context, pos as int, setlists[index]); }, ), ), ), ], ), ), ); }, buildDefaultDragHandles: false, onReorder: (int oldIndex, int newIndex) { if (oldIndex < newIndex) { // removing the item at oldIndex will shorten the list by 1. newIndex -= 1; } final element = setlists.removeAt(oldIndex); setlists.insert(newIndex, element); TrackData().saveSetlists(); }), ), ), ], ), Padding( padding: const EdgeInsets.all(20.0), child: FloatingActionButton( backgroundColor: Colors.blue, foregroundColor: Colors.white, onPressed: () { createSetlist(); }, child: const Icon( Icons.add, size: 28, ), ), ) ], ), ); } } ================================================ FILE: lib/audio/trackdata/trackData.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:convert'; import 'dart:io'; import 'package:audio_picker/audio_picker.dart'; import 'package:flutter/foundation.dart'; import 'package:mighty_plug_manager/audio/models/jamTrack.dart'; import 'package:mighty_plug_manager/audio/models/setlist.dart'; import 'package:path/path.dart' as path; import 'package:uuid/uuid.dart'; import '../../platform/platformUtils.dart'; class TrackData { static final TrackData _storage = TrackData._(); static const tracksFile = "tracks.json"; static const setlistsFile = "setlists.json"; final Uuid uuid = const Uuid(); factory TrackData() { return _storage; } String tracksPath = ""; String setlistsPath = ""; late Directory? storageDirectory; late File _tracksFile, _setlistsFile; List _tracksData = []; List get tracks => _tracksData; List _setlistsData = []; final Setlist _allTracks = Setlist("All Tracks", []); List get setlistsFull => [_allTracks] + _setlistsData; Setlist get allTracks => _allTracks; List get setlists => _setlistsData; bool _tracksReady = false; TrackData._() { _init(); } _init() async { _tracksData = []; await _getDirectory(); await _loadTracks(); AudioPicker().regusterOnStaleBookmark(_onBookmarkUpdated); } _getDirectory() async { storageDirectory = await PlatformUtils.getAppDataDirectory(); tracksPath = path.join(storageDirectory?.path ?? "", tracksFile); setlistsPath = path.join(storageDirectory?.path ?? "", setlistsFile); _tracksFile = File(tracksPath); _setlistsFile = File(setlistsPath); } _loadTracks() async { try { var exists = await _tracksFile.exists(); if (exists) { var tracksJson = await _tracksFile.readAsString(); var data = json.decode(tracksJson); _tracksData = data.map((json) => JamTrack.fromJson(json)).toList(); //read setlists exists = await _setlistsFile.exists(); if (exists) { var setlistsJson = await _setlistsFile.readAsString(); data = json.decode(setlistsJson); _setlistsData = data.map((json) => Setlist.fromJson(json)).toList(); } _createAllTracksSetlist(); } _tracksReady = true; } catch (e) { debugPrint(e.toString()); //still ready _tracksReady = true; // //no file // print("Presets file not available"); } } _createAllTracksSetlist() { _allTracks.clear(); for (int i = 0; i < _tracksData.length; i++) { _allTracks.addTrack(_tracksData[i]); } } Future waitLoading() async { for (int i = 0; i < 20; i++) { if (_tracksReady) break; await Future.delayed(const Duration(milliseconds: 200)); } } addTrack(String file, String name, bool save) { _tracksData.add(JamTrack( name: name, path: file, uuid: _generateUuid(), )); if (save) saveTracks(); } JamTrack? findByUuid(String uuid) { for (int i = 0; i < _tracksData.length; i++) { if (_tracksData[i].uuid == uuid) return _tracksData[i]; } return null; } removeTrack(JamTrack track) async { if (_tracksData.contains(track)) { _tracksData.remove(track); bool tracklistChanged = false; //remove any setlist instances for (int i = 0; i < _setlistsData.length; i++) { for (int j = _setlistsData[i].items.length - 1; j >= 0; j--) { if (_setlistsData[i].items[j].trackUuid == track.uuid) { _setlistsData[i].items.removeAt(j); tracklistChanged = true; } } } if (tracklistChanged) await saveSetlists(); await saveTracks(); } } removeTracks(List tracks) async { bool tracklistChanged = false; for (var element in tracks) { _tracksData.remove(element); //remove any setlist instances for (int i = 0; i < _setlistsData.length; i++) { for (int j = _setlistsData[i].items.length - 1; j >= 0; j--) { if (_setlistsData[i].items[j].trackUuid == element.uuid) { _setlistsData[i].items.removeAt(j); tracklistChanged = true; } } } } if (tracklistChanged) await saveSetlists(); await saveTracks(); } bool isPresetInUse(String presetUuid) { for (int i = 0; i < _tracksData.length; i++) { if (_tracksData[i].automation.initialEvent.getPresetUuid() == presetUuid) { return true; } var e = _tracksData[i].automation.events; for (int j = 0; j < e.length; j++) { if (e[j].getPresetUuid() == presetUuid) return true; } } return false; } bool isAnyPresetInUse(List presetsUuid) { for (int i = 0; i < _tracksData.length; i++) { if (presetsUuid.contains( _tracksData[i].automation.initialEvent.getPresetUuid())) return true; var e = _tracksData[i].automation.events; for (int j = 0; j < e.length; j++) { if (presetsUuid.contains(e[j].getPresetUuid())) return true; } } return false; } void removePresetInstances(String presetUuid) { for (int i = 0; i < _tracksData.length; i++) { if (_tracksData[i].automation.initialEvent.getPresetUuid() == presetUuid) { _tracksData[i].automation.initialEvent.clearPreset(); } var e = _tracksData[i].automation.events; for (int j = e.length - 1; j >= 0; j--) { if (e[j].getPresetUuid() == presetUuid) e[j].clearPreset(); } } saveTracks(); } void removeMultiplePresetsInstances(List presetsUuid) { for (int i = 0; i < _tracksData.length; i++) { if (presetsUuid .contains(_tracksData[i].automation.initialEvent.getPresetUuid())) { _tracksData[i].automation.initialEvent.clearPreset(); } var e = _tracksData[i].automation.events; for (int j = e.length - 1; j >= 0; j--) { var uuid = e[j].getPresetUuid(); if (presetsUuid.contains(uuid)) { e[j].clearPreset(); } } } saveTracks(); } saveTracks() async { _createAllTracksSetlist(); String jsonData = json.encode(_tracksData); await _tracksFile.writeAsString(jsonData); } addSetlist(String name) { var setlist = Setlist(name, []); _setlistsData.add(setlist); saveSetlists(); } Setlist? findSetlist(String name) { for (int i = 0; i < _setlistsData.length; i++) { if (_setlistsData[i].name == name) return _setlistsData[i]; } return null; } removeSetlist(Setlist setlist) async { if (_setlistsData.contains(setlist)) { _setlistsData.remove(setlist); await saveSetlists(); } } saveSetlists() async { String jsonData = json.encode(_setlistsData); await _setlistsFile.writeAsString(jsonData); } String _generateUuid() { String id = ""; bool unique = true; do { id = uuid.v4(); // check unique for (var element in _tracksData) { if (element.uuid == id) unique = false; } } while (unique == false); return id; } void _onBookmarkUpdated(String oldBookmark, String newBookmark) { for (var track in _tracksData) { if (track.path == oldBookmark) { track.path = newBookmark; saveTracks(); } } } } ================================================ FILE: lib/audio/tracksPage.dart ================================================ import 'package:audio_picker/audio_picker.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:on_audio_query_forked/on_audio_query.dart'; import 'package:mighty_plug_manager/UI/popups/alertDialogs.dart'; import 'package:mighty_plug_manager/UI/theme.dart'; import 'package:mighty_plug_manager/UI/widgets/fabMenu.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/UI/widgets/common/searchTextField.dart'; import 'package:mighty_plug_manager/audio/setlist_player/setlistPlayerState.dart'; import 'package:mighty_plug_manager/audio/widgets/media_library/media_browse.dart'; import 'package:path/path.dart'; import '../platform/platformUtils.dart'; import '../platform/simpleSharedPrefs.dart'; import 'audioEditor.dart'; import 'models/jamTrack.dart'; import 'online_sources/YoutubeSource.dart'; import 'online_sources/onlineTrack.dart'; import 'trackdata/trackData.dart'; import 'widgets/online_source/online_source.dart'; import 'widgets/online_source/search_screen.dart'; class TracksPage extends StatefulWidget { final bool selectorOnly; final Function(JamTrack)? onSelectedTrack; final Function(bool, Map)? multiSelectState; const TracksPage( {Key? key, this.selectorOnly = false, this.onSelectedTrack, this.multiSelectState}) : super(key: key); @override State createState() => _TracksPageState(); } class _TracksPageState extends State with SingleTickerProviderStateMixin { //search (filter) stuff String filter = ""; final TextEditingController searchCtrl = TextEditingController(text: ""); final scrollController = ScrollController(); bool _showHiddenSources = false; //multiselection stuff bool _multiselectMode = false; //menu anim late Animation _animation; late AnimationController _animationController; static List? songList; bool get multiselectMode => _multiselectMode; set multiselectMode(value) { _multiselectMode = value; widget.multiSelectState?.call(_multiselectMode, selected); } Map selected = {}; var popupSubmenu = [ PopupMenuItem( value: 0, child: Row( children: [ Icon( Icons.edit, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Edit"), ], ), ), PopupMenuItem( value: 1, child: Row( children: [ Icon( Icons.drive_file_rename_outline, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Rename"), ], ), ), PopupMenuItem( value: 2, child: Row( children: [ Icon( Icons.delete, color: AppThemeConfig.contextMenuIconColor, ), const SizedBox(width: 5), const Text("Delete"), ], ), ) ]; void menuActions(BuildContext context, int action, JamTrack item) async { switch (action) { case 0: //edit editTrack(context, item); break; case 1: //rename renameTrack(context, item); break; case 2: //delete AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Are you sure you want to delete ${item.name}?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) { if (delete) { SetlistPlayerState.instance().onTrackRemoved(item.uuid); TrackData().removeTrack(item).then((value) => setState(() {})); } }); break; } } String getProperTags(Map? tags, String filename) { String title = "", artist = ""; if (tags != null) { if (tags.containsKey("artist")) artist = tags["artist"]; if (tags.containsKey("title")) title = tags["title"]; } if (artist.isNotEmpty || title.isNotEmpty) { return "$artist - $title"; } String fn = basename(filename); if (fn.contains('.')) { return fn.substring(0, fn.lastIndexOf(".")); } return fn; } @override void initState() { super.initState(); searchCtrl.addListener(() { filter = searchCtrl.value.text.toLowerCase(); setState(() {}); }); _animationController = AnimationController( vsync: this, duration: const Duration(milliseconds: 260), ); final curvedAnimation = CurvedAnimation(curve: Curves.easeInOut, parent: _animationController); _animation = Tween(begin: 0, end: 1).animate(curvedAnimation); _showHiddenSources = SharedPrefs().getInt(SettingsKeys.hiddenSources, 0) != 0 || kDebugMode; querySongs(); } void querySongs() async { if (songList != null) return; if (PlatformUtils.isAndroid) { final OnAudioQuery audioQuery = OnAudioQuery(); songList = await audioQuery.querySongs(); } } void multiselectHandler(int index) { if (selected.isEmpty || !selected.containsKey(index)) { //fill it first if not created selected[index] = true; multiselectMode = true; } else { selected.remove(index); if (selected.isEmpty) multiselectMode = false; } setState(() {}); } void deselectAll() { selected.clear(); multiselectMode = false; setState(() {}); } void stopPlayer() { SetlistPlayerState.instance().stop(); } void editTrack(BuildContext context, JamTrack track) { stopPlayer(); Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute(builder: (context) => AudioEditor(track))) .then((value) { //save track data TrackData().saveTracks(); }); } void renameTrack(BuildContext context, JamTrack track) { AlertDialogs.showInputDialog(context, title: "Rename", description: "Enter track name:", cancelButton: "Cancel", confirmButton: "Rename", value: track.name, validation: (String newName) { return newName.isNotEmpty; }, validationErrorMessage: "Name already taken!", confirmColor: Theme.of(context).hintColor, onConfirm: (newName) { track.name = newName; TrackData().saveTracks(); setState(() {}); }); } Widget? createTrailingWidget(BuildContext context, int index) { if (multiselectMode) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10), child: Icon( selected.containsKey(index) ? Icons.check_circle : Icons.brightness_1_outlined, color: selected.containsKey(index) ? null : Colors.grey[800], ), ); } if (widget.selectorOnly) return null; return PopupMenuButton( child: const Padding( padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10), child: Icon(Icons.more_vert), ), itemBuilder: (context) { return popupSubmenu; }, onSelected: (pos) { menuActions(context, pos as int, TrackData().tracks[index]); }, ); } void deleteSelected(BuildContext context) { AlertDialogs.showConfirmDialog(context, title: "Confirm", description: "Are you sure you want to delete ${selected.length} items?", cancelButton: "Cancel", confirmButton: "Delete", confirmColor: Colors.red, onConfirm: (delete) async { if (delete) { List delTracks = []; for (int i = 0; i < selected.length; i++) { var item = TrackData().tracks[selected.keys.elementAt(i)]; delTracks.add(item); SetlistPlayerState.instance().onTrackRemoved(item.uuid); } await TrackData().removeTracks(delTracks); deselectAll(); } }); } Future _processMediaList(List urls) async { for (int i = 0; i < urls.length; i++) { await _processFileUrl(urls[i]); //clear filter and scroll to bottom searchCtrl.text = ""; setState(() {}); } if (urls.isNotEmpty) { TrackData().saveTracks(); _scrollToNewSongs(); } } void addFromFile() async { //add track mode var path = await AudioPicker().pickAudioMultiple(); await _processMediaList(path); } void addFromIosFile() async { var path = await AudioPicker().pickAudioFiles(); await _processMediaList(path); } Future _processFileUrl(String path) async { SongModel? libSong; if (PlatformUtils.isAndroid && path.contains("com.android.providers.media")) { var spl = path.split("%3A"); if (spl.length < 2) return; var id = int.tryParse(path.split("%3A")[1]); if (id != null) { for (var s = 0; s < (songList?.length ?? 0); s++) { if (songList![s].id == id) { libSong = songList![s]; break; } } } } else { //find song in media library String file = basename(path); for (var s = 0; s < (songList?.length ?? 0); s++) { if (songList![s].uri?.contains(file) ?? false) { libSong = songList![s]; break; } } } String artist = ""; String title = ""; String trackName = ""; String url = ""; if (libSong != null) { artist = libSong.artist == null ? "" : libSong.artist!; title = libSong.title; url = libSong.uri ?? ""; } else { var meta = await AudioPicker().getMetadata(path); artist = meta["artist"]?.trim() ?? ""; title = meta["title"]?.trim() ?? ""; url = path; } trackName = artist.isEmpty || title.isEmpty ? artist + title : "$artist - $title"; if (url.isEmpty) { url = path; } if (trackName.isEmpty) { trackName = Uri.decodeComponent(basenameWithoutExtension(path)); } TrackData().addTrack(url, trackName, false); } void addFromMediaLibrary(BuildContext context) { Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute( builder: (context) => const MediaLibraryBrowser())) .then((value) { if (value is List) { for (int i = 0; i < value.length; i++) { var name = value[i].artist != "" ? "${value[i].artist} - ${value[i].title}" : value[i].title; TrackData().addTrack(value[i].uri ?? "", name, false); } TrackData().saveTracks(); //clear filter and scroll to bottom searchCtrl.text = ""; setState(() {}); _scrollToNewSongs(); } }); } void addFromOnlineSource(BuildContext context) { stopPlayer(); Navigator.of(context, rootNavigator: true) .push( MaterialPageRoute(builder: (context) => const OnlineSourceSearch())) .then((value) { if (value is List) { for (int i = 0; i < value.length; i++) { var name = "${value[i].artist} - ${value[i].title}"; TrackData().addTrack(value[i].url, name, false); } TrackData().saveTracks(); //clear filter and scroll to bottom searchCtrl.text = ""; setState(() {}); _scrollToNewSongs(); } }); } void addFromYoutubeSource(BuildContext context) { stopPlayer(); Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute( builder: (context) => OnlineSearchScreen(source: YoutubeSource()))) .then((value) { if (value is List) { for (int i = 0; i < value.length; i++) { var name = "${value[i].artist} - ${value[i].title}"; TrackData().addTrack(value[i].url, name, false); } TrackData().saveTracks(); //clear filter and scroll to bottom searchCtrl.text = ""; setState(() {}); _scrollToNewSongs(); } }); } void _scrollToNewSongs() async { await Future.delayed(const Duration(milliseconds: 300)); scrollController.animateTo(scrollController.position.maxScrollExtent, duration: const Duration(milliseconds: 300), curve: Curves.easeInCubic); } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () { if (multiselectMode) { deselectAll(); return Future.value(false); } return Future.value(true); }, child: Scaffold( resizeToAvoidBottomInset: false, body: Column( children: [ if (TrackData().tracks.isNotEmpty) SearchTextField(controller: searchCtrl), Expanded( child: ListTileTheme( selectedTileColor: const Color.fromARGB(255, 9, 51, 116), selectedColor: Colors.white, child: IndexedStack( index: TrackData().tracks.isEmpty ? 0 : 1, children: [ Center( child: Text("No Tracks", style: Theme.of(context).textTheme.bodyLarge)), ListView.builder( controller: scrollController, itemCount: TrackData().tracks.length, padding: const EdgeInsets.only(bottom: 90), itemBuilder: (context, index) { if (filter != "" && !TrackData() .tracks[index] .name .toLowerCase() .contains(filter)) return const SizedBox(); return ListTile( contentPadding: const EdgeInsets.only(left: 12), selected: multiselectMode && selected.containsKey(index), title: Text(TrackData().tracks[index].name), onTap: () { if (multiselectMode) { multiselectHandler(index); return; } if (widget.selectorOnly) { widget.onSelectedTrack ?.call(TrackData().tracks[index]); } else { editTrack(context, TrackData().tracks[index]); } }, onLongPress: () => multiselectHandler(index), trailing: createTrailingWidget(context, index), ); }, ), ], ), ), ), ], ), floatingActionButton: (widget.selectorOnly) ? null : FloatingActionBubble( // Menu items items: _bubbles(context), // animation controller animation: _animation, // On pressed change animation state onPress: () { if (multiselectMode) { deleteSelected(context); } else { _animationController.isCompleted ? _animationController.reverse() : _animationController.forward(); } }, // Floating Action button Icon color iconColor: Colors.white, // Flaoting Action button Icon iconData: multiselectMode ? Icons.delete : Icons.add, backGroundColor: Colors.blue, ), ), ); } List _bubbles(BuildContext context) { return [ // Floating action menu item if (_showHiddenSources) Bubble( title: "Youtube", iconColor: Colors.white, bubbleColor: Colors.red, icon: Icons.ondemand_video_outlined, titleStyle: const TextStyle(fontSize: 16, color: Colors.white), onPress: () { _animationController.reverse(); addFromYoutubeSource(context); }), if (_showHiddenSources) Bubble( title: "Online Source", iconColor: Colors.white, bubbleColor: Colors.blue, icon: Icons.cloud, titleStyle: const TextStyle(fontSize: 16, color: Colors.white), onPress: () { _animationController.reverse(); addFromOnlineSource(context); }, ), Bubble( title: "Media Library", iconColor: Colors.white, bubbleColor: Colors.blue, icon: Icons.library_music, titleStyle: const TextStyle(fontSize: 16, color: Colors.white), onPress: () { _animationController.reverse(); if (PlatformUtils.isIOS) { addFromFile(); } else { addFromMediaLibrary(context); } }, ), //Floating action menu item Bubble( title: "File Browser", iconColor: Colors.white, bubbleColor: Colors.blue, icon: Icons.folder, titleStyle: const TextStyle(fontSize: 16, color: Colors.white), onPress: () { _animationController.reverse(); if (PlatformUtils.isAndroid) { addFromFile(); } else if (PlatformUtils.isIOS) { addFromIosFile(); } }, ), ]; } } ================================================ FILE: lib/audio/widgets/eventEditor.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/selectPreset.dart'; import 'package:mighty_plug_manager/UI/widgets/thickSlider.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/devices/presets/preset_constants.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import '../models/trackAutomation.dart'; class EventEditor { final AutomationEvent event; final bool noneOption; EventEditor({required this.event, required this.noneOption}); List createPresetTiles( context, dynamic preset, StateSetter setState) { var tiles = []; Color color = preset != null ? PresetConstants.channelColorsPlug[preset["channel"]] : Colors.white; String category = preset != null ? PresetsStorage().findCategoryOfPreset(preset)!["name"] : ""; String name = preset != null ? "$category/${preset['name']}" : "None"; var tile = ListTile( title: Text( name, style: TextStyle(color: color), ), trailing: const Icon(Icons.keyboard_arrow_right), onTap: () { showDialog( context: context, builder: (BuildContext context) => SelectPresetDialog().buildDialog(context, noneOption: noneOption), ).then((value) { if (value == false) { event.setPresetUuid(""); } else if (value != null) { event.setPresetUuid(value['uuid']); } setState(() {}); }); }, ); tiles.add(tile); return tiles; } Future buildDialog(BuildContext context) { return showGeneralDialog( context: context, barrierDismissible: true, // should dialog be dismissed when tapped outside barrierLabel: "Dialog", // label for barrier pageBuilder: (_, __, ___) { // your widget implementation return StatefulBuilder( builder: (context, setState) { var device = NuxDeviceControl.instance().device; bool cab = device.cabinetSupport; var preset = PresetsStorage().findPresetByUuid(event.getPresetUuid()); return AlertDialog( title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( icon: Icon( Icons.adaptive.arrow_back, color: Colors.white, ), onPressed: () => Navigator.of(context).pop()), const Text("Edit Event", style: TextStyle(color: Colors.white)), ], ), contentPadding: const EdgeInsets.only( left: 10, right: 10, bottom: 20, top: 30), content: ListTileTheme( iconColor: Colors.white, child: Column( mainAxisSize: MainAxisSize.min, children: [ const Text("Preset", style: TextStyle( color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold)), ...createPresetTiles(context, preset, setState), if (cab) const Divider(), if (cab) CheckboxListTile( title: const Text("Cabinet level override"), value: event.cabinetLevelOverrideEnable, onChanged: (val) { if (val == null) return; event.cabinetLevelOverrideEnable = val; setState(() {}); }, ), if (cab) ListTile( enabled: event.cabinetLevelOverrideEnable, title: SizedBox( height: 50, width: 1, child: ThickSlider( enabled: event.cabinetLevelOverrideEnable, activeColor: Colors.blue, min: device.decibelFormatter?.min.toDouble() ?? -6, max: device.decibelFormatter?.max.toDouble() ?? 6, value: event.cabinetLevelOverride, onChanged: (value, skip) { event.cabinetLevelOverride = value; setState(() {}); }, label: "Level", labelFormatter: (value) { return "${value.toStringAsFixed(1)} db"; }, ), ), trailing: IconButton( icon: const Icon(Icons.replay_sharp), onPressed: !event.cabinetLevelOverrideEnable ? null : () { if (preset != null) { event.cabinetLevelOverride = preset["cabinet"]["level"]; } else { event.cabinetLevelOverride = 0; } setState(() {}); }, ), ), ], ), ), ); }, ); }, ); } } ================================================ FILE: lib/audio/widgets/jamtracksView.dart ================================================ import 'package:flutter/material.dart'; import '../setlist_player/setlistPlayerState.dart'; import 'setlistPlayer.dart'; class JamtracksView extends StatelessWidget { final Widget child; const JamtracksView({Key? key, required this.child}) : super(key: key); @override Widget build(BuildContext context) { final SetlistPlayerState playerState = SetlistPlayerState.instance(); final bool playerVisible = SetlistPlayerState.instance().setlist != null && SetlistPlayerState.instance().currentTrack < SetlistPlayerState.instance().setlist!.items.length; return Stack( alignment: Alignment.bottomCenter, children: [ Padding( padding: EdgeInsets.only(bottom: playerVisible ? 56 : 0), child: child, ), if (playerVisible) AnimatedSwitcher( duration: const Duration(milliseconds: 250), child: playerState.expanded ? const SetlistPlayer() : const SetlistMiniPlayer(), ) ], ); } } ================================================ FILE: lib/audio/widgets/loopPanel.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/widgets/common/numberPicker.dart'; import '../automationController.dart'; class LoopPanel extends StatelessWidget { final AutomationController automation; final Function(bool?) onLoopEnable; final Function(bool) onUseLoopPoints; final Function(int) onLoopTimes; const LoopPanel({ Key? key, required this.automation, required this.onLoopEnable, required this.onUseLoopPoints, required this.onLoopTimes, }) : super(key: key); @override Widget build(BuildContext context) { var dense = false; var height = MediaQuery.of(context).size.height; if (height < 600) dense = true; return Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ /*ElevatedButton( onPressed: () { onAddLoop(); }, child: Text("Insert Loop Points"), ), const SizedBox( width: 8, ),*/ CheckboxListTile( title: const Text("Enable Loop"), value: automation.loopEnable, dense: dense, onChanged: onLoopEnable), SwitchListTile( title: const Text("Use Loop Points"), value: automation.useLoopPoints, dense: dense, onChanged: automation.loopEnable == false ? null : onUseLoopPoints), if (!dense) const SizedBox( height: 8, ), Center( child: Text( "Loop Times", style: TextStyle( fontSize: dense ? 12 : 16, color: automation.loopEnable ? Colors.white : Colors.grey[700]), )), AbsorbPointer( absorbing: !automation.loopEnable, child: NumberPicker( axis: Axis.horizontal, itemHeight: dense ? 50 : 70, minValue: 0, maxValue: 20, selectedTextStyle: TextStyle( fontSize: 22, color: automation.loopEnable ? Colors.white : Colors.grey[700]), textStyle: TextStyle( color: automation.loopEnable ? Colors.grey : Colors.grey[800]), zeroSymbol: "∞", value: automation.loopTimes, onChanged: automation.loopEnable == false ? null : (value) { onLoopTimes(value); }, ), ) /*Row( children: [ Expanded( child: ElevatedButton( child: Text("Edit"), onPressed: automation.selectedEvent == null ? null : () { //onEditEvent(automation.selectedEvent!); }, ), ), const SizedBox( width: 8, ), Expanded( child: ElevatedButton( child: Text("Delete"), onPressed: automation.selectedEvent == null ? null : () { //onDelete(); }, ), ) ], ),*/ ], ), ); } } ================================================ FILE: lib/audio/widgets/media_library/albumTracks.dart ================================================ // (c) 2020 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:on_audio_query_forked/on_audio_query.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; class AlbumTracks extends StatefulWidget { final String albumName; final String albumId; final String artist; const AlbumTracks(this.albumName, this.albumId, this.artist, {Key? key}) : super(key: key); @override State createState() => _AlbumTracksState(); } class _AlbumTracksState extends State { final OnAudioQuery audioQuery = OnAudioQuery(); late Future> songs; late List songList; bool _multiselectMode = false; Map selected = {}; @override void initState() { super.initState(); songs = audioQuery.queryAudiosFrom(AudiosFromType.ALBUM_ID, widget.albumId); //songs = audioQuery.getSongsFromArtistAlbum( // albumId: widget.albumId, artist: widget.artist); } void multiselectHandler(int index) { if (selected.isEmpty || !selected.containsKey(index)) { //fill it first if not created selected[index] = true; _multiselectMode = true; } else { selected.remove(index); if (selected.isEmpty) _multiselectMode = false; } setState(() {}); } void deselectAll() { selected.clear(); _multiselectMode = false; setState(() {}); } Widget? createTrailingWidget(BuildContext context, int index) { if (_multiselectMode) { return Icon( selected.containsKey(index) ? Icons.check_circle : Icons.brightness_1_outlined, color: selected.containsKey(index) ? null : Colors.grey[800], ); } return null; } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () { //collapse player if extended if (_multiselectMode) { deselectAll(); return Future.value(false); } return Future.value(true); }, child: Scaffold( appBar: AppBar(title: Text("${widget.albumName} tracks")), body: FutureBuilder>( future: songs, builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: break; case ConnectionState.waiting: break; case ConnectionState.active: break; case ConnectionState.done: songList = snapshot.data!; return ListTileTheme( selectedTileColor: const Color.fromARGB(255, 9, 51, 116), selectedColor: Colors.white, child: ListView.builder( itemCount: snapshot.data!.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: const EdgeInsets.symmetric(vertical: 2.0), child: ListTile( selected: _multiselectMode && selected.containsKey(index), onTap: () { if (_multiselectMode) { multiselectHandler(index); return; } //return list of 1 track Navigator.of(context) .pop([snapshot.data![index]]); }, onLongPress: () => multiselectHandler(index), title: Text( snapshot.data![index].title, style: const TextStyle(color: Colors.white), ), trailing: createTrailingWidget(context, index)), ); }), ); } return const Text("Loading..."); }, ), floatingActionButton: _multiselectMode && selected.isNotEmpty ? FloatingActionButton( onPressed: () { List sel = []; for (int i = 0; i < selected.length; i++) { var index = selected.keys.elementAt(i); if (selected[index] == true) { sel.add(songList[index]); } } Navigator.of(context).pop(sel); }, backgroundColor: Colors.blue, foregroundColor: Colors.white, shape: const StadiumBorder(), child: const Icon(Icons.add), ) : null, ), ); } } ================================================ FILE: lib/audio/widgets/media_library/artistAlbums.dart ================================================ // (c) 2020 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:on_audio_query_forked/on_audio_query.dart'; import 'albumTracks.dart'; class ArtistAlbums extends StatelessWidget { final String artist; final int artistId; final OnAudioQuery audioQuery = OnAudioQuery(); ArtistAlbums(this.artist, {Key? key, required this.artistId}) : super(key: key); @override Widget build(BuildContext context) { Future album = audioQuery.queryWithFilters( artist, WithFiltersType.ALBUMS, args: AlbumsArgs.ARTIST); //Future> album = // audioQuery.getAlbumsFromArtist(artist: artist); return Scaffold( appBar: AppBar(title: Text("$artist albums")), body: FutureBuilder>( future: album, builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: break; case ConnectionState.waiting: break; case ConnectionState.active: break; case ConnectionState.done: return ListView.builder( itemCount: snapshot.data!.length, itemBuilder: (BuildContext ctxt, int index) { var albums = snapshot.data!; return Padding( padding: const EdgeInsets.symmetric(vertical: 2.0), child: ListTile( onTap: () async { var result = await Navigator.of(context).push( MaterialPageRoute( builder: (context) => AlbumTracks( albums[index]["album"], albums[index]["album_id"], albums[index]["artist"] ?? ""))); if (result != null) { Navigator.of(context).pop(result); } }, title: Text( snapshot.data![index]["album"], style: const TextStyle(color: Colors.white), ), trailing: const Icon(Icons.keyboard_arrow_right)), ); }); } return const Text("Loading..."); }, ), ); } } ================================================ FILE: lib/audio/widgets/media_library/media_browse.dart ================================================ // (c) 2020 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) // import 'dart:async'; import 'package:flutter/material.dart'; import 'package:on_audio_query_forked/on_audio_query.dart'; import 'artistAlbums.dart'; class MediaLibraryBrowser extends StatefulWidget { const MediaLibraryBrowser({super.key}); @override _MediaLibraryBrowserState createState() => _MediaLibraryBrowserState(); } class _MediaLibraryBrowserState extends State { final StreamController _refreshController = StreamController(); //Future> songs; static List artists = []; TextEditingController editingController = TextEditingController(); @override void initState() { super.initState(); getArtists(refresh: false); editingController.addListener(() { setState(() {}); }); } Future getArtists({bool refresh = true}) async { final OnAudioQuery audioQuery = OnAudioQuery(); if (artists.isEmpty || refresh) artists = await audioQuery.queryArtists(); _refreshController.add(""); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text("Media Library")), body: Center( child: Column( children: [ TextField( controller: editingController, decoration: const InputDecoration( labelText: "Search", hintText: "Search", prefixIcon: Icon(Icons.search), border: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(25.0)))), ), Expanded( child: StreamBuilder( stream: _refreshController.stream, builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: break; case ConnectionState.waiting: break; case ConnectionState.active: case ConnectionState.done: List _artists; var searchText = editingController.text.toLowerCase(); if (editingController.text.isNotEmpty) { _artists = []; for (var item in artists) { if (item.artist.toLowerCase().contains(searchText)) { _artists.add(item); } } } else { _artists = artists; } return RefreshIndicator( onRefresh: getArtists, child: ListView.builder( itemCount: _artists.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: const EdgeInsets.symmetric(vertical: 2.0), child: ListTile( onTap: () async { var result = await Navigator.of(context) .push(MaterialPageRoute( builder: (context) => ArtistAlbums( _artists[index].artist, artistId: _artists[index].id))); if (result != null) { Navigator.of(context).pop(result); } }, title: Text( _artists[index].artist, ), trailing: const Icon(Icons.keyboard_arrow_right)), ); }), ); } return const Center( child: CircularProgressIndicator.adaptive()); }, ), ), ], ), ), ); } } ================================================ FILE: lib/audio/widgets/online_source/online_source.dart ================================================ // (c) 2020 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) // import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/online_sources/backingTracksCoSource.dart'; import 'package:mighty_plug_manager/audio/online_sources/guitarBackingTracksSource.dart'; import 'search_screen.dart'; class OnlineSourceSearch extends StatefulWidget { const OnlineSourceSearch({Key? key}) : super(key: key); @override _OnlineSourceSearchState createState() => _OnlineSourceSearchState(); } class _OnlineSourceSearchState extends State { int refreshTime = 1; String path = ""; TextEditingController editingController = TextEditingController(); @override void initState() { super.initState(); editingController.addListener(() { setState(() {}); }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text("Online Sources")), body: ListView( children: [ ListTile( leading: const Icon(Icons.cloud), onTap: () async { var result = await Navigator.of(context).push( MaterialPageRoute( builder: (context) => OnlineSearchScreen( source: GuitarBackingTracksSource()))); if (result != null) Navigator.of(context).pop(result); }, title: const Text("guitarbackingtracks.com"), trailing: const Icon(Icons.keyboard_arrow_right)), ListTile( leading: const Icon(Icons.cloud), onTap: () async { var result = await Navigator.of(context).push( MaterialPageRoute( builder: (context) => OnlineSearchScreen( source: BackingTracksCoSource()))); if (result != null) Navigator.of(context).pop(result); }, title: const Text("backingtracks.co"), trailing: const Icon(Icons.keyboard_arrow_right)) ], )); } } ================================================ FILE: lib/audio/widgets/online_source/search_screen.dart ================================================ // (c) 2020 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) // import 'package:flutter/material.dart'; import 'package:just_audio/just_audio.dart'; import 'package:mighty_plug_manager/UI/widgets/common/nestedWillPopScope.dart'; import 'package:mighty_plug_manager/audio/online_sources/onlineSource.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:mighty_plug_manager/audio/online_sources/onlineTrack.dart'; class OnlineSearchScreen extends StatefulWidget { final OnlineSource source; const OnlineSearchScreen({Key? key, required this.source}) : super(key: key); @override State createState() => _OnlineSearchScreenState(); } class _OnlineSearchScreenState extends State { List tracks = []; bool loading = false; TextEditingController editingController = TextEditingController(); AudioPlayer? player; int? playedTrack; //multiselection bool _multiselectMode = false; Map selected = {}; @override void initState() { super.initState(); editingController.addListener(() { setState(() {}); }); } void multiselectHandler(int index) { if (selected.isEmpty || !selected.containsKey(index)) { //fill it first if not created selected[index] = true; _multiselectMode = true; } else { selected.remove(index); if (selected.isEmpty) _multiselectMode = false; } setState(() {}); } void deselectAll() { selected.clear(); _multiselectMode = false; setState(() {}); } Widget? createTrailingWidget(BuildContext context, int index) { if (_multiselectMode) { return Icon( selected.containsKey(index) ? Icons.check_circle : Icons.brightness_1_outlined, color: selected.containsKey(index) ? null : Colors.grey[800], ); } return null; } void onSubmit() async { setState(() { loading = true; }); tracks = await widget.source.getSearchResults(editingController.text); setState(() { loading = false; }); } void closeTrack() { player?.dispose(); player = null; playedTrack = null; setState(() {}); } void previewPlay(int index) async { if (playedTrack != null && index == playedTrack) { // player?.pause(); // setState(() {}); return; } await player?.dispose(); if (tracks[index].url == "") { tracks[index].url = await widget.source.getPreviewUrl(tracks[index]); } var as = ProgressiveAudioSource(Uri.parse(tracks[index].url)); player = AudioPlayer(); await player?.setAudioSource(as); player?.play(); player?.positionStream.listen((event) { setState(() {}); }); print("index $index"); playedTrack = index; setState(() {}); } @override Widget build(BuildContext context) { return NestedWillPopScope( onWillPop: () { if (_multiselectMode) { deselectAll(); return Future.value(false); } closeTrack(); return Future.value(true); }, child: Scaffold( appBar: AppBar(title: Text(widget.source.name)), body: ListTileTheme( minLeadingWidth: 0, selectedTileColor: const Color.fromARGB(255, 9, 51, 116), selectedColor: Colors.white, child: Column( children: [ TypeAheadField( builder: (context, controller, focusNode) { return TextField( autofocus: true, controller: editingController, onSubmitted: (value) => onSubmit(), decoration: const InputDecoration( border: OutlineInputBorder(), hintText: "Search", prefixIcon: Icon(Icons.search), )); }, suggestionsCallback: (pattern) async { return await widget.source.getSuggestions(pattern); }, itemBuilder: (context, suggestion) { return ListTile( title: Text(suggestion.toString()), ); }, onSelected: (suggestion) async { editingController.text = suggestion.toString(); onSubmit(); }, ), Expanded( child: IndexedStack( alignment: Alignment.center, index: loading == true ? 0 : 1, children: [ const CircularProgressIndicator.adaptive(), ListView.builder( itemBuilder: (context, index) { return ListTile( selected: _multiselectMode && selected.containsKey(index), onTap: () async { if (_multiselectMode) { multiselectHandler(index); return; } //return list of 1 track tracks[index].url = await widget.source .getTrackUri(tracks[index]); closeTrack(); Navigator.of(context).pop([tracks[index]]); }, onLongPress: () => multiselectHandler(index), leading: ColoredBox( color: Colors.red, child: IconButton( icon: Icon( index == playedTrack ? Icons.pause : Icons.play_arrow, size: 30, ), onPressed: () => previewPlay(index), ), ), title: Text(tracks[index].artist), subtitle: Text(tracks[index].title), trailing: createTrailingWidget(context, index)); }, itemCount: tracks.length, ), ], ), ), if (player != null) ListTile( title: Slider( max: player?.duration?.inSeconds.toDouble() ?? 1, value: player?.position.inSeconds.toDouble() ?? 0, onChanged: (value) { player?.seek(Duration(seconds: value.round())); setState(() {}); }, ), trailing: IconButton( icon: const Icon(Icons.close), onPressed: closeTrack, ), ) ], ), ), floatingActionButton: _multiselectMode && selected.isNotEmpty ? FloatingActionButton( onPressed: () async { List sel = []; for (int i = 0; i < selected.length; i++) { var index = selected.keys.elementAt(i); if (selected[index] == true) { tracks[index].url = await widget.source.getTrackUri(tracks[index]); sel.add(tracks[index]); } } closeTrack(); Navigator.of(context).pop(sel); }, backgroundColor: Colors.blue, foregroundColor: Colors.white, shape: const StadiumBorder(), child: const Icon(Icons.add), ) : null, ), ); } } ================================================ FILE: lib/audio/widgets/painted_waveform.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/models/trackAutomation.dart'; import 'package:mighty_plug_manager/audio/models/waveform_data.dart'; import 'package:mighty_plug_manager/audio/widgets/waveform_painter.dart'; import '../automationController.dart'; class PaintedWaveform extends StatefulWidget { final double dragHandlesheight = 56; final Function(int) onWaveformTap; final Function onEventSelectionChanged; final WaveformData? sampleData; final int currentSample; final AutomationEventType? showType; final AutomationController automation; final Function(double, double) onTimingData; final List channelColors; const PaintedWaveform( {Key? key, required this.sampleData, required this.onWaveformTap, required this.onEventSelectionChanged, required this.currentSample, required this.automation, required this.showType, required this.onTimingData, required this.channelColors}) : super(key: key); @override _PaintedWaveformState createState() => _PaintedWaveformState(); } class _PaintedWaveformState extends State { int startPosition = 0; int endPosition = 0; double canvasSize = 0; late Offset _startingFocalPoint; double _previousOffset = 0; double _offset = 0; // where the top left corner of the waveform is drawn double _previousScale = 0; double _scale = 0; bool isSingle = true; bool layoutBuilt = false; @override void initState() { super.initState(); } void initScaling() { endPosition = widget.sampleData!.data.length - 1; //get initial scale. endPosition is essentialy waveform width _scale = canvasSize / endPosition; double fitted = endPosition * _scale; _offset = canvasSize - fitted; layoutBuilt = true; } void scroll(d) { if (widget.sampleData == null) return; var _fullScale = widget.sampleData!.data.length / canvasSize; var _position = (d.localPosition.dx * _fullScale).round(); var _extent = ((endPosition - startPosition) / 2).round(); if (_position - _extent < 0) _position = _extent; if (_position + _extent > widget.sampleData!.data.length - 1) { _position = widget.sampleData!.data.length - 1 - _extent; } startPosition = _position - _extent; endPosition = _position + _extent; _offset = -_scale * startPosition; setState(() {}); } void zoomViewOnTapUp(TapUpDetails e) { { int sample = ((e.localPosition.dx / canvasSize) * (endPosition - startPosition) + startPosition) .floor(); widget.onWaveformTap.call(sample); } } void zoomViewScaleStart(ScaleStartDetails d) { _startingFocalPoint = d.focalPoint; _previousOffset = _offset; _previousScale = _scale; } void zoomViewScaleUpdate(ScaleUpdateDetails d) { if (d.scale == 1) { isSingle = true; //return; } isSingle = false; double newScale = _previousScale * d.scale; //if (newScale > 50 || newScale < 0.01) { // return; //} // Ensure that item under the focal point stays in the same place despite zooming final double normalizedOffset = (_startingFocalPoint.dx - _previousOffset) / _previousScale; final double newOffset = d.focalPoint.dx - normalizedOffset * newScale; setState(() { var _oldScale = _scale; var _oldOffset = _offset; _scale = newScale; _offset = newOffset; //limit left boundary if (_offset > 0) { _offset = 0; } startPosition = -(_offset / _scale).round(); //limit right boundary if (canvasSize / _scale + startPosition > widget.sampleData!.data.length - 1) { _offset = _oldOffset; //i think we should not manipulate the scale //we should adjust the offset endPosition = widget.sampleData!.data.length - 1; //calculate offset based on end position and new scale startPosition = endPosition - (canvasSize / _scale).round(); _scale = _oldScale; if (startPosition < 0) startPosition = 0; } else { endPosition = (startPosition + canvasSize / _scale).round(); } }); } Widget _eventPointer( AutomationEvent event, double msPerSample, double samplesPerPixel) { bool empty = event.type == AutomationEventType.preset && event.getPresetUuid().isEmpty; return Positioned( left: (((event.eventTime.inMilliseconds * msPerSample) - startPosition) / (endPosition - startPosition)) * canvasSize - widget.dragHandlesheight / 2 - 9, child: GestureDetector( onHorizontalDragUpdate: (d) { widget.automation.selectedEvent = event; //get samples per pixel setState(() { event.eventTime += Duration( milliseconds: (d.delta.dx * (samplesPerPixel / msPerSample)).round()); }); }, onHorizontalDragEnd: (d) { widget.automation.selectedEvent = event; widget.onEventSelectionChanged(); widget.automation.sortEvents(); //update automation setState(() {}); }, child: ClipPath( clipper: GuitarPickClipper(), child: ElevatedButton( onPressed: () { widget.automation.selectedEvent = event; widget.onEventSelectionChanged(); setState(() {}); }, style: ElevatedButton.styleFrom( shape: const CircleBorder(), padding: const EdgeInsets.fromLTRB(24, 20, 24, 15), backgroundColor: empty ? Colors.grey : widget.channelColors[event.channel], // <-- Button color foregroundColor: Colors.black, // <-- Splash color ), child: Icon(widget.automation.selectedEvent == event ? Icons.circle : null)), ), ), ); } @override Widget build(context) { double msPerSample = 0; //double time = 0; List automationEventButtons = []; if (layoutBuilt == true && widget.sampleData != null) { msPerSample = widget.sampleData!.data.length / widget.automation.duration.inMilliseconds; var samplesPerPixel = ((endPosition - startPosition) / canvasSize); widget.onTimingData(samplesPerPixel, msPerSample); //time = (widget.currentSample / msPerSample) / 1000; //create automation event handles (TODO: move them in separate widget) for (int i = 0; i < widget.automation.events.length; i++) { var element = widget.automation.events[i]; if (element.type != widget.showType) continue; Widget w = _eventPointer(element, msPerSample, samplesPerPixel); automationEventButtons.add(w); } } return ColoredBox( color: Colors.grey[900]!, child: LayoutBuilder( builder: (context, BoxConstraints constraints) { // adjust the shape based on parent's orientation/shape if (canvasSize == 0 && widget.sampleData != null) { canvasSize = constraints.maxWidth; initScaling(); } return Column( children: [ Expanded( flex: 1, child: GestureDetector( behavior: HitTestBehavior.translucent, onTapUp: scroll, onHorizontalDragUpdate: scroll, child: CustomPaint( size: Size( constraints.maxWidth, constraints.maxHeight, ), foregroundPainter: WaveformPainter( widget.sampleData, endingFrame: endPosition, startingFrame: startPosition, currentSample: widget.currentSample, automation: widget.automation, showType: widget.showType, overallWaveform: true, color: const Color(0xff3994DB), ), ), ), ), Expanded( flex: 2, child: GestureDetector( behavior: HitTestBehavior.translucent, onTapUp: zoomViewOnTapUp, onScaleStart: zoomViewScaleStart, onScaleUpdate: zoomViewScaleUpdate, child: CustomPaint( size: Size( constraints.maxWidth, constraints.maxHeight, ), foregroundPainter: WaveformPainter( widget.sampleData, endingFrame: endPosition, startingFrame: startPosition, currentSample: widget.currentSample, overallWaveform: false, automation: widget.automation, showType: widget.showType, color: const Color(0xff3994DB), ), ), ), ), //container for event handles Container( decoration: BoxDecoration( border: Border.all(color: Colors.grey), color: Colors.black), height: widget.dragHandlesheight, child: Stack( children: automationEventButtons, ), ), //Text(time.floor().toString()) ], ); }, ), ); } } class GuitarPickClipper extends CustomClipper { @override getClip(Size size) { var path = Path(); path.moveTo(size.width * 0.5, 0); path.cubicTo(size.width * 0.9, size.height * 0.5, size.width * 0.9, size.height * 0.9, size.width * 0.5, size.height * 0.9); path.cubicTo(size.width * 0.1, size.height * 0.9, size.width * 0.1, size.height * 0.5, size.width * 0.5, 0); return path; } @override bool shouldReclip(CustomClipper oldClipper) { return true; } } ================================================ FILE: lib/audio/widgets/presetsPanel.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/popups/selectPreset.dart'; import 'package:mighty_plug_manager/audio/models/trackAutomation.dart'; import '../automationController.dart'; class PresetsPanel extends StatelessWidget { final AutomationController automation; final Function(Map) onSelectedPreset; final Function(AutomationEvent) onDuplicateEvent; final Function(AutomationEvent, bool) onEditEvent; final Function onDelete; const PresetsPanel( {Key? key, required this.onSelectedPreset, required this.automation, required this.onDelete, required this.onEditEvent, required this.onDuplicateEvent}) : super(key: key); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), child: ListView( //crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Row( children: [ Expanded( child: ElevatedButton( onPressed: () { showDialog( context: context, builder: (BuildContext context) => SelectPresetDialog() .buildDialog(context, noneOption: false), ).then((value) { if (value != null) { onSelectedPreset(value); } }); }, child: const Text("Insert Event"), ), ), const SizedBox( width: 8, ), Expanded( child: ElevatedButton( onPressed: automation.selectedEvent != null ? () { onDuplicateEvent(automation.selectedEvent!); } : null, child: const Text("Duplicate"), ), ), ], ), Row( children: [ Expanded( child: ElevatedButton( onPressed: automation.selectedEvent == null ? null : () { onEditEvent(automation.selectedEvent!, false); }, child: const Text("Edit"), ), ), const SizedBox( width: 8, ), Expanded( child: ElevatedButton( onPressed: automation.selectedEvent == null ? null : () { onDelete(); }, child: const Text("Delete"), ), ) ], ), MaterialButton( color: automation.initialEvent.getPresetUuid() == "" ? Colors.orange[700] : Colors.blue, textColor: Colors.white, child: const Text("Edit Initial Parameters"), onPressed: () { onEditEvent(automation.initialEvent, true); }, ), ], ), ); } } ================================================ FILE: lib/audio/widgets/setlistPlayer.dart ================================================ import 'dart:async'; import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:marquee_text/marquee_text.dart'; import 'package:mighty_plug_manager/UI/widgets/thickSlider.dart'; import '../../UI/mightierIcons.dart'; import '../../UI/widgets/VolumeDrawer.dart'; import '../../bluetooth/NuxDeviceControl.dart'; import '../../platform/platformUtils.dart'; import '../../platform/simpleSharedPrefs.dart'; import '../automationController.dart'; import '../setlist_player/setlistPlayerState.dart'; import 'speedPanel.dart'; class SetlistPlayer extends StatefulWidget { const SetlistPlayer({Key? key}) : super(key: key); @override State createState() => _SetlistPlayerState(); } class _SetlistPlayerState extends State { final animationDuration = const Duration(milliseconds: 200); final SetlistPlayerState playerState = SetlistPlayerState.instance(); StreamSubscription? _positionSub; @override void initState() { super.initState(); playerState.addListener(_onPlayerStateChange); _positionSub = playerState.positionStream.listen(_onPlayerPosition); NuxDeviceControl().addListener(_onPlayerStateChange); } @override void dispose() { super.dispose(); playerState.removeListener(_onPlayerStateChange); NuxDeviceControl().removeListener(_onPlayerStateChange); _positionSub?.cancel(); } void _onPlayerPosition(Duration position) { setState(() {}); } void _onPlayerStateChange() { setState(() {}); } @override Widget build(BuildContext context) { return createPlayerView(context); } Widget? createTitle() { return MarqueeText( text: TextSpan( text: playerState.setlist?.items[playerState.currentTrack] .trackReference?.name ?? "No Track"), speed: 20, ); } Widget createPlayerView(BuildContext context) { return LayoutBuilder(builder: (context, constraints) { return Material( color: Theme.of(context).scaffoldBackgroundColor, child: ListView( //crossAxisAlignment: CrossAxisAlignment.stretch, //physics: const NeverScrollableScrollPhysics(), children: [ ListTile( tileColor: Colors.grey[850], leading: IconButton( iconSize: 32, onPressed: playerState.toggleExpanded, icon: const Icon(Icons.keyboard_arrow_down), ), title: createTitle(), ), Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: createFullTrackControls(constraints), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: Row( children: [ Text(playerState.getMMSS(playerState.currentPosition)), Expanded( child: SliderTheme( data: SliderThemeData( trackShape: SliderRepeatTrackShape(state: playerState)), child: Slider( value: playerState.currentPosition.inMilliseconds.toDouble(), onChanged: (value) { setState(() { playerState.setPosition(value.round()); }); }, max: playerState.getDuration().inMilliseconds.toDouble(), onChangeStart: (val) { playerState.setPositionUpdateMode(true); }, onChangeEnd: (val) { playerState.setPosition(val.round()); playerState.setPositionUpdateMode(false); }, ), )), Text(playerState.getMMSS(playerState.getDuration())) ], ), ), /*ListTile( title: Text("Current preset: aoufh"), ),*/ CheckboxListTile( title: const Text("Auto Advance"), value: playerState.autoAdvance, onChanged: (value) { playerState.autoAdvance = value ?? true; setState(() {}); }), if (playerState.automation != null && playerState.automation!.loopEnable && playerState.automation!.abRepeatState != ABRepeatState.addedB) ListTile( title: Text("Loop ${createLoopLabel()}"), trailing: ElevatedButton( child: const Text("Cancel Loop"), onPressed: () { playerState.automation?.forceLoopDisable(); setState(() {}); }, ), ), SpeedPanel( compact: true, onSemitonesChanged: (val) { playerState.pitch = val; playerState.automation?.setPitch(val); setState(() {}); }, onSpeedChanged: (speed) { playerState.speed = speed; playerState.automation?.setSpeed(speed); setState(() {}); }, semitones: playerState.pitch, speed: playerState.speed, ), if (PlatformUtils.isAndroid) ThickSlider( activeColor: playerState.gain <= 0 ? Colors.blue : playerState.gain < 12 ? Colors.amber : Colors.red, label: "Track Gain", value: playerState.gain, min: -20, max: 20, snapToCenter: true, labelFormatter: (val) => "${playerState.gain.toStringAsFixed(1)} db", onChanged: (value, skip) { playerState.gain = value; setState(() {}); }, onDragEnd: (value) { SharedPrefs() .setValue(SettingsKeys.trackGain, playerState.gain); }, ), const VolumeSlider(label: "Amp Volume") ], ), ); }); } String createLoopLabel() { if (playerState.automation!.loopTimes == 0) return "∞"; return "${playerState.automation!.currentLoop}/${playerState.automation!.loopTimes}"; } IconData getABRepeatIcon() { switch (SetlistPlayerState.instance().abRepeat) { case ABRepeatState.off: return MightierIcons.repeat; case ABRepeatState.addedA: return MightierIcons.repeat_a; case ABRepeatState.addedB: return MightierIcons.repeat_ab; } } List createFullTrackControls(BoxConstraints constraints) { var totalIconSize = constraints.maxWidth.floorToDouble() / 6; totalIconSize = math.min(totalIconSize, 70); var iconSize = totalIconSize - 14; var padding = const EdgeInsets.all(7); return [ IconButton( padding: padding, onPressed: () { playerState.previous(); }, iconSize: iconSize, icon: const Icon( Icons.skip_previous, color: Colors.white, ), ), IconButton( padding: padding, onPressed: () { playerState.setPosition( (playerState.currentPosition + const Duration(seconds: -5)) .inMilliseconds); }, iconSize: iconSize, icon: const Icon( Icons.fast_rewind, color: Colors.white, ), ), IconButton( padding: padding, onPressed: () { playerState.playPause(); }, iconSize: iconSize, icon: Icon( playerState.state == PlayerState.play ? Icons.pause : Icons.play_arrow, color: Colors.white, ), ), IconButton( padding: padding, onPressed: () { playerState.setPosition( (playerState.currentPosition + const Duration(seconds: 5)) .inMilliseconds); }, iconSize: iconSize, icon: const Icon( Icons.fast_forward, color: Colors.white, ), ), IconButton( padding: padding, onPressed: playerState.next, iconSize: iconSize, icon: const Icon( Icons.skip_next, color: Colors.white, ), ), IconButton( padding: padding, onPressed: playerState.toggleABRepeat, iconSize: iconSize, icon: Icon( getABRepeatIcon(), color: Colors.white, ), ), ]; } } class SliderRepeatTrackShape extends RoundedRectSliderTrackShape { final SetlistPlayerState state; double p1 = 0, p2 = 0; bool loopEnabled = false; final Paint repeatPaintOff = Paint() ..style = PaintingStyle.stroke ..color = Colors.grey[700]! ..strokeWidth = 2; final Paint repeatPaint = Paint() ..style = PaintingStyle.stroke ..color = Colors.green ..strokeWidth = 2; SliderRepeatTrackShape({required this.state}) { if (state.automation != null && state.automation!.loopEnable == true) { loopEnabled = true; var points = state.automation!.getLoopPoints(); var dur = state.automation!.duration.inMicroseconds; if (points.length == 2 && state.automation!.useLoopPoints) { p1 = points[0].eventTime.inMicroseconds / dur; p2 = points[1].eventTime.inMicroseconds / dur; } else if (!state.automation!.useLoopPoints) { p1 = 0; p2 = 1; } } } @override void paint( PaintingContext context, Offset offset, { required RenderBox parentBox, required SliderThemeData sliderTheme, required Animation enableAnimation, required TextDirection textDirection, required Offset thumbCenter, Offset? secondaryOffset, bool isDiscrete = false, bool isEnabled = false, double additionalActiveTrackHeight = 2, }) { final Rect trackRect = getPreferredRect( parentBox: parentBox, offset: offset, sliderTheme: sliderTheme, isEnabled: isEnabled, isDiscrete: isDiscrete, ); if (state.automation != null && loopEnabled) { var pos1 = (trackRect.right - trackRect.left) * p1 + trackRect.left; var pos2 = (trackRect.right - trackRect.left) * p2 + trackRect.left; var posPercentage = state.currentPosition.inMicroseconds / state.automation!.duration.inMicroseconds; var paint = repeatPaintOff; if (posPercentage >= p1 && (state.automation!.loopTimes == 0 || state.automation!.currentLoop < state.automation!.loopTimes)) { paint = repeatPaint; } context.canvas.drawRect( Rect.fromLTRB( pos1, (textDirection == TextDirection.ltr) ? trackRect.top - additionalActiveTrackHeight * 4 : trackRect.top, pos2, (textDirection == TextDirection.ltr) ? trackRect.bottom + additionalActiveTrackHeight * 4 : trackRect.bottom, ), paint); } super.paint(context, offset, parentBox: parentBox, sliderTheme: sliderTheme, enableAnimation: enableAnimation, textDirection: textDirection, thumbCenter: thumbCenter); } } class SetlistMiniPlayer extends StatefulWidget { const SetlistMiniPlayer({Key? key}) : super(key: key); @override State createState() => SetlistMiniPlayerState(); } class SetlistMiniPlayerState extends State { final SetlistPlayerState playerState = SetlistPlayerState.instance(); StreamSubscription? _positionSub; @override void initState() { super.initState(); playerState.addListener(_onPlayerStateChange); _positionSub = playerState.positionStream.listen(_opPlayerPosition); } @override void dispose() { super.dispose(); playerState.removeListener(_onPlayerStateChange); _positionSub?.cancel(); } void _opPlayerPosition(Duration position) { setState(() {}); } void _onPlayerStateChange() { setState(() {}); } Widget? createTitle() { return MarqueeText( text: TextSpan( text: playerState.setlist?.items[playerState.currentTrack] .trackReference?.name ?? "No Track"), speed: 20, ); } List createMiniTrackControls() { return [ IconButton( onPressed: playerState.playPause, icon: Icon( playerState.state == PlayerState.play ? Icons.pause : Icons.play_arrow, color: Colors.white, size: 30, ), ), IconButton( onPressed: playerState.next, icon: const Icon( Icons.skip_next, color: Colors.white, size: 30, ), ) ]; } @override Widget build(BuildContext context) { return Material( color: Colors.grey[850], child: ListTile( onTap: playerState.toggleExpanded, leading: IconButton( iconSize: 32, onPressed: playerState.toggleExpanded, icon: const Icon(Icons.keyboard_arrow_up), ), minLeadingWidth: 0, title: createTitle(), trailing: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: createMiniTrackControls()), ), ); } } ================================================ FILE: lib/audio/widgets/speedPanel.dart ================================================ import 'dart:math'; import 'package:flutter/material.dart'; import '../../UI/widgets/hold_to_repeat.dart'; import '../../platform/platformUtils.dart'; class SpeedPanel extends StatelessWidget { final double speed; final int semitones; final bool compact; final Function(double) onSpeedChanged; final Function(int) onSemitonesChanged; const SpeedPanel( {Key? key, required this.speed, required this.semitones, required this.onSpeedChanged, required this.onSemitonesChanged, this.compact = false}) : super(key: key); void _modifySpeed(double amount) { var _speed = speed + amount; _speed = min(max(_speed, 0.1), 2.5); onSpeedChanged(_speed); } void _modifyPitch(int amount) { var _semitones = semitones + amount; _semitones = min(max(_semitones, -12), 12); onSemitonesChanged(_semitones); } Widget _speedControl() { return Row( children: [ HoldToRepeat( onPressed: () => _modifySpeed(-0.02), child: const Padding( padding: EdgeInsets.all(16), child: Icon(Icons.remove_circle_outlined)), ), InkWell( onTap: () => onSpeedChanged(1), child: SizedBox( width: 58, child: Column( children: [ const Icon(Icons.speed), Text("${(speed * 100).round()}%") ], ), ), ), HoldToRepeat( onPressed: () => _modifySpeed(0.02), child: const Padding( padding: EdgeInsets.all(16), child: Icon(Icons.add_circle_outlined)), ), ], ); } Widget _pitchControl() { return Row( children: [ IconButton( padding: const EdgeInsets.all(16), onPressed: () => _modifyPitch(-1), icon: const Icon(Icons.remove_circle_outlined)), InkWell( onTap: () => onSemitonesChanged(0), child: SizedBox( width: 58, child: Column( children: [ const Icon(Icons.music_note), Text("${semitones > 0 ? "+" : ""}$semitones semi") ], ), ), ), IconButton( padding: const EdgeInsets.all(16), onPressed: () => _modifyPitch(1), icon: const Icon(Icons.add_circle_outlined)), ], ); } @override Widget build(BuildContext context) { return Column( children: [ if (compact) Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: PlatformUtils.isIOS ? MainAxisAlignment.center : MainAxisAlignment.spaceBetween, children: [ _speedControl(), if (!PlatformUtils.isIOS) _pitchControl(), ]), if (!compact) ListTile( title: Text("Speed: ${(speed * 100).round()}%"), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( onPressed: () => _modifySpeed(-0.02), child: const Text("-")), ElevatedButton( onPressed: () => _modifySpeed(0.02), child: const Text("+")) ], ), ), if (!compact && !PlatformUtils.isIOS) ListTile( title: Text("Pitch: ${semitones > 0 ? "+" : ""}$semitones semitones"), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( onPressed: () => _modifyPitch(-1), child: const Text("-")), ElevatedButton( onPressed: () => _modifyPitch(1), child: const Text("+")) ], ), ), ], ); } } ================================================ FILE: lib/audio/widgets/waveform_painter.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/audio/models/trackAutomation.dart'; import '../../bluetooth/devices/presets/preset_constants.dart'; import '../automationController.dart'; import '../models/waveform_data.dart'; class WaveformPainter extends CustomPainter { final WaveformData? data; final int startingFrame; final int endingFrame; final int currentSample; final bool overallWaveform; final AutomationController automation; final AutomationEventType? showType; late Paint painter; final Color color; final double strokeWidth; final Paint playbackPaint = Paint() ..color = Colors.grey[200]! ..strokeWidth = 1 ..style = PaintingStyle.stroke; final List channelPaints = []; final Paint greyPaint = Paint(); WaveformPainter(this.data, {this.strokeWidth = 1.0, this.startingFrame = 0, this.endingFrame = 1, this.currentSample = 0, required this.automation, required this.showType, this.overallWaveform = false, this.color = Colors.blue}) { painter = Paint() ..style = PaintingStyle.fill ..color = color ..strokeWidth = strokeWidth ..isAntiAlias = true; for (int i = 0; i < PresetConstants.channelColorsPlug.length; i++) { var _paint = Paint() ..color = PresetConstants.channelColorsPlug[i] ..strokeWidth = 1 ..style = PaintingStyle.stroke; channelPaints.add(_paint); } greyPaint ..color = Colors.grey ..strokeWidth = 1 ..style = PaintingStyle.stroke; } @override void paint(Canvas canvas, Size size) { if (data == null || !data!.initialized) { return; } var _start = startingFrame, _end = endingFrame; if (!overallWaveform) { final path = data!.path(size, fromFrame: startingFrame, toFrame: endingFrame); if (path != null) canvas.drawPath(path, painter); if (currentSample >= startingFrame && currentSample <= endingFrame) { double dx = data!.verticalLine(size, currentSample, startingFrame, endingFrame); canvas.drawLine(Offset(dx, 0), Offset(dx, size.height), playbackPaint); } } else { _start = 0; _end = data!.data.length; final path = data!.overallPath(size); if (path != null) canvas.drawPath(path, painter); double dx = data!.verticalLine(size, startingFrame, 0, data!.data.length); double dy = data!.verticalLine(size, endingFrame, 0, data!.data.length); //draw currently visible rectangle var rrect = Rect.fromLTRB(dx, 0, dy, size.height); canvas.drawRect(rrect, playbackPaint); //draw playback needle dx = data!.verticalLine(size, currentSample, 0, data!.data.length); canvas.drawLine(Offset(dx, 0), Offset(dx, size.height), playbackPaint); } var msPerSample = data!.data.length / automation.duration.inMilliseconds; //draw events int realIndex = 0; for (int i = 0; i < automation.events.length; i++) { var element = automation.events[i]; var paint = channelPaints[element.channel]; if (element.type == AutomationEventType.preset && element.getPresetUuid().isEmpty) paint = greyPaint; if (element.type != showType) continue; var dx = (((element.eventTime.inMilliseconds * msPerSample) - _start) / (_end - _start)) * size.width; if (dx < 0 || dx > size.width - 1) continue; canvas.drawLine(Offset(dx, 0), Offset(dx, size.height), paint); //add labels if (!overallWaveform) { var paragraphBuilder = ui.ParagraphBuilder(ui.ParagraphStyle()) ..pushStyle(ui.TextStyle( color: PresetConstants.channelColorsPlug[element.channel])) ..addText(element.name); final ui.Paragraph paragraph = paragraphBuilder.build() ..layout(ui.ParagraphConstraints(width: size.width - 12.0 - 12.0)); canvas.drawParagraph(paragraph, Offset(dx + 2, 6 + realIndex % 3 * 13)); } realIndex++; } } @override bool shouldRepaint(WaveformPainter oldDelegate) { if (oldDelegate.data != data) { debugPrint("Redrawing"); return true; } return false; } } ================================================ FILE: lib/bluetooth/NuxDeviceControl.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMighty8BT.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMighty8BTMk2.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import 'package:mighty_plug_manager/utilities/list_extenstions.dart'; import 'package:undo/undo.dart'; import 'bleMidiHandler.dart'; import 'ble_controllers/BLEController.dart'; import 'devices/NuxConstants.dart'; import 'devices/NuxDevice.dart'; import 'devices/NuxMighty2040BT.dart'; import 'devices/NuxMightyLite.dart'; import 'devices/NuxMightyLiteMk2.dart'; import 'devices/NuxMightyPlugAir.dart'; import 'devices/NuxMightyPlugPro.dart'; import 'devices/NuxMightySpace.dart'; import 'devices/effects/Processor.dart'; enum DeviceConnectionState { connectionBegin, presetsLoaded, connectionComplete, disconnected } class NuxDiagnosticData { String device = ""; bool connected = false; String lastNuxPreset = ""; Map toMap(bool includeJsonPreset) { var data = {}; data['device'] = device; data['connected'] = connected; data['lastNuxPreset'] = lastNuxPreset; if (includeJsonPreset) { data['jsonPreset'] = NuxDeviceControl.instance().device.presetToJson(); } return data; } } class NuxDeviceControl extends ChangeNotifier { static final NuxDeviceControl _nuxDeviceControl = NuxDeviceControl._(); final BLEMidiHandler _midiHandler = BLEMidiHandler.instance(); factory NuxDeviceControl.instance() { return _nuxDeviceControl; } NuxDiagnosticData diagData = NuxDiagnosticData(); //holds current device late NuxDevice _device; StreamSubscription>? rxSubscription; Timer? batteryTimer; //Preset Name Stuff String _presetName = ""; String presetCategory = ""; String presetUUID = ""; String get presetName => _presetName; set presetName(String name) { _presetName = name; presetNameNotifier.value = name; } ValueNotifier presetNameNotifier = ValueNotifier(""); ValueNotifier masterVolumeNotifier = ValueNotifier(100); double _masterVolume = 100; ChangeStack get changes => device.presets[device.selectedChannel].changes; bool developer = false; Function(List)? onDataReceiveDebug; double get masterVolume { if (device.fakeMasterVolume) { return _masterVolume; } else { return device.presets[device.selectedChannel].volume; } } set masterVolume(double vol) { masterVolumeNotifier.value = vol; if (device.fakeMasterVolume) { _masterVolume = vol; if (isConnected) { device.sendAmpLevel(); } } else { device.presets[device.selectedChannel].volume = vol; } } //connect status control final StreamController _connectStatus = StreamController.broadcast(); final StreamController _batteryPercentage = StreamController.broadcast(); Stream get connectStatus => _connectStatus.stream; Stream get batteryPercentage => _batteryPercentage.stream; bool get isConnected => _midiHandler.connectedDevice != null; //list of all different nux devices final List _deviceInstances = []; List get deviceList => _deviceInstances; List deviceBLEName() { var names = []; for (int i = 0; i < _deviceInstances.length; i++) { names.addAll(_deviceInstances[i].productBLENames); } return names; } List get deviceNameList { var names = []; for (int i = 0; i < _deviceInstances.length; i++) { names.add(_deviceInstances[i].productNameShort); } return names; } int get deviceIndex { for (int i = 0; i < _deviceInstances.length; i++) { if (_device == _deviceInstances[i]) return i; } return 0; } set deviceIndex(int index) { _clearAllDevicesStack(); clearPresetData(); _device = _deviceInstances[index]; updateDiagnosticsData(); SharedPrefs().setValue(SettingsKeys.device, _device.productStringId); SharedPrefs().setValue(SettingsKeys.deviceVersion, _device.productVersion); notifyListeners(); } List get deviceVersionsList { var names = []; for (int i = 0; i < device.getAvailableVersions(); i++) { names.add(device.getProductNameVersion(i)); } return names; } int get deviceFirmwareVersion => device.productVersion; set deviceFirmwareVersion(int ver) { _clearDeviceStack(); clearPresetData(); device.setFirmwareVersionByIndex(ver); SharedPrefs().setValue(SettingsKeys.deviceVersion, ver); } NuxDevice deviceFromBLEId(String id) { for (int i = 0; i < _deviceInstances.length; i++) { if (_deviceInstances[i].productBLENames.containsPartial(id)) { return _deviceInstances[i]; } } //return plug/air by default return _deviceInstances[0]; } String getDeviceNameFromId(String id) { for (int i = 0; i < _deviceInstances.length; i++) { if (_deviceInstances[i].productStringId == id) { return _deviceInstances[i].productNameShort; } } return "Unknown"; } NuxDevice? getDeviceFromId(String id) { for (int i = 0; i < _deviceInstances.length; i++) { if (_deviceInstances[i].productStringId == id) return _deviceInstances[i]; } return null; } NuxDevice? getDeviceFromPresetClass(String presetClass) { for (int i = 0; i < _deviceInstances.length; i++) { if (_deviceInstances[i].presetClass == presetClass) { return _deviceInstances[i]; } } return null; } _clearDeviceStack({NuxDevice? device}) { bool notify = device == null; device ??= _device; for (int i = 0; i < device.channelsCount; i++) { device.presets[i].changes.clearHistory(); } if (notify) notifyListeners(); } _clearAllDevicesStack() { for (int i = 0; i < _deviceInstances.length; i++) { _clearDeviceStack(device: _deviceInstances[i]); } } undoStackChanged() { notifyListeners(); } void clearPresetData() { presetName = ""; presetCategory = ""; presetUUID = ""; } forceNotifyListeners() { notifyListeners(); } factory NuxDeviceControl() { return _nuxDeviceControl; } NuxDeviceControl._() { _midiHandler.setAmpDeviceIdProvider(deviceBLEName); _midiHandler.status.listen(_statusListener); //create all supported devices _deviceInstances.add(NuxMightyPlug(this)); _deviceInstances.add(NuxMightyPlugPro(this)); _deviceInstances.add(NuxMightySpace(this)); _deviceInstances.add(NuxMighty8BT(this)); _deviceInstances.add(NuxMighty2040BT(this)); _deviceInstances.add(NuxMightyLite(this)); _deviceInstances.add(NuxMightyLiteMk2(this)); _deviceInstances.add(NuxMighty8BTMk2(this)); //make it read from config String dev = SharedPrefs() .getValue(SettingsKeys.device, _deviceInstances[0].productStringId); _device = getDeviceFromId(dev) ?? _deviceInstances[0]; int ver = SharedPrefs().getValue( SettingsKeys.deviceVersion, _device.getAvailableVersions() - 1); _device.setFirmwareVersionByIndex(ver); updateDiagnosticsData(connected: false); if (device.fakeMasterVolume) { masterVolume = SharedPrefs().getValue(SettingsKeys.masterVolume, 100.0); } for (int i = 0; i < _deviceInstances.length; i++) { var dev = _deviceInstances[i]; dev.parameterChanged.stream.listen(parameterChangedListener); _deviceInstances[i].effectChanged.stream.listen(effectChangedListener); _deviceInstances[i].effectSwitched.stream.listen(effectSwitchedListener); _deviceInstances[i].slotSwapped.stream.listen(slotSwappedListener); } } void _statusListener(statusValue) { switch (statusValue) { case MidiSetupStatus.deviceFound: // check if this is valid nux device debugPrint("Devices found ${_midiHandler.nuxDevices}"); for (var dev in _midiHandler.nuxDevices) { //don't autoconnect on manual scan if (!_midiHandler.manualScan) { _midiHandler.connectToDevice(dev.device); } } break; case MidiSetupStatus.deviceConnected: _clearDeviceStack(); //find which device connected if (isConnected) { debugPrint("${_midiHandler.connectedDevice!.name} connected"); _device = deviceFromBLEId(_midiHandler.connectedDevice!.name); updateDiagnosticsData(connected: true); SharedPrefs().setValue(SettingsKeys.device, _device.productStringId); //can't set version yet, firmware is unknown notifyListeners(); _onConnect(); } break; case MidiSetupStatus.deviceDisconnected: _clearDeviceStack(); updateDiagnosticsData(connected: false); notifyListeners(); _onDisconnect(); break; default: break; } } void _onConnect() { clearPresetData(); device.onConnect(); _connectStatus.add(DeviceConnectionState.connectionBegin); rxSubscription = _midiHandler.registerDataListener(_onDataReceive); requestFirmwareVersion(); } void _onDisconnect() { batteryTimer?.cancel(); rxSubscription?.cancel(); clearPresetData(); device.onDisconnect(); debugPrint("Device disconnected"); _connectStatus.add(DeviceConnectionState.disconnected); } void _onDataReceive(List data) { if (developer) onDataReceiveDebug?.call(data); _device.communication.onDataReceive(data); } void _onBatteryTimer(Timer? t) { device.communication.requestBatteryStatus(); } void requestFirmwareVersion() async { await Future.delayed(const Duration(seconds: 1)); var data = device.communication.createFirmwareMessage(); if (data.isNotEmpty) { sendBLEData(data); } else { onFirmwareVersionReady(); } } void onFirmwareVersionReady() { device.communication.performNextConnectionStep(); } void onConnectionStepReady() { if (device.communication.isConnectionReady()) { if (device.batterySupport) { batteryTimer = Timer.periodic(const Duration(seconds: 15), _onBatteryTimer); _onBatteryTimer(null); } device.sendAmpLevel(); _connectStatus.add(DeviceConnectionState.connectionComplete); debugPrint("Device connection complete"); notifyListeners(); } else { device.communication.performNextConnectionStep(); } } bool isConnectionComplete() { return device.communication.isConnectionReady(); } void onPresetsReady() { _connectStatus.add(DeviceConnectionState.presetsLoaded); } //for some reason we should not ask for presets immediately void requestPresetDelayed(int? delay) async { await Future.delayed(Duration(milliseconds: delay ?? 400)); requestPreset(0); } void requestPreset(int index) { sendBLEData(_device.communication.requestPresetByIndex(index)); } void onBatteryPercentage(int val) { _batteryPercentage.add(val); } //preset editing listeners void parameterChangedListener(Parameter param) { if (!isConnected) return; sendParameter(param, false); } void changeDeviceChannel(int channel) { if (!isConnected) return; sendBLEData(device.communication.setChannel(channel)); } void effectChangedListener(int slot) { sendFullEffectSettings(slot, true); } void effectSwitchedListener(int slot) { device.communication.sendSlotEnabledState(slot); } void slotSwappedListener(int slot) { device.communication.sendSlotOrder(); } void sendFullEffectSettings(int slot, bool force) { if (!isConnected) return; var preset = device.getPreset(device.selectedChannel); Processor effect; int index; effect = preset.getEffectsForSlot(slot)[preset.getSelectedEffectForSlot(slot)]; index = effect.nuxIndex; //check if preset switchable bool switchable = preset.slotSwitchable(slot); bool enabled = preset.slotEnabled(slot); bool distinctCCodes = effect.midiCCSelectionValue != effect.midiCCEnableValue; //send parameters only if the effect is on OR is not switchable off bool send = !switchable || (switchable && enabled) || force; send = true; //still buggy, fix it first //send effect type if (effect.midiCCSelectionValue >= 0) { if (distinctCCodes) { if (device.presets[0].getEffectsForSlot(slot).length > 1) { device.communication.sendSlotEffect(slot, index); } } else { device.communication.sendSlotEnabledState(slot); } } //send parameters if (send) { for (int i = 0; i < effect.parameters.length; i++) { sendParameter(effect.parameters[i], false); } } //send switched if (switchable && distinctCCodes) { device.communication.sendSlotEnabledState(slot); } } void sendFullPresetSettings() { if (!isConnected) return; BLEMidiHandler.instance().clearDataQueue(); if (!device.fakeMasterVolume) { device.presets[device.selectedChannel].sendVolume(); } for (var i = 0; i < device.processorList.length; i++) { sendFullEffectSettings(i, false); } if (device.reorderableFXChain) { device.communication.sendSlotOrder(); } } void resetToChannelDefaults() { int channel = device.selectedChannel; changeDeviceChannel(channel); sendFullPresetSettings(); } List sendParameter(Parameter param, bool returnOnly) { int outVal; //implement master volume if (device.fakeMasterVolume && param.masterVolume) { outVal = param.masterVolMidiValue; } else { outVal = param.midiValue; } var data = createCCMessage(param.midiCC, outVal); if (!returnOnly) sendBLEData(data); return data; } void saveNuxPreset() async { if (!isConnected) return; double vol = 0; if (device.fakeMasterVolume) { vol = masterVolume; if (vol < 100) { _masterVolume = 100; device.sendAmpLevel(); await Future.delayed(const Duration(milliseconds: 200)); } } device.communication.saveCurrentPreset(device.selectedChannel); if (device.fakeMasterVolume) { _masterVolume = vol; } requestPreset(device.selectedChannel); } void resetNuxPresets() async { if (!isConnected) return; device.communication.sendReset(); //show loading popup if (device.presetSaveSupport) { await Future.delayed(const Duration(seconds: 3)); _connectStatus.add(DeviceConnectionState.connectionBegin); requestPresetDelayed(3000); } } void sendBLEData(List data) { _midiHandler.sendData(data); } List createCCMessage(int controlNumber, int value) { var msg = List.filled(5, 0); msg[0] = 0x80; msg[1] = 0x80; msg[2] = MidiMessageValues.controlChange; msg[3] = controlNumber; msg[4] = value; return msg; } void updateDiagnosticsData( {bool? connected, String? nuxPreset, bool includeJsonPreset = false}) { if (nuxPreset != null) diagData.lastNuxPreset = nuxPreset; diagData.device = "${_device.productName} ${_device.productVersion}"; if (connected != null) diagData.connected = connected; /* Sentry.configureScope((scope) { scope.setTag( "nuxDevice", "${_device.productName} ${_device.productVersion}"); scope.setContexts('NUX', diagData.toMap(includeJsonPreset)); });*/ } NuxDevice get device => _device; } ================================================ FILE: lib/bluetooth/bleMidiHandler.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) //Good explanation for location usage //https://support.chefsteps.com/hc/en-us/articles/360009480814-I-have-an-Android-Why-am-I-being-asked-to-allow-location-access- import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'ble_controllers/DummyBLEController.dart'; import 'ble_controllers/FlutterBluePlusController.dart'; import 'package:permission_handler/permission_handler.dart'; import '../platform/platformUtils.dart'; import 'ble_controllers/BLEController.dart'; import 'ble_controllers/WebBleController.dart'; typedef BluetoothErrorCallback = void Function(BleError, dynamic data); class BLEMidiHandler { //List of devices that doesn't advertise their midi service static const List forcedDevices = [ "FootCtrl", //Cuvave / M-Wave Chocolate "FootCtrlPlus" ]; static final BLEMidiHandler _bleHandler = BLEMidiHandler._(); late BLEController bleController; Stream get status => bleController.status; Stream get isScanningStream => bleController.isScanningStream; MidiSetupStatus get currentStatus => bleController.currentStatus; bool _manualScan = false; bool _granted = false; bool _permanentlyDenied = false; bool get permissionGranted => PlatformUtils.isWeb || _granted; bool get permanentlyDenied => !PlatformUtils.isWeb && _permanentlyDenied; BleState get bleState => bleController.bleState; bool get isScanning => bleController.isScanning; bool get manualScan => _manualScan; factory BLEMidiHandler.instance() { return _bleHandler; } var _nuxDevices = []; List get nuxDevices => _nuxDevices; //controller devices var _controllerDevices = []; List get controllerDevices => _controllerDevices; BLEDevice? get connectedDevice { return bleController.connectedDevice; } BLEMidiHandler._() { //bleController = DummyBLEController(forcedDevices); //return; if (PlatformUtils.isAndroid) { bleController = FlutterBluePlusController(forcedDevices); } else if (PlatformUtils.isIOS) { bleController = FlutterBluePlusController(forcedDevices); } else if (PlatformUtils.isWeb) { bleController = WebBleController(forcedDevices); } else if (PlatformUtils.isWindows) { bleController = DummyBLEController(forcedDevices); } else if (PlatformUtils.isLinux) { bleController = DummyBLEController(forcedDevices); } else { bleController = DummyBLEController(forcedDevices); } } initBle(BluetoothErrorCallback onError) async { var deviceInfoPlugin = DeviceInfoPlugin(); bool noLocationNeeded = false; //TODO: what happens with iOS? if (PlatformUtils.isAndroid) { final androidInfo = await deviceInfoPlugin.androidInfo; noLocationNeeded = (androidInfo.version.sdkInt) >= 31; } if (PlatformUtils.isMobile) { PermissionStatus pStatus; bool askOneTime = false; if (noLocationNeeded) { pStatus = await Permission.bluetoothScan.status; if (!pStatus.isGranted) { pStatus = await Permission.bluetoothScan.request(); } if (!pStatus.isGranted) { onError(BleError.scanPermissionDenied, pStatus); return; } pStatus = await Permission.bluetoothConnect.status; if (!pStatus.isGranted) { pStatus = await Permission.bluetoothConnect.request(); } if (!pStatus.isGranted) onError(BleError.scanPermissionDenied, pStatus); } else { do { if (PlatformUtils.isIOS) break; pStatus = await Permission.location.status; if (pStatus.isGranted) break; if (!askOneTime) { pStatus = await Permission.location.request(); if (pStatus.isPermanentlyDenied) _permanentlyDenied = true; askOneTime = true; if (!pStatus.isGranted) { onError(BleError.permissionDenied, pStatus); } } Future.delayed(const Duration(milliseconds: 500)); } while (!pStatus.isGranted); } } debugPrint("BLE permissions granted!"); _granted = true; _permanentlyDenied = false; await bleController.init(_onScanResults); var available = await bleController.isAvailable(); if (!available) { onError(BleError.unavailable, null); } if (PlatformUtils.isAndroid && !noLocationNeeded) { ServiceStatus ss = await Permission.location.serviceStatus; if (!ss.isEnabled) { onError(BleError.locationServiceOff, null); } } debugPrint("BLEMidiHandler:Init()"); } void _onScanResults( List nuxResults, List controllerResults) { _nuxDevices = nuxResults; _controllerDevices = controllerResults; } void setAmpDeviceIdProvider(List Function() provider) { bleController.setAmpDeviceIdProvider(provider); } void startScanning(bool manual) { if (!_granted) return; _manualScan = manual; bleController.startScanning(); } void stopScanning() { if (!_granted) return; bleController.stopScanning(); } Future connectToDevice(BLEDevice device) async { if (!_granted) return null; return bleController.connectToDevice(device); } void disconnectDevice() async { if (!_granted) return; bleController.disconnectDevice(); } StreamSubscription> registerDataListener( Function(List) listener) { return bleController.registerDataListener(listener); } void clearDataQueue() { bleController.clearDataQueue(); } void onDataQueueEmpty(VoidCallback onEmpty) { bleController.onDataQueueEmpty(onEmpty); } void sendData(List data) { if (!_granted) return; bleController.sendData(data); } void dispose() { bleController.dispose(); } } ================================================ FILE: lib/bluetooth/ble_controllers/BLEController.dart ================================================ import 'dart:async'; import 'dart:collection'; import 'dart:io'; import 'package:flutter/foundation.dart'; import '../devices/NuxConstants.dart'; enum MidiSetupStatus { bluetoothOff, deviceIdle, deviceSearching, deviceFound, deviceConnecting, deviceConnected, deviceDisconnected, unknown } enum BleState { off, on } enum BleDeviceState { disconnected, connecting, connected, disconnecting } enum BleError { unavailable, permissionDenied, locationServiceOff, scanPermissionDenied } typedef ScanResultsCallback = void Function( List nuxDevices, List controllerDevices); abstract class BLEScanResult { String get id; String get name; late BLEDevice _device; @protected set device(BLEDevice val) => _device = val; BLEDevice get device => _device; } abstract class BLEDevice { String get name; String get id; ///Returns a stream telling the connection state of a device ///Used only for MIDI foot controllers and not for amps Stream get state; } /// Ble connection class used for MIDI foot controllers only /// Not needed for amps class BLEConnection { final Stream> _dataStream; Stream> get data => _dataStream; BLEConnection(this._dataStream); } abstract class BLEController { static const String midiServiceGuid = "03b80e5a-ede8-4b33-a751-6ce34ec4c700"; static const String midiCharacteristicGuid = "7772e5db-3868-4112-a1a9-f2669d106bf3"; MidiSetupStatus _currentStatus = MidiSetupStatus.unknown; final StreamController _status = StreamController.broadcast(); Stream get status => _status.stream; BleState _bleState = BleState.off; @protected set bleState(BleState state) => _bleState = state; BleState get bleState => _bleState; @protected set currentStatus(MidiSetupStatus val) => _currentStatus = val; MidiSetupStatus get currentStatus => _currentStatus; BLEDevice? get connectedDevice; final StreamController _scanStatus = StreamController.broadcast(); Stream get isScanningStream => _scanStatus.stream; bool _isScanning = false; bool get isScanning => _isScanning; ListQueue> dataQueue = ListQueue>(); @protected late List Function() deviceListProvider; @protected late ScanResultsCallback onScanResults; @protected List forcedDevices; BLEController(this.forcedDevices); void setAmpDeviceIdProvider(List Function() provider) { deviceListProvider = provider; } Future init(ScanResultsCallback callback) async { onScanResults = callback; } Future isAvailable(); void startScanning(); void stopScanning(); Future connectToDevice(BLEDevice device); void disconnectDevice(); StreamSubscription> registerDataListener( Function(List) listener); void sendData(List data) { var queueLength = dataQueue.length; if (data[2] == MidiMessageValues.controlChange && dataQueue.isNotEmpty) { //check if another CC message with the same code is in the queue and remove it dataQueue.removeWhere((element) => element[2] == MidiMessageValues.controlChange && element[3] == data[3]); } dataQueue.addLast(data); if (queueLength == 0) _queueSender(); } void clearDataQueue() { dataQueue.clear(); } VoidCallback? _onQueueEmpty; void onDataQueueEmpty(VoidCallback onQueueEmpty) { if (dataQueue.isEmpty) { onQueueEmpty.call(); } else { _onQueueEmpty = onQueueEmpty; } } void dispose(); void _queueSender() async { //Stopwatch stopwatch = Stopwatch()..start(); //List currentData = List(); bool noResponse = true; while (dataQueue.isNotEmpty) { if (connectedDevice == null) { dataQueue.clear(); break; } try { if (isWriteReady) { var data = dataQueue.first; //try to combine CC messages in single running message //default MTU 23 bytes per packet (maybe 20???) /*int elementsCount = 0; if ((data[2] == MidiMessageValues.controlChange || data[2] == MidiMessageValues.programChange) && dataQueue.length > 1) { for (var element in dataQueue) { if (element[2] == MidiMessageValues.controlChange || element[2] == MidiMessageValues.programChange) { elementsCount++; if (elementsCount == 2) break; } else { break; } } List dataPacket = [data[0], data[1], data[2]]; for (int i = 0; i < elementsCount; i++) { var dataElement = dataQueue.elementAt(i); dataPacket.add(dataElement[3]); dataPacket.add(dataElement[4]); } await writeToCharacteristic(dataPacket); print("Combined: ${dataPacket.toString()}"); for (int i = 0; i < elementsCount; i++) { dataQueue.removeFirst(); } } else {*/ //any other message if (Platform.isAndroid && data[2] == MidiMessageValues.sysExStart && data[6] == SyxMsg.kSYX_MODULELINK) { noResponse = false; await Future.delayed(const Duration(milliseconds: 100)); } await writeToCharacteristic(data, noResponse); if (Platform.isAndroid) { await Future.delayed(const Duration(milliseconds: 10)); } noResponse = true; dataQueue.removeFirst(); //} } else { dataQueue.clear(); } } catch (e) { debugPrint(e.toString()); //noResponse = false; //await Future.delayed(const Duration(milliseconds: 50)); } } _onQueueEmpty?.call(); _onQueueEmpty = null; // if (kDebugMode) { // Settings.print('sending executed in ${stopwatch.elapsed.inMilliseconds}'); // } } @protected void setMidiSetupStatus(MidiSetupStatus status) { _currentStatus = status; _status.add(status); } @protected void setScanningStatus(bool scanning) { _isScanning = scanning; _scanStatus.add(scanning); } bool get isWriteReady; Future writeToCharacteristic(List data, bool noResponse); } ================================================ FILE: lib/bluetooth/ble_controllers/DummyBLEController.dart ================================================ import 'dart:async'; import 'BLEController.dart'; class DummyBLEController extends BLEController { DummyBLEController(List forcedDevices) : super(forcedDevices); @override Future connectToDevice(BLEDevice device) { throw UnimplementedError(); } @override BLEDevice? get connectedDevice => null; @override void disconnectDevice() {} @override void dispose() {} @override Future isAvailable() async { return false; } @override bool get isWriteReady => false; @override StreamSubscription> registerDataListener( Function(List p1) listener) { throw UnimplementedError(); } @override void startScanning() {} @override void stopScanning() {} @override Future writeToCharacteristic(List data, bool noResponse) { return Future.delayed(const Duration(milliseconds: 100)); } /* @override Future setNotificationEnabled(bool enabled) { return Future.delayed(const Duration(milliseconds: 100)); } */ } ================================================ FILE: lib/bluetooth/ble_controllers/FlutterBluePluginController.dart ================================================ /* Almost identical to flutte_blue_plus - comes from the same base, but added Windows and macOS support. However, doesn't work well on Windows. Not tested on macOS, nut flutter_blue_plus should be easy to port for macOS. Another problem is that it requires Android API level 21 - lollipop and too many people requested to keep KitKat compatibility */ /* import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:flutter_blue_plugin/flutter_blue_plugin.dart'; import 'package:mighty_plug_manager/bluetooth/ble_controllers/BLEController.dart'; class FBPScanResult extends BLEScanResult { @override String get id => (device as FBPBleDevice).device.id.toString().toLowerCase(); @override String get name => (device as FBPBleDevice).device.name; FBPScanResult(ScanResult sr) { device = FBPBleDevice(sr.device); } } class FBPBleDevice extends BLEDevice { final BluetoothDevice _device; BluetoothDevice get device => _device; FBPBleDevice(this._device); @override String get name => _device.name; @override String get id => _device.id.toString().toLowerCase(); @override Stream get state { StreamController stateStream = StreamController(); StreamSubscription s = _device.state.listen((event) { switch (event) { case BluetoothDeviceState.disconnected: stateStream.add(BleDeviceState.disconnected); break; case BluetoothDeviceState.connecting: stateStream.add(BleDeviceState.connecting); break; case BluetoothDeviceState.connected: stateStream.add(BleDeviceState.connected); break; case BluetoothDeviceState.disconnecting: stateStream.add(BleDeviceState.disconnecting); break; } }); stateStream.onCancel = () { s.cancel(); }; return stateStream.stream; } } class FlutterBluePluginController extends BLEController { FlutterBlue flutterBlue = FlutterBlue.instance; FBPBleDevice? _device; @override BLEDevice? get connectedDevice => _device; BluetoothCharacteristic? _midiCharacteristic; StreamSubscription? _deviceStreamSubscription; bool _connectInProgress = false; StreamSubscription? _scanningStatusSubscription; StreamSubscription? _bluetoothStateSubscription; StreamSubscription>? _scanSubscription; FlutterBluePluginController(List forcedDevices) : super(forcedDevices); @override Future isAvailable() { return flutterBlue.isAvailable; } @override void startScanning() { if (bleState == BleState.off) return; setMidiSetupStatus(MidiSetupStatus.deviceSearching); flutterBlue .startScan( timeout: const Duration(seconds: 8), //withServices: [Guid(midiService)] ) .listen((event) { print(event); }); // .then((result) { //if device is not connected after the search - set to idle //if (_device == null) setMidiSetupStatus(MidiSetupStatus.deviceIdle); //}); } @override void stopScanning() { if (bleState == BleState.off) return; flutterBlue.stopScan(); } @override Future connectToDevice(BLEDevice device) async { if (bleState != BleState.on) return null; var ownDevice = (device as FBPBleDevice).device; bool ampDevice = false; if (deviceListProvider.call().containsPartial(ownDevice.name)) { ampDevice = true; if (_connectInProgress || _device != null) { debugPrint("Denying secondary connection!"); return null; } } _connectInProgress = true; stopScanning(); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); try { await ownDevice.connect( autoConnect: false, timeout: const Duration(seconds: 5)); } on Exception { _connectInProgress = false; return null; } catch (e) { debugPrint("Connect error $e"); _connectInProgress = false; if (e == 'already_connected') return null; rethrow; } if (ampDevice) { if (_device != null) return null; _device = device; } List services = await ownDevice.discoverServices(); //find midi service BluetoothService? midiService; for (var element in services) { if (element.uuid == Guid(BLEController.midiServiceGuid)) { midiService = element; } } if (midiService != null) { for (var characteristic in midiService.characteristics) { if (characteristic.uuid == Guid(BLEController.midiCharacteristicGuid)) { if (ampDevice) { _connectAmpDevice(device.device, characteristic); } else { characteristic.setNotifyValue(true); _connectInProgress = false; return BLEConnection(characteristic.value); } } } } return null; } void _connectAmpDevice( BluetoothDevice device, BluetoothCharacteristic characteristic) { _midiCharacteristic = characteristic; _midiCharacteristic?.setNotifyValue(true); _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _deviceStreamSubscription = device.state.listen((event) { if (event == BluetoothDeviceState.disconnected) { _deviceStreamSubscription?.cancel(); _device = null; _midiCharacteristic = null; _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); } }); } @override Future init(ScanResultsCallback callback) async { await super.init(callback); _subscribeBleState(); _subscribeScanningStatus(); _subscribeScanResults(); } @override StreamSubscription> registerDataListener( Function(List) listener) { return _midiCharacteristic!.value.listen(listener); } @override void disconnectDevice() async { if (_device != null) { _connectInProgress = false; _device?.device.disconnect(); _midiCharacteristic = null; _device = null; } } @override void dispose() { _scanningStatusSubscription?.cancel(); _bluetoothStateSubscription?.cancel(); _scanSubscription?.cancel(); _device?.device.disconnect(); _connectInProgress = false; } _subscribeBleState() { _bluetoothStateSubscription = flutterBlue.state.listen((event) { debugPrint(event.toString()); switch (event) { case BluetoothState.unknown: case BluetoothState.unavailable: case BluetoothState.unauthorized: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); break; case BluetoothState.turningOn: case BluetoothState.on: bleState = BleState.on; setMidiSetupStatus(MidiSetupStatus.deviceSearching); startScanning(); break; case BluetoothState.turningOff: flutterBlue.stopScan(); break; case BluetoothState.off: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); _device = null; _connectInProgress = false; break; } }); } _subscribeScanningStatus() { _scanningStatusSubscription = flutterBlue.isScanning.listen((event) { setScanningStatus(event); }); } _subscribeScanResults() { _scanSubscription = flutterBlue.scanResults.listen((results) { List nuxDevices = []; List controllerDevices = []; //filter the scan results var devNames = deviceListProvider.call(); for (ScanResult result in results) { if (devNames.containsPartial(result.device.name)) { nuxDevices.add(result); } else { bool validDevice = false; //check if it advertises the MIDI service for (var uuid in result.advertisementData.serviceUuids) { if (uuid.toLowerCase() == BLEController.midiServiceGuid) { validDevice = true; } } //check if it is in the special device list if (validDevice || forcedDevices.contains(result.advertisementData.localName) || forcedDevices.contains(result.device.name)) { controllerDevices.add(result); } } } //convert to blescanresult List nuxBle = [], ctrlBle = []; for (var dev in nuxDevices) { nuxBle.add(FBPScanResult(dev)); } for (var dev in controllerDevices) { ctrlBle.add(FBPScanResult(dev)); } onScanResults(nuxBle, ctrlBle); setMidiSetupStatus(MidiSetupStatus.deviceFound); for (ScanResult r in results) { debugPrint('${r.device.name} found! rssi: ${r.rssi}'); } }); } @override bool get isWriteReady => _midiCharacteristic != null; @override Future writeToCharacteristic(List data) async { return _midiCharacteristic!.write(data, withoutResponse: true); } } */ ================================================ FILE: lib/bluetooth/ble_controllers/FlutterBluePlusController.dart ================================================ /* The original plugin used in Mightier Amp. For Android and iOS https://pub.dev/packages/flutter_blue_plus This plugin works great. Unfortunately it's only for mobile platforms. MacOS is possible, due to almost 100% identical code to iOS */ import 'dart:async'; import 'dart:io'; import 'package:flutter/widgets.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:mighty_plug_manager/bluetooth/ble_controllers/BLEController.dart'; import 'package:mighty_plug_manager/utilities/list_extenstions.dart'; class FBPScanResult extends BLEScanResult { @override String get id => (device as FBPBleDevice).device.id.toString().toLowerCase(); @override String get name => (device as FBPBleDevice).device.name; FBPScanResult(ScanResult sr) { device = FBPBleDevice(sr.device); } } class FBPBleDevice extends BLEDevice { final BluetoothDevice _device; BluetoothDevice get device => _device; FBPBleDevice(this._device); @override String get name => _device.name; @override String get id => _device.id.toString().toLowerCase(); @override Stream get state { StreamController stateStream = StreamController(); StreamSubscription s = _device.state.listen((event) { switch (event) { case BluetoothDeviceState.disconnected: stateStream.add(BleDeviceState.disconnected); break; case BluetoothDeviceState.connecting: stateStream.add(BleDeviceState.connecting); break; case BluetoothDeviceState.connected: stateStream.add(BleDeviceState.connected); break; case BluetoothDeviceState.disconnecting: stateStream.add(BleDeviceState.disconnecting); break; } }); stateStream.onCancel = () { s.cancel(); }; return stateStream.stream; } } class FlutterBluePlusController extends BLEController { FlutterBluePlus flutterBlue = FlutterBluePlus.instance; FBPBleDevice? _device; @override BLEDevice? get connectedDevice => _device; BluetoothCharacteristic? _midiCharacteristic; StreamSubscription? _deviceStreamSubscription; bool _connectInProgress = false; StreamSubscription? _scanningStatusSubscription; StreamSubscription? _bluetoothStateSubscription; StreamSubscription>? _scanSubscription; FlutterBluePlusController(List forcedDevices) : super(forcedDevices); @override Future isAvailable() { return flutterBlue.isAvailable; } @override Future init(ScanResultsCallback callback) async { await super.init(callback); _subscribeBleState(); _subscribeScanningStatus(); _subscribeScanResults(); flutterBlue.setLogLevel(LogLevel.info); } @override void startScanning() { if (bleState == BleState.off) return; setMidiSetupStatus(MidiSetupStatus.deviceSearching); flutterBlue .startScan( timeout: const Duration(seconds: 8), //withServices: [Guid(midiService)] ) .then((result) { //if device is not connected after the search - set to idle if (_device == null) setMidiSetupStatus(MidiSetupStatus.deviceIdle); }); } @override Future stopScanning() { if (bleState == BleState.off) return Future.value(null); return flutterBlue.stopScan(); } @override Future connectToDevice(BLEDevice device) async { if (bleState != BleState.on) return null; var ownDevice = (device as FBPBleDevice).device; bool ampDevice = false; if (deviceListProvider.call().containsPartial(ownDevice.name)) { ampDevice = true; if (_connectInProgress || _device != null) { debugPrint("Denying secondary connection!"); return null; } } _connectInProgress = true; await stopScanning(); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); try { await ownDevice.connect( autoConnect: false, timeout: const Duration(seconds: 5)); } on Exception { _connectInProgress = false; return null; } catch (e) { debugPrint("Connect error $e"); _connectInProgress = false; if (e == 'already_connected') return null; rethrow; } if (ampDevice) { if (_device != null) return null; _device = device; } List services = await ownDevice.discoverServices(); //find midi service BluetoothService? midiService; for (var element in services) { if (element.uuid == Guid(BLEController.midiServiceGuid)) { midiService = element; } } if (midiService != null) { for (var characteristic in midiService.characteristics) { if (characteristic.uuid == Guid(BLEController.midiCharacteristicGuid)) { if (ampDevice) { _connectAmpDevice(device.device, characteristic); } else { characteristic.setNotifyValue(true); _connectInProgress = false; return BLEConnection(characteristic.value); } } } } return null; } void _connectAmpDevice( BluetoothDevice device, BluetoothCharacteristic characteristic) { _midiCharacteristic = characteristic; _midiCharacteristic?.setNotifyValue(true); _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _deviceStreamSubscription = device.state.listen((event) { if (event == BluetoothDeviceState.disconnected) { if (Platform.isAndroid) { //android deadObjectException fix device.clearGattCache().then((value) { device.disconnect(); }).catchError((_) {}); } _deviceStreamSubscription?.cancel(); _device = null; _midiCharacteristic = null; _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); } }); } @override StreamSubscription> registerDataListener( Function(List) listener) { return _midiCharacteristic!.value.listen(listener); } @override void disconnectDevice() async { if (_device != null) { _connectInProgress = false; await _device?.device.disconnect(); _midiCharacteristic = null; _device = null; } } @override void dispose() { _scanningStatusSubscription?.cancel(); _bluetoothStateSubscription?.cancel(); _scanSubscription?.cancel(); _device?.device.disconnect(); _connectInProgress = false; } _subscribeBleState() { _bluetoothStateSubscription = flutterBlue.state.listen((event) { debugPrint(event.toString()); switch (event) { case BluetoothState.unknown: //fix for ios not recognizing bluetooth on at startup if (Platform.isIOS) { Future.delayed(const Duration(milliseconds: 500)).then((value) { flutterBlue.isOn.then((value) { if (value) { bleState = BleState.on; setMidiSetupStatus(MidiSetupStatus.deviceSearching); startScanning(); } }); }); } break; case BluetoothState.unavailable: case BluetoothState.unauthorized: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); break; case BluetoothState.turningOn: case BluetoothState.on: bleState = BleState.on; setMidiSetupStatus(MidiSetupStatus.deviceSearching); startScanning(); break; case BluetoothState.turningOff: flutterBlue.stopScan(); break; case BluetoothState.off: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); _device = null; _connectInProgress = false; break; } }); } _subscribeScanningStatus() { _scanningStatusSubscription = flutterBlue.isScanning.listen((event) { setScanningStatus(event); }); } _subscribeScanResults() { _scanSubscription = flutterBlue.scanResults.listen((results) { List nuxDevices = []; List controllerDevices = []; //filter the scan results var devNames = deviceListProvider.call(); for (ScanResult result in results) { if (devNames.containsPartial(result.device.name)) { nuxDevices.add(result); } else { bool validDevice = false; //check if it advertises the MIDI service for (var uuid in result.advertisementData.serviceUuids) { if (uuid.toLowerCase() == BLEController.midiServiceGuid) { validDevice = true; } } //check if it is in the special device list if (validDevice || forcedDevices.contains(result.advertisementData.localName) || forcedDevices.contains(result.device.name)) { controllerDevices.add(result); } } } //convert to blescanresult List nuxBle = [], ctrlBle = []; for (var dev in nuxDevices) { nuxBle.add(FBPScanResult(dev)); } for (var dev in controllerDevices) { ctrlBle.add(FBPScanResult(dev)); } onScanResults(nuxBle, ctrlBle); setMidiSetupStatus(MidiSetupStatus.deviceFound); for (ScanResult r in results) { debugPrint('${r.device.name} found! rssi: ${r.rssi}'); } }); } @override bool get isWriteReady => _midiCharacteristic != null; @override Future writeToCharacteristic(List data, bool noResponse) async { bool withoutResponse = noResponse; //wait for response on sysex messages //if (data[2] == 0xf0) withoutResponse = false; return _midiCharacteristic!.write(data, withoutResponse: withoutResponse); } } ================================================ FILE: lib/bluetooth/ble_controllers/FlutterReactiveBle.dart ================================================ /* import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:mighty_plug_manager/bluetooth/ble_controllers/BLEController.dart'; class FRBScanResult extends BLEScanResult { @override String get id => (device as FRBleDevice).id.toString().toLowerCase(); @override String get name => (device as FRBleDevice).name; FRBScanResult(DiscoveredDevice sr) { device = FRBleDevice(sr); } } class FRBleDevice extends BLEDevice { final DiscoveredDevice _device; DiscoveredDevice get device => _device; FRBleDevice(this._device); @override String get name => _device.name; @override String get id => _device.id.toString().toLowerCase(); @override Stream get state { StreamController stateStream = StreamController(); StreamSubscription s = _device.state.listen((event) { switch (event) { case BluetoothDeviceState.disconnected: stateStream.add(BleDeviceState.disconnected); break; case BluetoothDeviceState.connecting: stateStream.add(BleDeviceState.connecting); break; case BluetoothDeviceState.connected: stateStream.add(BleDeviceState.connected); break; case BluetoothDeviceState.disconnecting: stateStream.add(BleDeviceState.disconnecting); break; } }); stateStream.onCancel = () { s.cancel(); }; return stateStream.stream; } } class FlutterReactiveBleController extends BLEController { FlutterReactiveBle flutterBlue = FlutterReactiveBle(); FRBleDevice? _device; @override BLEDevice? get connectedDevice => _device; BluetoothCharacteristic? _midiCharacteristic; StreamSubscription? _deviceStreamSubscription; bool _connectInProgress = false; StreamSubscription? _scanningStatusSubscription; StreamSubscription? _bluetoothStateSubscription; StreamSubscription>? _scanSubscription; FlutterReactiveBleController(List forcedDevices) : super(forcedDevices); @override Future isAvailable() async { return true; } @override Future init(ScanResultsCallback callback) async { await super.init(callback); _subscribeBleState(); _subscribeScanningStatus(); _subscribeScanResults(); } @override void startScanning() { if (bleState == BleState.off) return; setMidiSetupStatus(MidiSetupStatus.deviceSearching); flutterBlue.scanForDevices( withServices: [], ); flutterBlue .startScan( timeout: const Duration(seconds: 8), //withServices: [Guid(midiService)] ) .then((result) { //if device is not connected after the search - set to idle if (_device == null) setMidiSetupStatus(MidiSetupStatus.deviceIdle); }); } @override void stopScanning() { if (bleState == BleState.off) return; flutterBlue.stopScan(); } @override Future connectToDevice(BLEDevice device) async { if (bleState != BleState.on) return null; var ownDevice = (device as FBPBleDevice).device; bool ampDevice = false; if (deviceListProvider.call().containsPartial(ownDevice.name)) { ampDevice = true; if (_connectInProgress || _device != null) { debugPrint("Denying secondary connection!"); return null; } } _connectInProgress = true; stopScanning(); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); try { await ownDevice.connect( autoConnect: false, timeout: const Duration(seconds: 5)); } on Exception { _connectInProgress = false; return null; } catch (e) { debugPrint("Connect error $e"); _connectInProgress = false; if (e == 'already_connected') return null; rethrow; } if (ampDevice) { if (_device != null) return null; _device = device; } List services = await ownDevice.discoverServices(); //find midi service BluetoothService? midiService; for (var element in services) { if (element.uuid == Guid(BLEController.midiServiceGuid)) { midiService = element; } } if (midiService != null) { for (var characteristic in midiService.characteristics) { if (characteristic.uuid == Guid(BLEController.midiCharacteristicGuid)) { if (ampDevice) { _connectAmpDevice(device.device, characteristic); } else { characteristic.setNotifyValue(true); _connectInProgress = false; return BLEConnection(characteristic.value); } } } } return null; } void _connectAmpDevice( BluetoothDevice device, BluetoothCharacteristic characteristic) { _midiCharacteristic = characteristic; _midiCharacteristic?.setNotifyValue(true); _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _deviceStreamSubscription = device.state.listen((event) { if (event == BluetoothDeviceState.disconnected) { _deviceStreamSubscription?.cancel(); _device = null; _midiCharacteristic = null; _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); } }); } @override StreamSubscription> registerDataListener( Function(List) listener) { return _midiCharacteristic!.value.listen(listener); } @override void disconnectDevice() async { if (_device != null) { _connectInProgress = false; await _device?.device.disconnect(); _midiCharacteristic = null; _device = null; } } @override void dispose() { _scanningStatusSubscription?.cancel(); _bluetoothStateSubscription?.cancel(); _scanSubscription?.cancel(); _device?.device.disconnect(); _connectInProgress = false; } _subscribeBleState() { _bluetoothStateSubscription = flutterBlue.statusStream.listen((event) { debugPrint(event.toString()); switch (event) { case BleStatus.unknown: case BleStatus.poweredOff: case BleStatus.unauthorized: case BleStatus.unsupported: case BleStatus.locationServicesDisabled: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); break; case BleStatus.ready: bleState = BleState.on; setMidiSetupStatus(MidiSetupStatus.deviceSearching); startScanning(); break; case BleStatus.poweredOff: //flutterBlue. break; case BluetoothState.off: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); _device = null; _connectInProgress = false; break; } }); } _onScanResults(DiscoveredDevice result) { List nuxDevices = []; List controllerDevices = []; //filter the scan results var devNames = deviceListProvider.call(); if (devNames.containsPartial(result.name)) { nuxDevices.add(result); } else { bool validDevice = false; //check if it advertises the MIDI service for (var uuid in result.serviceUuids) { if (uuid.toString().toLowerCase() == BLEController.midiServiceGuid) { validDevice = true; } } //check if it is in the special device list if (validDevice || forcedDevices.contains(result.name)) { controllerDevices.add(result); } } //convert to blescanresult List nuxBle = [], ctrlBle = []; for (var dev in nuxDevices) { nuxBle.add(FBPScanResult(dev)); } for (var dev in controllerDevices) { ctrlBle.add(FBPScanResult(dev)); } onScanResults(nuxBle, ctrlBle); setMidiSetupStatus(MidiSetupStatus.deviceFound); for (ScanResult r in results) { debugPrint('${r.device.name} found! rssi: ${r.rssi}'); } } @override bool get isWriteReady => _midiCharacteristic != null; @override Future writeToCharacteristic(List data) async { return _midiCharacteristic!.write(data, withoutResponse: true); } } */ ================================================ FILE: lib/bluetooth/ble_controllers/MightyBle.dart ================================================ import 'dart:async'; import 'package:mighty_plug_manager/utilities/list_extenstions.dart'; import 'BLEController.dart'; import 'package:mighty_ble/mighty_ble.dart'; class MBScanResult extends BLEScanResult { @override String get id => (device as MBDevice).id; @override String get name => (device as MBDevice).name; MBScanResult(ScanResult sr) { device = MBDevice(sr.id, sr.name); } } class MBDevice extends BLEDevice { final String _device; final String _name; String get device => _device; final StreamController _stateStream = StreamController(); MBDevice(this._device, this._name); @override String get name => _name; @override String get id => _device; @override Stream get state => _stateStream.stream; void statePost(BleDeviceState state) { _stateStream.add(state); } void dispose() { _stateStream.close(); } } class MightyBLEController extends BLEController { MightyBle mightyBle = MightyBle(); MightyBLEController(List forcedDevices) : super(forcedDevices); StreamSubscription? _scanningStatusSubscription; //StreamSubscription? _bluetoothStateSubscription; StreamSubscription>? _scanSubscription; @override Future init(ScanResultsCallback callback) async { await super.init(callback); mightyBle.init(); //_subscribeBleState(); _subscribeScanningStatus(); _subscribeScanResults(); _subscribeConnectStatus(); mightyBle.setNotifyCallback(_notifyCallback); setMidiSetupStatus(MidiSetupStatus.deviceIdle); bleState = BleState.on; } MBDevice? _connectedDevice; MBDevice? _tmpConnectingDevice; @override MBDevice? get connectedDevice => _connectedDevice; StreamController>? _dataStreamController; @override Future connectToDevice(BLEDevice device) async { var ownDevice = (device as MBDevice); _tmpConnectingDevice = device; mightyBle.connect(ownDevice.id); ownDevice.statePost(BleDeviceState.connecting); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); return null; } @override void disconnectDevice() async { if (_connectedDevice == null) { return; } var ownDevice = (connectedDevice as MBDevice); _connectedDevice!.statePost(BleDeviceState.disconnecting); await mightyBle.disconnect(ownDevice.id); } @override void dispose() { _scanningStatusSubscription?.cancel(); _scanSubscription?.cancel(); _dataStreamController?.close(); } @override Future isAvailable() async { return await mightyBle.isAvailable(); } @override bool get isWriteReady => _connectedDevice != null; @override Future writeToCharacteristic(List data, bool noResponse) { return mightyBle.writeBle(_connectedDevice!.id, data); } @override StreamSubscription> registerDataListener( Function(List value) listener) { _dataStreamController = StreamController(); return _dataStreamController!.stream.listen(listener); } @override void startScanning() { mightyBle.startScan(); setMidiSetupStatus(MidiSetupStatus.deviceSearching); } @override void stopScanning() { mightyBle.stopScan(); } /* @override Future setNotificationEnabled(bool enabled) async { if (_connectedDevice == null) return; return mightyBle.setNotificationEnabled(_connectedDevice!.id, enabled); } */ _notifyCallback(String id, List data) { if (_connectedDevice != null) { if (_connectedDevice!.id == id) { _dataStreamController?.add(data); } } } _subscribeScanningStatus() { _scanningStatusSubscription = mightyBle.scanStatus.listen((event) { print("ScanStatus $event"); setScanningStatus(event); }); } _subscribeScanResults() { _scanSubscription = mightyBle.scanResults.listen((results) { List nuxDevices = []; List controllerDevices = []; //filter the scan results var devNames = deviceListProvider.call(); for (ScanResult result in results) { if (devNames.containsPartial(result.name)) { nuxDevices.add(result); } else { //check if it is in the special device list if (result.hasMidiService || forcedDevices.contains(result.name)) { controllerDevices.add(result); } } } //convert to blescanresult List nuxBle = [], ctrlBle = []; for (var dev in nuxDevices) { nuxBle.add(MBScanResult(dev)); } for (var dev in controllerDevices) { ctrlBle.add(MBScanResult(dev)); } onScanResults(nuxBle, ctrlBle); setMidiSetupStatus(MidiSetupStatus.deviceFound); for (ScanResult r in results) { print('${r.name} found!'); } }); } _subscribeConnectStatus() { mightyBle.onConnect.listen((id) { print("MightyBle on connect $id"); if (_tmpConnectingDevice?.id == id) { _connectedDevice = _tmpConnectingDevice; _tmpConnectingDevice = null; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _connectedDevice!.statePost(BleDeviceState.connected); } }); mightyBle.onDisconnect.listen((id) { print("MightyBle on disconnect $id"); if (id == _connectedDevice?.id) { setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); _connectedDevice!.statePost(BleDeviceState.disconnected); _connectedDevice!.dispose(); _connectedDevice = null; _dataStreamController?.close(); } }); } } ================================================ FILE: lib/bluetooth/ble_controllers/QuickBlueController.dart ================================================ /* Controller that uses quick_blue plugin, which supports all platforms, except web https://pub.dev/packages/quick_blue Summary State: Bad Tested mostly in Windows, also in Linux and Android Windows: When app is launched, the first connection attempt works 50% of the time. Any subsequent connects don't work. Few days later it stopped working AT ALL! Sometimes even crashes the app Linux: the version from pub.dev has incomplete linux port, only scanning is done. There's another nearly complete version here https://github.com/woodemi/quick.flutter/tree/master/packages/quick_blue However it's not reliable. While it connects, it does not raise connect & disconnect events properly. It uses bluez plugin for linux: https://pub.dev/packages/bluez This can be used as a starting point for custom plugin Android: tested it just a little, works horrible, which proves that the plugin is crap, because the actual Android plugin that I use - flutter_blue_plugin is flawless. Another problem is that it required API level 21 (Lollipop), however there are too many people using the app on KitKat so it's important to keep compatibility. This plugin doesn't provide device services while scanning. This is important, because it can't filter by devices which support MIDI-BLE */ /* import 'dart:async'; import 'dart:typed_data'; import 'package:quick_blue/quick_blue.dart'; import 'BLEController.dart'; class QuickBlueScanResult extends BLEScanResult { @override String get id => (device as QuickBlueDevice).id; @override String get name => (device as QuickBlueDevice).name; late BlueScanResult _scanResult; QuickBlueScanResult(BlueScanResult r) { _scanResult = r; device = QuickBlueDevice(_scanResult); } } class QuickBlueDevice extends BLEDevice { final BlueScanResult _scanResult; late StreamController _deviceState; QuickBlueDevice(this._scanResult); @override String get id => _scanResult.deviceId; @override String get name => _scanResult.name; void setupDeviceStateStream() { _deviceState = StreamController(); } void publishDeviceState(BleDeviceState devState) { _deviceState.add(devState); if (devState == BleDeviceState.disconnected) { _deviceState.close(); } } @override // TODO: implement state Stream get state => _deviceState.stream; } class QuickBlueController extends BLEController { QuickBlueController(List forcedDevices) : super(forcedDevices); StreamSubscription? _scanSubscription; QuickBlueDevice? _device; List scannedDevices = []; DateTime _scanStarted = DateTime.now(); late List nuxDeviceNames; StreamController>? _dataStreamController; bool _connected = false; bool _connectInProgress = false; @override // TODO: implement connectedDevice BLEDevice? get connectedDevice => _device; @override Future isAvailable() async { bool available = await QuickBlue.isBluetoothAvailable(); if (available) bleState = BleState.on; return available; } @override Future init(ScanResultsCallback callback) async { await super.init(callback); nuxDeviceNames = deviceListProvider.call(); //_subscribeBleState(); //_subscribeScanningStatus(); _subscribeScanResults(); QuickBlue.setValueHandler(_handleValueChange); } @override void startScanning() { if (bleState == BleState.off) return; setMidiSetupStatus(MidiSetupStatus.deviceSearching); setScanningStatus(true); _scanStarted = DateTime.now(); QuickBlue.startScan(); } @override void stopScanning() { QuickBlue.stopScan(); setScanningStatus(false); } @override StreamSubscription> registerDataListener( Function(List data) listener) { _dataStreamController = StreamController(); return _dataStreamController!.stream.listen(listener); } @override Future connectToDevice(BLEDevice device) async { if (bleState != BleState.on) return null; bool ampDevice = false; if (nuxDeviceNames.containsPartial(device.name)) { ampDevice = true; if (_connectInProgress || _device != null) { print("Denying secondary connection!"); return null; } } _connectInProgress = true; stopScanning(); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); if (ampDevice) { if (_device != null) return null; _device = device as QuickBlueDevice; _device!.setupDeviceStateStream(); _device!.publishDeviceState(BleDeviceState.connecting); } QuickBlue.setConnectionHandler(_handleConnectionChange); QuickBlue.connect(device.id); } void _handleConnectionChange(String deviceId, BlueConnectionState state) { if (_device != null && deviceId == _device!.id) { switch (state) { case BlueConnectionState.connected: print("QuickBlue: device connected"); _device!.publishDeviceState(BleDeviceState.connected); QuickBlue.setServiceHandler(_handleServiceDiscovery); QuickBlue.discoverServices(_device!.id); break; case BlueConnectionState.disconnected: print("QuickBlue: device disconnected"); _device!.publishDeviceState(BleDeviceState.disconnected); _dataStreamController?.close(); _device = null; _connectInProgress = false; _connected = false; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); break; } } } void _handleServiceDiscovery( String deviceId, String serviceId, List characteristicIds) { if (_device != null && deviceId == _device!.id) { if (serviceId == BLEController.midiServiceGuid) { print("QuickBlue: midi service discovered"); if (characteristicIds.contains(BLEController.midiCharacteristicGuid)) { print("QuickBlue: midi characteristic discovered"); _connectInProgress = false; _connected = true; setMidiSetupStatus(MidiSetupStatus.deviceConnected); QuickBlue.setNotifiable( deviceId, serviceId, BLEController.midiCharacteristicGuid, BleInputProperty.notification); } } } } void _handleValueChange( String deviceId, String characteristicId, Uint8List value) { print("QuickBlue: Data coming"); if (_device != null && _device!.id == deviceId) { _dataStreamController?.add(value.toList()); } } @override void disconnectDevice() { if (_device != null) { _connectInProgress = false; QuickBlue.disconnect(_device!.id); //TODO: this should not be here _dataStreamController?.close(); _device = null; _connectInProgress = false; _connected = false; } } @override void dispose() { _scanSubscription?.cancel(); } @override bool get isWriteReady => _connected; @override Future writeToCharacteristic(List data) async { print("QuickBlue: Writing"); if (_connected) { return QuickBlue.writeValue( _device!.id, BLEController.midiServiceGuid, BLEController.midiCharacteristicGuid, Uint8List.fromList(data), BleOutputProperty.withoutResponse); } } void _subscribeScanResults() { _scanSubscription = _scanSubscription = QuickBlue.scanResultStream.listen((device) { print("---Scan Result---"); print(device.deviceId); print(device.name); print(device.rssi); print(device.manufacturerData.toList()); print(device.manufacturerDataHead.toList()); final index = scannedDevices .indexWhere((element) => element.deviceId == device.deviceId); // Updating existing device if (index != -1) { // if (device.name.isNotEmpty && scannedDevices[index].name.isEmpty) { // scannedDevices[index].name = device.name; // } // if (device.serviceUuids.isNotEmpty && // scannedDevices[index].serviceUuids.isEmpty) { // scannedDevices[index].serviceUuids = device.serviceUuids; // } } else { scannedDevices.add(device); } //TODO: scan timeout must be implemented in a different way //because this breaks in linux if ((DateTime.now().difference(_scanStarted).inMilliseconds < 5000)) { return; } stopScanning(); scannedDevices .retainWhere((device) => nuxDeviceNames.containsPartial(device.name)); List nuxBle = [], ctrlBle = []; for (var dev in scannedDevices) { nuxBle.add(QuickBlueScanResult(dev)); } onScanResults(nuxBle, []); setMidiSetupStatus(MidiSetupStatus.deviceFound); }); } } */ ================================================ FILE: lib/bluetooth/ble_controllers/WebBleController.dart ================================================ /* Controller that uses flutter_web_bluetooth plugin for adding BLE support for web https://pub.dev/packages/flutter_web_bluetooth Summary State: works somewhat The plugin works, but is not very reliable. Can't determine if the platform has bluetooth hardware or not. Connects half of the time, sometimes disconnects in 1-2 minutes of inactivity. This may be due to the very early stage of web bluetooth standard. */ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter_web_bluetooth/flutter_web_bluetooth.dart'; import 'package:flutter_web_bluetooth/js_web_bluetooth.dart'; import 'BLEController.dart'; class WebBleScanResult extends BLEScanResult { @override String get id => (device as WebBleDevice).device.id.toString().toLowerCase(); @override String get name => (device as WebBleDevice).device.name ?? "Unknown"; WebBleScanResult(BluetoothDevice dev) { device = WebBleDevice(dev); } } class WebBleDevice extends BLEDevice { final BluetoothDevice _device; BluetoothDevice get device => _device; WebBleDevice(this._device); @override String get name => _device.name ?? "Unknown"; @override String get id => _device.id.toString().toLowerCase(); @override Stream get state { StreamController stateStream = StreamController(); StreamSubscription s = _device.connected.listen((event) { if (event) { stateStream.add(BleDeviceState.disconnected); } else { stateStream.add(BleDeviceState.connected); } }); stateStream.onCancel = () { s.cancel(); }; return stateStream.stream; } } class WebBleController extends BLEController { WebBleController(List forcedDevices) : super(forcedDevices); StreamSubscription? _bluetoothStateSubscription; StreamSubscription? _deviceStreamSubscription; WebBleDevice? _device; @override BLEDevice? get connectedDevice => _device; BluetoothCharacteristic? _characteristic; bool? lastBleState; @override Future init(ScanResultsCallback callback) async { await super.init(callback); _subscribeBleState(); } @override Future isAvailable() async { // The bluetooth api exists in this user agent. final supported = FlutterWebBluetooth.instance .isBluetoothApiSupported; // A stream that says if a bluetooth adapter is available to the browser. return supported; } @override Future connectToDevice(BLEDevice dev) async { var ownDevice = dev as WebBleDevice; var device = ownDevice.device; setMidiSetupStatus(MidiSetupStatus.deviceConnecting); await device.connect(); final services = await device.discoverServices(); final service = services .firstWhere((service) => service.uuid == BLEController.midiServiceGuid); // Now get the characteristic _characteristic = await service.getCharacteristic(BLEController.midiCharacteristicGuid); await _characteristic?.startNotifications(); _device = dev; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _deviceStreamSubscription = device.connected.listen((event) { if (event == false) { _deviceStreamSubscription?.cancel(); _device = null; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); } }); return null; } @override void disconnectDevice() { // TODO: implement disconnectDevice _device?.device.disconnect(); _device = null; _characteristic = null; } @override void startScanning() async { final requestOptions = RequestOptionsBuilder.acceptAllDevices( optionalServices: [BLEController.midiServiceGuid]); try { final device = await FlutterWebBluetooth.instance.requestDevice(requestOptions); final scanResult = WebBleScanResult(device); onScanResults([scanResult], []); setMidiSetupStatus(MidiSetupStatus.deviceFound); } on UserCancelledDialogError { // The user cancelled the dialog } on DeviceNotFoundError { // There is no device in range for the options defined above } } @override void stopScanning() {} @override StreamSubscription> registerDataListener( Function(List data) listener) { StreamController> streamCtrl = StreamController(); var dataSubscr = _characteristic?.value.listen((data) { var listData = data.buffer.asUint8List().toList(growable: false); streamCtrl.add(listData); }); streamCtrl.onCancel = () { dataSubscr?.cancel(); }; return streamCtrl.stream.listen(listener); } @override bool get isWriteReady => _characteristic != null; @override Future writeToCharacteristic(List data, noResponse) async { Uint8List byteData = Uint8List.fromList(data); if (noResponse) { return _characteristic!.writeValueWithoutResponse(byteData); } else { return _characteristic!.writeValueWithResponse(byteData); } } @override void dispose() { _bluetoothStateSubscription?.cancel(); } _subscribeBleState() { _bluetoothStateSubscription = FlutterWebBluetooth.instance.isAvailable.listen((event) { if (lastBleState != null && lastBleState == event) return; debugPrint("Ble state ${event.toString()}"); bleState = event ? BleState.on : BleState.off; lastBleState = event; if (event) { bleState = BleState.on; setMidiSetupStatus(MidiSetupStatus.deviceSearching); startScanning(); } else { bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); } }); } } ================================================ FILE: lib/bluetooth/ble_controllers/WinBleController.dart ================================================ /* Controller that uses win_ble plugin for adding BLE support for Windows https://pub.dev/packages/win_ble Summary State: Unusable BLE support detection works 10% of the time Connection to the device works IF the peripheral device sends a packet that has a byte with value 0x40, maybe also 0x41, the packet is not received at all: https://github.com/rohitsangwan01/win_ble/issues/17 */ /* import 'dart:async'; import 'dart:typed_data'; import 'package:win_ble/win_ble.dart' as ble; import 'BLEController.dart'; class WinBleScanResult extends BLEScanResult { @override String get id => (device as WinBleDevice).id; @override String get name => (device as WinBleDevice).name; WinBleScanResult(ble.BleDevice dev) { device = WinBleDevice(dev); } } class WinBleDevice extends BLEDevice { final ble.BleDevice _device; WinBleDevice(this._device); @override // TODO: implement id String get id => _device.address; @override // TODO: implement name String get name => _device.name; String get address => _device.address; ble.BleDevice get device => _device; @override // TODO: implement state Stream get state => throw UnimplementedError(); } class WinBleController extends BLEController { WinBleController(List forcedDevices) : super(forcedDevices); WinBleDevice? _device; ble.BleCharacteristic? _midiCharacteristic; bool _connectInProgress = false; bool? _bleSupported; bool _scanning = false; DateTime _scanStarted = DateTime.now(); List scannedDevices = []; late List nuxDeviceNames; StreamSubscription? _scanSubscription; StreamSubscription? _bluetoothStateSubscription; StreamSubscription? _deviceStreamSubscription; @override BLEDevice? get connectedDevice => _device; @override Future init(ScanResultsCallback callback) async { await super.init(callback); nuxDeviceNames = deviceListProvider.call(); _subscribeBleState(); _subscribeScanResults(); await ble.WinBle.initialize(enableLog: false); print("WinBle controller init."); bleState = BleState.on; } @override Future isAvailable() async { for (int i = 0; i < 10; i++) { if (_bleSupported != null) break; await Future.delayed(const Duration(milliseconds: 200)); } if (_bleSupported == null) { print("Can't get info if bluetooth is supported"); } return _bleSupported ?? false; } @override void startScanning() { if (bleState == BleState.off) return; scannedDevices.clear(); _scanSubscription?.cancel(); _subscribeScanResults(); ble.WinBle.startScanning(); setMidiSetupStatus(MidiSetupStatus.deviceSearching); setScanningStatus(true); _scanning = true; _scanStarted = DateTime.now(); } @override void stopScanning() { if (bleState == BleState.off) return; _scanSubscription?.cancel(); ble.WinBle.stopScanning(); setScanningStatus(false); _scanning = false; } @override Future connectToDevice(BLEDevice device) async { if (bleState != BleState.on) return null; WinBleDevice ownDevice = device as WinBleDevice; bool ampDevice = false; if (deviceListProvider.call().contains(ownDevice.name)) { ampDevice = true; if (_connectInProgress || _device != null) { print("Denying secondary connection!"); return null; } } _connectInProgress = true; stopScanning(); setMidiSetupStatus(MidiSetupStatus.deviceConnecting); try { await ble.WinBle.connect(ownDevice.address); } on Exception { _connectInProgress = false; return null; } catch (e) { print("Connect error $e"); _connectInProgress = false; return null; } if (ampDevice) { if (_device != null) return null; _device = device; } var services = await ble.WinBle.discoverServices(_device!.address); if (services.contains(BLEController.midiServiceGuid)) { List bleCharacteristics = await ble.WinBle.discoverCharacteristics( address: _device!.address, serviceId: BLEController.midiServiceGuid); for (var characteristic in bleCharacteristics) { if (characteristic.uuid == BLEController.midiCharacteristicGuid) { if (ampDevice) { _connectAmpDevice(_device!.device, characteristic); } else { ble.WinBle.subscribeToCharacteristic( address: _device!.address, serviceId: BLEController.midiServiceGuid, characteristicId: characteristic.uuid); _connectInProgress = false; //Stream _connectionStream = //ble.WinBle.connectionStreamOf(_device.address) //return BLEConnection(characteristic.value); } break; } } } return null; } void _connectAmpDevice( ble.BleDevice device, ble.BleCharacteristic characteristic) async { _midiCharacteristic = characteristic; await ble.WinBle.subscribeToCharacteristic( address: device.address, serviceId: BLEController.midiServiceGuid, characteristicId: characteristic.uuid); _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceConnected); _deviceStreamSubscription = ble.WinBle.connectionStreamOf(device.address).listen((event) { if (event == false) { _deviceStreamSubscription?.cancel(); _device = null; _midiCharacteristic = null; _connectInProgress = false; setMidiSetupStatus(MidiSetupStatus.deviceDisconnected); } }); } @override void disconnectDevice() async { if (bleState != BleState.on) return; if (_device != null) { _connectInProgress = false; await ble.WinBle.disconnect(_device!.address); } } @override void dispose() { _scanSubscription?.cancel(); _bluetoothStateSubscription?.cancel(); _deviceStreamSubscription?.cancel(); ble.WinBle.dispose(); } @override StreamSubscription> registerDataListener( Function(List data) listener) { StreamController> streamCtrl = StreamController(); // ble.WinBle.characteristicValueStream.listen((event) { // print(event); // }); var dataSubscr = ble.WinBle.characteristicValueStreamOf( address: _device!.address, serviceId: BLEController.midiServiceGuid, characteristicId: _midiCharacteristic!.uuid) .listen((data) { streamCtrl.add(data.cast()); }); streamCtrl.onCancel = () { dataSubscr.cancel(); }; return streamCtrl.stream.listen(listener); } @override bool get isWriteReady => _midiCharacteristic != null; @override Future writeToCharacteristic(List data) { Uint8List byteData = Uint8List.fromList(data); print("WinBle: Write $data"); return ble.WinBle.write( address: _device!.address, service: BLEController.midiServiceGuid, characteristic: _midiCharacteristic!.uuid, data: byteData, writeWithResponse: false); } void _subscribeBleState() { _bluetoothStateSubscription = ble.WinBle.bleState.listen((ble.BleState event) { print("Ble Event: $event"); _bleSupported = true; switch (event) { case ble.BleState.On: bleState = BleState.on; //setMidiSetupStatus(MidiSetupStatus.deviceSearching); //startScanning(); break; case ble.BleState.Off: case ble.BleState.Unknown: case ble.BleState.Disabled: bleState = BleState.off; setMidiSetupStatus(MidiSetupStatus.bluetoothOff); if (_scanning) stopScanning(); break; case ble.BleState.Unsupported: _bleSupported = false; break; } }); } void _subscribeScanResults() { _scanSubscription = ble.WinBle.scanStream.listen((device) { final index = scannedDevices .indexWhere((element) => element.address == device.address); // Updating existing device if (index != -1) { if (device.name.isNotEmpty && scannedDevices[index].name.isEmpty) { scannedDevices[index].name = device.name; } if (device.serviceUuids.isNotEmpty && scannedDevices[index].serviceUuids.isEmpty) { scannedDevices[index].serviceUuids = device.serviceUuids; } } else { scannedDevices.add(device); } if ((DateTime.now().difference(_scanStarted).inMilliseconds < 5000)) { return; } stopScanning(); scannedDevices.retainWhere((device) => nuxDeviceNames.containsPartial(device.name) && device.serviceUuids.contains("{${BLEController.midiServiceGuid}}")); List nuxBle = [], ctrlBle = []; for (var dev in scannedDevices) { nuxBle.add(WinBleScanResult(dev)); } onScanResults(nuxBle, []); setMidiSetupStatus(MidiSetupStatus.deviceFound); }); } } */ ================================================ FILE: lib/bluetooth/devices/NuxConstants.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'NuxFXID.dart'; class AppConstants { static const patcherUrl = "https://github.com/tuntorius/nux-ir-patcher#nux-ir-patcher"; } class EProductNo { static const CHERUB_VID = 8721; static const TAPECORE_PID = 0; static const STAGEMAN_PID = 16; static const CERBERUS_PID = 32; static const MIGHTYBT_PID = 48; static const MIGHTYLITE_PID = 64; static const TAP5_PID = 102; } class CherubSysExMessageID { static const cSysExRollCallMsgID = 0; static const cSysExDeviceSpecMsgID = 7; } class SysCtrlState { static const syscmd_null = 0; static const syscmd_save = 48; static const syscmd_footsw = 49; static const syscmd_resetall = 50; static const syscmd_refresh_preset = 51; static const syscmd_bt = 64; static const syscmd_eco_pro = 65; static const syscmd_dsprun_battery = 66; static const syscmd_usbaudio = 67; static const speccmd_auxeqsave = 68; static const speccmd_speakereqsave = 69; static const syscmd_midicc_ex = 112; } class DeviceMessageID { static const devReqFwID = 0; static const devReqMIDIParaMsgID = 0; static const devGetMIDIParaMsgID = 1; static const devSetMIDIParaMsgID = 2; static const devReqCurCCMsgID = 3; static const devReqCurNRPNMsgID = 4; static const devSysCtrlMsgID = 5; static const devReqPresetMsgID = 6; //request preset static const devGetPresetMsgID = 7; static const devSetPresetMsgID = 8; static const devReqCurLoopMsgID = 9; static const devProjectMsgID = 16; static const devReqManuMsgID = 22; static const devGetManuMsgID = 23; static const devSetManuMsgID = 24; static const devSetPresetNameMsgID = 32; static const devNullDataID = 80; static const devParaDataID = 81; static const devCabDataSetID = 88; static const devCabDataGetID = 89; static const devCrcNameGetId = 92; static const devCablevelGetId = 94; static const devCabLCGetId = 96; static const devCabHCGetId = 98; static const devOpenTapLedMsgID = 10; static const padReqCurCCMsgID = 19; static const devHadrWareTestID = 100; static const devDfuEnterID = 102; static const devSysStateID = 103; static const devDfuDataSetID = 104; static const devDfuDataGetID = 105; } class PresetDataIndexPlugAir { static const ngenable = 0; static const ngthresold = 1; static const ngsustain = 2; static const efxenable = 3; static const efxtype = 4; static const efxvar1 = 5; static const efxvar2 = 6; static const efxvar3 = 7; static const ampenable = 8; static const amptype = 9; static const ampgain = 10; static const amplevel = 11; static const ampbass = 12; static const ampmiddle = 13; static const amptreble = 14; static const amptone = 15; static const cabenable = 16; static const cabtype = 17; static const cabgain = 18; static const modfxenable = 19; static const modfxtype = 20; static const modfxrate = 21; static const modfxvar1rate = 21; static const modfxdepth = 22; static const modfxvar2depth = 22; static const modfxmix = 23; static const modfxvar3mix = 23; static const delayenable = 24; static const delaytype = 25; static const delaytime = 26; static const delayvar1time = 26; static const delayfeedback = 27; static const delayvar2feedback = 27; static const delaymix = 28; static const delayvar3mix = 28; static const reverbenable = 29; static const reverbtype = 30; static const reverbdecay = 31; static const reverbvar1decay = 31; static const reverbdamp = 32; static const reverbvar2damp = 32; static const reverbmix = 33; static const reverbvar3mix = 33; } class PresetDataIndex8BT { //use PresetDataIndexLite for most of the constants } class PresetDataIndex2040BT { static const ngenable = 0; static const ngthresold = 1; static const wah_enable = 2; static const wah_pedal = 3; static const amp_type = 4; static const amp_gain = 5; static const amp_level = 6; static const amp_bass = 7; static const amp_mid = 8; static const amp_high = 9; static const mod_enable = 10; static const mod_type = 11; static const mod_rate = 12; static const mod_depth = 13; static const mod_mix = 14; static const dly_enable = 15; static const dly_type = 16; static const dly_time = 17; static const dly_feedback = 18; static const dly_mix = 19; static const rvb_enable = 20; static const rvb_type = 21; static const rvb_decay = 22; static const rvb_damp = 23; static const rvb_mix = 24; static const tap_time_flag = 25; static const tap_time_value_h = 26; static const tap_time_value_l = 27; } class PresetDataIndexLite { static const ngenable = 0; static const ngthresold = 1; static const ngsustain = 2; static const drivetype = 3; static const drivesubtype1 = 4; static const drivesubtype2 = 5; static const drivesubtype3 = 6; static const drivegain = 7; static const drivelevel = 8; static const drivebass = 9; static const drivemid = 10; static const drivetreble = 11; static const drivetone = 12; static const modfxenable = 13; static const modfxtype = 14; static const modfxrate = 15; static const modfxdepth = 16; static const modfxmix = 17; static const efxenable = 18; static const efxtype = 19; static const reverbtype = 20; static const reverbdecay = 21; static const reverbmix = 22; static const delaytype = 23; static const delaytime = 24; static const delayfeedback = 25; static const delaymix = 26; static const tap_time_flag = 27; static const tap_time_bpm_h = 28; static const tap_time_bpm_l = 29; static const tap_time_value_h = 30; static const tap_time_value_l = 31; static const reverbenable = 32; static const delayenable = 33; static const miclevel = 34; static const micambsend = 35; } class PresetDataIndexPlugPro { static const effectTypesIndex = [ Head_iCMP, Head_iEFX, Head_iAMP, Head_iEQ, Head_iNG, Head_iMOD, Head_iDLY, Head_iRVB, Head_iCAB, //Head_iSR ]; static const defaultEffects = [ PlugProFXID.gate, PlugProFXID.comp, PlugProFXID.mod, PlugProFXID.efx, PlugProFXID.amp, PlugProFXID.cab, PlugProFXID.eq, PlugProFXID.reverb, PlugProFXID.delay ]; static const Head_iWAH = 0; static const Head_iCMP = 1; static const Head_iEFX = 2; static const Head_iAMP = 3; static const Head_iEQ = 4; static const Head_iNG = 5; static const Head_iMOD = 6; static const Head_iDLY = 7; static const Head_iRVB = 8; static const Head_iCAB = 9; static const Head_iSR = 10; static const WAH_Count = 11; static const WAH_Para1 = 12; static const WAH_Para2 = 13; static const CMP_Count = 14; static const CMP_Para1 = 15; static const CMP_Para2 = 16; static const CMP_Para3 = 17; static const CMP_Para4 = 18; static const EFX_Count = 19; static const EFX_Para1 = 20; static const EFX_Para2 = 21; static const EFX_Para3 = 22; static const EFX_Para4 = 23; static const EFX_Para5 = 24; static const EFX_Para6 = 25; static const AMP_Count = 26; static const AMP_Para1 = 27; static const AMP_Para2 = 28; static const AMP_Para3 = 29; static const AMP_Para4 = 30; static const AMP_Para5 = 31; static const AMP_Para6 = 32; static const AMP_Para7 = 33; static const AMP_Para8 = 34; static const EQ_Count = 35; static const EQ_Para1 = 36; static const EQ_Para2 = 37; static const EQ_Para3 = 38; static const EQ_Para4 = 39; static const EQ_Para5 = 40; static const EQ_Para6 = 41; static const EQ_Para7 = 42; static const EQ_Para8 = 43; static const EQ_Para9 = 44; static const EQ_Para10 = 45; static const EQ_Para11 = 46; static const EQ_Para12 = 47; static const NG_Count = 48; static const NG_Para1 = 49; static const NG_Para2 = 50; static const NG_Para3 = 51; static const NG_Para4 = 52; static const MOD_Count = 53; static const MOD_Para1 = 54; static const MOD_Para2 = 55; static const MOD_Para3 = 56; static const MOD_Para4 = 57; static const MOD_Para5 = 58; static const MOD_Para6 = 59; static const DLY_Count = 60; static const DLY_Para1 = 61; static const DLY_Para2 = 62; static const DLY_Para3 = 63; static const DLY_Para4 = 64; static const DLY_Para5 = 65; static const DLY_Para6 = 66; static const DLY_Para7 = 67; static const DLY_Para8 = 68; static const RVB_Count = 69; static const RVB_Para1 = 70; static const RVB_Para2 = 71; static const RVB_Para3 = 72; static const RVB_Para4 = 73; static const CAB_Count = 74; static const CAB_Para1 = 75; static const CAB_Para2 = 76; static const CAB_Para3 = 77; static const CAB_Para4 = 78; static const CAB_Para5 = 79; static const CAB_Para6 = 80; static const SR_Count = 81; static const SR_Para1 = 82; static const SR_Para2 = 83; static const MASTER = 84; static const delay_time_flag = 85; static const bpmH = 86; static const bpmL = 87; static const BITCTRL = 88; static const LINK1 = 89; static const LINK2 = 90; static const LINK3 = 91; static const LINK4 = 92; static const LINK5 = 93; static const LINK6 = 94; static const LINK7 = 95; static const LINK8 = 96; static const LINK9 = 97; static const LINK10 = 98; static const LINK11 = 99; static const UserName1 = 100; static const UserName2 = 101; static const UserName3 = 102; static const UserName4 = 103; static const UserName5 = 104; static const UserName6 = 105; static const UserName7 = 106; static const UserName8 = 107; static const UserName9 = 108; static const UserName10 = 109; static const UserName11 = 110; static const UserName12 = 111; static const UserName13 = 112; static const UserName14 = 113; static const UserName15 = 114; static const UserName16 = 115; static const swsel1 = 116; static const swsel2 = 117; static const swsel3 = 118; static const pdsel1 = 119; static const pdsel2 = 120; static const version = 121; static const scene1 = 122; static const scene2 = 123; static const scene3 = 124; } class MidiMessageValues { static const controlChange = 0xb0; static const programChange = 0xc0; static const sysExStart = 0xf0; static const sysExEnd = 0xf7; } class SysexPrivacy { final int _value; const SysexPrivacy._internal(this._value); @override toString() => '$_value'; toInt() => _value; static const kSYSEX_PUBLIC = 0x0; static const kSYSEX_PUBLICREPLY = 0x10; static const kSYSEX_RDCTRL = 0x20; static const kSYSEX_IRCTRL = 0x30; static const kSYSEX_PRIVATE = 0x70; } class SyxMsg { final int _value; const SyxMsg._internal(this._value); @override toString() => '$_value'; toInt() => _value; static const kSYX_BPM = 0x03; static const kSYX_LANGUAGE = 0x04; static const kSYX_CPURUN = 0x05; static const kSYX_SWAPPRESET = 0x06; static const kSYX_CPYPRESET = 0x07; static const kSYX_IRSAVEAS = 0x08; static const kSYX_CRCNAME = 0x09; static const kSYX_MANUAL = 0x0A; static const kSYX_PRESET = 0x0B; static const kSYX_CURPRESET = 0x0C; static const kSYX_MODULELINK = 0x0D; static const kSYX_GLOBLE = 0x0E; static const kSYX_MIDICC = 0x0F; static const kSYX_CABDATA = 0x10; static const kSYX_CABCURVE = 0x11; static const kSYX_PRESETNAME = 0x12; static const kSYX_PEDALSET = 0x13; static const kSYX_SYSTEMSET = 0x14; static const kSYX_CURSTATE = 0x15; static const kSYX_IRDELETE = 0x16; static const kSYX_CUTOVER = 0x17; static const kSYX_LOOP = 0x18; static const kSYX_DRUM = 0x19; static const kSYX_CABNAME = 0x1A; static const kSYX_BTSET = 0x1B; //bluetooth eq groups 1-3, however use group 4 to retrieve mute and phase static const kSYX_AUXEQ = 27; static const kSYX_SPKEQ = 28; static const kSYX_SPKSET = 0x1C; static const kSYX_STICKY = 95; static const kSYX_PARAINIT = 0x60; static const kSYX_WELCOME = 0x61; static const kSYX_QTVERSION = 0x62; static const kSYX_UAC_EFFECT = 0x63; static const kSYX_UAC_TRANS = 0x64; static const kSYX_UAC_SAVE = 0x65; static const kSYX_TUNER_SETTINGS = 0x6F; static const kSYX_VOLDISPLAY = 0x74; static const kSYX_SPEC_CMD = 0x75; static const kSYX_HW_VERSION = 0x76; static const kSYX_CODEC_SET = 0x77; static const kSYX_TFT_SET = 0x78; static const kSYX_SNAPSHOTCMD = 0x79; static const kSYX_SNAPSHOT = 0x7A; static const kSYX_RESET = 0x7B; static const kSYX_IRINFO = 0x7C; static const kSYX_DEVINFO = 0x7D; static const kSYX_SENDCMD = 0x7E; static const kSYX_NOUSE = 0x7F; } class SyxDir { static const kSYXDIR_GET = 0; static const kSYXDIR_SET = 1; static const kSYXDIR_REQ = 2; static const kSYXDIR_ACK = 3; static const kSYXDIR_CMD = 4; } class MidiCCValues { static const bCC_NotUsed = -1; //for LITE amp static const bCC_OverDriveEnable = 111; static const bCC_OverDriveDrive = 13; static const bCC_OverDriveTone = 14; static const bCC_OverDriveLevel = 15; static const bCC_OverDriveMode = 16; static const bCC_DistEnable = 84; static const bCC_DistGain = 21; static const bCC_DistTone = 17; static const bCC_DistLevel = 10; static const bCC_DistMode = 12; static const bCC_BoostEnable = 76; static const bCC_BypassEnable = 9; static const bCC_Routing = 11; static const bCC_VolumePedal = 7; static const bCC_VolumePrePost = 47; static const bCC_VolumePedalMin = 46; static const bCC_TempoMSB = 89; static const bCC_TempoLSB = 90; static const bCC_Tap = 64; static const bCC_GateEnable = 22; static const bCC_GateThresold = 23; static const bCC_GateDecay = 24; static const bCC_CabMode = 71; static const bCC_CabMicsel = 70; static const bCC_CabEnable = 101; static const bCC_AmpModeSetup = 75; static const bCC_AmpMode = 78; static const bCC_AmpDrive = 79; static const bCC_AmpPresence = 80; static const bCC_AmpMaster = 81; static const bCC_AmpEnable = 102; static const bCC_AmpBass = 103; static const bCC_AmpMid = 104; static const bCC_AmpHigh = 105; static const bCC_ModfxMode = 58; static const bCC_ModfxRate = 51; static const bCC_ModfxDepth = 52; static const bCC_ChorusMode = 61; static const bCC_ChorusRate = 53; static const bCC_ChorusDepth = 54; static const bCC_ChorusLevel = 55; static const bCC_ModfxEnable = 56; static const bCC_ChorusEnable = 57; static const bCC_DelayMode = 88; static const bCC_DelayTime = 30; static const bCC_DelayRepeat = 31; static const bCC_ReverbMode = 37; static const bCC_DelayLevel = 85; static const bCC_ReverbDecay = 86; static const bCC_ReverbLevel = 87; static const bCC_ReverbRouting = 34; static const bCC_DelayEnable = 28; static const bCC_ReverbEnable = 36; static const bCC_CtrlType = 49; static const bCC_drumOnOff_No = 122; static const bCC_drumType_No = 123; static const bCC_drumLevel_No = 125; static const bCC_drumTempo1 = 0x62; static const bCC_drumTempo2 = 0x63; static const bCC_drumTempoH = 0x06; static const bCC_drumTempoL = 0x26; static const bCC_LoopLevel = 121; static const bCC_LoopCtrl = 124; static const bCC_DrumLed = 126; static const bCC_CtrlCmd = 127; static const bcc_mChrOnOff = 112; static const bcc_gChrOnOff = 57; static const bcc_mRevOnOff = 113; static const bcc_gRevOnOff = 36; static const bcc_gChrRate = 51; static const bcc_gChrDepth = 52; static const bcc_mChrRate = 53; static const bcc_mChrDepth = 54; static const bcc_gRevDecay = 91; static const bcc_gRevDamp = 92; static const bcc_mRevDecay = 93; static const bcc_mRevDamp = 94; static const bcc_gChrType = 60; static const bcc_mChrType = 63; static const bcc_gRevType = 37; static const bcc_mRevType = 39; } class MidiCCValuesPro { static const CC_Unknown = 0; static const Head_iWAH = 0; static const Head_iCMP = 1; static const Head_iEFX = 2; static const Head_iAMP = 3; static const Head_iEQ = 4; static const Head_iNG = 5; static const Head_iMOD = 6; static const Head_iDLY = 7; static const Head_iRVB = 8; static const Head_iCAB = 9; static const Head_iSR = 10; static const TUNER_State = 11; static const TUNER_Note = 12; static const CMP_Para1 = 13; static const CMP_Para2 = 14; static const CMP_Para3 = 15; static const CMP_Para4 = 16; static const EFX_Para1 = 17; static const EFX_Para2 = 18; static const EFX_Para3 = 19; static const EFX_Para4 = 20; static const EFX_Para5 = 21; static const EFX_Para6 = 22; static const AMP_Para1 = 23; static const AMP_Para2 = 24; static const AMP_Para3 = 25; static const AMP_Para4 = 26; static const AMP_Para5 = 27; static const AMP_Para6 = 28; static const AMP_Para7 = 29; static const AMP_Para8 = 30; static const EQ_Para1 = 31; static const EQ_Para2 = 32; static const EQ_Para3 = 33; static const EQ_Para4 = 34; static const EQ_Para5 = 35; static const EQ_Para6 = 36; static const EQ_Para7 = 37; static const EQ_Para8 = 38; static const EQ_Para9 = 39; static const EQ_Para10 = 40; static const EQ_Para11 = 41; static const EQ_Para12 = 42; static const NG_Para1 = 43; static const NG_Para2 = 44; static const NG_Para3 = 45; static const NG_Para4 = 46; static const MOD_Para1 = 47; static const MOD_Para2 = 48; static const MOD_Para3 = 49; static const MOD_Para4 = 50; static const MOD_Para5 = 51; static const MOD_Para6 = 52; static const DLY_Para1 = 53; static const DLY_Para2 = 54; static const DLY_Para3 = 55; static const DLY_Para4 = 56; static const DLY_Para5 = 57; static const DLY_Para6 = 58; static const DLY_Para7 = 59; static const DLY_Para8 = 60; static const RVB_Para1 = 61; static const RVB_Para2 = 62; static const RVB_Para3 = 63; static const RVB_Para4 = 64; static const CAB_Para1 = 65; static const CAB_Para2 = 66; static const CAB_Para3 = 67; static const CAB_Para4 = 68; static const CAB_Para5 = 69; static const CAB_Para6 = 70; static const TUNER_Number = 71; static const TUNER_Cent = 72; static const MASTER = 73; //patch level static const MSELECT = 74; static const PEDAL = 75; static const SCENE = 76; static const DRUMENABLE = 77; static const DRUMTYPE = 78; //drum styles - 0 to xx(66?) static const DRUMLEVEL = 79; static const LOOPLEVEL = 80; //Looper level - confirmed static const LOOPSTATE = 81; static const AUXEQENABLE = 82; //aux eq group 0-3 static const PRESETRANGE = 83; //this sets/receives Active bitfield static const MICVOLUME = 84; static const MICMUTE = 85; static const USBROUNT_1 = 86; //Recording LV static const USBROUNT_2 = 87; //Playback LV static const USBROUNT_3 = 88; //Audio Mode 0-2 //0-dry out, 1 - normal, 2 - reamp, ---x ---- - this bit is for loopback //the loopback is supposed to work with normal only, but I can set it with everything static const USBROUNT_4 = 89; //Dry/Wet static const AUX_MUTE = 90; static const AUX_PHASE = 91; //phase invert static const AUX_BAND_1 = 92; static const AUX_BAND_2 = 93; static const AUX_BAND_3 = 94; static const AUX_BAND_4 = 95; static const AUX_BAND_5 = 96; static const AUX_BAND_6 = 97; static const AUX_BAND_7 = 98; static const AUX_BAND_8 = 99; static const AUX_BAND_9 = 100; static const AUX_BAND_10 = 101; static const AUX_BAND_11 = 102; static const AUX_BAND_12 = 103; //NOT USED static const DRUM_BASS = 104; static const DRUM_MIDDLE = 105; static const DRUM_TREBLE = 106; static const LOOP_ARNR = 107; static const NR_ENABLE = 108; static const NR_SENS = 109; static const NR_DECAY = 110; static const SPK_EQ_GROUP = 111; static const SPK_EQ_VOL = 112; static const SPK_EQ_1 = 113; static const SPK_EQ_2 = 114; static const SPK_EQ_3 = 115; static const SPK_EQ_4 = 116; static const SPK_EQ_5 = 117; static const SPK_EQ_6 = 118; static const SPK_EQ_7 = 119; static const SPK_EQ_8 = 120; static const SPK_EQ_9 = 121; static const SPK_EQ_10 = 122; static const SPK_EQ_11 = 123; static const AUX_SAVE = 125; static const TunerLiteMK2_State = 112; static const TunerLiteMK2_Note = 113; static const TunerLiteMK2_Number = 114; static const TunerLiteMK2_Cent = 115; } ================================================ FILE: lib/bluetooth/devices/NuxDevice.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'dart:convert'; import 'dart:math' as math; import 'package:flutter/widgets.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/communication.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import 'package:qr_utils/qr_utils.dart'; import '../../modules/cloud/presetEncoder.dart'; import '../NuxDeviceControl.dart'; import '../bleMidiHandler.dart'; import "NuxConstants.dart"; import 'NuxFXID.dart'; import 'effects/Processor.dart'; import 'presets/Preset.dart'; import 'value_formatters/ValueFormatter.dart'; class NuxDeviceConfiguration { bool ecoMode = false; //drum settings bool drumsEnabled = false; int selectedDrumStyle = 0; double drumsVolume = 50; double drumsTempo = 120; late List activeChannels; } abstract class NuxDevice extends ChangeNotifier { final NuxDeviceControl deviceControl; int get productVID; int get vendorID { return 8721; } DeviceCommunication get communication; @protected NuxDeviceConfiguration get config; //General device parameters String get productName; String get productNameShort; String get productIconLabel; String get productStringId; String get presetClass; String get productNameForQR => productNameShort; int get productVersion; List get productBLENames; int get channelsCount; int get effectsChainLength; List get processorList; int get amplifierSlotIndex; bool get activeChannelRetrieval; bool get fakeMasterVolume; bool get longChannelNames; bool get cabinetSupport; bool get hackableIRs; int get cabinetSlotIndex; bool get presetSaveSupport; bool get reorderableFXChain; bool get batterySupport; bool get nativeActiveChannelsSupport; ValueFormatter? get decibelFormatter => null; bool get jamTrackChannelChange => false; int get deviceQRId; int get deviceQRVersion; int get channelChangeCC; List channelNames = []; List groupsName = []; //Notifies when an effect is switched on and off final StreamController effectSwitched = StreamController(); //Notifies when an effect in a certain slot is changed final StreamController effectChanged = StreamController(); //Notifies when an effect in a certain slot is changed final StreamController slotSwapped = StreamController(); //Notifies when an effect parameter has changed final StreamController parameterChanged = StreamController(); List presets = []; bool nuxPresetsReceived = false; @protected int selectedChannelP = 0; //nux-based channel index int get selectedChannel => selectedChannelP; void setFirmwareVersion(int ver); void setFirmwareVersionByIndex(int ver); NuxDevice(this.deviceControl) { config.activeChannels = List.filled(channelsCount, true); } int getAvailableVersions() { return 1; } String getProductNameVersion(int version) { return productNameShort; } String getProductNameForQR(int version) { return productNameForQR; } ProcessorInfo? getProcessorInfoByKey(String key) { for (var proc in processorList) { if (proc.keyName == key) return proc; } return null; } int? getSlotByEffectKeyName(String key) { var pi = getProcessorInfoByKey(key); if (pi != null) { return pi.nuxFXID.toInt(); } return null; } ProcessorInfo? getProcessorInfoByFXID(NuxFXID fxid) { return processorList[fxid.toInt()]; } void setSelectedChannel(int chan, {required bool notifyBT, required bool sendFullPreset, required bool notifyUI}) { if (chan >= channelsCount) { debugPrint( "setSelectedChannel error: trying to set to invalid channel $chan"); chan = 0; } if (selectedChannelP != chan) { selectedChannelP = chan; deviceControl.clearPresetData(); if (notifyBT) deviceControl.changeDeviceChannel(selectedChannelP); } if (sendFullPreset) deviceControl.sendFullPresetSettings(); if (deviceControl.isConnected) sendAmpLevel(); if (notifyUI) { deviceControl.forceNotifyListeners(); } } bool getChannelActive(int channel) { return config.activeChannels[channel]; } void toggleChannelActive(int channel) { config.activeChannels[channel] = !config.activeChannels[channel]; //check for at least one channel enabled bool hasEnabled = false; for (var act in config.activeChannels) { if (act == true) hasEnabled = true; } if (!hasEnabled) { config.activeChannels[channel] = true; return; } if (nativeActiveChannelsSupport) { communication.sendActiveChannels(config.activeChannels); } notifyListeners(); } //UI Stuff int selectedSlot = 0; //general settings bool get ecoMode => config.ecoMode; //drum stuff double get drumsMinTempo => 40; double get drumsMaxTempo => 240; bool get drumsEnabled => config.drumsEnabled; int get selectedDrumStyle => config.selectedDrumStyle; double get drumsVolume => config.drumsVolume; double get drumsTempo => config.drumsTempo; void onConnect() { nuxPresetsReceived = false; //reset nux data for (int i = 0; i < presets.length; i++) { presets[i].resetNuxData(); } resetDrumSettings(); } void onDisconnect() { communication.onDisconnect(); deviceControl.onBatteryPercentage(0); } dynamic getDrumStyles(); int getDrumStylesCount() { return (getDrumStyles() as List).length; } void resetDrumSettings() { config.drumsEnabled = false; config.selectedDrumStyle = 0; config.drumsVolume = 50; config.drumsTempo = 120; } void setDrumsEnabled(bool enabled) { config.drumsEnabled = enabled; communication.sendDrumsEnabled(config.drumsEnabled); } void setDrumsStyle(int style) { if (config.selectedDrumStyle == style) return; config.selectedDrumStyle = style; communication.sendDrumsStyle(style); } void setDrumsLevel(double level, bool send) { if (config.drumsVolume == level) return; config.drumsVolume = level; if (send) communication.sendDrumsLevel(level); } void setDrumsTempo(double tempo, bool send) { if (config.drumsTempo == tempo) return; tempo = math.min(math.max(tempo, drumsMinTempo), drumsMaxTempo); config.drumsTempo = tempo; if (send) communication.sendDrumsTempo(tempo); } void setEcoMode(bool enabled) { config.ecoMode = enabled; communication.setEcoMode(enabled); } //used for master volume control void sendAmpLevel() { if (fakeMasterVolume) { //amps are at slot 1 var preset = getPreset(selectedChannel); var amp = preset.getEffectsForSlot(amplifierSlotIndex)[ preset.getSelectedEffectForSlot(amplifierSlotIndex)]; for (int i = 0; i < amp.parameters.length; i++) { if (amp.parameters[i].masterVolume) { deviceControl.sendParameter(amp.parameters[i], false); } } } } Preset getPreset(int index) { return presets[index]; } //used for QR stuff, probably will be removed Preset getCustomPreset(int channel); String getAmpNameByNuxIndex(int index, int version) { return presets[0].getAmpNameByNuxIndex(index, version); } void renameCabinet(int cabIndex, String name) { if (cabinetSupport) { SharedPrefs().setCustomCabinetName(productStringId, cabIndex, name); notifyListeners(); } } List getPresetsList() { return presets; } String channelName(int channel) { return channelNames[channel]; } void onPresetsReady() { if (!activeChannelRetrieval) { setSelectedChannel(0, notifyBT: true, notifyUI: true, sendFullPreset: true); } deviceControl.onPresetsReady(); nuxPresetsReceived = true; } void _handleChannelChange(int index) { var newIndex = index; if (!nativeActiveChannelsSupport) { int attempts = 0; //channel skipping while (config.activeChannels[newIndex] == false) { newIndex++; attempts++; if (newIndex == channelsCount) newIndex = 0; if (attempts > 7) break; } } if (newIndex == index) { setSelectedChannel(index, notifyBT: false, notifyUI: true, sendFullPreset: false); } else { //skipped - update ui setSelectedChannel(newIndex, notifyBT: true, sendFullPreset: false, notifyUI: true); } getPreset(selectedChannel).setupPresetFromNuxData(); //immediately set the amp level sendAmpLevel(); } void _handleKnobReceiveData(List data) { if (data.length < 3) return; //scan through the effects to find which one is controlled var preset = getPreset(selectedChannel); for (int i = 0; i < effectsChainLength; i++) { var selected = preset.getSelectedEffectForSlot(i); var effect = preset.getEffectsForSlot(i)[selected]; var cmdCC = data[1]; bool enable = ((data[2] & 0xc0) != 0) ^ effect.nuxEnableInverted; int effectIndex = data[2] & 0x3f; if (effect.midiCCEnableValue == effect.midiCCSelectionValue && cmdCC == effect.midiCCEnableValue) { var procIndex = preset.getFXIDFromSlot(i); var nuxIndex = preset.getEffectArrayIndexFromNuxIndex(procIndex, effectIndex); preset.setSelectedEffectForSlot(i, nuxIndex, false); preset.setSlotEnabled(i, enable, false); notifyListeners(); return; } else if (cmdCC == effect.midiCCEnableValue) { preset.setSlotEnabled(i, enable, false); notifyListeners(); return; } else if (cmdCC == effect.midiCCSelectionValue) { var procIndex = preset.getFXIDFromSlot(i); var nuxIndex = preset.getEffectArrayIndexFromNuxIndex(procIndex, effectIndex); preset.setSelectedEffectForSlot(i, nuxIndex, false); notifyListeners(); return; } else { for (var param in effect.parameters) { if (param.midiCC == data[1]) { //this is the one to change param.midiValue = data[2]; notifyListeners(); return; } } } } } void onDataReceived(List data) { if (data.length < 2) return; switch (data[0] & 0xf0) { case MidiMessageValues.sysExStart: switch (data[1]) { case DeviceMessageID.devReqMIDIParaMsgID: switch (data[7]) { case DeviceMessageID.devSysCtrlMsgID: switch (data[8]) { case SysCtrlState.syscmd_dsprun_battery: //Is this MP-2 Only? deviceControl.onBatteryPercentage(data[9]); break; } break; } break; } break; case MidiMessageValues.programChange: if (data[1] < channelsCount) _handleChannelChange(data[1]); break; case MidiMessageValues.controlChange: if (data[1] == channelChangeCC) { _handleChannelChange(data[2]); } else if (data[1] == MidiCCValues.bCC_drumOnOff_No) { config.drumsEnabled = data[2] > 0 ? true : false; deviceControl.forceNotifyListeners(); return; } else if (data[1] == MidiCCValues.bCC_drumType_No) { config.selectedDrumStyle = data[2]; deviceControl.forceNotifyListeners(); } else { _handleKnobReceiveData(data); } break; } } void saveNuxPreset() { deviceControl.saveNuxPreset(); } void resetNuxPresets() { nuxPresetsReceived = false; deviceControl.resetNuxPresets(); } bool isPresetSupported(dynamic preset) { String productId = preset["product_id"]; return presetClass == productId; } Widget getSettingsWidget() { return const SizedBox.shrink(); } PresetQRError setupFromQRData(String qrData) { var result = presets[selectedChannel].setupPresetFromQRData(qrData); if (result == PresetQRError.Ok) { deviceControl.clearPresetData(); } return result; } Preset? setupDetachedPresetFromQRData(String qrData) { var p = getCustomPreset(selectedChannel); var result = p.setupPresetFromQRData(qrData); if (result == PresetQRError.Ok) return p; return null; } String? jsonToQR(Map jsonPreset) { var preset = presetFromJson(jsonPreset, null, qrOnly: true); if (preset != null) { var data = preset.createNuxDataFromPreset(); return "${QrUtils.nuxQRPrefix}${base64Encode(data)}"; } return null; } List? jsonToCompressedData(Map jsonPreset) { var preset = presetFromJson(jsonPreset, null, qrOnly: true); if (preset != null) { var data = preset.createNuxDataFromPreset(); var encoded = PresetEncoder.encode(data); return encoded; } return null; } String channelToQR(int channel) { var data = presets[channel].createNuxDataFromPreset(); return "${QrUtils.nuxQRPrefix}${base64Encode(data)}"; } bool checkQRValid(int deviceId, int ver); void parseEffect( Map effect, int slotIndex, Preset devicePreset, int presetVersion, bool unselected, double? overrideLevel) { int fxTypeNuxIndex = effect["fx_type"]; bool enabled = unselected ? false : effect["enabled"]; NuxFXID nuxSlotIndex = devicePreset.getFXIDFromSlot(slotIndex); int fxIndex = devicePreset.getEffectArrayIndexFromNuxIndex( nuxSlotIndex, fxTypeNuxIndex); //check if preset conversion is needed if (presetVersion != productVersion) { //temporarily switch the preset to the other version //to get equivalent from this one devicePreset.setFirmwareVersion(presetVersion); //2 things - either switch the version or convert the preset int? newfxType = devicePreset .getEffectsForSlot(slotIndex)[fxIndex] .getEquivalentEffect(productVersion); if (newfxType != null) { fxTypeNuxIndex = newfxType; fxIndex = devicePreset.getEffectArrayIndexFromNuxIndex( nuxSlotIndex, fxTypeNuxIndex); } else { //if we don't know equivalent then disable it fxTypeNuxIndex = 0; //set to 0 to avoid null references fxIndex = 0; enabled = false; } //revert the preset back devicePreset.setFirmwareVersion(productVersion); } if (!unselected) { devicePreset.setSelectedEffectForSlot(slotIndex, fxIndex, false); devicePreset.setSlotEnabled(slotIndex, enabled, false); } Processor? fx; if (unselected) { var fxList = devicePreset.getEffectsForSlot(slotIndex); for (var searchFx in fxList) { if (searchFx.nuxIndex == fxTypeNuxIndex) fx = searchFx; } } else { fx = devicePreset.getEffectsForSlot( slotIndex)[devicePreset.getSelectedEffectForSlot(slotIndex)]; } if (fx == null) return; for (int f = 0; f < fx.parameters.length; f++) { //this is only for cabs override level if (overrideLevel != null && cabinetSupport && slotIndex == cabinetSlotIndex && fx.parameters[f].handle == "level") { fx.parameters[f].value = overrideLevel; } else { if (presetVersion == productVersion) { if (effect.containsKey(fx.parameters[f].handle)) { fx.parameters[f].value = effect[fx.parameters[f].handle]; } else { debugPrint( "Warning: No key ${fx.parameters[f].handle} for effect $fxTypeNuxIndex in slot $fxTypeNuxIndex"); } } else { //ask the effect for the proper handle var handle = fx.parameters[f].handle; if (effect.containsKey(handle)) { fx.parameters[f].value = effect[handle]; } } } } } Preset? presetFromJson(Map preset, double? overrideLevel, {bool qrOnly = false, bool dontChangeChannel = false}) { var pVersion = preset["version"] ?? 0; var nuxChannel = preset["channel"]; if (!qrOnly) { BLEMidiHandler.instance().clearDataQueue(); if (!dontChangeChannel || jamTrackChannelChange) { setSelectedChannel(nuxChannel, notifyBT: true, notifyUI: true, sendFullPreset: false); } deviceControl.presetName = preset["name"]; var category = PresetsStorage().findCategoryOfPreset(preset); deviceControl.presetCategory = category!["name"]; deviceControl.presetUUID = preset["uuid"]; } Preset p; if (!qrOnly) { p = getPreset(selectedChannel); } else { p = getCustomPreset(nuxChannel); } if (preset.containsKey("volume")) p.setVolume(preset["volume"], !qrOnly); //set the chain order first, if the device supports it if (reorderableFXChain) { int index = 0; for (String key in preset.keys) { var pInfo = getProcessorInfoByKey(key); if (pInfo != null) { p.setFXIDAtSlot(index, pInfo.nuxFXID); index++; } } } //parse selected effects and apply them for (String key in preset.keys) { int? index = getSlotByEffectKeyName(key); if (index != null) { //get effect Map effect = preset[key]; parseEffect(effect, index, p, pVersion, false, overrideLevel); if (!qrOnly) deviceControl.sendFullEffectSettings(index, false); } } //parse unselected effects if (!qrOnly && preset.containsKey(PresetsStorage.inactiveEffectsKey)) { var inactives = preset[PresetsStorage.inactiveEffectsKey]; for (String effectKey in inactives.keys) { int? index = getSlotByEffectKeyName(effectKey); if (index != null) { //get effect for (var effect in inactives[effectKey]) { parseEffect(effect, index, p, pVersion, true, null); } } } } //send slot order last, because it's a message with a response //and due to a bug in android ble stack causing a race condition //it screws up the connection if (!qrOnly) communication.sendSlotOrder(); //update widgets if (!qrOnly) { deviceControl.forceNotifyListeners(); } else { return p; } return null; } Map presetToJson({Preset? customPreset}) { Map mainJson = { "channel": selectedChannel, "product_id": presetClass, "version": productVersion }; Preset p = customPreset ?? getPreset(selectedChannel); if (!fakeMasterVolume) mainJson["volume"] = p.volume; //parse all effects for (int i = 0; i < effectsChainLength; i++) { Processor fx; fx = p.getEffectsForSlot(i)[p.getSelectedEffectForSlot(i)]; var fxData = {}; fxData["fx_type"] = fx.nuxIndex; fxData["enabled"] = p.slotEnabled(i); for (int f = 0; f < fx.parameters.length; f++) { fxData[fx.parameters[f].handle] = fx.parameters[f].value; } var proc = p.getFXIDFromSlot(i); var effect = getProcessorInfoByFXID(proc); mainJson[effect!.keyName] = fxData; } // Save settings for not selected effects var inactiveFX = {}; for (int i = 0; i < effectsChainLength; i++) { List fxSlotList = []; //skip cab block, because it makes the preset huge //while not being very useful if (i == cabinetSlotIndex) continue; List effectsForslot = p.getEffectsForSlot(i); for (int j = 0; j < effectsForslot.length; j++) { if (j == p.getSelectedEffectForSlot(i)) continue; var fxData = {}; fxData["fx_type"] = effectsForslot[j].nuxIndex; // Generic processing of not selected effects Processor fx; fx = effectsForslot[j]; for (int f = 0; f < fx.parameters.length; f++) { fxData[fx.parameters[f].handle] = fx.parameters[f].value; } fxSlotList.add(fxData); } if (fxSlotList.isNotEmpty) { var proc = p.getFXIDFromSlot(i); var effect = getProcessorInfoByFXID(proc); inactiveFX[effect!.keyName] = fxSlotList; } } mainJson[PresetsStorage.inactiveEffectsKey] = inactiveFX; return mainJson; } } ================================================ FILE: lib/bluetooth/devices/NuxFXID.dart ================================================ import "NuxConstants.dart"; class NuxFXID { final int value; const NuxFXID._internal(this.value); @override toString() => '$value'; toInt() => value; static fromInt(int val) => NuxFXID._internal(val); @override bool operator ==(covariant NuxFXID other) => other.value == value; } class PlugAirFXID extends NuxFXID { const PlugAirFXID._internal(int value) : super._internal(value); static const gate = PlugAirFXID._internal(0); static const efx = PlugAirFXID._internal(1); static const amp = PlugAirFXID._internal(2); static const cab = PlugAirFXID._internal(3); static const mod = PlugAirFXID._internal(4); static const delay = PlugAirFXID._internal(5); static const reverb = PlugAirFXID._internal(6); } class PlugProFXID extends NuxFXID { const PlugProFXID._internal(int value) : super._internal(value); static const wah = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iWAH); static const comp = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iCMP); static const efx = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iEFX); static const amp = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iAMP); static const eq = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iEQ); static const gate = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iNG); static const mod = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iMOD); static const delay = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iDLY); static const reverb = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iRVB); static const cab = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iCAB); static const sr = PlugProFXID._internal(PresetDataIndexPlugPro.Head_iSR); //@override //bool operator ==(covariant NuxFXID other) => other.value == value; } class PlugBTFXID extends NuxFXID { const PlugBTFXID._internal(int value) : super._internal(value); static const gate = PlugBTFXID._internal(0); static const amp = PlugBTFXID._internal(1); static const mod = PlugBTFXID._internal(2); static const delay = PlugBTFXID._internal(3); static const reverb = PlugBTFXID._internal(4); } class LiteFXID extends NuxFXID { const LiteFXID._internal(int value) : super._internal(value); static const gate = LiteFXID._internal(0); static const amp = LiteFXID._internal(1); static const mod = LiteFXID._internal(2); static const ambience = LiteFXID._internal(3); } class LiteMK2FXID extends NuxFXID { const LiteMK2FXID._internal(int value) : super._internal(value); static const gate = LiteFXID._internal(0); static const efx = LiteFXID._internal(1); static const amp = LiteFXID._internal(2); static const cab = LiteFXID._internal(3); static const mod = LiteFXID._internal(4); static const delay = LiteFXID._internal(5); static const reverb = LiteFXID._internal(6); } ================================================ FILE: lib/bluetooth/devices/NuxMighty2040BT.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/device_data/processors_list.dart'; import 'NuxConstants.dart'; import 'communication/communication.dart'; import 'communication/liteCommunication.dart'; import 'device_data/drumstyles.dart'; import 'presets/MightyXXBTPreset.dart'; import '../NuxDeviceControl.dart'; import 'NuxDevice.dart'; import 'effects/Processor.dart'; import 'presets/Preset.dart'; enum M2040BTChannel { Clean1, Overdrive1, Metal1, Lead1, Clean2, Overdrive2, Metal2, Lead2 } class NuxMighty2040BT extends NuxDevice { @override int get productVID => 48; late final LiteCommunication _communication = LiteCommunication(this, config); @override DeviceCommunication get communication => _communication; final NuxDeviceConfiguration _config = NuxDeviceConfiguration(); @override NuxDeviceConfiguration get config => _config; @override String get productName => "NUX Mighty 20/40 BT"; @override String get productNameShort => "Mighty 20/40 BT"; @override String get productStringId => "mighty_20_40bt"; @override String get presetClass => productStringId; @override int get productVersion => 0; @override String get productIconLabel => "20/40|BT"; @override List get productBLENames => ["NUX MIGHTY20BT", "NUX MIGHTY40BT"]; @override int get channelsCount => 8; @override int get effectsChainLength => 5; int get groupsCount => 1; @override int get amplifierSlotIndex => 1; @override bool get fakeMasterVolume => true; @override bool get activeChannelRetrieval => false; @override bool get longChannelNames => true; @override bool get cabinetSupport => false; @override bool get hackableIRs => false; @override int get cabinetSlotIndex => 0; @override bool get presetSaveSupport => true; @override bool get reorderableFXChain => false; @override bool get batterySupport => false; @override bool get nativeActiveChannelsSupport => false; @override int get channelChangeCC => MidiCCValues.bCC_AmpMode; @override int get deviceQRId => 7; @override int get deviceQRVersion => 1; @override bool get jamTrackChannelChange => true; @override List get groupsName => ["All"]; //, "Group 2"]; @override List get processorList => ProcessorsList.bt2040List; List presets1 = []; List presets2 = []; NuxMighty2040BT(NuxDeviceControl devControl) : super(devControl) { //get channel names for (var element in M2040BTChannel.values) { channelNames.add(element.toString().split('.')[1]); } //clean presets1.add(MXXBTPreset( device: this, channel: M2040BTChannel.Clean1.index, channelName: "Clean 1")); //OD presets1.add(MXXBTPreset( device: this, channel: M2040BTChannel.Overdrive1.index, channelName: "Drive 1")); //Metal presets1.add(MXXBTPreset( device: this, channel: M2040BTChannel.Metal1.index, channelName: "Metal 1")); //Lead presets1.add(MXXBTPreset( device: this, channel: M2040BTChannel.Lead1.index, channelName: "Lead 1")); presets2.add(MXXBTPreset( device: this, channel: M2040BTChannel.Clean2.index, channelName: "Clean 2")); //OD presets2.add(MXXBTPreset( device: this, channel: M2040BTChannel.Overdrive2.index, channelName: "Drive 2")); //Metal presets2.add(MXXBTPreset( device: this, channel: M2040BTChannel.Metal2.index, channelName: "Metal 2")); //Lead presets2.add(MXXBTPreset( device: this, channel: M2040BTChannel.Lead2.index, channelName: "Lead 2")); presets.addAll(presets1); presets.addAll(presets2); } @override dynamic getDrumStyles() => DrumStyles.drumStyles2040BT; @override void setFirmwareVersion(int ver) {} @override void setFirmwareVersionByIndex(int ver) {} @override MXXBTPreset getCustomPreset(int channel) { var preset = MXXBTPreset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override bool checkQRValid(int deviceId, int ver) { return deviceId == deviceQRId; } } ================================================ FILE: lib/bluetooth/devices/NuxMighty8BT.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/device_data/processors_list.dart'; import 'NuxConstants.dart'; import 'communication/communication.dart'; import 'communication/liteCommunication.dart'; import 'device_data/drumstyles.dart'; import 'presets/Mighty8BTPreset.dart'; import '../NuxDeviceControl.dart'; import 'NuxDevice.dart'; import 'effects/Processor.dart'; enum M8BTChannel { Clean, Overdrive, Distortion } class NuxMighty8BT extends NuxDevice { @override int get productVID => 48; late final LiteCommunication _communication = LiteCommunication(this, config); @override DeviceCommunication get communication => _communication; final NuxDeviceConfiguration _config = NuxDeviceConfiguration(); @override NuxDeviceConfiguration get config => _config; @override String get productName => "NUX Mighty 8 BT"; @override String get productNameShort => "Mighty 8 BT"; @override String get productIconLabel => "8 BT"; @override String get productStringId => "mighty_8bt"; @override String get presetClass => productStringId; @override int get productVersion => 0; @override List get productBLENames => ["NUX MIGHTY8BT"]; @override int get channelsCount => 3; @override int get effectsChainLength => 5; @override int get amplifierSlotIndex => 1; @override bool get fakeMasterVolume => true; @override bool get activeChannelRetrieval => false; @override bool get longChannelNames => true; @override bool get cabinetSupport => false; @override bool get hackableIRs => false; @override int get cabinetSlotIndex => 0; @override bool get presetSaveSupport => true; @override bool get reorderableFXChain => false; @override bool get batterySupport => false; @override bool get nativeActiveChannelsSupport => false; @override int get channelChangeCC => MidiCCValues.bCC_AmpModeSetup; @override int get deviceQRId => 12; @override int get deviceQRVersion => 1; @override bool get jamTrackChannelChange => true; @override List get processorList => ProcessorsList.mighty8BTList; List channelNames = []; NuxMighty8BT(NuxDeviceControl devControl) : super(devControl) { //get channel names for (var element in M8BTChannel.values) { channelNames.add(element.toString().split('.')[1]); } //clean presets.add(M8BTPreset( device: this, channel: M8BTChannel.Clean.index, channelName: "Clean")); //OD presets.add(M8BTPreset( device: this, channel: M8BTChannel.Overdrive.index, channelName: "Drive")); //Dist presets.add(M8BTPreset( device: this, channel: M8BTChannel.Distortion.index, channelName: "Dist")); } @override dynamic getDrumStyles() => DrumStyles.drumStyles8BT; @override void setFirmwareVersion(int ver) {} @override void setFirmwareVersionByIndex(int ver) {} @override M8BTPreset getCustomPreset(int channel) { var preset = M8BTPreset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override bool checkQRValid(int deviceId, int ver) { return deviceId == deviceQRId; } } ================================================ FILE: lib/bluetooth/devices/NuxMighty8BTMk2.dart ================================================ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/device_specific_settings/PlugProSettings.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/communication.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import '../../UI/pages/device_specific_settings/LiteMk2Settings.dart'; import 'NuxConstants.dart'; import 'communication/liteMk2Communication.dart'; import 'device_data/drumstyles.dart'; import 'device_data/processors_list.dart'; import 'effects/plug_pro/EQ.dart'; import 'features/drumsTone.dart'; import 'features/looper.dart'; import 'features/proUsbSettings.dart'; import 'features/tuner.dart'; import 'presets/MightyMk2Preset.dart'; import 'value_formatters/ValueFormatter.dart'; enum LiteMK2Version { LiteMK2v1 } class NuxMighty8BT2Configuration extends NuxDeviceConfiguration { static const bluetoothEQCount = 4; double drumsBass = 50; double drumsMiddle = 50; double drumsTreble = 50; int routingMode = 1; int recLevel = 50; int playbackLevel = 50; int usbDryWet = 50; //Bluetooth and mic EQTenBandBT bluetoothEQ = EQTenBandBT(); int bluetoothGroup = 0; bool bluetoothEQMute = false; bool bluetoothInvertChannel = false; bool micMute = false; int micVolume = 50; bool micNoiseGate = false; int micNGSensitivity = 50; int micNGDecay = 50; LooperData looperData = LooperData(); TunerData tunerData = TunerData(); } class NuxMighty8BTMk2 extends NuxDevice implements Tuner, ProUsbSettings, DrumsTone, Looper { NuxMighty8BTMk2(super.devControl) { //get channel names for (int i = 0; i < channelsCount; i++) { presets.add(MightyMk2Preset( device: this, channel: i, channelName: (i + 1).toString())); channelNames.add((i + 1).toString()); } } late final LiteMk2Communication _communication = LiteMk2Communication(this, config); final NuxMighty8BT2Configuration _config = NuxMighty8BT2Configuration(); LiteMK2Version version = LiteMK2Version.LiteMK2v1; @override String get productName => "NUX Mighty 8BT MKII"; @override String get productNameShort => "Mighty 8BT MKII"; @override String get productStringId => "mighty_lite2"; @override int get productVersion => version.index; @override String get productIconLabel => "LITE II|-|8BT II"; @override List get productBLENames => ["NUX NGA-8BT", "MIGHTY 8BT MKII"]; @override int get productVID => 0; @override bool get activeChannelRetrieval => true; @override bool get batterySupport => false; @override bool get cabinetSupport => true; @override int get channelChangeCC => -1; @override int get channelsCount => 7; @override ValueFormatter? get decibelFormatter => ValueFormatters.decibelMPPro; @override DeviceCommunication get communication => _communication; @override // TODO: implement config NuxMighty8BT2Configuration get config => _config; @override int get deviceQRId => 0x14; int get deviceQRIdAlt => 0x13; //Mighty lite QR @override int get deviceQRVersion => 0x01; @override int get effectsChainLength => 7; @override bool get fakeMasterVolume => false; @override bool get hackableIRs => false; @override bool get longChannelNames => false; @override bool get nativeActiveChannelsSupport => true; @override bool get reorderableFXChain => false; @override int get amplifierSlotIndex => 2; @override int get cabinetSlotIndex => 3; @override String get presetClass => "mighty_amps_mk2"; @override bool get presetSaveSupport => true; @override double get drumsBass => _config.drumsBass; @override double get drumsMiddle => _config.drumsMiddle; @override double get drumsTreble => _config.drumsTreble; @override double get drumsMaxTempo => 300; @override int get loopState => config.looperData.loopState; @override int get loopUndoState => config.looperData.loopUndoState; @override int get loopRecordMode => config.looperData.loopRecordMode; @override double get loopLevel => config.looperData.loopLevel; final looperController = StreamController.broadcast(); @override List get processorList => ProcessorsList.liteMk2List; final _tunerController = StreamController.broadcast(); int? _drumStylesCount; @override getDrumStyles() => DrumStyles.drumCategoriesPro; @override int getDrumStylesCount() { if (_drumStylesCount == null) { _drumStylesCount = 0; for (var cat in DrumStyles.drumCategoriesPro.values) { _drumStylesCount = _drumStylesCount! + cat.length; } } return _drumStylesCount!; } @override void setFirmwareVersion(int ver) { // TODO: implement setFirmwareVersion } @override void setFirmwareVersionByIndex(int ver) { // TODO: implement setFirmwareVersionByIndex } @override Widget getSettingsWidget() { return PlugProSettings(device: this, mightySpace: false); } @override bool checkQRValid(int deviceId, int ver) { if (deviceId != deviceQRId && deviceId != deviceQRIdAlt) return false; return ver == 1; } @override MightyMk2Preset getCustomPreset(int channel) { var preset = MightyMk2Preset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override void setDrumsTone(double value, DrumsToneControl control, bool send) { switch (control) { case DrumsToneControl.bass: _config.drumsBass = value; break; case DrumsToneControl.middle: _config.drumsMiddle = value; break; case DrumsToneControl.treble: _config.drumsTreble = value; break; } if (send) _communication.setDrumsTone(value, control); } @override bool get tunerAvailable { return deviceControl.isConnected; } @override void tunerEnable(bool enable) { _communication.enableTuner(enable); } @override void tunerRequestSettings() { _communication.requestTunerSettings(); } @override void tunerSetMode(TunerMode mode) { _config.tunerData.mode = mode; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerSetReferencePitch(int refPitch) { _config.tunerData.referencePitch = refPitch; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerMute(bool enable) { _config.tunerData.muted = enable; _communication.tunerSetSettings(); notifyTunerListeners(); } @override Stream getTunerDataStream() { return _tunerController.stream; } @override void notifyTunerListeners() { _tunerController.add(_config.tunerData); } @override int get tunerNoteCC => MidiCCValuesPro.TunerLiteMK2_Note; @override int get tunerPitchCC => MidiCCValuesPro.TunerLiteMK2_Cent; @override int get tunerStateCC => MidiCCValuesPro.TunerLiteMK2_State; @override int get tunerStringCC => MidiCCValuesPro.TunerLiteMK2_Number; @override void setUsbMode(int mode) { _config.routingMode = mode; communication.setUsbAudioMode(mode); } @override void setUsbRecordingVol(int vol) { _config.recLevel = vol; communication.setUsbInputVolume(vol); } @override void setUsbPlaybackVol(int vol) { _config.playbackLevel = vol; communication.setUsbOutputVolume(vol); } @override void setUsbDryWetVol(int vol) { _config.usbDryWet = vol; _communication.setUsbDryWet(vol); } @override Stream getLooperDataStream() { return looperController.stream; } void notifyLooperListeners() { looperController.add(config.looperData); } @override void looperClear() { _communication.looperClear(); } @override void looperRecordPlay() { _communication.looperRecord(); } @override void looperStop() { _communication.looperStop(); } @override void looperUndoRedo() { _communication.looperUndoRedo(); } @override void looperLevel(int vol) { config.looperData.loopLevel = vol.toDouble(); _communication.looperVolume(vol); } @override void looperNrAr(bool auto) { config.looperData.loopRecordMode = auto ? 1 : 0; _communication.looperNrAr(auto); } @override void requestLooperSettings() { _communication.requestLooperSettings(); } } ================================================ FILE: lib/bluetooth/devices/NuxMightyLite.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/device_data/processors_list.dart'; import 'NuxConstants.dart'; import 'communication/communication.dart'; import 'communication/liteCommunication.dart'; import 'device_data/drumstyles.dart'; import 'presets/MightyLitePreset.dart'; import '../NuxDeviceControl.dart'; import 'NuxDevice.dart'; import 'effects/Processor.dart'; enum MLiteChannel { Clean, Overdrive, Distortion } class NuxMightyLite extends NuxDevice { @override int get productVID => 64; late final LiteCommunication _communication = LiteCommunication(this, config); @override DeviceCommunication get communication => _communication; final NuxDeviceConfiguration _config = NuxDeviceConfiguration(); @override NuxDeviceConfiguration get config => _config; @override String get productName => "NUX Mighty Lite BT"; @override String get productNameShort => "Mighty Lite"; @override String get productStringId => "mighty_lite"; @override String get presetClass => productStringId; @override int get productVersion => 0; @override String get productIconLabel => "LITE"; @override List get productBLENames => ["NUX MIGHTY LITE", "AirBorne GO", "GUO AN"]; @override int get channelsCount => 3; @override int get effectsChainLength => 4; int get groupsCount => 1; @override int get amplifierSlotIndex => 1; @override bool get fakeMasterVolume => true; @override bool get activeChannelRetrieval => false; @override bool get longChannelNames => true; @override bool get cabinetSupport => false; @override bool get hackableIRs => false; @override int get cabinetSlotIndex => 0; @override bool get presetSaveSupport => true; @override bool get reorderableFXChain => false; @override bool get batterySupport => false; @override bool get nativeActiveChannelsSupport => false; @override int get channelChangeCC => MidiCCValues.bCC_AmpModeSetup; @override int get deviceQRId => 9; @override int get deviceQRVersion => 1; @override bool get jamTrackChannelChange => true; @override List get groupsName => ["Default"]; @override List get processorList => ProcessorsList.liteList; List channelNames = []; NuxMightyLite(NuxDeviceControl devControl) : super(devControl) { //get channel names for (var element in MLiteChannel.values) { channelNames.add(element.toString().split('.')[1]); } //clean presets.add(MLitePreset( device: this, channel: MLiteChannel.Clean.index, channelName: "Clean")); //OD presets.add(MLitePreset( device: this, channel: MLiteChannel.Overdrive.index, channelName: "Drive")); //Dist presets.add(MLitePreset( device: this, channel: MLiteChannel.Distortion.index, channelName: "Dist")); } @override dynamic getDrumStyles() => DrumStyles.drumStyles8BT; @override void setFirmwareVersion(int ver) {} @override void setFirmwareVersionByIndex(int ver) {} @override MLitePreset getCustomPreset(int channel) { var preset = MLitePreset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override bool checkQRValid(int deviceId, int ver) { return deviceId == deviceQRId; } } ================================================ FILE: lib/bluetooth/devices/NuxMightyLiteMk2.dart ================================================ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/communication.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/Processor.dart'; import '../../UI/pages/device_specific_settings/LiteMk2Settings.dart'; import 'NuxConstants.dart'; import 'NuxMightyPlugPro.dart'; import 'communication/liteMk2Communication.dart'; import 'device_data/drumstyles.dart'; import 'device_data/processors_list.dart'; import 'features/drumsTone.dart'; import 'features/proUsbSettings.dart'; import 'features/tuner.dart'; import 'presets/MightyMk2Preset.dart'; import 'value_formatters/ValueFormatter.dart'; enum LiteMK2Version { LiteMK2v1 } class NuxMightyLiteMk2 extends NuxDevice implements Tuner, ProUsbSettings, DrumsTone { NuxMightyLiteMk2(super.devControl) { //get channel names for (int i = 0; i < channelsCount; i++) { presets.add(MightyMk2Preset( device: this, channel: i, channelName: (i + 1).toString())); channelNames.add((i + 1).toString()); } } late final LiteMk2Communication _communication = LiteMk2Communication(this, config); final NuxPlugProConfiguration _config = NuxPlugProConfiguration(); LiteMK2Version version = LiteMK2Version.LiteMK2v1; @override String get productName => "NUX Mighty Lite MKII"; @override String get productNameShort => "Mighty Lite MKII"; @override String get productStringId => "mighty_lite2"; @override int get productVersion => version.index; @override String get productIconLabel => "LITE II|-|8BT II"; @override List get productBLENames => ["NUX NGA-3BT", "MIGHTY LITE BT MKII"]; @override int get productVID => 0; @override bool get activeChannelRetrieval => true; @override bool get batterySupport => false; @override bool get cabinetSupport => true; @override int get channelChangeCC => -1; @override int get channelsCount => 7; @override ValueFormatter? get decibelFormatter => ValueFormatters.decibelMPPro; @override DeviceCommunication get communication => _communication; @override // TODO: implement config NuxDeviceConfiguration get config => _config; @override int get deviceQRId => 0x13; int get deviceQRIdAlt => 0x14; //mighty 8BT mk2 @override int get deviceQRVersion => 0x01; @override int get effectsChainLength => 7; @override bool get fakeMasterVolume => false; @override bool get hackableIRs => false; @override bool get longChannelNames => false; @override bool get nativeActiveChannelsSupport => true; @override bool get reorderableFXChain => false; @override int get amplifierSlotIndex => 2; @override int get cabinetSlotIndex => 3; @override String get presetClass => "mighty_amps_mk2"; @override bool get presetSaveSupport => true; @override double get drumsBass => _config.drumsBass; @override double get drumsMiddle => _config.drumsMiddle; @override double get drumsTreble => _config.drumsTreble; @override double get drumsMaxTempo => 300; @override List get processorList => ProcessorsList.liteMk2List; final _tunerController = StreamController.broadcast(); int? _drumStylesCount; @override getDrumStyles() => DrumStyles.drumCategoriesPro; @override int getDrumStylesCount() { if (_drumStylesCount == null) { _drumStylesCount = 0; for (var cat in DrumStyles.drumCategoriesPro.values) { _drumStylesCount = _drumStylesCount! + cat.length; } } return _drumStylesCount!; } @override void setFirmwareVersion(int ver) { // TODO: implement setFirmwareVersion } @override void setFirmwareVersionByIndex(int ver) { // TODO: implement setFirmwareVersionByIndex } @override Widget getSettingsWidget() { return LiteMk2Settings(device: this); } @override bool checkQRValid(int deviceId, int ver) { if (deviceId != deviceQRId && deviceId != deviceQRIdAlt) return false; return ver == 1; } @override MightyMk2Preset getCustomPreset(int channel) { var preset = MightyMk2Preset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override void setDrumsTone(double value, DrumsToneControl control, bool send) { switch (control) { case DrumsToneControl.bass: _config.drumsBass = value; break; case DrumsToneControl.middle: _config.drumsMiddle = value; break; case DrumsToneControl.treble: _config.drumsTreble = value; break; } if (send) _communication.setDrumsTone(value, control); } @override bool get tunerAvailable { return deviceControl.isConnected; } @override void tunerEnable(bool enable) { _communication.enableTuner(enable); } @override void tunerRequestSettings() { _communication.requestTunerSettings(); } @override void tunerSetMode(TunerMode mode) { _config.tunerData.mode = mode; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerSetReferencePitch(int refPitch) { _config.tunerData.referencePitch = refPitch; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerMute(bool enable) { _config.tunerData.muted = enable; _communication.tunerSetSettings(); notifyTunerListeners(); } @override Stream getTunerDataStream() { return _tunerController.stream; } @override void notifyTunerListeners() { _tunerController.add(_config.tunerData); } @override int get tunerNoteCC => MidiCCValuesPro.TunerLiteMK2_Note; @override int get tunerPitchCC => MidiCCValuesPro.TunerLiteMK2_Cent; @override int get tunerStateCC => MidiCCValuesPro.TunerLiteMK2_State; @override int get tunerStringCC => MidiCCValuesPro.TunerLiteMK2_Number; @override void setUsbMode(int mode) { _config.routingMode = mode; communication.setUsbAudioMode(mode); } @override void setUsbRecordingVol(int vol) { _config.recLevel = vol; communication.setUsbInputVolume(vol); } @override void setUsbPlaybackVol(int vol) { _config.playbackLevel = vol; communication.setUsbOutputVolume(vol); } @override void setUsbDryWetVol(int vol) { _config.usbDryWet = vol; _communication.setUsbDryWet(vol); } } ================================================ FILE: lib/bluetooth/devices/NuxMightyPlugAir.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/device_specific_settings/PlugAirSettings.dart'; import 'package:mighty_plug_manager/bluetooth/devices/device_data/processors_list.dart'; import '../bleMidiHandler.dart'; import 'communication/communication.dart'; import 'communication/plugAirCommunication.dart'; import '../NuxDeviceControl.dart'; import 'NuxConstants.dart'; import 'NuxDevice.dart'; import 'device_data/drumstyles.dart'; import 'effects/Processor.dart'; import 'presets/PlugAirPreset.dart'; import 'presets/Preset.dart'; import 'value_formatters/ValueFormatter.dart'; enum PlugAirChannel { Clean, Overdrive, Distortion, AGSim, Pop, Rock, Funk } enum PlugAirVersion { PlugAir15, PlugAir21 } enum PlugAirVariant { MightyPlug, MightyAir } class NuxMightyPlugConfiguration extends NuxDeviceConfiguration { int usbMode = 0; int inputVol = 50; int outputVol = 50; int btEq = 0; } class NuxMightyPlug extends NuxDevice { //this is used in conversion of very old format of presets which // didn't contain device id. They were always for mighty plug/air static const defaultNuxId = "mighty_plug_air"; @override int get productVID => 48; late final PlugAirCommunication _communication = PlugAirCommunication(this, config); @override DeviceCommunication get communication => _communication; final NuxMightyPlugConfiguration _config = NuxMightyPlugConfiguration(); @override NuxMightyPlugConfiguration get config => _config; PlugAirVersion version = PlugAirVersion.PlugAir21; PlugAirVariant ampVariant = PlugAirVariant.MightyPlug; @override String get productName => "NUX Mighty Plug/Air"; @override String get productNameShort => "Mighty Plug/Air"; @override String get productStringId => "mighty_plug_air"; @override String get presetClass => productStringId; @override int get productVersion => version.index; @override String get productIconLabel => "PLUG|-|AIR"; @override List get productBLENames => ["NUX MIGHTY PLUG", "NUX MIGHTY AIR", "NUX NGA-10W"]; String get mightyAirBLEName => productBLENames[1]; //general settings int get usbMode => config.usbMode; int get inputVol => config.inputVol; int get outputVol => config.outputVol; int get btEq => config.btEq; @override int get channelsCount => 7; @override int get effectsChainLength => 7; int get groupsCount => 1; @override int get amplifierSlotIndex => 2; @override bool get fakeMasterVolume => true; @override bool get activeChannelRetrieval => true; @override bool get longChannelNames => false; @override bool get cabinetSupport => true; @override bool get hackableIRs => true; @override int get cabinetSlotIndex => 3; @override bool get presetSaveSupport => true; @override bool get reorderableFXChain => false; @override bool get batterySupport => true; @override bool get nativeActiveChannelsSupport => false; @override ValueFormatter? get decibelFormatter => ValueFormatters.decibelMP2; @override int get channelChangeCC => MidiCCValues.bCC_CtrlType; @override int get deviceQRId => 11; //alternative id for Mighty Air int get deviceQRIdAlt => 6; @override int get deviceQRVersion => version == PlugAirVersion.PlugAir21 ? 2 : 0; @override List get processorList => ProcessorsList.plugAirList; List guitarPresets = []; List bassPresets = []; List channelNames = []; NuxMightyPlug(NuxDeviceControl devControl) : super(devControl) { //clean guitarPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Clean.index, channelName: "1")); //OD guitarPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Overdrive.index, channelName: "2")); //Dist guitarPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Distortion.index, channelName: "3")); //AGSim guitarPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.AGSim.index, channelName: "4")); //Pop Bass bassPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Pop.index, channelName: "5")); //Rock Bass bassPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Rock.index, channelName: "6")); //Funk Bass bassPresets.add(PlugAirPreset( device: this, channel: PlugAirChannel.Funk.index, channelName: "7")); presets.addAll(guitarPresets); presets.addAll(bassPresets); //get channel names for (var preset in presets) { (preset as PlugAirPreset).setFirmwareVersion(version.index); channelNames.add("Channel ${preset.channelName}"); } } @override dynamic getDrumStyles() => DrumStyles.drumStylesPlug; @override void onConnect() { var name = BLEMidiHandler.instance().connectedDevice?.name; if (name != null && name.contains(mightyAirBLEName)) { ampVariant = PlugAirVariant.MightyAir; } else { ampVariant = PlugAirVariant.MightyPlug; } super.onConnect(); } @override void setFirmwareVersion(int ver) { if (ver < 21) { version = PlugAirVersion.PlugAir15; } else { version = PlugAirVersion.PlugAir21; } //set all presets with that firmware for (var preset in presets) { (preset as PlugAirPreset).setFirmwareVersion(version.index); } } @override void setFirmwareVersionByIndex(int ver) { version = PlugAirVersion.values[ver]; //set all presets with that firmware for (var preset in presets) { (preset as PlugAirPreset).setFirmwareVersion(version.index); } } @override int getAvailableVersions() { return 2; } @override String getProductNameVersion(int version) { switch (PlugAirVersion.values[version]) { case PlugAirVersion.PlugAir15: return "$productNameShort v1.x"; case PlugAirVersion.PlugAir21: return "$productNameShort v2.x"; } } @override String getProductNameForQR(int version) { switch (PlugAirVersion.values[version]) { case PlugAirVersion.PlugAir15: return "$productNameForQR v1.x"; case PlugAirVersion.PlugAir21: return "$productNameForQR v2.x"; } } @override PlugAirPreset getCustomPreset(int channel) { var preset = PlugAirPreset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } //device specific settings void setUsbMode(int mode) { config.usbMode = mode; communication.setUsbAudioMode(mode); } void setUsbInputVol(int vol) { config.inputVol = vol; communication.setUsbInputVolume(vol); } void setUsbOutputVol(int vol) { config.outputVol = vol; communication.setUsbOutputVolume(vol); } void setBtEq(int eq) { config.btEq = eq; communication.setBTEq(eq); } @override Widget getSettingsWidget() { return PlugAirSettings(device: this); } @override bool checkQRValid(int deviceId, int ver) { if (deviceId != deviceQRId && deviceId != deviceQRIdAlt) return false; if (version == PlugAirVersion.PlugAir15 && ver == 0) { return true; } else if (version == PlugAirVersion.PlugAir21 && ver > 0) { return true; } return false; } } ================================================ FILE: lib/bluetooth/devices/NuxMightyPlugPro.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/device_data/processors_list.dart'; import '../../UI/pages/device_specific_settings/PlugProSettings.dart'; import 'NuxConstants.dart'; import 'NuxFXID.dart'; import 'NuxReorderableDevice.dart'; import 'communication/communication.dart'; import 'communication/plugProCommunication.dart'; import '../NuxDeviceControl.dart'; import 'NuxDevice.dart'; import 'device_data/drumstyles.dart'; import 'effects/Processor.dart'; import 'effects/plug_pro/EQ.dart'; import 'features/drumsTone.dart'; import 'features/looper.dart'; import 'features/proUsbSettings.dart'; import 'features/tuner.dart'; import 'presets/PlugProPreset.dart'; import 'value_formatters/ValueFormatter.dart'; enum PlugProChannel { Clean, Overdrive, Distortion, AGSim, Pop, Rock, Funk } enum PlugProVersion { PlugPro1 } class NuxPlugProConfiguration extends NuxDeviceConfiguration { static const bluetoothEQCount = 4; double drumsBass = 50; double drumsMiddle = 50; double drumsTreble = 50; int routingMode = 1; int recLevel = 50; int playbackLevel = 50; int usbDryWet = 50; //Bluetooth and mic EQTenBandBT bluetoothEQ = EQTenBandBT(); int bluetoothGroup = 0; bool bluetoothEQMute = false; bool bluetoothInvertChannel = false; bool micMute = false; int micVolume = 50; bool micNoiseGate = false; int micNGSensitivity = 50; int micNGDecay = 50; LooperData looperData = LooperData(); TunerData tunerData = TunerData(); } class NuxMightyPlugPro extends NuxReorderableDevice implements Tuner, ProUsbSettings, DrumsTone { @override int get productVID => 48; late final PlugProCommunication _communication = PlugProCommunication(this, config); @override DeviceCommunication get communication => _communication; final NuxPlugProConfiguration _config = NuxPlugProConfiguration(); @override NuxPlugProConfiguration get config => _config; PlugProVersion version = PlugProVersion.PlugPro1; String versionDate = ""; bool version2024July = true; @override String get productName => "NUX Mighty Plug Pro"; @override String get productNameShort => "Mighty Plug Pro"; @override String get productStringId => "mighty_plug_pro"; @override String get presetClass => "mighty_plug_pro"; @override String get productNameForQR => "Mighty Plug Pro/Space"; @override int get productVersion => version.index; @override String get productIconLabel => "MP-3|-|SPACE"; @override List get productBLENames => ["MIGHTY PLUG PRO"]; @override int get channelsCount => 7; @override int get effectsChainLength => 9; int get groupsCount => 1; @override NuxFXID get ampFXID => PlugProFXID.amp; @override NuxFXID get cabFXID => PlugProFXID.cab; @override bool get longChannelNames => false; @override bool get fakeMasterVolume => false; @override bool get activeChannelRetrieval => true; @override bool get cabinetSupport => true; @override bool get hackableIRs => false; @override bool get presetSaveSupport => true; @override bool get batterySupport => false; @override bool get nativeActiveChannelsSupport => true; @override int get channelChangeCC => -1; @override ValueFormatter? get decibelFormatter => ValueFormatters.decibelMPPro; @override int get deviceQRId => 15; @override int get deviceQRVersion => 1; @override double get drumsBass => config.drumsBass; @override double get drumsMiddle => config.drumsMiddle; @override double get drumsTreble => config.drumsTreble; @override double get drumsMaxTempo => 300; @override List get processorList => ProcessorsList.plugProList; final _tunerController = StreamController.broadcast(); int? _drumStylesCount; NuxMightyPlugPro(NuxDeviceControl devControl) : super(devControl) { for (int i = 0; i < PlugProChannel.values.length; i++) { presets.add(PlugProPreset( device: this, channel: i, channelName: (i + 1).toString())); } for (var preset in presets) { (preset as PlugProPreset).setFirmwareVersion(version.index); channelNames.add("Channel ${preset.channelName}"); } } @override Map> getDrumStyles() => version2024July ? DrumStyles.drumCategoriesProV2 : DrumStyles.drumCategoriesPro; @override int getDrumStylesCount() { if (_drumStylesCount == null) { _drumStylesCount = 0; for (var cat in getDrumStyles().values) { _drumStylesCount = _drumStylesCount! + cat.length; } } return _drumStylesCount!; } @override void setFirmwareVersion(int ver) { version = PlugProVersion.PlugPro1; //set all presets with that firmware for (var preset in presets) { (preset as PlugProPreset).setFirmwareVersion(version.index); } } @override void setFirmwareVersionByIndex(int ver) { if (ver > getAvailableVersions() - 1) ver = getAvailableVersions() - 1; version = PlugProVersion.values[ver]; //set all presets with that firmware for (var preset in presets) { (preset as PlugProPreset).setFirmwareVersion(version.index); } } void setVersionDate(String vDate) { versionDate = vDate; version2024July = versionDate.compareTo("20240101") > 0; } @override onDisconnect() { versionDate = ""; super.onDisconnect(); } @override PlugProPreset getCustomPreset(int channel) { var preset = PlugProPreset(device: this, channel: channel, channelName: ""); preset.setFirmwareVersion(productVersion); return preset; } @override void setUsbMode(int mode) { config.routingMode = mode; communication.setUsbAudioMode(mode); } @override void setUsbRecordingVol(int vol) { config.recLevel = vol; communication.setUsbInputVolume(vol); } @override void setUsbPlaybackVol(int vol) { config.playbackLevel = vol; communication.setUsbOutputVolume(vol); } @override void setUsbDryWetVol(int vol) { config.usbDryWet = vol; _communication.setUsbDryWet(vol); } @override Widget getSettingsWidget() { return PlugProSettings(device: this, mightySpace: false); } @override bool checkQRValid(int deviceId, int ver) { return deviceId == deviceQRId && ver == 1; } @override void setDrumsTone(double value, DrumsToneControl control, bool send) { switch (control) { case DrumsToneControl.bass: config.drumsBass = value; break; case DrumsToneControl.middle: config.drumsMiddle = value; break; case DrumsToneControl.treble: config.drumsTreble = value; break; } if (send) _communication.setDrumsTone(value, control); } @override bool get tunerAvailable { return versionDate.compareTo("20230101") > 0; } @override void tunerEnable(bool enable) { _communication.enableTuner(enable); } @override void tunerRequestSettings() { _communication.requestTunerSettings(); } @override void tunerSetMode(TunerMode mode) { config.tunerData.mode = mode; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerSetReferencePitch(int refPitch) { config.tunerData.referencePitch = refPitch; _communication.tunerSetSettings(); notifyTunerListeners(); } @override void tunerMute(bool enable) { config.tunerData.muted = enable; _communication.tunerSetSettings(); notifyTunerListeners(); } @override Stream getTunerDataStream() { return _tunerController.stream; } @override void notifyTunerListeners() { _tunerController.add(config.tunerData); } @override int get tunerNoteCC => MidiCCValuesPro.TUNER_Note; @override int get tunerPitchCC => MidiCCValuesPro.TUNER_Cent; @override int get tunerStateCC => MidiCCValuesPro.TUNER_State; @override int get tunerStringCC => MidiCCValuesPro.TUNER_Number; } ================================================ FILE: lib/bluetooth/devices/NuxMightySpace.dart ================================================ import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/plugProCommunication.dart'; import '../../UI/pages/device_specific_settings/PlugProSettings.dart'; import 'NuxMightyPlugPro.dart'; import 'effects/plug_pro/EQ.dart'; import 'features/looper.dart'; import 'features/tuner.dart'; class NuxMightySpaceConfiguration extends NuxPlugProConfiguration { EQTenBandSpeaker speakerEQ = EQTenBandSpeaker(); int speakerEQGroup = 0; } class NuxMightySpace extends NuxMightyPlugPro implements Tuner, Looper { NuxMightySpace(super.devControl); final NuxMightySpaceConfiguration _config = NuxMightySpaceConfiguration(); @override NuxMightySpaceConfiguration get config => _config; PlugProCommunication get _communication => communication as PlugProCommunication; @override String get productName => "NUX Mighty Space"; @override String get productNameShort => "Mighty Space"; @override String get productStringId => "mighty_space"; @override int get productVersion => version.index; @override String get productIconLabel => "MP-3|-|SPACE"; @override List get productBLENames => ["MIGHTY SPACE", "NUX NGA-30W"]; @override int get loopState => config.looperData.loopState; @override int get loopUndoState => config.looperData.loopUndoState; @override int get loopRecordMode => config.looperData.loopRecordMode; @override double get loopLevel => config.looperData.loopLevel; bool get speakerAvailable => versionDate.compareTo("20230101") > 0; final looperController = StreamController.broadcast(); @override Widget getSettingsWidget() { return PlugProSettings(device: this, mightySpace: true); } @override Stream getLooperDataStream() { return looperController.stream; } void notifyLooperListeners() { looperController.add(config.looperData); } @override void looperClear() { _communication.looperClear(); } @override void looperRecordPlay() { _communication.looperRecord(); } @override void looperStop() { _communication.looperStop(); } @override void looperUndoRedo() { _communication.looperUndoRedo(); } @override void looperLevel(int vol) { config.looperData.loopLevel = vol.toDouble(); _communication.looperVolume(vol); } @override void looperNrAr(bool auto) { config.looperData.loopRecordMode = auto ? 1 : 0; _communication.looperNrAr(auto); } @override void requestLooperSettings() { _communication.requestLooperSettings(); } } ================================================ FILE: lib/bluetooth/devices/NuxReorderableDevice.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import 'NuxFXID.dart'; import 'effects/Processor.dart'; import 'presets/Preset.dart'; abstract class NuxReorderableDevice extends NuxDevice { NuxReorderableDevice(super.deviceControl); NuxFXID get ampFXID; NuxFXID get cabFXID; @override bool get reorderableFXChain => true; @override int get amplifierSlotIndex { var preset = getPreset(selectedChannel); for (int i = 0; i < processorList.length; i++) { if (preset.getFXIDFromSlot(i) == ampFXID) { return i; } } return ampFXID.value; } @override int get cabinetSlotIndex { var preset = getPreset(selectedChannel); for (int i = 0; i < processorList.length; i++) { if (preset.getFXIDFromSlot(i) == cabFXID) { return i; } } return cabFXID.value; } @override ProcessorInfo? getProcessorInfoByFXID(NuxFXID fxid) { for (var proc in processorList) { if (proc.nuxFXID == fxid) return proc; } return null; } @override int? getSlotByEffectKeyName(String key) { var pi = getProcessorInfoByKey(key); if (pi != null) { T p = getPreset(selectedChannel) as T; var index = p.getSlotFromFXID(pi.nuxFXID); if (index != null) return index; } return null; } } ================================================ FILE: lib/bluetooth/devices/communication/communication.dart ================================================ import 'package:flutter/widgets.dart'; import '../NuxConstants.dart'; import '../NuxDevice.dart'; abstract class DeviceCommunication { @protected NuxDevice device; NuxDeviceConfiguration config; DeviceCommunication(this.device, this.config); List createFirmwareMessage(); List requestPresetByIndex(int index); void requestBatteryStatus(); @protected int get connectionSteps; @protected int currentConnectionStep = 0; bool isConnectionReady() { return connectionSteps == currentConnectionStep; } void performNextConnectionStep(); @protected void connectionStepReady() { if (isConnectionReady()) return; currentConnectionStep++; device.deviceControl.onConnectionStepReady(); } void sendSlotEnabledState(int slot) { if (!device.deviceControl.isConnected) return; var preset = device.getPreset(device.selectedChannel); var swIndex = preset .getEffectsForSlot(slot)[preset.getSelectedEffectForSlot(slot)] .midiCCEnableValue; //in midi boolean is 00 and 7f for false and true int enabled = preset.slotEnabled(slot) ? 0x7f : 0x00; var data = createCCMessage(swIndex, enabled); device.deviceControl.sendBLEData(data); } void sendSlotEffect(int slot, int index) { if (!device.deviceControl.isConnected) return; var preset = device.getPreset(device.selectedChannel); var paramIndex = preset .getEffectsForSlot(slot)[preset.getSelectedEffectForSlot(slot)] .midiCCSelectionValue; var data = createCCMessage(paramIndex, index); device.deviceControl.sendBLEData(data); } void saveCurrentPreset(int index); void sendActiveChannels(List channels) {} void sendSlotOrder() {} void sendReset(); void sendDrumsEnabled(bool enabled); void sendDrumsStyle(int style); void sendDrumsLevel(double volume); void sendDrumsTempo(double tempo); void setEcoMode(bool enable); void setBTEq(int eq); void setUsbAudioMode(int mode); void setUsbInputVolume(int vol); void setUsbOutputVolume(int vol); void onDataReceive(List data); void onDisconnect() { currentConnectionStep = 0; } List setChannel(int channel); @protected List createCCMessage(int controlNumber, int value) { var msg = List.filled(5, 0); msg[0] = 0x80; msg[1] = 0x80; msg[2] = MidiMessageValues.controlChange; msg[3] = controlNumber; msg[4] = value; return msg; } List createPCMessage(int programNumber) { var msg = List.filled(4, 0); msg[0] = 0x80; msg[1] = 0x80; msg[2] = MidiMessageValues.programChange; msg[3] = programNumber; return msg; } List createSysExMessage(int deviceMessageId, var data, {int sysExMsgId = CherubSysExMessageID.cSysExDeviceSpecMsgID}) { List msg = []; //create header msg.addAll([ 0x80, 0x80, MidiMessageValues.sysExStart, 0, device.vendorID & 255, (device.vendorID >> 8) & 255, device.productVID & 255, (device.productVID >> 8) & 255, (7 & sysExMsgId) << 4, deviceMessageId ]); //add payload if (data is int) { msg.add(data); } else { msg.addAll(data); } //add termination symbol msg.addAll([0x80, MidiMessageValues.sysExEnd]); return msg; } //version for Mighty Plug Pro List createSysExMessagePro( int privacy, int syxMsgType, int syxDir, List data) { List msg = []; //create header msg.addAll([ 0x80, 0x80, MidiMessageValues.sysExStart, 0x43, 0x58, privacy, syxMsgType, syxDir, ]); msg.addAll(data); msg.addAll([0x80, MidiMessageValues.sysExEnd]); return msg; } @protected int percentageTo7Bit(double val) { return (val / 100 * 127).floor(); } void fillTestData() {} } ================================================ FILE: lib/bluetooth/devices/communication/liteCommunication.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/NuxDevice.dart'; import '../NuxConstants.dart'; import 'communication.dart'; class LiteCommunication extends DeviceCommunication { LiteCommunication(NuxDevice device, NuxDeviceConfiguration config) : super(device, config); @override int get connectionSteps => 1; int _readyPresetsCount = 0; @override void performNextConnectionStep() { switch (currentConnectionStep) { case 0: _readyPresetsCount = 0; //device.deviceControl.sendBLEData(requestPresetByIndex(0)); requestAllPresets(); break; } connectionStepReady(); } void requestAllPresets() async { for (int i = 0; i < device.channelsCount; i++) { device.deviceControl.sendBLEData(requestPresetByIndex(i)); await Future.delayed(const Duration(milliseconds: 80)); } } @override List createFirmwareMessage() { return []; } @override List requestPresetByIndex(int index) { return createSysExMessage(DeviceMessageID.devReqPresetMsgID, index); } @override List setChannel(int channel) { return createCCMessage(device.channelChangeCC, channel); } @override void requestBatteryStatus() { if (!device.batterySupport) return; var data = createSysExMessage(DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_dsprun_battery, 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } @override void sendReset() { var data = createCCMessage(MidiCCValues.bCC_CtrlCmd, 0x7f); device.deviceControl.sendBLEData(data); _readyPresetsCount = 0; } @override void sendDrumsEnabled(bool enabled) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValues.bCC_drumOnOff_No, enabled ? 0x7f : 0); device.deviceControl.sendBLEData(data); } @override void sendDrumsStyle(int style) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValues.bCC_drumType_No, style); device.deviceControl.sendBLEData(data); } @override void sendDrumsLevel(double volume) { if (!device.deviceControl.isConnected) return; int val = percentageTo7Bit(volume); var data = createCCMessage(MidiCCValues.bCC_drumLevel_No, val); device.deviceControl.sendBLEData(data); } @override void sendDrumsTempo(double tempo) { if (!device.deviceControl.isConnected) return; int tempoNux = (((tempo - 40) / 200) * 16384).floor(); //these must be sent as 2 7bit values int tempoL = tempoNux & 0x7f; int tempoH = (tempoNux >> 7); //no idea what the first 2 messages are for var data = createCCMessage(MidiCCValues.bCC_drumTempo1, 0x06); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempo2, 0x26); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempoH, tempoH); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempoL, tempoL); device.deviceControl.sendBLEData(data); } @override void setEcoMode(bool enable) {} @override void setBTEq(int eq) {} @override void setUsbAudioMode(int mode) {} @override void setUsbInputVolume(int vol) {} @override void setUsbOutputVolume(int vol) {} @override void saveCurrentPreset(int index) { var data = createCCMessage(MidiCCValues.bCC_CtrlCmd, 0x7e); device.deviceControl.sendBLEData(data); } void _handlePresetDataPiece(List data) { var total = (data[3] & 0xf0) >> 4; var current = data[3] & 0x0f; print('preset ${data[2] + 1}, piece ${current + 1} of $total'); print(data); var preset = device.getPreset(data[2]); if (current == 0) preset.resetNuxData(); preset.addNuxPayloadPiece(data.sublist(4, data.length - 2), current, total); if (preset.payloadPiecesReady()) { preset.setupPresetFromNuxData(); if (!device.nuxPresetsReceived) { _readyPresetsCount++; if (_readyPresetsCount == device.channelsCount) { device.onPresetsReady(); device.deviceControl.forceNotifyListeners(); //connectionStepReady(); } else { //device.deviceControl.sendBLEData(requestPresetByIndex(data[2] + 1)); } } else { device.deviceControl.forceNotifyListeners(); } } } @override void onDataReceive(List data) { if (data.length < 3) return; switch (data[2] & 0xf0) { case MidiMessageValues.sysExStart: switch (data[3]) { case DeviceMessageID.devGetPresetMsgID: _handlePresetDataPiece(data.sublist(2)); return; } break; } device.onDataReceived(data.sublist(2)); } @override void onDisconnect() { super.onDisconnect(); _readyPresetsCount = 0; } @override void fillTestData() { //Data for Mighty 20/40 BT _handlePresetDataPiece( [240, 7, 0, 48, 0, 0, 0, 50, 0, 20, 41, 40, 30, 55, 0, 2, 128, 247]); _handlePresetDataPiece( [240, 7, 0, 49, 52, 24, 2, 0, 0, 50, 1, 12, 1, 0, 30, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 0, 50, 20, 1, 3, 116, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 1, 48, 0, 0, 0, 50, 1, 70, 23, 30, 30, 20, 0, 1, 128, 247]); _handlePresetDataPiece( [240, 7, 1, 49, 78, 41, 100, 0, 0, 50, 39, 19, 1, 0, 28, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 1, 50, 35, 1, 3, 116, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 2, 48, 1, 70, 0, 50, 2, 80, 20, 50, 50, 50, 0, 2, 128, 247]); _handlePresetDataPiece( [240, 7, 2, 49, 55, 39, 100, 0, 0, 50, 52, 19, 1, 0, 20, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 2, 50, 35, 1, 3, 116, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 3, 48, 0, 45, 0, 50, 3, 100, 21, 50, 50, 35, 0, 1, 128, 247]); _handlePresetDataPiece( [240, 7, 3, 49, 50, 50, 100, 0, 2, 50, 50, 40, 1, 0, 40, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 3, 50, 25, 1, 5, 71, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 4, 48, 0, 0, 0, 50, 4, 50, 50, 40, 90, 0, 1, 1, 128, 247]); _handlePresetDataPiece([ 240, 7, 4, 49, 50, 100, 100, 1, 1, 50, 30, 20, 0, 0, 11, 50, 128, 247 ]); _handlePresetDataPiece( [240, 7, 4, 50, 26, 1, 3, 119, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 5, 48, 0, 0, 0, 50, 5, 80, 12, 30, 100, 15, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 5, 49, 27, 50, 100, 0, 1, 50, 35, 20, 1, 0, 15, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 5, 50, 25, 1, 3, 119, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 6, 48, 1, 70, 0, 50, 6, 80, 25, 40, 50, 50, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 6, 49, 2, 27, 100, 0, 0, 50, 50, 24, 0, 0, 11, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 6, 50, 70, 1, 3, 116, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 7, 48, 0, 49, 0, 50, 7, 100, 17, 50, 50, 50, 0, 0, 128, 247]); _handlePresetDataPiece( [240, 7, 7, 49, 2, 49, 100, 1, 0, 50, 60, 34, 1, 0, 60, 50, 128, 247]); _handlePresetDataPiece( [240, 7, 7, 50, 20, 1, 3, 119, 0, 0, 0, 0, 0, 0, 0, 0, 128, 247]); } } ================================================ FILE: lib/bluetooth/devices/communication/liteMk2Communication.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/communication/plugProCommunication.dart'; import '../NuxDevice.dart'; class LiteMk2Communication extends PlugProCommunication { LiteMk2Communication(NuxDevice device, NuxDeviceConfiguration config) : super(device, config); @override get connectionSteps => 3; @override void performNextConnectionStep() { switch (currentConnectionStep) { case 0: //presets readyPresetsCount = 0; readyIRsCount = 0; device.deviceControl.sendBLEData(requestPresetByIndex(0)); break; case 1: device.deviceControl.sendBLEData(requestCurrentChannel()); break; case 2: device.deviceControl .sendBLEData(requestIRName(PlugProCommunication.customIRStart)); break; /*case 3: device.deviceControl.sendBLEData(_requestSystemSettings()); break; case 4: device.deviceControl.sendBLEData(_requestDrumData()); break; case 5: device.deviceControl.sendBLEData(_requestMicSettings()); break;*/ } } @override List createFirmwareMessage() { return []; } } ================================================ FILE: lib/bluetooth/devices/communication/plugAirCommunication.dart ================================================ import '../NuxMightyPlugAir.dart'; import '../../../platform/simpleSharedPrefs.dart'; import '../NuxDevice.dart'; import '../NuxConstants.dart'; import 'communication.dart'; class PlugAirCommunication extends DeviceCommunication { PlugAirCommunication(NuxDevice device, NuxDeviceConfiguration config) : super(device, config); @override int get connectionSteps => 3; int _readyPresetsCount = 0; @override NuxMightyPlugConfiguration get config => super.config as NuxMightyPlugConfiguration; @override List createFirmwareMessage() { List msg = []; //create header msg.addAll([ 0x80, 0x80, MidiMessageValues.sysExStart, 0, device.vendorID & 255, (device.vendorID >> 8) & 255, device.productVID & 255, (device.productVID >> 8) & 255, 0 ]); //add termination symbol msg.add(0x80); msg.add(MidiMessageValues.sysExEnd); return msg; } @override void performNextConnectionStep() { switch (currentConnectionStep) { case 0: _readyPresetsCount = 0; device.deviceControl.sendBLEData(requestPresetByIndex(0)); break; case 1: //eco mode and other var message = createSysExMessage(DeviceMessageID.devReqManuMsgID, [0]); device.deviceControl.sendBLEData(message); break; case 2: //usb settings var message = createSysExMessage(DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_usbaudio, 0, 0, 0, 0]); device.deviceControl.sendBLEData(message); break; } } @override void saveCurrentPreset(int index) { var data = createCCMessage(MidiCCValues.bCC_CtrlCmd, 0x7e); device.deviceControl.sendBLEData(data); } @override List requestPresetByIndex(int index) { return createSysExMessage(DeviceMessageID.devReqPresetMsgID, index); } @override void requestBatteryStatus() { if (!device.batterySupport) return; var data = createSysExMessage(DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_dsprun_battery, 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } @override void sendReset() { var data = createCCMessage(MidiCCValues.bCC_CtrlCmd, 0x7f); device.deviceControl.sendBLEData(data); _readyPresetsCount = 0; } @override List setChannel(int channel) { return createCCMessage(device.channelChangeCC, channel); } //*************/ //Drums section //*************/ @override void sendDrumsEnabled(bool enabled) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValues.bCC_drumOnOff_No, enabled ? 0x7f : 0); device.deviceControl.sendBLEData(data); } @override void sendDrumsStyle(int style) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValues.bCC_drumType_No, style); device.deviceControl.sendBLEData(data); } @override void sendDrumsLevel(double volume) { if (!device.deviceControl.isConnected) return; int val = percentageTo7Bit(volume); var data = createCCMessage(MidiCCValues.bCC_drumLevel_No, val); device.deviceControl.sendBLEData(data); } @override void sendDrumsTempo(double tempo) { if (!device.deviceControl.isConnected) return; int tempoNux = (((tempo - 40) / 200) * 16384).floor(); //these must be sent as 2 7bit values int tempoL = tempoNux & 0x7f; int tempoH = (tempoNux >> 7); //no idea what the first 2 messages are for var data = createCCMessage(MidiCCValues.bCC_drumTempo1, 0x06); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempo2, 0x26); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempoH, tempoH); device.deviceControl.sendBLEData(data); data = createCCMessage(MidiCCValues.bCC_drumTempoL, tempoL); device.deviceControl.sendBLEData(data); } //***************/ //Settings section //***************/ @override void setEcoMode(bool enable) { var data = createSysExMessage(DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_eco_pro, enable ? 1 : 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } @override void setBTEq(int eq) { var data = createSysExMessage( DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_bt, 1, eq, 0, 0]); device.deviceControl.sendBLEData(data); } @override void setUsbAudioMode(int mode) { var data = createCCMessage(MidiCCValues.bCC_VolumePedalMin, mode); device.deviceControl.sendBLEData(data); } @override void setUsbInputVolume(int vol) { var data = createCCMessage( MidiCCValues.bCC_VolumePedal, percentageTo7Bit(vol.toDouble())); device.deviceControl.sendBLEData(data); } @override void setUsbOutputVolume(int vol) { var data = createCCMessage( MidiCCValues.bCC_VolumePrePost, percentageTo7Bit(vol.toDouble())); device.deviceControl.sendBLEData(data); } void _handlePresetDataPiece(List data) { var total = (data[3] & 0xf0) >> 4; var current = data[3] & 0x0f; var preset = device.getPreset(data[2]); if (current == 0) preset.resetNuxData(); preset.addNuxPayloadPiece(data.sublist(4, 16), current, total); if (preset.payloadPiecesReady()) { preset.setupPresetFromNuxData(); if (!device.nuxPresetsReceived) { _readyPresetsCount++; if (_readyPresetsCount == device.channelsCount) { device.onPresetsReady(); connectionStepReady(); } else { device.deviceControl.sendBLEData(requestPresetByIndex(data[2] + 1)); } } } } bool _handleFirmwareData(List data) { if (data[8] == 16 && data.length == 12) { //firmware version is in the 9th bit device.setFirmwareVersion(data[9]); //save device version since we know it already SharedPrefs().setValue(SettingsKeys.deviceVersion, device.productVersion); device.deviceControl.onFirmwareVersionReady(); return true; } return false; } void _handleBTEcoMode(List data) { //this has lots of unknown values - maybe bpm settings //eco mode is 12 if (data[data.length - 1] == MidiMessageValues.sysExEnd) { //current preset is located here device.setSelectedChannel(data[4], notifyBT: false, notifyUI: false, sendFullPreset: false); config.btEq = data[10]; config.ecoMode = data[12] != 0; connectionStepReady(); } } void _handleUSBConfig(List data) { config.usbMode = data[9]; config.inputVol = data[10]; config.outputVol = data[11]; connectionStepReady(); } @override void onDataReceive(List data) { if (data.length > 3) { switch (data[2] & 0xf0) { case MidiMessageValues.sysExStart: switch (data[3]) { case DeviceMessageID.devReqFwID: if (data[9] == DeviceMessageID.devSysCtrlMsgID && data[10] == SysCtrlState.syscmd_usbaudio) { _handleUSBConfig(data.sublist(2)); } else if (_handleFirmwareData(data)) { return; } break; case DeviceMessageID.devGetManuMsgID: _handleBTEcoMode(data.sublist(2)); break; case DeviceMessageID.devGetPresetMsgID: _handlePresetDataPiece(data.sublist(2)); return; } break; } device.onDataReceived(data.sublist(2)); } } @override void onDisconnect() { super.onDisconnect(); _readyPresetsCount = 0; } } ================================================ FILE: lib/bluetooth/devices/communication/plugProCommunication.dart ================================================ import 'dart:async'; import 'dart:convert'; import 'package:flutter/foundation.dart'; import '../NuxDevice.dart'; import '../NuxFXID.dart'; import '../NuxMightySpace.dart'; import '../effects/plug_pro/Cabinet.dart'; import '../features/drumsTone.dart'; import '../features/tuner.dart'; import '../presets/PlugProPreset.dart'; import '../../../platform/simpleSharedPrefs.dart'; import '../NuxConstants.dart'; import '../NuxMightyPlugPro.dart'; import 'communication.dart'; class PlugProCommunication extends DeviceCommunication { PlugProCommunication(NuxDevice device, NuxDeviceConfiguration config) : super(device, config); StreamController>? _bluetoothEQReceived; Stream>? get bluetoothEQStream => _bluetoothEQReceived?.stream; StreamController>? _speakerEQReceived; Stream>? get speakerEQStream => _speakerEQReceived?.stream; @override get connectionSteps => 6; @protected int readyPresetsCount = 0; @protected int readyIRsCount = 0; //use this, because when the app sends the order, the amp answers sends it back, //however, it must be ignored in this case, but not in other cases. //This DateTime is used for that DateTime _lastEffectReorder = DateTime.now(); @override NuxPlugProConfiguration get config => super.config as NuxPlugProConfiguration; static const int customIRStart = 34; static const int customIRsCount = 20; static const int irLength = customIRStart + customIRsCount; @override List createFirmwareMessage() { List msg = []; //create header msg.addAll([ 0x80, 0x80, MidiMessageValues.sysExStart, 0x43, 0x58, SysexPrivacy.kSYSEX_PUBLIC.toInt(), 0x80, MidiMessageValues.sysExEnd ]); return msg; } @override void performNextConnectionStep() { switch (currentConnectionStep) { case 0: //presets readyPresetsCount = 0; readyIRsCount = 0; device.deviceControl.sendBLEData(requestPresetByIndex(0)); break; case 1: device.deviceControl.sendBLEData(requestCurrentChannel()); break; case 2: device.deviceControl.sendBLEData(requestIRName(customIRStart)); break; case 3: device.deviceControl.sendBLEData(_requestSystemSettings()); break; case 4: device.deviceControl.sendBLEData(_requestDrumData()); break; case 5: device.deviceControl.sendBLEData(_requestMicSettings()); break; } } @override void saveCurrentPreset(int index) { var data = createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SPEC_CMD, SyxDir.kSYXDIR_SET, [SysCtrlState.syscmd_save, index]); device.deviceControl.sendBLEData(data); } @override List requestPresetByIndex(int index) { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_PRESET, SyxDir.kSYXDIR_REQ, [index]); } @protected List requestCurrentChannel() { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_CURPRESET, SyxDir.kSYXDIR_REQ, []); } List _requestSystemSettings() { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SYSTEMSET, SyxDir.kSYXDIR_REQ, []); } @protected List requestIRName(int index) { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_CRCNAME, SyxDir.kSYXDIR_REQ, [index]); } List _requestEffectsOrder() { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_MODULELINK, SyxDir.kSYXDIR_REQ, []); } List _requestDrumData() { return createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_DRUM, SyxDir.kSYXDIR_REQ, []); } List _requestMicSettings() { return createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_CURSTATE, SyxDir.kSYXDIR_REQ, []); } void requestBTEQData(int index) { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_BTSET, SyxDir.kSYXDIR_REQ, [index]); device.deviceControl.sendBLEData(data); _bluetoothEQReceived = StreamController>(); } void requestSpeakerEQData(int index) { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SPKSET, SyxDir.kSYXDIR_GET, [index]); device.deviceControl.sendBLEData(data); _speakerEQReceived = StreamController>(); } @override void requestBatteryStatus() { if (!device.batterySupport) return; //TODO: Wrong!!! // var data = createSysExMessagePro( // SysexPrivacy.kSYSEX_PRIVATE, // SyxMsg.kSYX_SPEC_CMD, // SyxDir.kSYXDIR_REQ, // [SysCtrlState.syscmd_dsprun_battery]); var data = createSysExMessage(DeviceMessageID.devSysCtrlMsgID, [SysCtrlState.syscmd_dsprun_battery, 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } @override void sendReset() { var data = createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SPEC_CMD, SyxDir.kSYXDIR_SET, [SysCtrlState.syscmd_resetall]); readyPresetsCount = 0; readyIRsCount = 0; device.deviceControl.sendBLEData(data); } void _sendSlotData(int slot, bool enabled, int effectIndex) { var preset = device.getPreset(device.selectedChannel); var swIndex = preset .getEffectsForSlot(slot)[preset.getSelectedEffectForSlot(slot)] .midiCCEnableValue; preset.getSelectedEffectForSlot(slot); int midiVal = effectIndex | (enabled ? 0x00 : 0x40); var data = createCCMessage(swIndex, midiVal); device.deviceControl.sendBLEData(data); } @override void sendSlotEnabledState(int slot) { if (!device.deviceControl.isConnected) return; var preset = device.getPreset(device.selectedChannel); var effect = preset.getEffectsForSlot(slot)[preset.getSelectedEffectForSlot(slot)]; var index = effect.nuxIndex; _sendSlotData(slot, preset.slotEnabled(slot), index); } void setSlotEffect(int slot, int index) { if (!device.deviceControl.isConnected) return; var preset = device.getPreset(device.selectedChannel); _sendSlotData(slot, preset.slotEnabled(slot), index); } @override void sendActiveChannels(List channels) { if (!device.deviceControl.isConnected) return; int channelsBitfield = 0; for (int i = 0; i < channels.length; i++) { channelsBitfield |= (channels[i] ? 1 : 0) << i; } var data = createCCMessage(MidiCCValuesPro.PRESETRANGE, channelsBitfield); device.deviceControl.sendBLEData(data); } @override void sendSlotOrder() { if (!device.deviceControl.isConnected) return; var preset = device.getPreset(device.selectedChannel); List order = (preset as PlugProPreset).processorAtSlot; var nuxOrder = [order.length]; for (var i = 0; i < order.length; i++) { var p = device.getProcessorInfoByFXID(order[i]); if (p != null) nuxOrder.add(p.nuxFXID.toInt()); } var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_MODULELINK, SyxDir.kSYXDIR_SET, nuxOrder); device.deviceControl.sendBLEData(data); _lastEffectReorder = DateTime.now(); } void sendChannelVolume(int value) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.MASTER, value); device.deviceControl.sendBLEData(data); } @override List setChannel(int channel) { return createPCMessage(channel); } @override void sendDrumsEnabled(bool enabled) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.DRUMENABLE, enabled ? 1 : 0); device.deviceControl.sendBLEData(data); } @override void sendDrumsStyle(int style) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.DRUMTYPE, style); device.deviceControl.sendBLEData(data); } @override void sendDrumsLevel(double volume) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.DRUMLEVEL, volume.round()); device.deviceControl.sendBLEData(data); } setDrumsTone(double value, DrumsToneControl control) { if (!device.deviceControl.isConnected) return; int cc = 0; switch (control) { case DrumsToneControl.bass: cc = MidiCCValuesPro.DRUM_BASS; break; case DrumsToneControl.middle: cc = MidiCCValuesPro.DRUM_MIDDLE; break; case DrumsToneControl.treble: cc = MidiCCValuesPro.DRUM_TREBLE; break; } var data = createCCMessage(cc, value.round()); device.deviceControl.sendBLEData(data); } @override void sendDrumsTempo(double tempo) { if (!device.deviceControl.isConnected) return; //int tempoNux = (((tempo - 40) / 200) * 16384).floor(); //these must be sent as 2 7bit values int tempoL = tempo.round() & 0x7f; int tempoH = (tempo.round() >> 7); var data = createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_DRUM, SyxDir.kSYXDIR_SET, [ config.drumsEnabled ? 1 : 0, config.selectedDrumStyle, config.drumsVolume.round(), config.drumsBass.round(), config.drumsMiddle.round(), config.drumsTreble.round(), tempoH, tempoL ]); device.deviceControl.sendBLEData(data); } @override void setEcoMode(bool enable) {} //sets eq group @override void setBTEq(int eq) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.AUXEQENABLE, eq); device.deviceControl.sendBLEData(data); } void saveBTEQGroup(int group) { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SPEC_CMD, SyxDir.kSYXDIR_SET, [SysCtrlState.speccmd_auxeqsave, group]); device.deviceControl.sendBLEData(data); } void setSpeakerEq(int eq) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.SPK_EQ_GROUP, eq); device.deviceControl.sendBLEData(data); } void saveSpeakerEQGroup(int group) { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro( SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_SPEC_CMD, SyxDir.kSYXDIR_SET, [SysCtrlState.speccmd_speakereqsave, group]); device.deviceControl.sendBLEData(data); } void setBTInvert(bool invert) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.AUX_PHASE, invert ? 1 : 0); device.deviceControl.sendBLEData(data); } void setBTMute(bool mute) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.AUX_MUTE, mute ? 1 : 0); device.deviceControl.sendBLEData(data); } void setMicMute(bool mute) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.MICMUTE, mute ? 1 : 0); device.deviceControl.sendBLEData(data); } void setMicLevel(int level) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.MICVOLUME, level); device.deviceControl.sendBLEData(data); } void setMicNoiseGate(bool enable) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.NR_ENABLE, enable ? 1 : 0); device.deviceControl.sendBLEData(data); } void setMicNoiseGateSens(int level) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.NR_SENS, level); device.deviceControl.sendBLEData(data); } void setMicNoiseGateDecay(int level) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.NR_DECAY, level); device.deviceControl.sendBLEData(data); } @override void setUsbAudioMode(int mode) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.USBROUNT_3, mode); device.deviceControl.sendBLEData(data); } @override void setUsbInputVolume(int vol) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.USBROUNT_1, vol); device.deviceControl.sendBLEData(data); } @override void setUsbOutputVolume(int vol) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.USBROUNT_2, vol); device.deviceControl.sendBLEData(data); } void setUsbDryWet(int vol) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.USBROUNT_4, vol); device.deviceControl.sendBLEData(data); } void enableTuner(bool enable) { tunerSetSettings(tunerOn: enable); } void tunerSetSettings({bool tunerOn = true}) { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_TUNER_SETTINGS, SyxDir.kSYXDIR_SET, [ tunerOn ? 1 : 0, config.tunerData.mode.mode, config.tunerData.referencePitch, config.tunerData.muted ? 1 : 0, 0, 0, 0 ]); device.deviceControl.sendBLEData(data); } void requestTunerSettings() { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_TUNER_SETTINGS, SyxDir.kSYXDIR_GET, [0, 0, 0, 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } void looperRecord() { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOPSTATE, 1); device.deviceControl.sendBLEData(data); } void looperStop() { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOPSTATE, 2); device.deviceControl.sendBLEData(data); } void looperClear() { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOPSTATE, 4); device.deviceControl.sendBLEData(data); } void looperUndoRedo() { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOPSTATE, 8); device.deviceControl.sendBLEData(data); } void looperVolume(int volume) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOPLEVEL, volume); device.deviceControl.sendBLEData(data); } void looperNrAr(bool auto) { if (!device.deviceControl.isConnected) return; var data = createCCMessage(MidiCCValuesPro.LOOP_ARNR, auto ? 1 : 0); device.deviceControl.sendBLEData(data); } void requestLooperSettings() { if (!device.deviceControl.isConnected) return; var data = createSysExMessagePro(SysexPrivacy.kSYSEX_PRIVATE, SyxMsg.kSYX_LOOP, SyxDir.kSYXDIR_GET, [0, 0, 0, 0, 0, 0, 0, 0]); device.deviceControl.sendBLEData(data); } List> _splitPresetData(List data) { List> presetData = []; int pos = 0; //sometimes MPPro sends several data pieces in one payload. //Let's split it here do { pos = data.indexOf(SysexPrivacy.kSYSEX_PRIVATE); if (pos > 0) { var sublist = data.sublist(0, pos - 1); presetData.add(sublist); if (data.length >= pos + 1) data = data.sublist(pos + 1); } else { if (data.length > 2) presetData.add(data); } } while (pos > 0); return presetData; } void _handlePresetDataPiece(List data) { List> presetData = _splitPresetData(data); for (List data in presetData) { //remove last 2 bytes if needed if (data[data.length - 1] == MidiMessageValues.sysExEnd) { data = data.sublist(0, data.length - 2); } var total = (data[3] & 0xf0) >> 4; var current = data[3] & 0x0f; debugPrint('preset ${data[2] + 1}, piece ${current + 1} of $total'); var preset = device.getPreset(data[2]); if (current == 0) preset.resetNuxData(); preset.addNuxPayloadPiece(data.sublist(4), current, total); if (preset.payloadPiecesReady()) { preset.setupPresetFromNuxData(); if (!device.nuxPresetsReceived) { readyPresetsCount++; if (readyPresetsCount == device.channelsCount) { device.onPresetsReady(); debugPrint("Presets connection step ready"); connectionStepReady(); } else { device.deviceControl.sendBLEData(requestPresetByIndex(data[2] + 1)); } } } } } void _handleIRName(List data) { if (data.length > 8) { int index = data[1]; bool hasIR = data[data.length - 3] != 0; int stringEnd = 0; //find name length for (int i = 8; i < data.length - 1; i++) { if (data[i] == 0 && data[i + 1] == 0) { stringEnd = i; break; } } if (stringEnd < 8) stringEnd = data.length - 3; if (hasIR) { List encodedName = data.sublist(8, stringEnd); List decodedName = []; for (int i = 0; i < encodedName.length; i++) { if (i % 3 == 0) { decodedName.add((encodedName[i] & 0x01) << 6); } else if (i % 3 == 1) { decodedName.last |= encodedName[i] >> 1; } else if (i % 3 == 2) { decodedName.add(encodedName[i]); } } var decoder = const AsciiDecoder(); String name = decoder.convert(decodedName); debugPrint("IR $index, active: $hasIR, name: $name"); for (var preset in device.presets) { if (preset.cabinetList == null) continue; if (index >= preset.cabinetList!.length) break; var cab = preset.cabinetList![index]; if (cab is UserCab) { cab.setName(name); } } } else { debugPrint("IR $index, active: $hasIR}"); } } readyIRsCount++; if (readyIRsCount == customIRsCount) { debugPrint("IR names connection step ready"); connectionStepReady(); } else { device.deviceControl .sendBLEData(requestIRName(customIRStart + readyIRsCount)); } } bool _handleEffectsOrderData(List data) { var dt = DateTime.now(); if (dt.difference(_lastEffectReorder).inMilliseconds < 3000) { return true; } if (data[0] == SyxDir.kSYXDIR_REQ) { var len = data[1]; var preset = device.getPreset(device.selectedChannel); List order = (preset as PlugProPreset).processorAtSlot; order.clear(); data.sublist(2, 2 + len).forEach((element) { order.add(NuxFXID.fromInt(element)); }); device.deviceControl.forceNotifyListeners(); return true; } return false; } bool _handleFirmwareData(List data) { //check for firmware message if (data[2] == MidiMessageValues.sysExStart && data[3] == 67 && data[5] == SysexPrivacy.kSYSEX_PUBLICREPLY.toInt()) { //the actual version starts at byte 9 and is 8 byte string //containing the date of the build //for now it's not needed device.setFirmwareVersion(0); //get FW version date of MPPro var versionArray = data.sublist(6, 14); String asciiString = String.fromCharCodes(versionArray); (device as NuxMightyPlugPro).setVersionDate(asciiString); //save device version since we know it already SharedPrefs().setValue(SettingsKeys.deviceVersion, device.productVersion); device.deviceControl.onFirmwareVersionReady(); return true; } return false; } bool _handleDrumCCData(int control, int value) { bool consumed = false; switch (control) { case MidiCCValuesPro.DRUMENABLE: config.drumsEnabled = value != 0; consumed = true; break; case MidiCCValuesPro.DRUMLEVEL: config.drumsVolume = value.toDouble(); consumed = true; break; case MidiCCValuesPro.DRUMTYPE: config.selectedDrumStyle = value; consumed = true; break; case MidiCCValuesPro.DRUM_BASS: config.drumsBass = value.toDouble(); consumed = true; break; case MidiCCValuesPro.DRUM_MIDDLE: config.drumsMiddle = value.toDouble(); consumed = true; break; case MidiCCValuesPro.DRUM_TREBLE: config.drumsTreble = value.toDouble(); consumed = true; break; } if (consumed) { device.deviceControl.forceNotifyListeners(); return true; } return false; } void _handleActiveChannelsData(int bitfield) { for (int i = 0; i < config.activeChannels.length; i++) { config.activeChannels[i] = ((bitfield >> i) & 1) != 0; } device.deviceControl.forceNotifyListeners(); } void _handleVolumeData(int vol) { (device.presets[device.selectedChannel] as PlugProPreset).setVolumeRaw(vol); device.deviceControl.forceNotifyListeners(); } void _handleLooperState(int state) { config.looperData.loopState = state & 0x0f; config.looperData.loopUndoState = (state >> 4) & 0x03; config.looperData.loopHasAudio = (state >> 6) & 0x01 != 0; } void _handleLooperCC(int ccNumber, int value) { switch (ccNumber) { case MidiCCValuesPro.LOOPLEVEL: config.looperData.loopLevel = value.toDouble(); break; case MidiCCValuesPro.LOOPSTATE: _handleLooperState(value); break; case MidiCCValuesPro.LOOP_ARNR: config.looperData.loopRecordMode = value; break; } (device as NuxMightySpace).notifyLooperListeners(); } void _handleLooperSysEx(List data) { if (data[0] != 2) return; config.looperData.loopLevel = data[1].toDouble(); _handleLooperState(data[2]); config.looperData.loopRecordMode = data[3]; (device as NuxMightySpace).notifyLooperListeners(); } void _handleTuner(int ccNumber, int value) { var tuner = device as Tuner; if (ccNumber == tuner.tunerStateCC) { config.tunerData.enabled = value == 1; } else if (ccNumber == tuner.tunerNoteCC) { config.tunerData.note = value; } else if (ccNumber == tuner.tunerPitchCC) { config.tunerData.cents = value; } else if (ccNumber == tuner.tunerStringCC) { config.tunerData.stringNumber = value; } tuner.notifyTunerListeners(); } void _handleTunerSysEx(List data) { if (data[0] != 2) return; config.tunerData.mode = TunerMode.getByMode(data[2]) ?? TunerMode.chromatic; config.tunerData.referencePitch = data[3]; config.tunerData.muted = data[4] == 1; (device as Tuner).notifyTunerListeners(); } //Info: in plugProDataObject.js in the beginning there are few const enums // O, G, z, etc... they are the indexes of some SysEx data //just reduce with 1 /* const G = { micmute: 0, outmodeeq1: 1, outmodeeq2: 2, outmodeeq3: 3, display1: 4, display2: 5, display3: 6, expset1: 7, expset2: 8, expset3: 9, expset4: 10, preeq1: 11, preeq2: 12, preeq3: 13, preeq4: 14, usbrount1: 15, usbrount2: 16, usbrount3: 17, usbrount4: 18, presetrange: 19, micvolume: 20, midi_chan: 21, length: 22, }; */ void _handleSystemSettings(List data) { config.micMute = data[1] > 0; config.routingMode = data[18]; config.recLevel = data[16]; config.playbackLevel = data[17]; config.usbDryWet = data[19]; config.micVolume = data[21]; for (int i = 0; i < config.activeChannels.length; i++) { config.activeChannels[i] = ((data[20] >> i) & 1) != 0; } } /* const z = { drum_command: 0, drumtype: 1, drum_vol: 2, drumeqL: 3, drumeqM: 4, drumeqH: 5, tmpoH: 6, tmpoL: 7, length: 8, }; */ void _handleDrumData(List data) { if (data[0] == SyxDir.kSYXDIR_REQ && data.length >= 8) { config.drumsEnabled = data[1] != 0; config.selectedDrumStyle = data[2]; config.drumsVolume = data[3].toDouble(); config.drumsBass = data[4].toDouble(); config.drumsMiddle = data[5].toDouble(); config.drumsTreble = data[6].toDouble(); config.drumsTempo = (data[8] + (data[7] << 7)).toDouble(); if (!isConnectionReady()) { debugPrint("Drums connection step ready"); connectionStepReady(); } else { device.deviceControl.forceNotifyListeners(); } } } void _handleMicSettings(List data) { if (data[0] == SyxDir.kSYXDIR_REQ) { config.bluetoothGroup = data[2]; config.micNoiseGate = data[3] > 0; config.micNGSensitivity = data[4]; config.micNGDecay = data[5]; if (config is NuxMightySpaceConfiguration) { (config as NuxMightySpaceConfiguration).speakerEQGroup = data[6]; } debugPrint("Mic step ready"); connectionStepReady(); } } void _handleBTEqData(List data) { if (data[0] == SyxDir.kSYXDIR_REQ) { _bluetoothEQReceived?.add(data.sublist(2)); _bluetoothEQReceived?.close(); } } void _handleSpeakerEqData(List data) { if (data[0] == SyxDir.kSYXDIR_REQ) { _speakerEQReceived?.add(data.sublist(2)); _speakerEQReceived?.close(); _speakerEQReceived = null; } } //Some discovered stuff //kSYX_SYSTEMSET - for ACTIVE channels, mic stuff and USB stuff @override void onDataReceive(List data) { if (data.length > 2) { switch (data[2]) { case MidiMessageValues.controlChange: switch (data[3]) { case MidiCCValuesPro.PRESETRANGE: _handleActiveChannelsData(data[4]); return; case MidiCCValuesPro.MASTER: _handleVolumeData(data[4]); break; case MidiCCValuesPro.TUNER_State: case MidiCCValuesPro.TUNER_Note: case MidiCCValuesPro.TUNER_Number: case MidiCCValuesPro.TUNER_Cent: case MidiCCValuesPro.TunerLiteMK2_Cent: case MidiCCValuesPro.TunerLiteMK2_Note: case MidiCCValuesPro.TunerLiteMK2_Number: case MidiCCValuesPro.TunerLiteMK2_State: _handleTuner(data[3], data[4]); break; case MidiCCValuesPro.LOOPLEVEL: case MidiCCValuesPro.LOOPSTATE: case MidiCCValuesPro.LOOP_ARNR: _handleLooperCC(data[3], data[4]); } bool consumed = false; consumed = _handleDrumCCData(data[3], data[4]); if (consumed) return; break; case MidiMessageValues.sysExStart: switch (data[5]) { case SysexPrivacy.kSYSEX_PUBLICREPLY: if (_handleFirmwareData(data)) return; break; case SysexPrivacy.kSYSEX_PRIVATE: switch (data[6]) { case SyxMsg.kSYX_PRESET: _handlePresetDataPiece(data.sublist(6)); return; case SyxMsg.kSYX_CRCNAME: _handleIRName(data.sublist(7)); return; case SyxMsg.kSYX_SYSTEMSET: _handleSystemSettings(data.sublist(7)); connectionStepReady(); return; case SyxMsg.kSYX_CURPRESET: //current preset is sent 3 times, check it's the 3rd time //to proceed with connection if (data[9] == 0x32) { device.setSelectedChannel(data[8], notifyBT: false, notifyUI: true, sendFullPreset: false); debugPrint("Current preset connection step ready"); connectionStepReady(); } return; case SyxMsg.kSYX_MODULELINK: if (_handleEffectsOrderData(data.sublist(7))) return; break; case SyxMsg.kSYX_DRUM: _handleDrumData(data.sublist(7)); return; case SyxMsg.kSYX_CURSTATE: _handleMicSettings(data.sublist(7)); return; case SyxMsg.kSYX_BTSET: _handleBTEqData(data.sublist(7)); return; case SyxMsg.kSYX_SPKSET: _handleSpeakerEqData(data.sublist(7)); return; case SyxMsg.kSYX_TUNER_SETTINGS: _handleTunerSysEx(data.sublist(7)); return; case SyxMsg.kSYX_LOOP: _handleLooperSysEx(data.sublist(7)); return; case SyxMsg.kSYX_SENDCMD: if (data[7] == SyxDir.kSYXDIR_REQ) { switch (data[8]) { case SyxMsg.kSYX_MODULELINK: device.deviceControl .sendBLEData(_requestEffectsOrder()); break; case SyxMsg.kSYX_DRUM: //request drums data device.deviceControl.sendBLEData(_requestDrumData()); break; } } return; } break; } break; } device.onDataReceived(data.sublist(2)); } } @override void onDisconnect() { super.onDisconnect(); readyPresetsCount = 0; readyIRsCount = 0; } } ================================================ FILE: lib/bluetooth/devices/device_data/drumstyles.dart ================================================ class DrumStyles { static const List drumStyles8BT = [ "Metronome", "Pop", "Metal", "Blues", "Country", "Rock", "Ballad Rock", "Funk", "R&B", "Latin" ]; static const List drumStyles2040BT = [ "Metronome", "Rock", "60's", "Bossanova", "Pop 1", "Pop 2", "Pop 3", "Blues 1", "Blues 2", "Jazz", "Jam", "R&B", "Latin", "Dance House", "Dance House 1", "Blues 3/4", "Ballad 3/4" ]; static const List drumStylesPlug = [ "Metronome", "Pop", "Metal", "Blues", "Swing", "Rock", "Ballad Rock", "Funk", "R&B", "Latin", "Dance" ]; static const Map rockStylesPro = { 'Standard': 0, 'Swing Rock': 1, 'Power Beat': 2, 'Smooth': 3, 'Mega Drive': 4, 'Hard Rock': 5, 'Boogie': 6 }; static const Map countryStylesPro = { 'Walk Line': 7, 'Blue Grass': 8, 'Country': 9, 'Waltz': 10, 'Train': 11, 'Country Rock': 12, 'Slowly': 13 }; static const Map bluesStylesPro = { 'Slow Blues': 14, 'Chicago': 15, 'R&B': 16, 'Blues Rock': 17, 'Road Train': 18, 'Shuffle': 19, }; static const Map metalStylesPro = { '2X Bass': 20, 'Close Beat': 21, 'Heavy Bass': 22, 'Fast': 23, 'Holy Case': 24, 'Open Hat': 25, 'Epic': 26, }; static const Map funkStylesPro = { 'Bounce': 27, 'East Coast': 28, 'New Mann': 29, 'R&B Funk': 30, '80s Funk': 31, 'Soul': 32, 'Uncle Jam': 33, }; static const Map jazzStylesPro = { 'Blues Jazz': 34, 'Classic 1': 35, 'Classic 2': 36, 'Easy Jazz': 37, 'Fast': 38, 'Walking': 39, 'Smooth': 40, }; static const Map balladStylesPro = { 'Bluesy': 41, 'Grooves': 42, 'Ballad Rock': 43, 'Slow Rock': 44, 'Tutorial': 45, 'R&B Ballad': 46, 'Gospel': 47, }; static const Map popStylesPro = { 'Beach Side': 48, 'Big City': 49, 'Funky Pop': 50, 'Modern': 51, 'School Pop': 52, 'Motown': 53, 'Resistor': 54, }; static const Map reggaeStylesPro = { 'Sheriff': 55, 'Santeria': 56, 'Reggae 3': 57, 'Reggae 4': 58, 'Reggae 5': 59, 'Reggae 6': 60, 'Reggae 7': 61, }; static const Map electronicStylesPro = { 'Electronic 1': 62, 'Electronic 2': 63, 'Electronic 3': 64, 'Elec-EDM': 65, 'Elec-Tech': 66, }; static const Map metronomeStylesPro = { 'M1 - 4/4 4th': 67, 'M2 - 4/4 8th': 68, 'M3 - 4/4 16th': 69, 'M4 - 4/4 2nd Tri': 70, 'M5 - 4/4 4th Tri': 71, 'M6 - 4/4 8th Tri': 72, 'M7 - 3/4 4th': 73, 'M8 - 3/4 8th': 74, }; static const Map drumCategoriesPro = { "Rock": rockStylesPro, "Country": countryStylesPro, "Blues": bluesStylesPro, "Metal": metalStylesPro, "Funk": funkStylesPro, "Jazz": jazzStylesPro, "Ballad": balladStylesPro, "Pop": popStylesPro, "Reggae": reggaeStylesPro, "Electronic": electronicStylesPro }; static const Map drumCategoriesProV2 = { "Metronome": metronomeStylesProV2, "Rock": rockStylesProV2, "Country": countryStylesProV2, "Blues": bluesStylesProV2, "Metal": metalStylesProV2, "Funk": funkStylesProV2, "Jazz": jazzStylesProV2, "Ballad": balladStylesProV2, "Pop": popStylesProV2, "Reggae": reggaeStylesProV2, "Electronic": electronicStylesProV2 }; //version 2 - for 2024 update: static const Map metronomeStylesProV2 = { 'M1 - 4/4 4th': 0, 'M2 - 4/4 8th': 1, 'M3 - 4/4 16th': 2, 'M4 - 4/4 2nd Tri': 3, 'M5 - 4/4 4th Tri': 4, 'M6 - 4/4 8th Tri': 5, 'M7 - 3/4 4th': 6, 'M8 - 3/4 8th': 7, }; static const Map rockStylesProV2 = { 'Standard': 8, 'Swing Rock': 9, 'Power Beat': 10, 'Smooth': 11, 'Mega Drive': 12, 'Hard Rock': 13, 'Boogie': 14 }; static const Map countryStylesProV2 = { 'Walk Line': 15, 'Blue Grass': 16, 'Country': 17, 'Waltz': 18, 'Train': 19, 'Country Rock': 20, 'Slowly': 21 }; static const Map bluesStylesProV2 = { 'Slow Blues': 22, 'Chicago': 23, 'R&B': 24, 'Blues Rock': 25, 'Road Train': 26, 'Shuffle': 27, }; static const Map metalStylesProV2 = { '2X Bass': 28, 'Close Beat': 29, 'Heavy Bass': 30, 'Fast': 31, 'Holy Case': 32, 'Open Hat': 33, 'Epic': 34, }; static const Map funkStylesProV2 = { 'Bounce': 35, 'East Coast': 36, 'New Mann': 37, 'R&B Funk': 38, '80s Funk': 39, 'Soul': 40, 'Uncle Jam': 41, }; static const Map jazzStylesProV2 = { 'Blues Jazz': 42, 'Classic 1': 43, 'Classic 2': 44, 'Easy Jazz': 45, 'Fast': 46, 'Walking': 47, 'Smooth': 48, }; static const Map balladStylesProV2 = { 'Bluesy': 49, 'Grooves': 50, 'Ballad Rock': 51, 'Slow Rock': 52, 'Tutorial': 53, 'R&B Ballad': 54, 'Gospel': 55, }; static const Map popStylesProV2 = { 'Beach Side': 56, 'Big City': 57, 'Funky Pop': 58, 'Modern': 59, 'School Pop': 60, 'Motown': 61, 'Resistor': 62, }; static const Map reggaeStylesProV2 = { 'Sheriff': 63, 'Santeria': 64, 'Reggae 3': 65, 'Reggae 4': 66, 'Reggae 5': 67, 'Reggae 6': 68, 'Reggae 7': 69, }; static const Map electronicStylesProV2 = { 'Electronic 1': 70, 'Electronic 2': 71, 'Electronic 3': 72, 'Elec-EDM': 73, 'Elec-Tech': 74, }; } ================================================ FILE: lib/bluetooth/devices/device_data/processors_list.dart ================================================ import 'package:flutter/material.dart'; import '../../../UI/mightierIcons.dart'; import '../NuxFXID.dart'; import '../effects/Processor.dart'; class ProcessorsList { static const List plugAirList = [ ProcessorInfo( shortName: "Gate", longName: "Noise Gate", keyName: "gate", nuxFXID: PlugAirFXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "EFX", longName: "EFX", keyName: "efx", nuxFXID: PlugAirFXID.efx, color: Color(0xFFB388FF), //deepPurpleAccent[100] icon: MightierIcons.pedal), ProcessorInfo( shortName: "Amp", longName: "Amplifier", keyName: "amp", nuxFXID: PlugAirFXID.amp, color: Colors.green, icon: MightierIcons.amp), ProcessorInfo( shortName: "IR", longName: "Cabinet", keyName: "cabinet", nuxFXID: PlugAirFXID.cab, color: Colors.blue, icon: MightierIcons.cabinet), ProcessorInfo( shortName: "Mod", longName: "Modulation", keyName: "mod", nuxFXID: PlugAirFXID.mod, color: Color(0xFF4DD0E1), //cyan[300] icon: Icons.waves), ProcessorInfo( shortName: "Delay", longName: "Delay", keyName: "delay", nuxFXID: PlugAirFXID.delay, color: Colors.blueAccent, icon: Icons.blur_linear), ProcessorInfo( shortName: "Reverb", longName: "Reverb", keyName: "reverb", nuxFXID: PlugAirFXID.reverb, color: Colors.orange, icon: Icons.blur_on), ]; static const List plugProList = [ ProcessorInfo( shortName: "COMP", longName: "Comp", keyName: "comp", nuxFXID: PlugProFXID.comp, color: Colors.lime, icon: MightierIcons.compressor), ProcessorInfo( shortName: "EFX", longName: "EFX", keyName: "efx", nuxFXID: PlugProFXID.efx, color: Colors.orange, icon: MightierIcons.pedal), ProcessorInfo( shortName: "AMP", longName: "Amplifier", keyName: "amp", nuxFXID: PlugProFXID.amp, color: Colors.red, icon: MightierIcons.amp), ProcessorInfo( shortName: "EQ", longName: "EQ", keyName: "eq", nuxFXID: PlugProFXID.eq, color: Color(0xFFE0E0E0), //grey[300] icon: MightierIcons.sliders), ProcessorInfo( shortName: "GATE", longName: "Noise Gate", keyName: "gate", nuxFXID: PlugProFXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "MOD", longName: "Modulation", keyName: "mod", nuxFXID: PlugProFXID.mod, color: Color(0xFF7E57C2), //deepPurple[400] icon: Icons.waves), ProcessorInfo( shortName: "DLY", longName: "Delay", keyName: "delay", nuxFXID: PlugProFXID.delay, color: Color(0xFF4DD0E1), //cyan[300] icon: Icons.blur_linear), ProcessorInfo( shortName: "RVB", longName: "Reverb", keyName: "reverb", nuxFXID: PlugProFXID.reverb, color: Color(0xFFCE93D8), //purple[200] icon: Icons.blur_on), ProcessorInfo( shortName: "IR", longName: "Cab", keyName: "cabinet", nuxFXID: PlugProFXID.cab, color: Color(0xFF29B6F6), //lightBlue[400] icon: MightierIcons.cabinet), ]; static const List liteMk2List = [ ProcessorInfo( shortName: "GATE", longName: "Noise Gate", keyName: "gate", nuxFXID: LiteMK2FXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "EFX", longName: "EFX", keyName: "efx", nuxFXID: LiteMK2FXID.efx, color: Colors.orange, icon: MightierIcons.pedal), ProcessorInfo( shortName: "AMP", longName: "Amplifier", keyName: "amp", nuxFXID: LiteMK2FXID.amp, color: Colors.red, icon: MightierIcons.amp), ProcessorInfo( shortName: "IR", longName: "Cab", keyName: "cabinet", nuxFXID: LiteMK2FXID.cab, color: Color(0xFF29B6F6), //lightBlue[400] icon: MightierIcons.cabinet), ProcessorInfo( shortName: "MOD", longName: "Modulation", keyName: "mod", nuxFXID: LiteMK2FXID.mod, color: Color(0xFF7E57C2), //Colors.deepPurple[400]!, icon: Icons.waves), ProcessorInfo( shortName: "DLY", longName: "Delay", keyName: "delay", nuxFXID: LiteMK2FXID.delay, color: Color(0xFF4DD0E1), //Colors.cyan[300]!, icon: Icons.blur_linear), ProcessorInfo( shortName: "RVB", longName: "Reverb", keyName: "reverb", nuxFXID: LiteMK2FXID.reverb, color: Color(0xFFCE93D8), //Colors.purple[200]!, icon: Icons.blur_on), ]; static const List liteList = [ ProcessorInfo( shortName: "Gate", longName: "Noise Gate", keyName: "gate", nuxFXID: LiteFXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "Amp", longName: "Amplifier", keyName: "amp", nuxFXID: LiteFXID.amp, color: Colors.green, icon: MightierIcons.amp), ProcessorInfo( shortName: "Mod", longName: "Modulation", keyName: "mod", nuxFXID: LiteFXID.mod, color: Color(0xFF4DD0E1), //cyan[300] icon: Icons.waves), ProcessorInfo( shortName: "Ambience", longName: "Ambience", keyName: "ambience", nuxFXID: LiteFXID.ambience, color: Colors.orange, icon: Icons.blur_on), ]; static const List bt2040List = [ ProcessorInfo( shortName: "Gate", longName: "Noise Gate", keyName: "gate", nuxFXID: PlugBTFXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "Amp", longName: "Amplifier", keyName: "amp", nuxFXID: PlugBTFXID.amp, color: Colors.green, icon: MightierIcons.amp), ProcessorInfo( shortName: "Mod", longName: "Modulation", keyName: "mod", nuxFXID: PlugBTFXID.mod, color: Color(0xFF4DD0E1), //cyan[300] icon: Icons.waves), ProcessorInfo( shortName: "Delay", longName: "Delay", keyName: "delay", nuxFXID: PlugBTFXID.delay, color: Colors.blueAccent, icon: Icons.blur_linear), ProcessorInfo( shortName: "Reverb", longName: "Reverb", keyName: "reverb", nuxFXID: PlugBTFXID.reverb, color: Colors.orange, icon: Icons.blur_on), ]; static const List mighty8BTList = [ ProcessorInfo( shortName: "Gate", longName: "Noise Gate", keyName: "gate", nuxFXID: PlugBTFXID.gate, color: Colors.green, icon: MightierIcons.gate), ProcessorInfo( shortName: "Amp", longName: "Amplifier", keyName: "amp", nuxFXID: PlugBTFXID.amp, color: Colors.green, icon: MightierIcons.amp), ProcessorInfo( shortName: "Mod", longName: "Modulation", keyName: "mod", nuxFXID: PlugBTFXID.mod, color: Color(0xFF4DD0E1), //cyan[300] icon: Icons.waves), ProcessorInfo( shortName: "Delay", longName: "Delay", keyName: "delay", nuxFXID: PlugBTFXID.delay, color: Colors.blueAccent, icon: Icons.blur_linear), ProcessorInfo( shortName: "Reverb", longName: "Reverb", keyName: "reverb", nuxFXID: PlugBTFXID.reverb, color: Colors.orange, icon: Icons.blur_on), ]; } ================================================ FILE: lib/bluetooth/devices/effects/MidiControllerHandles.dart ================================================ enum ControllerHandleId { unknown, gateOff, gateOn, gateToggle, gatePrev, gateNext, compOff, compOn, compToggle, compPrev, compNext, modOff, modOn, modToggle, modPrev, modNext, efxOff, efxOn, efxToggle, efxPrev, efxNext, ampOff, ampOn, ampToggle, ampPrev, ampNext, cabOff, cabOn, cabToggle, cabPrev, cabNext, eqOff, eqOn, eqToggle, eqPrev, eqNext, reverbOff, reverbOn, reverbToggle, reverbPrev, reverbNext, delayOff, delayOn, delayToggle, delayPrev, delayNext, gateSense, gateDecay, compLevel, compSustain, compThreshold, compRatio, efxLevel, efxGain, efxTone, efxRate, efxDepth, efxBass, ampGain, ampVolume, ampBass, ampMiddle, ampTreble, ampTone, cabLevel, cabLoCut, cabHiCut, delayLevel, delayTime, delayRepeat, delayMod, reverbDecay, reverbMix, reverbTone, modRate, modDepth, modIntensity } class MidiControllerHandle { final String label; final ControllerHandleId id; const MidiControllerHandle(this.label, this.id); } class MidiControllerHandles { //on;off;toggle;prev;next handles static const MidiControllerHandle gateOff = MidiControllerHandle("", ControllerHandleId.gateOff); static const MidiControllerHandle gateOn = MidiControllerHandle("", ControllerHandleId.gateOn); static const MidiControllerHandle gateToggle = MidiControllerHandle("", ControllerHandleId.gateToggle); static const MidiControllerHandle gatePrev = MidiControllerHandle("", ControllerHandleId.gatePrev); static const MidiControllerHandle gateNext = MidiControllerHandle("", ControllerHandleId.gateNext); static const MidiControllerHandle compOff = MidiControllerHandle("", ControllerHandleId.compOff); static const MidiControllerHandle compOn = MidiControllerHandle("", ControllerHandleId.compOn); static const MidiControllerHandle compToggle = MidiControllerHandle("", ControllerHandleId.compToggle); static const MidiControllerHandle compPrev = MidiControllerHandle("", ControllerHandleId.compPrev); static const MidiControllerHandle compNext = MidiControllerHandle("", ControllerHandleId.compNext); static const MidiControllerHandle modOff = MidiControllerHandle("", ControllerHandleId.modOff); static const MidiControllerHandle modOn = MidiControllerHandle("", ControllerHandleId.modOn); static const MidiControllerHandle modToggle = MidiControllerHandle("", ControllerHandleId.modToggle); static const MidiControllerHandle modPrev = MidiControllerHandle("", ControllerHandleId.modPrev); static const MidiControllerHandle modNext = MidiControllerHandle("", ControllerHandleId.modNext); static const MidiControllerHandle efxOff = MidiControllerHandle("", ControllerHandleId.efxOff); static const MidiControllerHandle efxOn = MidiControllerHandle("", ControllerHandleId.efxOn); static const MidiControllerHandle efxToggle = MidiControllerHandle("", ControllerHandleId.efxToggle); static const MidiControllerHandle efxPrev = MidiControllerHandle("", ControllerHandleId.efxPrev); static const MidiControllerHandle efxNext = MidiControllerHandle("", ControllerHandleId.efxNext); static const MidiControllerHandle ampOff = MidiControllerHandle("", ControllerHandleId.ampOff); static const MidiControllerHandle ampOn = MidiControllerHandle("", ControllerHandleId.ampOn); static const MidiControllerHandle ampToggle = MidiControllerHandle("", ControllerHandleId.ampToggle); static const MidiControllerHandle ampPrev = MidiControllerHandle("", ControllerHandleId.ampPrev); static const MidiControllerHandle ampNext = MidiControllerHandle("", ControllerHandleId.ampNext); static const MidiControllerHandle cabOff = MidiControllerHandle("", ControllerHandleId.cabOff); static const MidiControllerHandle cabOn = MidiControllerHandle("", ControllerHandleId.cabOn); static const MidiControllerHandle cabToggle = MidiControllerHandle("", ControllerHandleId.cabToggle); static const MidiControllerHandle cabPrev = MidiControllerHandle("", ControllerHandleId.cabPrev); static const MidiControllerHandle cabNext = MidiControllerHandle("", ControllerHandleId.cabNext); static const MidiControllerHandle eqOff = MidiControllerHandle("", ControllerHandleId.eqOff); static const MidiControllerHandle eqOn = MidiControllerHandle("", ControllerHandleId.eqOn); static const MidiControllerHandle eqToggle = MidiControllerHandle("", ControllerHandleId.eqToggle); static const MidiControllerHandle eqPrev = MidiControllerHandle("", ControllerHandleId.eqPrev); static const MidiControllerHandle eqNext = MidiControllerHandle("", ControllerHandleId.eqNext); static const MidiControllerHandle reverbOff = MidiControllerHandle("", ControllerHandleId.reverbOff); static const MidiControllerHandle reverbOn = MidiControllerHandle("", ControllerHandleId.reverbOn); static const MidiControllerHandle reverbToggle = MidiControllerHandle("", ControllerHandleId.reverbToggle); static const MidiControllerHandle reverbPrev = MidiControllerHandle("", ControllerHandleId.reverbPrev); static const MidiControllerHandle reverbNext = MidiControllerHandle("", ControllerHandleId.reverbNext); static const MidiControllerHandle delayOff = MidiControllerHandle("", ControllerHandleId.delayOff); static const MidiControllerHandle delayOn = MidiControllerHandle("", ControllerHandleId.delayOn); static const MidiControllerHandle delayToggle = MidiControllerHandle("", ControllerHandleId.delayToggle); static const MidiControllerHandle delayPrev = MidiControllerHandle("", ControllerHandleId.delayPrev); static const MidiControllerHandle delayNext = MidiControllerHandle("", ControllerHandleId.delayNext); //Gate static const MidiControllerHandle gateSense = MidiControllerHandle("Threshold", ControllerHandleId.gateSense); static const MidiControllerHandle gateDecay = MidiControllerHandle("Decay", ControllerHandleId.gateDecay); //comp static const MidiControllerHandle compLevel = MidiControllerHandle("Level", ControllerHandleId.compLevel); static const MidiControllerHandle compSustain = MidiControllerHandle("Sustain", ControllerHandleId.compSustain); static const MidiControllerHandle compThreshold = MidiControllerHandle("Threshold", ControllerHandleId.compThreshold); static const MidiControllerHandle compRatio = MidiControllerHandle("Ratio", ControllerHandleId.compRatio); //EFX static const MidiControllerHandle efxLevel = MidiControllerHandle("Level", ControllerHandleId.efxLevel); static const MidiControllerHandle efxGain = MidiControllerHandle("Gain/Drive", ControllerHandleId.efxGain); static const MidiControllerHandle efxTone = MidiControllerHandle("Tone/Treble", ControllerHandleId.efxTone); static const MidiControllerHandle efxRate = MidiControllerHandle("Rate", ControllerHandleId.efxRate); static const MidiControllerHandle efxDepth = MidiControllerHandle("Depth/Sustain", ControllerHandleId.efxDepth); static const MidiControllerHandle efxBass = MidiControllerHandle("Bass", ControllerHandleId.efxBass); //Amps static const MidiControllerHandle ampGain = MidiControllerHandle("Gain", ControllerHandleId.ampGain); static const MidiControllerHandle ampVolume = MidiControllerHandle("Master Level", ControllerHandleId.ampVolume); static const MidiControllerHandle ampBass = MidiControllerHandle("Bass", ControllerHandleId.ampBass); static const MidiControllerHandle ampMiddle = MidiControllerHandle("Middle", ControllerHandleId.ampMiddle); static const MidiControllerHandle ampTreble = MidiControllerHandle("Treble", ControllerHandleId.ampTreble); static const MidiControllerHandle ampTone = MidiControllerHandle("Presence/Tone", ControllerHandleId.ampTone); //Cabs static const MidiControllerHandle cabLevel = MidiControllerHandle("Level", ControllerHandleId.cabLevel); static const MidiControllerHandle cabLoCut = MidiControllerHandle("Low Cut", ControllerHandleId.cabLoCut); static const MidiControllerHandle cabHiCut = MidiControllerHandle("High Cut", ControllerHandleId.cabHiCut); //Delays static const MidiControllerHandle delayLevel = MidiControllerHandle("Level", ControllerHandleId.delayLevel); static const MidiControllerHandle delayTime = MidiControllerHandle("Time", ControllerHandleId.delayTime); static const MidiControllerHandle delayRepeat = MidiControllerHandle("Repeat", ControllerHandleId.delayRepeat); static const MidiControllerHandle delayMod = MidiControllerHandle("Modulation", ControllerHandleId.delayMod); //Reverbs static const MidiControllerHandle reverbDecay = MidiControllerHandle("Decay", ControllerHandleId.reverbDecay); static const MidiControllerHandle reverbMix = MidiControllerHandle("Level/Mix", ControllerHandleId.reverbMix); static const MidiControllerHandle reverbTone = MidiControllerHandle("Tone/Misc", ControllerHandleId.reverbTone); static const MidiControllerHandle modRate = MidiControllerHandle("Rate", ControllerHandleId.modRate); static const MidiControllerHandle modDepth = MidiControllerHandle("Depth/Width", ControllerHandleId.modDepth); static const MidiControllerHandle modIntensity = MidiControllerHandle("Intensity/Mix", ControllerHandleId.modIntensity); } ================================================ FILE: lib/bluetooth/devices/effects/NoiseGate.dart ================================================ import '../NuxConstants.dart'; import '../value_formatters/ValueFormatter.dart'; import 'MidiControllerHandles.dart'; import 'Processor.dart'; class NoiseGate2Param extends Processor { @override final name = "Noise Gate"; @override int get nuxIndex => 0; @override int? get nuxEffectTypeIndex => null; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.ngenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_GateEnable; @override int get midiCCSelectionValue => 0; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.gateOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.gateOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.gateToggle; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; @override List parameters = [ Parameter( name: "Threshold", handle: "threshold", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ngthresold, midiCC: MidiCCValues.bCC_GateThresold, midiControllerHandle: MidiControllerHandles.gateSense), Parameter( name: "Sustain", handle: "sustain", value: 47, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ngsustain, midiCC: MidiCCValues.bCC_GateDecay, midiControllerHandle: MidiControllerHandles.gateDecay), ]; } class NoiseGate1Param extends Processor { @override final name = "Noise Gate"; @override int get nuxIndex => 0; //noise gate has no type specified @override int? get nuxEffectTypeIndex => null; @override int? get nuxEnableIndex => PresetDataIndexLite.ngenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_GateEnable; @override int get midiCCSelectionValue => 0; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.gateOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.gateOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.gateToggle; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; @override List parameters = [ Parameter( name: "Threshold", handle: "threshold", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ngthresold, midiCC: MidiCCValues.bCC_GateThresold, midiControllerHandle: MidiControllerHandles.gateSense), ]; } class NoiseGatePro extends Processor { @override final name = "Noise Gate"; @override int get nuxIndex => 1; @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iNG; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iNG; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iNG; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.gateOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.gateOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.gateToggle; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; @override List parameters = [ Parameter( name: "Sensitivity", handle: "sensitivity", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.NG_Para1, midiCC: MidiCCValuesPro.NG_Para1, midiControllerHandle: MidiControllerHandles.gateSense), Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.NG_Para2, midiCC: MidiCCValuesPro.NG_Para2, midiControllerHandle: MidiControllerHandles.gateDecay), ]; } ================================================ FILE: lib/bluetooth/devices/effects/Processor.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../NuxFXID.dart'; import '../../../utilities/MathEx.dart'; import '../value_formatters/SwitchFormatters.dart'; import 'MidiControllerHandles.dart'; class Parameter { ValueFormatter formatter; String name; String handle; int midiCC; int devicePresetIndex; double value; bool masterVolume = false; MidiControllerHandle? midiControllerHandle; Parameter( {required this.value, required this.handle, required this.formatter, required this.name, required this.midiCC, required this.devicePresetIndex, this.midiControllerHandle, this.masterVolume = false}); int get midiValue => formatter.valueToMidi7Bit(value); int get masterVolMidiValue => formatter .valueToMidi7Bit(value * (NuxDeviceControl().masterVolume * 0.01)); set midiValue(mv) => value = formatter.midi7BitToValue(mv); String get label => formatter.toLabel(value); double toHumanInput() { return formatter.toHumanInput(value); } double fromHumanInput(double val) { value = formatter.fromHumanInput(val); return value; } } class ProcessorInfo { final String shortName; final String longName; final String keyName; final NuxFXID nuxFXID; final Color color; final IconData icon; const ProcessorInfo( {required this.shortName, required this.longName, required this.keyName, required this.nuxFXID, required this.color, required this.icon}); } enum EffectEditorUI { Sliders, EQ } abstract class Processor { String get name; List get parameters; //the number which the nux device uses to refer to the effect int get nuxIndex; //index in nux data array where the effect type is set int? get nuxEffectTypeIndex; int? get nuxEnableIndex; int get nuxEnableMask => 0x7f; bool get nuxEnableInverted => false; EffectEditorUI get editorUI; //The CC command that switches the effect on/off int get midiCCEnableValue; //The CC command that selects the active effect for a certain slot int get midiCCSelectionValue; //MIDI foot controller stuff MidiControllerHandle? get midiControlOff; MidiControllerHandle? get midiControlOn; MidiControllerHandle? get midiControlToggle; MidiControllerHandle? get midiControlPrev; MidiControllerHandle? get midiControlNext; //used to declare that the device is a separator //Used in the selection popup menu bool isSeparator = false; //Used to sort various effects in a category //for example acoustic amps/electric amps //used in conjunction with isSeparator String category = ""; //at least for Mighty Plug MP-2, the NuxPayload values are 0-100, not 0,127 void setupFromNuxPayload(List nuxData) { for (int i = 0; i < parameters.length; i++) { var valueIndex = parameters[i].devicePresetIndex; if (nuxData.length <= valueIndex) { debugPrint("Error: $valueIndex outside of preset data!"); continue; } if (parameters[i].formatter is SwitchFormatter) { parameters[i].value = nuxData[parameters[i].devicePresetIndex].toDouble(); } else { parameters[i].value = MathEx.map( nuxData[parameters[i].devicePresetIndex].toDouble(), 0, 100, parameters[i].formatter.min.toDouble(), parameters[i].formatter.max.toDouble()); } } } void getNuxPayload(List nuxData, bool enabled) { if (nuxEffectTypeIndex != null) nuxData[nuxEffectTypeIndex!] = nuxIndex; for (int i = 0; i < parameters.length; i++) { //TODO: isn't this supposed to use valueformatter valueToMidi7Bit() int value = MathEx.map( parameters[i].value, parameters[i].formatter.min.toDouble(), parameters[i].formatter.max.toDouble(), 0, 100) .round(); nuxData[parameters[i].devicePresetIndex] = value; } if (nuxEnableIndex != null) { int value = (enabled != nuxEnableInverted ? 0xff : 0) & nuxEnableMask; nuxData[nuxEnableIndex!] |= value; } } //this is used for version transition int? getEquivalentEffect(int version) { return nuxIndex; } } abstract class Amplifier extends Processor { @override int get midiCCEnableValue; @override int get midiCCSelectionValue; int get defaultCab; } abstract class Cabinet extends Processor { String get cabName; } ================================================ FILE: lib/bluetooth/devices/effects/lite/Ambience.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Ambience extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndexLite.efxtype; @override int? get nuxEnableIndex => PresetDataIndexLite.efxenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ChorusEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ChorusMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.reverbOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.reverbOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.reverbToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.reverbPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.reverbNext; } class Delay1 extends Ambience { @override final name = "Delay 1"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay2 extends Ambience { @override final name = "Delay 2"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay3 extends Ambience { @override final name = "Delay 3"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay4 extends Ambience { @override final name = "Delay 4"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class RoomReverb extends Ambience { @override final name = "Room"; @override int get nuxIndex => 10; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class HallReverb extends Ambience { @override final name = "Hall"; @override int get nuxIndex => 11; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class PlateReverb extends Ambience { @override final name = "Plate"; @override int get nuxIndex => 12; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 81, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class SpringReverb extends Ambience { @override final name = "Spring"; @override int get nuxIndex => 13; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 32, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } ================================================ FILE: lib/bluetooth/devices/effects/lite/Amps.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class LiteAmplifier extends Amplifier { //TODO: check if correct @override int? get nuxEffectTypeIndex => null; @override int? get nuxEnableIndex => null; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_AmpEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_NotUsed; @override int get defaultCab => 0; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; } class AmpClean extends LiteAmplifier { @override final name = "Amplifier"; @override int get nuxIndex => 0; @override bool isSeparator = false; @override String category = ""; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.drivegain, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexLite.drivelevel, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.drivetone, //check this midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampTone), ]; } ================================================ FILE: lib/bluetooth/devices/effects/lite/Modulation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Modulation extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexLite.modfxtype; @override int? get nuxEnableIndex => PresetDataIndexLite.modfxenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; //row 1247: 0-phaser, 1-chorus, 2-Stereo chorus, 3-Flanger, 4-Vibe, 5-Tremolo @override int get midiCCEnableValue => MidiCCValues.bCC_ModfxEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ModfxMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.modOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.modOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.modToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.modPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.modNext; } class Phaser extends Modulation { @override final name = "Phaser"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Chorus extends Modulation { @override final name = "Chorus"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 88, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Tremolo extends Modulation { @override final name = "Tremolo"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Vibe extends Modulation { @override final name = "Vibe"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } ================================================ FILE: lib/bluetooth/devices/effects/liteMk2/delay.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../../NuxConstants.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; import '../plug_pro/Delay.dart'; class AnalogDelayLiteMk2 extends DelayPro { @override final name = "Analog"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Time", handle: "rate", value: 50, formatter: ValueFormatters.tempoProAnalog, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "echo", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "intensity", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), ]; } class DigitalDelayLiteV2 extends DelayPro { @override final name = "Digital"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Time", handle: "time", value: 50, formatter: ValueFormatters.tempoProAnalog, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "feedback", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), ]; } class ModDelayLiteMk2 extends DelayPro { @override final name = "Modulation"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Time", handle: "time", value: 49, formatter: ValueFormatters.tempoProMod, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 48, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "level", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Mod", handle: "mod", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para4, midiCC: MidiCCValuesPro.DLY_Para4, midiControllerHandle: MidiControllerHandles.delayMod), ]; } class TapeEchoLiteMk2 extends DelayPro { @override final name = "Tape Echo"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Time", handle: "time", value: 61, formatter: ValueFormatters.tempoProTapeEcho, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 56, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "level", value: 43, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), ]; } class PhiDelayLiteMk2 extends DelayPro { @override final name = "Phi Delay"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Time", handle: "time", value: 50, formatter: ValueFormatters.tempoPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "level", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), ]; } ================================================ FILE: lib/bluetooth/devices/effects/liteMk2/efx.dart ================================================ import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; import '../plug_pro/EFX.dart'; class RoseCompLiteMk2 extends EFXPro { @override final name = "Rose Comp"; @override int get nuxIndex => 14; @override List parameters = [ Parameter( name: "Sustain", handle: "sustain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.compSustain), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.compLevel), ]; } class KCompLiteMk2 extends EFXPro { @override final name = "K Comp"; @override int get nuxIndex => 15; @override List parameters = [ Parameter( name: "Sustain", handle: "sustain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.compSustain), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.compLevel), Parameter( name: "Clipping", handle: "clipping", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.compThreshold), ]; } class TouchWahLiteMk2 extends EFXPro { @override int get nuxIndex => 16; @override final name = "Touch Wah"; @override List parameters = [ Parameter( name: "Type", handle: "type", value: 81, formatter: ValueFormatters.touchWahFormatterLiteMk2, devicePresetIndex: 0, midiCC: MidiCCValuesPro.EFX_Para1), Parameter( name: "Wow", handle: "wow", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: 0, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Sense", handle: "sense", value: 27, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: 0, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxRate), ]; } class TremoloEFXLiteMk2 extends EFXPro { @override final name = "Tremolo"; @override int get nuxIndex => 17; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Depth", handle: "depth", value: 15, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxDepth), ]; } class VibeEFXLiteMk2 extends EFXPro { @override final name = "U-Vibe"; @override int get nuxIndex => 18; @override List parameters = [ Parameter( name: "Rate", handle: "Rate", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Depth", handle: "depth", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxDepth), Parameter( name: "Mode", handle: "mode", value: 0, formatter: ValueFormatters.vibeModePro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3), ]; } class PH100LiteMk2 extends EFXPro { @override final name = "PH 100"; @override int get nuxIndex => 19; @override List parameters = [ Parameter( name: "Intensity", handle: "depth", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.modRate), ]; } ================================================ FILE: lib/bluetooth/devices/effects/liteMk2/modulation.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/effects/plug_pro/Modulation.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; class FlangerLiteMk2 extends FlangerPro { @override int get nuxIndex => 5; } class Phase90LiteMk2 extends Phase90 { @override int get nuxIndex => 6; } class Phase100LiteMk2 extends Phase100 { @override int get nuxIndex => 7; } class SCFLiteMk2 extends SCFPro { @override int get nuxIndex => 8; } class VibeLiteMk2 extends VibePro { @override int get nuxIndex => 9; @override List parameters = [ Parameter( name: "Rate", handle: "speed", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "intensity", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mode", handle: "mode", value: 0, formatter: ValueFormatters.vibeModePro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3), ]; } class TremoloLiteMk2 extends TremoloPro { @override int get nuxIndex => 10; } class SCH1LiteMk2 extends SCH1Pro { @override int get nuxIndex => 11; } ================================================ FILE: lib/bluetooth/devices/effects/liteMk2/reverb.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/effects/plug_pro/Reverb.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; class RoomReverbLiteMk2 extends Reverb { @override final name = "Room"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para3, midiCC: MidiCCValuesPro.RVB_Para3, midiControllerHandle: MidiControllerHandles.reverbTone), ]; } class HallReverbLiteMk2 extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Tone", handle: "liveliness", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para3, midiCC: MidiCCValuesPro.RVB_Para3, midiControllerHandle: MidiControllerHandles.reverbTone), ]; } class DampReverbLiteMk2 extends DampReverbPro { @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_2040bt/Amps.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class MXXBTAmplifier extends Amplifier { @override int? get nuxEffectTypeIndex => null; @override int? get nuxEnableIndex => null; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_AmpEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_NotUsed; @override int get defaultCab => 0; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; } class Amp1 extends MXXBTAmplifier { @override final name = "Amplifier"; @override int get nuxIndex => 0; @override bool isSeparator = false; @override String category = ""; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.amp_gain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndex2040BT.amp_level, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.amp_bass, midiCC: MidiCCValues.bCC_AmpBass, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.amp_mid, midiCC: MidiCCValues.bCC_AmpMid, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "High", handle: "high", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.amp_high, midiCC: MidiCCValues.bCC_AmpHigh, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_2040bt/Delay.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Delay extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndex2040BT.dly_type; @override int? get nuxEnableIndex => PresetDataIndex2040BT.dly_enable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_DelayEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_DelayMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.delayOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.delayOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.delayToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.delayPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.delayNext; } class AnalogDelay extends Delay { @override final name = "Analog Delay"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndex2040BT.dly_time, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class ModulationDelay extends Delay { @override final name = "Modulation"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 56, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 43, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 61, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndex2040BT.dly_time, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class DigitalDelay extends Delay { @override final name = "Digital Delay"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 49, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.dly_mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 48, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndex2040BT.dly_time, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_2040bt/Modulation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Modulation extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndex2040BT.mod_type; @override int? get nuxEnableIndex => PresetDataIndex2040BT.mod_enable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ModfxEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ModfxMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.modOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.modOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.modToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.modPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.modNext; } class Phaser extends Modulation { @override final name = "Phaser"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Depth", handle: "depth", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate) ]; } class Chorus extends Modulation { @override final name = "Chorus"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Depth", handle: "depth", value: 88, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), ]; } class Tremolo extends Modulation { @override final name = "Tremolo"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Depth", handle: "depth", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Rate", handle: "rate", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.mod_rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate) ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_2040bt/Reverb.dart ================================================ import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Reverb extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndex2040BT.rvb_type; @override int? get nuxEnableIndex => PresetDataIndex2040BT.rvb_enable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ReverbEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ReverbMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.reverbOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.reverbOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.reverbToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.reverbPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.reverbNext; } class HallReverb extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_mix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class PlateReverb extends Reverb { @override final name = "Plate"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 81, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_mix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class SpringReverb extends Reverb { @override final name = "Spring"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 32, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndex2040BT.rvb_mix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_8bt/Amps.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class M8BTAmplifier extends Amplifier { //TODO: check if correct @override int? get nuxEffectTypeIndex => null; @override int? get nuxEnableIndex => null; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_AmpEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_NotUsed; @override int get defaultCab => 0; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; } class AmpClean extends M8BTAmplifier { @override final name = "Amplifier"; @override int get nuxIndex => 0; @override bool isSeparator = false; @override String category = ""; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.drivegain, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.drivetone, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexLite.drivelevel, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Mic Level", handle: "miclevel", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.miclevel, midiCC: MidiCCValues.bCC_AmpDrive), Parameter( name: "AMB Send", handle: "ambsend", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.micambsend, midiCC: MidiCCValues.bCC_AmpMaster), ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_8bt/Delay.dart ================================================ import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Delay extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndexLite.delaytype; @override int? get nuxEnableIndex => PresetDataIndexLite.delayenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_DelayEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_DelayMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.delayOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.delayOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.delayToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.delayPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.delayNext; } class Delay1 extends Delay { @override final name = "Delay 1"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay2 extends Delay { @override final name = "Delay 2"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay3 extends Delay { @override final name = "Delay 3"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class Delay4 extends Delay { @override final name = "Delay 4"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexLite.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_8bt/Modulation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Modulation extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexLite.modfxtype; @override int? get nuxEnableIndex => PresetDataIndexLite.modfxenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; //row 1247: 0-phaser, 1-chorus, 2-Stereo chorus, 3-Flanger, 4-Vibe, 5-Tremolo @override int get midiCCEnableValue => MidiCCValues.bCC_ModfxEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ModfxMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.modOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.modOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.modToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.modPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.modNext; } class Phaser extends Modulation { @override final name = "Phaser"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Chorus extends Modulation { @override final name = "Chorus"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 88, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Tremolo extends Modulation { @override final name = "Tremolo"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Vibe extends Modulation { @override final name = "Vibe"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } ================================================ FILE: lib/bluetooth/devices/effects/mighty_8bt/Reverb.dart ================================================ import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Reverb extends Processor { //TODO: check if correct @override int? get nuxEffectTypeIndex => PresetDataIndexLite.reverbtype; @override int? get nuxEnableIndex => PresetDataIndexLite.reverbenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ReverbEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ReverbMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.reverbOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.reverbOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.reverbToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.reverbPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.reverbNext; } class RoomReverb extends Reverb { @override final name = "Room"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class HallReverb extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class PlateReverb extends Reverb { @override final name = "Plate"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 81, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class SpringReverb extends Reverb { @override final name = "Spring"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 32, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexLite.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Amps.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/effects/MidiControllerHandles.dart'; import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../../NuxConstants.dart'; import '../../NuxMightyPlugAir.dart'; import '../Processor.dart'; import 'Ampsv2.dart'; import 'Cabinet.dart'; abstract class PlugAirAmplifier extends Amplifier { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.amptype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.ampenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_AmpEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_AmpModeSetup; @override int get defaultCab; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.ampPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.ampNext; } class TwinVerb extends PlugAirAmplifier { @override final name = "Twin Verb"; @override int get defaultCab => TR212.cabIndex; @override int get nuxIndex => 0; @override bool isSeparator = true; @override String category = "Clean"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 80, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Tone", handle: "tone", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return TwinRvbV2().nuxIndex; return nuxIndex; } } class JZ120 extends PlugAirAmplifier { @override final name = "JZ 120"; @override int get nuxIndex => 1; @override int get defaultCab => JZ120IR.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 76, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 75, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 62, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone", handle: "tone", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return JazzClean().nuxIndex; return nuxIndex; } } class TweedDlx extends PlugAirAmplifier { @override final name = "Tweed Dlx"; @override int get nuxIndex => 2; @override int get defaultCab => DR112.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 92, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 42, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone", handle: "tone", value: 49, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return DeluxeRvb().nuxIndex; return nuxIndex; } } class Plexi extends PlugAirAmplifier { @override final name = "Plexi"; @override bool isSeparator = true; @override String category = "Overdrive"; @override int get nuxIndex => 3; @override int get defaultCab => GB412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 26, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 53, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Tone", handle: "tone", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return Plexi1987x50().nuxIndex; return nuxIndex; } } class TopBoost extends PlugAirAmplifier { @override final name = "Top Boost 30"; @override int get nuxIndex => 4; @override int get defaultCab => A212.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 81, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mdl", value: 71, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone (Presence)", handle: "tone", value: 58, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return ClassA30().nuxIndex; return nuxIndex; } } class Lead100 extends PlugAirAmplifier { @override final name = "Lead 100"; @override int get nuxIndex => 5; @override int get defaultCab => BS410.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 71, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 66, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "middle", value: 62, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 53, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone (Presence)", handle: "tone", value: 67, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return Brit800().nuxIndex; return nuxIndex; } } class Fireman extends PlugAirAmplifier { @override final name = "Fireman"; @override bool isSeparator = true; @override String category = "Distortion"; @override int get nuxIndex => 6; @override int get defaultCab => V412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 69, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Tone", handle: "tone", value: 53, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class DIEVH4 extends PlugAirAmplifier { @override final name = "DIE VH4"; @override int get nuxIndex => 7; @override int get defaultCab => V412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 72, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone (Presence)", handle: "tone", value: 51, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return DIEVH4v2().nuxIndex; return nuxIndex; } } class Recto extends PlugAirAmplifier { @override final name = "Recto"; @override int get nuxIndex => 8; @override int get defaultCab => V412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 73, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 60, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 69, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 46, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Tone (Presence)", handle: "tone", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; //this is used for version transition @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return DualRect().nuxIndex; return nuxIndex; } } class Optima extends PlugAirAmplifier { @override final name = "Optima"; @override bool isSeparator = true; @override String category = "Acoustic"; @override int get nuxIndex => 9; @override int get defaultCab => MD45.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 72, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 100, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return Stagemanv2().nuxIndex; return nuxIndex; } } class Stageman extends PlugAirAmplifier { @override final name = "Stageman"; @override int get nuxIndex => 10; @override int get defaultCab => MD45.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 90, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return Stagemanv2().nuxIndex; return nuxIndex; } } class MLD extends PlugAirAmplifier { @override final name = "MLD"; @override bool isSeparator = true; @override String category = "Bass"; @override int get nuxIndex => 11; @override int get defaultCab => TRC410.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 91, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 61, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return MLDv2().nuxIndex; return nuxIndex; } } class AGL extends PlugAirAmplifier { @override final name = "AGL"; @override int get nuxIndex => 12; @override int get defaultCab => AGLDB810.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 61, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 89, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 72, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return AGLv2().nuxIndex; return nuxIndex; } } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Ampsv2.dart ================================================ import '../../NuxConstants.dart'; import '../../NuxMightyPlugAir.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; import 'Amps.dart'; import 'Cabinet.dart'; class JazzClean extends PlugAirAmplifier { @override final name = "Jazz Clean"; @override int get nuxIndex => 0; @override int get defaultCab => JZ120IR.cabIndex; @override bool isSeparator = true; @override String category = "Clean"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 70, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "tone", value: 100, formatter: ValueFormatters.brightMode, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return JZ120().nuxIndex; return nuxIndex; } } class DeluxeRvb extends PlugAirAmplifier { @override final name = "Deluxe Rvb"; @override int get nuxIndex => 1; @override int get defaultCab => DR112.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 80, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return TweedDlx().nuxIndex; return nuxIndex; } } class TwinRvbV2 extends PlugAirAmplifier { @override final name = "Twin Rvb"; @override int get defaultCab => TR212.cabIndex; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 85, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, //check this midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "middle", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, //check this midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, //check this midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "tone", value: 100, formatter: ValueFormatters.brightMode, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return TwinVerb().nuxIndex; return nuxIndex; } } class ClassA30 extends PlugAirAmplifier { @override final name = "Class A30"; @override int get nuxIndex => 3; @override int get defaultCab => A212.cabIndex; @override bool isSeparator = true; @override String category = "Drive"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 80, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Cut", handle: "cut", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return TopBoost().nuxIndex; return nuxIndex; } } class Brit800 extends PlugAirAmplifier { @override final name = "Brit 800"; @override int get nuxIndex => 4; @override int get defaultCab => V1960.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 81, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "middle", value: 71, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "tone", value: 58, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, //check this midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return Lead100().nuxIndex; return nuxIndex; } } class Plexi1987x50 extends PlugAirAmplifier { @override final name = "1987x50"; @override int get nuxIndex => 5; @override int get defaultCab => GB412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 81, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 71, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "tone", value: 58, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return Plexi().nuxIndex; return nuxIndex; } } class FiremanHBE extends PlugAirAmplifier { @override final name = "Fireman HBE"; @override int get nuxIndex => 6; @override int get defaultCab => V412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 77, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "tone", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class DualRect extends PlugAirAmplifier { @override final name = "Dual Rect"; @override int get nuxIndex => 7; @override int get defaultCab => V412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 70, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "tone", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return Recto().nuxIndex; return nuxIndex; } } class DIEVH4v2 extends PlugAirAmplifier { @override final name = "DIE VH4"; @override int get nuxIndex => 8; @override int get defaultCab => GB412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 80, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "tone", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return DIEVH4().nuxIndex; return nuxIndex; } } class AGLv2 extends PlugAirAmplifier { @override final name = "AGL"; @override int get nuxIndex => 9; @override int get defaultCab => AGLDB810.cabIndex; @override bool isSeparator = true; @override String category = "Bass"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 61, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 89, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 72, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return AGL().nuxIndex; return nuxIndex; } } class Starlift extends PlugAirAmplifier { @override final name = "Starlift"; @override int get nuxIndex => 10; @override int get defaultCab => MKB410.cabIndex; @override List parameters = [ Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid Freq", handle: "mid_freq", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Middle", handle: "mid", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Contour", handle: "contour", value: 0, formatter: ValueFormatters.contourMode, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive), Parameter( name: "Level", handle: "level", value: 80, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return AGL().nuxIndex; return nuxIndex; } } class MLDv2 extends PlugAirAmplifier { @override final name = "MLD"; @override int get nuxIndex => 11; @override int get defaultCab => TRC410.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 61, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 89, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 72, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptone, midiCC: MidiCCValues.bCC_AmpPresence, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return MLD().nuxIndex; return nuxIndex; } } class Stagemanv2 extends PlugAirAmplifier { @override final name = "Stageman"; @override int get nuxIndex => 12; @override int get defaultCab => MD45.cabIndex; @override bool isSeparator = true; @override String category = "Acoustic"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampgain, midiCC: MidiCCValues.bCC_AmpDrive, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Level", handle: "level", value: 70, formatter: ValueFormatters.percentage, masterVolume: true, devicePresetIndex: PresetDataIndexPlugAir.amplevel, midiCC: MidiCCValues.bCC_AmpMaster, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampbass, midiCC: MidiCCValues.bCC_OverDriveDrive, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.ampmiddle, midiCC: MidiCCValues.bCC_OverDriveTone, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.amptreble, midiCC: MidiCCValues.bCC_OverDriveLevel, midiControllerHandle: MidiControllerHandles.ampTreble), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return Stageman().nuxIndex; return nuxIndex; } } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Cabinet.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:core'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; //cabinets are 3 categories - electric, acoustic and bass abstract class CabinetMP2 extends Cabinet { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.cabtype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.cabenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_CabEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_CabMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.cabPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.cabNext; @override String get cabName; @override String get name { var name = SharedPrefs().getCustomCabinetName( NuxDeviceControl.instance().device.productStringId, nuxIndex); return name ?? cabName; } Parameter value = Parameter( devicePresetIndex: PresetDataIndexPlugAir.cabgain, name: "Level", handle: "level", value: 0, formatter: ValueFormatters.decibelMP2, midiCC: MidiCCValues.bCC_Routing, midiControllerHandle: MidiControllerHandles.cabLevel); @override List get parameters => [value]; } class V1960 extends CabinetMP2 { @override bool get isSeparator => true; @override String get category => "Electric IR"; @override final cabName = "V1960"; static int get cabIndex => 0; @override int get nuxIndex => cabIndex; } class A212 extends CabinetMP2 { @override final cabName = "A212"; //Sunn A212??? static int get cabIndex => 1; @override int get nuxIndex => cabIndex; } class BS410 extends CabinetMP2 { @override final cabName = "BS410"; static int get cabIndex => 2; @override int get nuxIndex => cabIndex; } class DR112 extends CabinetMP2 { @override final cabName = "DR112"; static int get cabIndex => 3; @override int get nuxIndex => cabIndex; } class GB412 extends CabinetMP2 { @override final cabName = "GB412"; static int get cabIndex => 4; @override int get nuxIndex => cabIndex; } class JZ120IR extends CabinetMP2 { @override final cabName = "JZ120"; static int get cabIndex => 5; @override int get nuxIndex => cabIndex; } class TR212 extends CabinetMP2 { @override final cabName = "TR212"; @override int get nuxIndex => cabIndex; static int get cabIndex => 6; } class V412 extends CabinetMP2 { @override final cabName = "V412"; static int get cabIndex => 7; @override int get nuxIndex => cabIndex; } class AGLDB810 extends CabinetMP2 { @override bool get isSeparator => true; @override String get category => "Bass IR"; @override final cabName = "AGL DB810"; static int get cabIndex => 8; @override int get nuxIndex => cabIndex; } class AMPSV810 extends CabinetMP2 { @override final cabName = "AMP SV810"; static int get cabIndex => 9; @override int get nuxIndex => cabIndex; } class MKB410 extends CabinetMP2 { @override final cabName = "MKB 410"; static int get cabIndex => 10; @override int get nuxIndex => cabIndex; } class TRC410 extends CabinetMP2 { @override final cabName = "TRC 410"; static int get cabIndex => 11; @override int get nuxIndex => cabIndex; } class GHBird extends CabinetMP2 { @override bool get isSeparator => true; @override String get category => "Acoustic IR"; @override final cabName = "G HBird EG Magnetic"; static int get cabIndex => 12; @override int get nuxIndex => cabIndex; } class GJ15 extends CabinetMP2 { @override final cabName = "G J15 EG Magnetic"; static int get cabIndex => 13; @override int get nuxIndex => cabIndex; } class MD45 extends CabinetMP2 { @override final cabName = "M D45 EG Magnetic"; static int get cabIndex => 14; @override int get nuxIndex => cabIndex; } class GIBJ200 extends CabinetMP2 { @override final cabName = "GIB J200 EG Magnetic"; static int get cabIndex => 15; @override int get nuxIndex => cabIndex; } class GIBJ45 extends CabinetMP2 { @override final cabName = "GIB J45 EG Magnetic"; static int get cabIndex => 16; @override int get nuxIndex => cabIndex; } class TL314 extends CabinetMP2 { @override final cabName = "TL 314 EG Magnetic"; static int get cabIndex => 17; @override int get nuxIndex => cabIndex; } class MHD28 extends CabinetMP2 { @override final cabName = "M HD28 EG Magnetic"; static int get cabIndex => 18; @override int get nuxIndex => cabIndex; } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Delay.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../NuxMightyPlugAir.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Delay extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.delaytype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.delayenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_DelayEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_DelayMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.delayOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.delayOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.delayToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.delayPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.delayNext; } class AnalogDelay extends Delay { @override final name = "Analog Delay"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 34, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar2feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar3mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 52, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delayvar1time, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class TapeEcho extends Delay { @override final name = "Tape Echo"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 56, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 43, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 61, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return ModDelay().nuxIndex; return nuxIndex; } } class DigitalDelay extends Delay { @override final name = "Digital Delay"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 49, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayfeedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delaymix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 48, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return DigitalDelayv2().nuxIndex; return nuxIndex; } } class PingPong extends Delay { @override final name = "Ping Pong"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar2feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar3mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 50, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; } class DigitalDelayv2 extends Delay { @override final name = "Digital Delay"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 49, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar2feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar3mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 48, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delayvar1time, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) { return DigitalDelay().nuxIndex; } return nuxIndex; } } class ModDelay extends Delay { @override final name = "Mod Delay"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Repeat", handle: "repeat", value: 49, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar2feedback, midiCC: MidiCCValues.bCC_DelayRepeat, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "mix", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.delayvar3mix, midiCC: MidiCCValues.bCC_DelayLevel, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 48, formatter: ValueFormatters.tempo, devicePresetIndex: PresetDataIndexPlugAir.delaytime, midiCC: MidiCCValues.bCC_DelayTime, midiControllerHandle: MidiControllerHandles.delayTime), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return TapeEcho().nuxIndex; return nuxIndex; } } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/EFX.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugAir.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/plug_air/EFXv2.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class EFX extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.efxtype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.efxenable; //row 1871 // 0 -Touch Wah, 1 - Uni Vibe, 2 - Tremolo, 3 - Phaser, 4 - Boost, 5 - TS Drive, 6 - Bass TS // 7 - 3 Band EQ, 8 - Muff, 9 - Crunch, 10 - Red Dist, 11 - Morning Drive, 12 - Dist One // The bass TS (6) is only available in bass preset mode, the rest are everywhere @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_DistEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_DistMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.efxOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.efxOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.efxToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.efxPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.efxNext; } class TouchWah extends EFX { @override final name = "Touch Wah"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Type", handle: "type", value: 1, formatter: ValueFormatters.touchWahFormatter, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain), Parameter( name: "Wow", handle: "wow", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Sense", handle: "sense", value: 27, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxRate), ]; } class UniVibe extends EFX { @override final name = "Uni Vibe"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 73, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Depth", handle: "depth", value: 83, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxDepth), Parameter( name: "Mode", handle: "mode", value: 0, formatter: ValueFormatters.vibeMode, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel), ]; } class TremoloEFX extends EFX { @override final name = "Tremolo"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 58, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Depth", handle: "depth", value: 73, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxDepth), ]; } class PhaserEFX extends EFX { @override final name = "Phaser"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Depth", handle: "depth", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxDepth), Parameter( name: "Feedback", handle: "feedback", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class Boost extends EFX { @override final name = "Boost"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Level", handle: "level", value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxLevel), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return Katana().nuxIndex; return nuxIndex; } } class TSDrive extends EFX { @override final name = "T Screamer"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 67, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Drive", handle: "drive", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class BassTS extends EFX { @override final name = "Bass TS"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 41, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 67, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Drive", handle: "drive", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return null; return nuxIndex; } } class ThreeBandEQ extends EFX { @override final name = "3 Band EQ"; @override int get nuxIndex => 7; @override List parameters = [ Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class Muff extends EFX { @override final name = "Muff Fuzz"; @override int get nuxIndex => 8; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Sustain", handle: "sustain", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxDepth), ]; } class Crunch extends EFX { @override final name = "Crunch"; @override int get nuxIndex => 9; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 20, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class RedDist extends EFX { @override final name = "Red Dist"; @override int get nuxIndex => 10; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Drive", handle: "drive", value: 85, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class MorningDrive extends EFX { @override final name = "Morning Drive"; @override int get nuxIndex => 11; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Drive", handle: "drive", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class DistOne extends EFX { @override final name = "Dist One"; @override int get nuxIndex => 12; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Tone", handle: "tone", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Drive", handle: "drive", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxGain), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/EFXv2.dart ================================================ import '../../NuxConstants.dart'; import '../../NuxMightyPlugAir.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; import 'EFX.dart'; class PH100EFX extends EFX { @override final name = "PH 100"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Intensity", handle: "depth", //legacy value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Rate", handle: "rate", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxRate), ]; } class STSinger extends EFX { @override final name = "ST Singer"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Volume", handle: "level", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Filter", handle: "filter", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxTone), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return null; return nuxIndex; } } class Katana extends EFX { @override final name = "Katana"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Boost", handle: "gain", value: 100, formatter: ValueFormatters.boostMode, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain), Parameter( name: "Volume", handle: "level", value: 78, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxLevel), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return Boost().nuxIndex; return nuxIndex; } } class RedDirt extends EFX { @override final name = "Red Dirt"; @override int get nuxIndex => 10; @override List parameters = [ Parameter( name: "Drive", handle: "drive", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 30, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxTone), Parameter( name: "Level", handle: "level", value: 40, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar3, midiCC: MidiCCValues.bCC_DistLevel, midiControllerHandle: MidiControllerHandles.efxLevel), ]; } class RoseComp extends EFX { @override final name = "Rose Comp"; @override int get nuxIndex => 13; @override List parameters = [ Parameter( name: "Sustain", handle: "sustain", value: 55, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar2, midiCC: MidiCCValues.bCC_DistTone, midiControllerHandle: MidiControllerHandles.efxDepth), Parameter( name: "Level", handle: "level", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.efxvar1, midiCC: MidiCCValues.bCC_DistGain, midiControllerHandle: MidiControllerHandles.efxLevel), ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir15.index) return null; return nuxIndex; } } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Modulation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Modulation extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.modfxtype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.modfxenable; //row 1247: 0-phaser, 1-chorus, 2-Stereo chorus, 3-Flanger, 4-Vibe, 5-Tremolo @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ModfxEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ModfxMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.modOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.modOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.modToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.modPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.modNext; } class Phaser extends Modulation { @override final name = "Phaser"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Feedback", handle: "feedback", value: 32, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxmix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class Chorus extends Modulation { @override final name = "Chorus"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 88, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mix", handle: "mix", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxmix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class STChorus extends Modulation { @override final name = "ST Chorus"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 74, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mix", handle: "mix", value: 36, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxmix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class Flanger extends Modulation { @override final name = "Flanger"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 56, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mix", handle: "mix", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxmix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class Vibe extends Modulation { @override final name = "U-Vibe"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 54, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mode", handle: "mode", value: 0, formatter: ValueFormatters.vibeMode, devicePresetIndex: PresetDataIndexPlugAir.modfxmix, midiCC: MidiCCValues.bCC_ChorusLevel), ]; } class Tremolo extends Modulation { @override final name = "Tremolo"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 59, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxrate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 63, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxdepth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class PH100 extends Modulation { @override final name = "PH 100"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Intensity", handle: "depth", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar1rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar2depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modRate), ]; } class CE1 extends Modulation { @override final name = "CE-1"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Intensity", handle: "mix", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar1rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Depth", handle: "depth", value: 88, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar2depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar3mix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modRate), ]; } class STChorusv2 extends Modulation { @override final name = "ST Chorus"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Intensity", handle: "mix", value: 36, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar1rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Width", handle: "depth", value: 74, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar2depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar3mix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modRate), ]; } class SCF extends Modulation { @override final name = "SCF"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Speed", handle: "rate", value: 56, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar1rate, midiCC: MidiCCValues.bCC_ModfxRate, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Width", handle: "depth", value: 68, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar2depth, midiCC: MidiCCValues.bCC_ModfxDepth, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Intensity", handle: "mix", value: 80, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.modfxvar3mix, midiCC: MidiCCValues.bCC_ChorusLevel, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_air/Reverb.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../NuxMightyPlugAir.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Reverb extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugAir.reverbtype; @override int? get nuxEnableIndex => PresetDataIndexPlugAir.reverbenable; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValues.bCC_ReverbEnable; @override int get midiCCSelectionValue => MidiCCValues.bCC_ReverbMode; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.reverbOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.reverbOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.reverbToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.reverbPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.reverbNext; } class RoomReverb extends Reverb { @override final name = "Room"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 64, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 60, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class HallReverb extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 65, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class PlateReverb extends Reverb { @override final name = "Plate"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 81, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Damp", handle: "damp", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbdamp, midiCC: MidiCCValues.bCC_ReverbRouting, midiControllerHandle: MidiControllerHandles.reverbTone), Parameter( name: "Mix", handle: "mix", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class SpringReverb extends Reverb { @override final name = "Spring"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 32, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar1decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar2damp, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } class ShimmerReverb extends Reverb { @override final name = "Shimmer Reverb"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbdecay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbmix, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; @override int? getEquivalentEffect(int version) { if (version == PlugAirVersion.PlugAir21.index) return SpringReverb().nuxIndex; return nuxIndex; } } class RoomReverbv2 extends Reverb { @override final name = "Room"; @override int get nuxIndex => 0; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 35, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar1decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 25, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar2damp, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Tone", handle: "tone", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar3mix, midiCC: MidiCCValues.bCC_ReverbRouting, midiControllerHandle: MidiControllerHandles.reverbTone) ]; } class HallReverbv2 extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 70, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar1decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 45, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar2damp, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Damp", handle: "damp", value: 85, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar3mix, midiCC: MidiCCValues.bCC_ReverbRouting, midiControllerHandle: MidiControllerHandles.reverbTone) ]; } class PlateReverbv2 extends Reverb { @override final name = "Plate"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Decay", handle: "decay", value: 81, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar1decay, midiCC: MidiCCValues.bCC_ReverbDecay, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Mix", handle: "mix", value: 66, formatter: ValueFormatters.percentage, devicePresetIndex: PresetDataIndexPlugAir.reverbvar2damp, midiCC: MidiCCValues.bCC_ReverbLevel, midiControllerHandle: MidiControllerHandles.reverbMix) ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Amps.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/effects/MidiControllerHandles.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../Processor.dart'; import 'Cabinet.dart'; abstract class PlugProAmplifier extends Amplifier { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iAMP; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iAMP; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iAMP; @override int get defaultCab; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.ampOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.ampOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.ampToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.ampPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.ampNext; } class JazzClean extends PlugProAmplifier { @override final name = "Jazz Clean"; @override int get nuxIndex => 1; @override int get defaultCab => JZ120Pro.cabIndex; @override bool isSeparator = true; @override String category = "Guitar"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 70, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "bright", value: 1, formatter: ValueFormatters.brightModePro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class DeluxeRvb extends PlugProAmplifier { @override final name = "Deluxe Rvb"; @override int get nuxIndex => 2; @override int get defaultCab => DR112Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 80, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } class BassMate extends PlugProAmplifier { @override final name = "Bass Mate"; @override int get defaultCab => BS410.cabIndex; @override int get nuxIndex => 3; @override bool isSeparator = true; @override String category = "Bass"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 85, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 100, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Tweedy extends PlugProAmplifier { @override final name = "Tweedy"; @override int get defaultCab => DR112Pro.cabIndex; @override int get nuxIndex => 4; @override bool isSeparator = true; @override String category = "Guitar"; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 78, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 80, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Tone", handle: "tone", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class HiWire extends PlugProAmplifier { @override final name = "Hiwire"; @override int get nuxIndex => 6; @override int get defaultCab => HIWIRE412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 76, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 75, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 62, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 54, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class CaliCrunch extends PlugProAmplifier { @override final name = "Cali Crunch"; @override int get nuxIndex => 7; @override int get defaultCab => CALI112.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 92, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 42, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 59, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 66, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 49, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class ClassA15 extends PlugProAmplifier { @override final name = "Class A15"; @override int get nuxIndex => 8; @override int get defaultCab => A112.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Cut", handle: "cut", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class ClassA30 extends PlugProAmplifier { @override final name = "Class A30"; @override int get nuxIndex => 9; @override int get defaultCab => A212Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 80, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Cut", handle: "cut", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Plexi100 extends PlugProAmplifier { @override final name = "Plexi 100"; @override int get nuxIndex => 10; @override int get defaultCab => GB412Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 71, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 66, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 62, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 53, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 67, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Plexi45 extends PlugProAmplifier { @override final name = "Plexi 45"; @override int get nuxIndex => 11; @override int get defaultCab => GB412Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 26, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 53, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 62, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 53, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 67, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Brit800 extends PlugProAmplifier { @override final name = "Brit 800"; @override int get nuxIndex => 12; @override int get defaultCab => M1960AV.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 81, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 71, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 58, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Pl1987x50 extends PlugProAmplifier { @override final name = "1987x50"; @override int get nuxIndex => 13; @override int get defaultCab => M1960TV.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 81, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 71, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 58, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Slo100 extends PlugProAmplifier { @override final name = "Slo 100"; @override int get nuxIndex => 14; @override int get defaultCab => SLO412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 81, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 71, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 58, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class FiremanHBE extends PlugProAmplifier { @override final name = "Fireman HBE"; @override int get nuxIndex => 15; @override int get defaultCab => FIREMAN412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 77, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class DualRect extends PlugProAmplifier { @override final name = "Dual Rect"; @override int get nuxIndex => 16; @override int get defaultCab => RECT412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 70, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class DIEVH4 extends PlugProAmplifier { @override final name = "DIE VH4"; @override int get nuxIndex => 17; @override int get defaultCab => DIE412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 72, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 41, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 64, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 51, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class MrZ38 extends PlugProAmplifier { @override final name = "Mr. Z38"; @override int get nuxIndex => 20; @override int get defaultCab => Z212.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 44, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 81, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 71, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Cut", handle: "cut", value: 58, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class SuperRvb extends PlugProAmplifier { @override final name = "Super Rvb"; @override int get nuxIndex => 21; @override int get defaultCab => SUPERVERB410.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 70, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "bright", value: 1, formatter: ValueFormatters.brightModePro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class AGL extends PlugProAmplifier { @override final name = "AGL"; @override bool isSeparator = true; @override String category = "Bass"; @override int get nuxIndex => 26; @override int get defaultCab => AGLDB810.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 61, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 89, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 72, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, //check this midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 63, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } class MLD extends PlugProAmplifier { @override final name = "MLD"; @override int get nuxIndex => 27; @override int get defaultCab => MKB410.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 91, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 59, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Mid Freq", handle: "mid_freq", value: 63, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 61, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } class OptimaAir extends PlugProAmplifier { @override final name = "Optima Air"; @override bool isSeparator = true; @override String category = "Acoustic"; @override int get nuxIndex => 28; @override int get defaultCab => GJ15Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 72, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 100, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } class Stageman extends PlugProAmplifier { @override final name = "Stageman"; @override int get nuxIndex => 29; @override int get defaultCab => MD45Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 90, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), ]; } class TwinRvb extends PlugProAmplifier { @override final name = "Twin Reverb"; @override int get nuxIndex => 5; @override int get defaultCab => TR212Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "bright", value: 1, formatter: ValueFormatters.brightModePro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class VibroKing extends PlugProAmplifier { @override final name = "Vibro King"; @override int get nuxIndex => 18; @override int get defaultCab => VIBROKING310.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Bright", handle: "bright", value: 1, formatter: ValueFormatters.brightModePro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Budda extends PlugProAmplifier { @override final name = "Budda"; @override int get nuxIndex => 19; @override int get defaultCab => BUDDA112.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Cut", handle: "cut", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class BritBlues extends PlugProAmplifier { @override final name = "Brit Blues"; @override int get nuxIndex => 22; @override int get defaultCab => GB412Pro.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class MatchD30 extends PlugProAmplifier { @override final name = "Match D30"; @override int get nuxIndex => 23; @override int get defaultCab => MATCH212.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Cut", handle: "cut", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class Brit2000 extends PlugProAmplifier { @override final name = "Brit 2000"; @override int get nuxIndex => 24; @override int get defaultCab => M1960AV.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } class UberHiGain extends PlugProAmplifier { @override final name = "Uber HiGain"; @override int get nuxIndex => 25; @override int get defaultCab => UBER412.cabIndex; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para1, midiCC: MidiCCValuesPro.AMP_Para1, midiControllerHandle: MidiControllerHandles.ampGain), Parameter( name: "Master", handle: "master", value: 50, formatter: ValueFormatters.percentageMPPro, masterVolume: true, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para2, midiCC: MidiCCValuesPro.AMP_Para2, midiControllerHandle: MidiControllerHandles.ampVolume), Parameter( name: "Bass", handle: "bass", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para3, midiCC: MidiCCValuesPro.AMP_Para3, midiControllerHandle: MidiControllerHandles.ampBass), Parameter( name: "Middle", handle: "mid", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para4, midiCC: MidiCCValuesPro.AMP_Para4, midiControllerHandle: MidiControllerHandles.ampMiddle), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para5, midiCC: MidiCCValuesPro.AMP_Para5, midiControllerHandle: MidiControllerHandles.ampTreble), Parameter( name: "Presence", handle: "presence", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.AMP_Para6, midiCC: MidiCCValuesPro.AMP_Para6, midiControllerHandle: MidiControllerHandles.ampTone), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Cabinet.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:core'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class CabinetPro extends Cabinet { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iCAB; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iCAB; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iCAB; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.cabOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.cabOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.cabToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.cabPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.cabNext; @override String get name => cabName; @override List parameters = [ Parameter( devicePresetIndex: PresetDataIndexPlugPro.CAB_Para4, name: "Level", handle: "level", value: 0, formatter: ValueFormatters.decibelMPPro, midiCC: MidiCCValuesPro.CAB_Para4, midiControllerHandle: MidiControllerHandles.cabLevel), Parameter( devicePresetIndex: PresetDataIndexPlugPro.CAB_Para5, name: "Low Cut", handle: "lowcut", value: 20, formatter: ValueFormatters.lowFreqFormatter, midiCC: MidiCCValuesPro.CAB_Para5, midiControllerHandle: MidiControllerHandles.cabLoCut), Parameter( devicePresetIndex: PresetDataIndexPlugPro.CAB_Para6, name: "High Cut", handle: "hicut", value: 100, formatter: ValueFormatters.highFreqFormatter, midiCC: MidiCCValuesPro.CAB_Para6, midiControllerHandle: MidiControllerHandles.cabHiCut) ]; } class JZ120Pro extends CabinetPro { @override bool get isSeparator => true; @override String get category => "Electric IR"; @override final cabName = "JZ120"; static int get cabIndex => 1; @override int get nuxIndex => cabIndex; } class DR112Pro extends CabinetPro { @override final cabName = "DR112"; static int get cabIndex => 2; @override int get nuxIndex => cabIndex; } class TR212Pro extends CabinetPro { @override final cabName = "TR212"; static int get cabIndex => 3; @override int get nuxIndex => cabIndex; } class HIWIRE412 extends CabinetPro { @override final cabName = "HIWIRE412"; static int get cabIndex => 4; @override int get nuxIndex => cabIndex; } class CALI112 extends CabinetPro { @override final cabName = "CALI 112"; static int get cabIndex => 5; @override int get nuxIndex => cabIndex; } class A112 extends CabinetPro { @override final cabName = "A112"; @override int get nuxIndex => cabIndex; static int get cabIndex => 6; } class GB412Pro extends CabinetPro { @override final cabName = "GB412"; static int get cabIndex => 7; @override int get nuxIndex => cabIndex; } class M1960AX extends CabinetPro { @override final cabName = "M1960AX"; static int get cabIndex => 8; @override int get nuxIndex => cabIndex; } class M1960AV extends CabinetPro { @override final cabName = "M1960AV"; static int get cabIndex => 9; @override int get nuxIndex => cabIndex; } class M1960TV extends CabinetPro { @override final cabName = "M1960TV"; static int get cabIndex => 10; @override int get nuxIndex => cabIndex; } class SLO412 extends CabinetPro { @override final cabName = "SLO412"; static int get cabIndex => 11; @override int get nuxIndex => cabIndex; } class FIREMAN412 extends CabinetPro { @override final cabName = "FIREMAN 412"; static int get cabIndex => 12; @override int get nuxIndex => cabIndex; } class RECT412 extends CabinetPro { @override final cabName = "RECT 412"; static int get cabIndex => 13; @override int get nuxIndex => cabIndex; } class DIE412 extends CabinetPro { @override final cabName = "DIE412"; static int get cabIndex => 14; @override int get nuxIndex => cabIndex; } class MATCH212 extends CabinetPro { @override final cabName = "MATCH212"; static int get cabIndex => 15; @override int get nuxIndex => cabIndex; } class UBER412 extends CabinetPro { @override final cabName = "UBER412"; static int get cabIndex => 16; @override int get nuxIndex => cabIndex; } class BS410 extends CabinetPro { @override final cabName = "BS410"; static int get cabIndex => 17; @override int get nuxIndex => cabIndex; } class A212Pro extends CabinetPro { @override final cabName = "A212"; static int get cabIndex => 18; @override int get nuxIndex => cabIndex; } class M1960AHW extends CabinetPro { @override final cabName = "M1960AHW"; static int get cabIndex => 19; @override int get nuxIndex => cabIndex; } class M1936 extends CabinetPro { @override final cabName = "M1936"; static int get cabIndex => 20; @override int get nuxIndex => cabIndex; } class BUDDA112 extends CabinetPro { @override final cabName = "BUDDA112"; static int get cabIndex => 21; @override int get nuxIndex => cabIndex; } class Z212 extends CabinetPro { @override final cabName = "Z212"; static int get cabIndex => 22; @override int get nuxIndex => cabIndex; } class SUPERVERB410 extends CabinetPro { @override final cabName = "SUPERVERB410"; static int get cabIndex => 23; @override int get nuxIndex => cabIndex; } class VIBROKING310 extends CabinetPro { @override final cabName = "VIBROKING310"; static int get cabIndex => 24; @override int get nuxIndex => cabIndex; } //Bass amps class AGLDB810 extends CabinetPro { @override bool get isSeparator => true; @override String get category => "Bass IR"; @override final cabName = "AGL_DB810"; static int get cabIndex => 25; @override int get nuxIndex => cabIndex; } class AMPSV212 extends CabinetPro { @override final cabName = "AMP_SV212"; static int get cabIndex => 26; @override int get nuxIndex => cabIndex; } class AMPSV410 extends CabinetPro { @override final cabName = "AMP_SV410"; static int get cabIndex => 27; @override int get nuxIndex => cabIndex; } class AMPSV810 extends CabinetPro { @override final cabName = "AMP_SV810"; static int get cabIndex => 28; @override int get nuxIndex => cabIndex; } class BASSGUY410 extends CabinetPro { @override final cabName = "BASSGUY410"; static int get cabIndex => 29; @override int get nuxIndex => cabIndex; } class EDEN410 extends CabinetPro { @override final cabName = "EDEN410"; static int get cabIndex => 30; @override int get nuxIndex => cabIndex; } class MKB410 extends CabinetPro { @override final cabName = "MKB410"; static int get cabIndex => 31; @override int get nuxIndex => cabIndex; } class GHBIRDPro extends CabinetPro { @override bool get isSeparator => true; @override String get category => "Acoustic IR"; @override final cabName = "G-HBIRD"; static int get cabIndex => 32; @override int get nuxIndex => cabIndex; } class GJ15Pro extends CabinetPro { @override final cabName = "G-J15"; static int get cabIndex => 33; @override int get nuxIndex => cabIndex; } class MD45Pro extends CabinetPro { @override final cabName = "M-D45"; static int get cabIndex => 34; @override int get nuxIndex => cabIndex; } class UserCab extends CabinetPro { String _cabinetName = "..."; late int _nuxIndex; @override String get cabName => _cabinetName; @override int get nuxIndex => _nuxIndex; void setName(String name) { _cabinetName = name; } void setNuxIndex(int index) { _nuxIndex = index; } void setActive(bool active) {} } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Compressor.dart ================================================ // (c) 2020-2022 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Compressor extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iCMP; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iCMP; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iCMP; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.compOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.compOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.compToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.compPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.compNext; } class RoseCompPro extends Compressor { @override final name = "Rose Comp"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para2, midiCC: MidiCCValuesPro.CMP_Para2, midiControllerHandle: MidiControllerHandles.compLevel), Parameter( name: "Sustain", handle: "sustain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para1, midiCC: MidiCCValuesPro.CMP_Para1, midiControllerHandle: MidiControllerHandles.compSustain), ]; } class KComp extends Compressor { @override final name = "K Comp"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para2, midiCC: MidiCCValuesPro.CMP_Para2, midiControllerHandle: MidiControllerHandles.compLevel), Parameter( name: "Sustain", handle: "sustain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para1, midiCC: MidiCCValuesPro.CMP_Para1, midiControllerHandle: MidiControllerHandles.compSustain), Parameter( name: "Clipping", handle: "clipping", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para3, midiCC: MidiCCValuesPro.CMP_Para3, midiControllerHandle: MidiControllerHandles.compThreshold), ]; } class StudioComp extends Compressor { @override final name = "Studio Comp"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para3, midiCC: MidiCCValuesPro.CMP_Para3, midiControllerHandle: MidiControllerHandles.compLevel), Parameter( name: "Threshold", handle: "threshold", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para1, midiCC: MidiCCValuesPro.CMP_Para1, midiControllerHandle: MidiControllerHandles.compThreshold), Parameter( name: "Ratio", handle: "ratio", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para2, midiCC: MidiCCValuesPro.CMP_Para2, midiControllerHandle: MidiControllerHandles.compRatio), Parameter( name: "Release", handle: "release", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.CMP_Para4, midiCC: MidiCCValuesPro.CMP_Para4, midiControllerHandle: MidiControllerHandles.compSustain) ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Delay.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class DelayPro extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iDLY; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iDLY; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iDLY; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.delayOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.delayOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.delayToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.delayPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.delayNext; } class AnalogDelay extends DelayPro { @override final name = "Analog"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Intensity", handle: "intensity", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "echo", value: 45, formatter: ValueFormatters.tempoProAnalog, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Rate", handle: "rate", value: 34, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayRepeat), ]; } class AnalogDelayV2 extends DelayPro { @override final name = "Analog"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Intensity", handle: "intensity", value: 52, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Rate", handle: "rate", value: 34, formatter: ValueFormatters.tempoProAnalog, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Echo", handle: "echo", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat) ]; } class DigitalDelay extends DelayPro { @override final name = "Digital Delay"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "E.Level", handle: "level", value: 49, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 48, formatter: ValueFormatters.tempoPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Feedback", handle: "feedback", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), ]; } class ModDelay extends DelayPro { @override final name = "Modulation"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 49, formatter: ValueFormatters.tempoProMod, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 48, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para4, midiCC: MidiCCValuesPro.DLY_Para4, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mod", handle: "mod", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayMod), ]; } class TapeEcho extends DelayPro { @override final name = "Tape Echo"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 43, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 61, formatter: ValueFormatters.tempoProTapeEcho, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 56, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayRepeat), ]; } class PanDelay extends DelayPro { @override final name = "Pan Delay"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), Parameter( name: "Time", handle: "time", value: 50, formatter: ValueFormatters.tempoPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), ]; } class PhiDelayPro extends DelayPro { @override final name = "Phi Delay"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Time", handle: "time", value: 50, formatter: ValueFormatters.tempoPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para1, midiCC: MidiCCValuesPro.DLY_Para1, midiControllerHandle: MidiControllerHandles.delayTime), Parameter( name: "Repeat", handle: "repeat", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para2, midiCC: MidiCCValuesPro.DLY_Para2, midiControllerHandle: MidiControllerHandles.delayRepeat), Parameter( name: "Mix", handle: "level", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.DLY_Para3, midiCC: MidiCCValuesPro.DLY_Para3, midiControllerHandle: MidiControllerHandles.delayLevel), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/EFX.dart ================================================ // (c) 2020-2022 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class EFXPro extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iEFX; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iEFX; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iEFX; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.efxOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.efxOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.efxToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.efxPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.efxNext; } class DistortionPlus extends EFXPro { @override final name = "Distortion+"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Output", handle: "output", value: 75, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Sensitivity", handle: "sensitivity", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxGain), ]; } class RCBoost extends EFXPro { @override final name = "RC Boost"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxBass), Parameter( name: "Treble", handle: "treble", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para4, midiCC: MidiCCValuesPro.EFX_Para4, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class ACBoost extends EFXPro { @override final name = "AC Boost"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Bass", handle: "bass", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxBass), Parameter( name: "Treble", handle: "treble", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para4, midiCC: MidiCCValuesPro.EFX_Para4, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class DistOne extends EFXPro { @override final name = "Dist One"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Drive", handle: "drive", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class TSDrive extends EFXPro { @override final name = "T Screamer"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 55, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Drive", handle: "drive", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class BluesDrive extends EFXPro { @override final name = "Blues Drive"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class MorningDrive extends EFXPro { @override final name = "Morning Drive"; @override int get nuxIndex => 7; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Drive", handle: "drive", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class EatDist extends EFXPro { @override final name = "Eat Dist"; @override int get nuxIndex => 8; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Distortion", handle: "distortion", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Filter", handle: "filter", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class RedDirt extends EFXPro { @override final name = "Red Dirt"; @override int get nuxIndex => 9; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Drive", handle: "drive", value: 65, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class Crunch extends EFXPro { @override final name = "Crunch"; @override int get nuxIndex => 10; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 25, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class MuffFuzz extends EFXPro { @override final name = "Muff Fuzz"; @override int get nuxIndex => 11; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Sustain", handle: "sustain", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxDepth), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class Katana extends EFXPro { @override final name = "Katana"; @override int get nuxIndex => 12; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 45, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Boost", handle: "boost", value: 0, formatter: ValueFormatters.boostModePro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1), ]; } class STSinger extends EFXPro { @override final name = "ST Singer"; @override int get nuxIndex => 13; @override List parameters = [ Parameter( name: "Volume", handle: "volume", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Gain", handle: "gain", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Filter", handle: "filter", value: 40, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxTone), ]; } class TouchWahPro extends EFXPro { @override int get nuxIndex => 14; @override final name = "Touch Wah"; @override List parameters = [ Parameter( name: "Type", handle: "type", value: 1, formatter: ValueFormatters.touchWahFormatterLiteMk2, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para1, midiCC: MidiCCValuesPro.EFX_Para1), Parameter( name: "Wow", handle: "wow", value: 35, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para2, midiCC: MidiCCValuesPro.EFX_Para2, midiControllerHandle: MidiControllerHandles.efxGain), Parameter( name: "Sense", handle: "sense", value: 90, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para3, midiCC: MidiCCValuesPro.EFX_Para3, midiControllerHandle: MidiControllerHandles.efxRate), Parameter( name: "Level", handle: "level", value: 100, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para5, midiCC: MidiCCValuesPro.EFX_Para5, midiControllerHandle: MidiControllerHandles.efxLevel), Parameter( name: "Up/Down Switch", handle: "direction", value: 0, formatter: ValueFormatters.touchWahDirectionFormatterPro, devicePresetIndex: PresetDataIndexPlugPro.EFX_Para4, midiCC: MidiCCValuesPro.EFX_Para4), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/EQ.dart ================================================ // (c) 2020-2022 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class EQ extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iEQ; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.EQ; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iEQ; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iEQ; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.eqOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.eqOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.eqToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.eqPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.eqNext; } class EQSixBand extends EQ { @override final name = "6-Band"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "100", handle: "eq_p1", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para1, midiCC: MidiCCValuesPro.EQ_Para1), Parameter( name: "220", handle: "eq_p2", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para2, midiCC: MidiCCValuesPro.EQ_Para2), Parameter( name: "500", handle: "eq_p3", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para3, midiCC: MidiCCValuesPro.EQ_Para3), Parameter( name: "1.2K", handle: "eq_p4", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para4, midiCC: MidiCCValuesPro.EQ_Para4), Parameter( name: "2.6K", handle: "eq_p5", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para5, midiCC: MidiCCValuesPro.EQ_Para5), Parameter( name: "6.4K", handle: "eq_p6", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para6, midiCC: MidiCCValuesPro.EQ_Para6), ]; } class EQTenBand extends EQ { @override final name = "10-Band"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Vol", handle: "eq_vol", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para1, midiCC: MidiCCValuesPro.EQ_Para1), Parameter( name: "31", handle: "eq_b1", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para2, midiCC: MidiCCValuesPro.EQ_Para2), Parameter( name: "62", handle: "eq_b2", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para3, midiCC: MidiCCValuesPro.EQ_Para3), Parameter( name: "125", handle: "eq_b3", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para4, midiCC: MidiCCValuesPro.EQ_Para4), Parameter( name: "250", handle: "eq_b4", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para5, midiCC: MidiCCValuesPro.EQ_Para5), Parameter( name: "500", handle: "eq_b5", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para6, midiCC: MidiCCValuesPro.EQ_Para6), Parameter( name: "1K", handle: "eq_b6", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para7, midiCC: MidiCCValuesPro.EQ_Para7), Parameter( name: "2K", handle: "eq_b7", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para8, midiCC: MidiCCValuesPro.EQ_Para8), Parameter( name: "4K", handle: "eq_b8", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para9, midiCC: MidiCCValuesPro.EQ_Para9), Parameter( name: "8K", handle: "eq_b9", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para10, midiCC: MidiCCValuesPro.EQ_Para10), Parameter( name: "16K", handle: "eq_b10", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para11, midiCC: MidiCCValuesPro.EQ_Para11), ]; } class EQTenBandBT extends EQ { @override List parameters = [ Parameter( name: "Vol", handle: "eq_vol", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para1, midiCC: MidiCCValuesPro.AUX_BAND_1), Parameter( name: "31", handle: "eq_b1", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para2, midiCC: MidiCCValuesPro.AUX_BAND_2), Parameter( name: "62", handle: "eq_b2", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para3, midiCC: MidiCCValuesPro.AUX_BAND_3), Parameter( name: "125", handle: "eq_b3", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para4, midiCC: MidiCCValuesPro.AUX_BAND_4), Parameter( name: "250", handle: "eq_b4", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para5, midiCC: MidiCCValuesPro.AUX_BAND_5), Parameter( name: "500", handle: "eq_b5", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para6, midiCC: MidiCCValuesPro.AUX_BAND_6), Parameter( name: "1K", handle: "eq_b6", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para7, midiCC: MidiCCValuesPro.AUX_BAND_7), Parameter( name: "2K", handle: "eq_b7", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para8, midiCC: MidiCCValuesPro.AUX_BAND_8), Parameter( name: "4K", handle: "eq_b8", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para9, midiCC: MidiCCValuesPro.AUX_BAND_9), Parameter( name: "8K", handle: "eq_b9", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para10, midiCC: MidiCCValuesPro.AUX_BAND_10), Parameter( name: "16K", handle: "eq_b10", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para11, midiCC: MidiCCValuesPro.AUX_BAND_11), ]; //TODO: this might not be needed List getNuxCommand() { List data = []; for (int i = 0; i < parameters.length; i++) { data.add(parameters[i].midiValue); } return data; } @override void setupFromNuxPayload(List nuxData) { for (int i = 0; i < parameters.length; i++) { parameters[i].midiValue = nuxData[i]; } } @override String get name => "Bluetooth EQ"; @override int get nuxIndex => 0; } class EQTenBandSpeaker extends EQ { @override List parameters = [ Parameter( name: "Vol", handle: "eq_vol", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para1, midiCC: MidiCCValuesPro.SPK_EQ_VOL), Parameter( name: "31", handle: "eq_b1", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para2, midiCC: MidiCCValuesPro.SPK_EQ_1), Parameter( name: "62", handle: "eq_b2", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para3, midiCC: MidiCCValuesPro.SPK_EQ_2), Parameter( name: "125", handle: "eq_b3", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para4, midiCC: MidiCCValuesPro.SPK_EQ_3), Parameter( name: "250", handle: "eq_b4", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para5, midiCC: MidiCCValuesPro.SPK_EQ_4), Parameter( name: "500", handle: "eq_b5", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para6, midiCC: MidiCCValuesPro.SPK_EQ_5), Parameter( name: "1K", handle: "eq_b6", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para7, midiCC: MidiCCValuesPro.SPK_EQ_6), Parameter( name: "2K", handle: "eq_b7", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para8, midiCC: MidiCCValuesPro.SPK_EQ_7), Parameter( name: "4K", handle: "eq_b8", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para9, midiCC: MidiCCValuesPro.SPK_EQ_8), Parameter( name: "8K", handle: "eq_b9", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para10, midiCC: MidiCCValuesPro.SPK_EQ_9), Parameter( name: "16K", handle: "eq_b10", value: 0, formatter: ValueFormatters.decibelEQ, devicePresetIndex: PresetDataIndexPlugPro.EQ_Para11, midiCC: MidiCCValuesPro.SPK_EQ_10), ]; //TODO: this might not be needed List getNuxCommand() { List data = []; for (int i = 0; i < parameters.length; i++) { data.add(parameters[i].midiValue); } return data; } @override void setupFromNuxPayload(List nuxData) { for (int i = 0; i < parameters.length; i++) { parameters[i].midiValue = nuxData[i]; } } @override String get name => "Speaker EQ"; @override int get nuxIndex => 0; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/EmptyEffects.dart ================================================ import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; class WahDummyPro extends Processor { @override final name = "Wah"; @override int get nuxIndex => 1; @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iWAH; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iWAH; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iWAH; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => null; @override MidiControllerHandle? get midiControlOn => null; @override MidiControllerHandle? get midiControlToggle => null; @override MidiControllerHandle? get midiControlPrev => null; @override MidiControllerHandle? get midiControlNext => null; @override List parameters = [ Parameter( name: "Param1", handle: "param1", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.WAH_Para1, midiCC: MidiCCValuesPro.CC_Unknown), Parameter( name: "Param2", handle: "param2", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.WAH_Para2, midiCC: MidiCCValuesPro.CC_Unknown), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Modulation.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:mighty_plug_manager/bluetooth/devices/effects/MidiControllerHandles.dart'; import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../Processor.dart'; abstract class Modulation extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iMOD; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; //row 1247: 0-phaser, 1-chorus, 2-Stereo chorus, 3-Flanger, 4-Vibe, 5-Tremolo @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iMOD; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iMOD; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.modOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.modOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.modToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.modPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.modNext; } class ModCE1 extends Modulation { @override final name = "CE-1"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 39, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Intensity", handle: "intensity", value: 32, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class ModCE2 extends Modulation { @override final name = "CE-2"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class STChorusPro extends Modulation { @override final name = "ST Chorus"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Width", handle: "width", value: 36, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Intensity", handle: "intensity", value: 74, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class Vibrato extends Modulation { @override final name = "Vibrato"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 56, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 68, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth) ]; } class Detune extends Modulation { @override final name = "Detune"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Shift-L", handle: "shift_l", value: 54, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Shift-R", handle: "shift_r", value: 0, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mix", handle: "mix", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class FlangerPro extends Modulation { @override final name = "Flanger"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 59, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Width", handle: "width", value: 63, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Level", handle: "level", value: 59, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Feedback", handle: "feedback", value: 63, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para4, midiCC: MidiCCValuesPro.MOD_Para4), ]; } class Phase90 extends Modulation { @override final name = "Phase 90"; @override int get nuxIndex => 7; @override List parameters = [ Parameter( name: "Speed", handle: "speed", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), ]; } class Phase100 extends Modulation { @override final name = "Phase 100"; @override int get nuxIndex => 8; @override List parameters = [ Parameter( name: "Speed", handle: "speed", value: 39, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Intensity", handle: "intensity", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class SCFPro extends Modulation { @override final name = "S.C.F."; @override int get nuxIndex => 9; @override List parameters = [ Parameter( name: "Speed", handle: "speed", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Width", handle: "width", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Intensity", handle: "intensity", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para4, midiCC: MidiCCValuesPro.MOD_Para4, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Mode", handle: "mode", value: 1, formatter: ValueFormatters.scfMode, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3), ]; } class VibePro extends Modulation { @override final name = "U-Vibe"; @override int get nuxIndex => 10; @override List parameters = [ Parameter( name: "Speed", handle: "speed", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Volume", handle: "volume", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Intensity", handle: "intensity", value: 80, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Mode", handle: "mode", value: 0, formatter: ValueFormatters.vibeModePro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para4, midiCC: MidiCCValuesPro.MOD_Para4), ]; } class TremoloPro extends Modulation { @override final name = "Tremolo"; @override int get nuxIndex => 11; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 15, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class Rotary extends Modulation { @override final name = "Rotary"; @override int get nuxIndex => 12; @override List parameters = [ Parameter( name: "Speed", handle: "speed", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Balance", handle: "balance", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modDepth), ]; } class SCH1Pro extends Modulation { @override final name = "SCH-1"; @override int get nuxIndex => 13; @override List parameters = [ Parameter( name: "Rate", handle: "rate", value: 30, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Depth", handle: "depth", value: 70, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modDepth), Parameter( name: "Tone", handle: "tone", value: 60, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modIntensity), ]; } class MonoOctave extends Modulation { @override final name = "Mono Octave"; @override int get nuxIndex => 14; @override List parameters = [ Parameter( name: "Sub", handle: "sub", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para1, midiCC: MidiCCValuesPro.MOD_Para1, midiControllerHandle: MidiControllerHandles.modRate), Parameter( name: "Dry", handle: "dry", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para2, midiCC: MidiCCValuesPro.MOD_Para2, midiControllerHandle: MidiControllerHandles.modIntensity), Parameter( name: "Up", handle: "up", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.MOD_Para3, midiCC: MidiCCValuesPro.MOD_Para3, midiControllerHandle: MidiControllerHandles.modDepth), ]; } ================================================ FILE: lib/bluetooth/devices/effects/plug_pro/Reverb.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import '../../NuxConstants.dart'; import '../../value_formatters/ValueFormatter.dart'; import '../MidiControllerHandles.dart'; import '../Processor.dart'; abstract class Reverb extends Processor { @override int? get nuxEffectTypeIndex => PresetDataIndexPlugPro.Head_iRVB; @override int? get nuxEnableIndex => nuxEffectTypeIndex; @override int get nuxEnableMask => 0x40; @override bool get nuxEnableInverted => true; @override EffectEditorUI get editorUI => EffectEditorUI.Sliders; @override int get midiCCEnableValue => MidiCCValuesPro.Head_iRVB; @override int get midiCCSelectionValue => MidiCCValuesPro.Head_iRVB; //MIDI foot controller stuff @override MidiControllerHandle? get midiControlOff => MidiControllerHandles.reverbOff; @override MidiControllerHandle? get midiControlOn => MidiControllerHandles.reverbOn; @override MidiControllerHandle? get midiControlToggle => MidiControllerHandles.reverbToggle; @override MidiControllerHandle? get midiControlPrev => MidiControllerHandles.reverbPrev; @override MidiControllerHandle? get midiControlNext => MidiControllerHandles.reverbNext; } class RoomReverb extends Reverb { @override final name = "Room"; @override int get nuxIndex => 1; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para3, midiCC: MidiCCValuesPro.RVB_Para3, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Tone", handle: "tone", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbTone), ]; } class HallReverb extends Reverb { @override final name = "Hall"; @override int get nuxIndex => 2; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para4, midiCC: MidiCCValuesPro.RVB_Para4, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Pre Delay", handle: "predelay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbTone), Parameter( name: "Liveliness", handle: "liveliness", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para3, midiCC: MidiCCValuesPro.RVB_Para3), ]; } class PlateReverb extends Reverb { @override final name = "Plate"; @override int get nuxIndex => 3; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), ]; } class SpringReverb extends Reverb { @override final name = "Spring"; @override int get nuxIndex => 4; @override List parameters = [ Parameter( name: "Level", handle: "level", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Decay", handle: "decay", value: 32, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbDecay), ]; } class ShimmerReverb extends Reverb { @override final name = "Shimmer"; @override int get nuxIndex => 5; @override List parameters = [ Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Decay", handle: "decay", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbDecay), Parameter( name: "Shimmer", handle: "shimmer", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para3, midiCC: MidiCCValuesPro.RVB_Para3, midiControllerHandle: MidiControllerHandles.reverbTone) ]; } class DampReverbPro extends Reverb { @override final name = "Damp"; @override int get nuxIndex => 6; @override List parameters = [ Parameter( name: "Mix", handle: "mix", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para1, midiCC: MidiCCValuesPro.RVB_Para1, midiControllerHandle: MidiControllerHandles.reverbMix), Parameter( name: "Depth", handle: "depth", value: 50, formatter: ValueFormatters.percentageMPPro, devicePresetIndex: PresetDataIndexPlugPro.RVB_Para2, midiCC: MidiCCValuesPro.RVB_Para2, midiControllerHandle: MidiControllerHandles.reverbTone) ]; } ================================================ FILE: lib/bluetooth/devices/features/drumsTone.dart ================================================ enum DrumsToneControl { bass, middle, treble } abstract class DrumsTone { double get drumsBass; double get drumsMiddle; double get drumsTreble; void setDrumsTone(double value, DrumsToneControl control, bool send); } ================================================ FILE: lib/bluetooth/devices/features/looper.dart ================================================ abstract class Looper { int get loopState; int get loopUndoState; int get loopRecordMode; double get loopLevel; void looperRecordPlay(); void looperStop(); void looperClear(); void looperUndoRedo(); void looperLevel(int vol); void looperNrAr(bool auto); void requestLooperSettings(); Stream getLooperDataStream(); } class LooperData { int loopState = 0; int loopUndoState = 0; int loopRecordMode = 0; bool loopHasAudio = false; double loopLevel = 50; } ================================================ FILE: lib/bluetooth/devices/features/proUsbSettings.dart ================================================ abstract class ProUsbSettings { void setUsbMode(int mode); void setUsbRecordingVol(int vol); void setUsbPlaybackVol(int vol); void setUsbDryWetVol(int vol); } ================================================ FILE: lib/bluetooth/devices/features/tuner.dart ================================================ import 'dart:async'; enum TunerMode { chromatic(0), guitarStandard(2), guitarCompensated(1), bass(3); const TunerMode(this.mode); final int mode; static TunerMode? getByMode(int mode) { for (TunerMode m in TunerMode.values) { if (m.mode == mode) return m; } return null; } } abstract class Tuner { static const List modesString = [ "Chromatic", "Guitar Standard", "Guitar Compensated", "Bass" ]; int get tunerStateCC; int get tunerNoteCC; int get tunerStringCC; int get tunerPitchCC; bool get tunerAvailable; void tunerEnable(bool enable); void tunerRequestSettings(); void tunerSetMode(TunerMode mode); void tunerSetReferencePitch(int refPitch); void tunerMute(bool enable); Stream getTunerDataStream(); void notifyTunerListeners(); } class TunerData { //TODO: this is not enabled but note on/note off bool enabled = false; bool muted = false; int note = 0; int stringNumber = 0; int cents = 0; int referencePitch = 10; TunerMode mode = TunerMode.guitarStandard; void clear() { note = 0; stringNumber = 0; cents = 0; } } ================================================ FILE: lib/bluetooth/devices/presets/Mighty8BTPreset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui'; import '../NuxDevice.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/mighty_8bt/Amps.dart'; import '../effects/mighty_8bt/Modulation.dart'; import '../effects/mighty_8bt/Delay.dart'; import '../effects/mighty_8bt/Reverb.dart'; import 'Preset.dart'; import 'preset_constants.dart'; class M8BTPreset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override int get qrDataLength => 40; @override Color get channelColor => PresetConstants.channelColorsPlug[channel]; final NoiseGate2Param noiseGate = NoiseGate2Param(); @override final List amplifierList = []; final List modulationList = []; final List delayList = []; final List reverbList = []; bool noiseGateEnabled = true; bool modulationEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedMod = 0; int selectedDelay = 0; int selectedReverb = 0; M8BTPreset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { //modulation is available everywhere modulationList.addAll([Phaser(), Chorus(), Tremolo(), Vibe()]); amplifierList.addAll([AmpClean()]); delayList.addAll([Delay1(), Delay2(), Delay3(), Delay4()]); //reverb is available in all presets reverbList .addAll([RoomReverb(), HallReverb(), PlateReverb(), SpringReverb()]); } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { if (index == 1) return false; return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { switch (index) { case 0: return noiseGateEnabled; case 2: return modulationEnabled; case 3: return delayEnabled; case 4: return reverbEnabled; default: return true; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { switch (index) { case 0: noiseGateEnabled = value; break; case 2: modulationEnabled = value; break; case 3: delayEnabled = value; break; case 4: reverbEnabled = value; break; default: return; } super.setSlotEnabled(index, value, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { switch (slot) { case 0: return [noiseGate]; case 1: return amplifierList; case 2: return modulationList; case 3: return delayList; case 4: return reverbList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { switch (slot) { case 0: return 0; case 1: return 0; case 2: return selectedMod; case 3: return selectedDelay; case 4: return selectedReverb; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { switch (slot) { case 2: selectedMod = index; break; case 3: selectedDelay = index; break; case 4: selectedReverb = index; break; } super.setSelectedEffectForSlot(slot, index, notifyBT); } @override Color effectColor(int index) { if (index != 1) { return device.processorList[index].color; } else { return channelColor; } } @override setFirmwareVersion(int version) {} } ================================================ FILE: lib/bluetooth/devices/presets/MightyLitePreset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui'; import '../NuxDevice.dart'; import '../NuxFXID.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/lite/Amps.dart'; import '../effects/lite/Modulation.dart'; import '../effects/lite/Ambience.dart'; import 'Preset.dart'; import 'preset_constants.dart'; class MLitePreset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override int get qrDataLength => 40; @override Color get channelColor => PresetConstants.channelColorsPlug[channel]; final NoiseGate2Param noiseGate = NoiseGate2Param(); @override final List amplifierList = []; final List modulationList = []; final List ambiList = []; bool noiseGateEnabled = true; bool modulationEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedMod = 0; int selectedAmbience = 0; MLitePreset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { //modulation is available everywhere modulationList.addAll([Phaser(), Chorus(), Tremolo(), Vibe()]); amplifierList.addAll([AmpClean()]); ambiList.addAll([ Delay1(), Delay2(), Delay3(), Delay4(), RoomReverb(), HallReverb(), PlateReverb(), SpringReverb() ]); } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { if (index == 1) return false; return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { switch (index) { case 0: return noiseGateEnabled; case 2: return modulationEnabled; case 3: return delayEnabled; case 4: return reverbEnabled; default: return true; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { switch (index) { case 0: noiseGateEnabled = value; break; case 2: modulationEnabled = value; break; case 3: delayEnabled = value; break; case 4: reverbEnabled = value; break; default: return; } super.setSlotEnabled(index, value, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { switch (slot) { case 0: return [noiseGate]; case 1: return amplifierList; case 2: return modulationList; case 3: return ambiList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { switch (slot) { case 0: return 0; case 1: return 0; case 2: return selectedMod; case 3: return selectedAmbience; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { switch (slot) { case 2: selectedMod = index; break; case 3: selectedAmbience = index; break; } super.setSelectedEffectForSlot(slot, index, notifyBT); } @override int getEffectArrayIndexFromNuxIndex(NuxFXID fxid, int nuxIndex) { if (fxid == LiteFXID.ambience) { for (int i = 0; i < ambiList.length; i++) { if (ambiList[i].nuxIndex == nuxIndex) return i; } } return nuxIndex; } @override Color effectColor(int index) { if (index != 1) { return device.processorList[index].color; } else { return channelColor; } } @override setFirmwareVersion(int ver) {} } ================================================ FILE: lib/bluetooth/devices/presets/MightyMk2Preset.dart ================================================ // (c) 2020-2021 Dian Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/liteMk2Communication.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/liteMk2/delay.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/liteMk2/efx.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/liteMk2/reverb.dart'; import 'package:mighty_plug_manager/bluetooth/devices/presets/preset_constants.dart'; import '../NuxConstants.dart'; import '../NuxDevice.dart'; import '../NuxFXID.dart'; import '../NuxMightyLiteMk2.dart'; import '../communication/plugProCommunication.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/liteMk2/modulation.dart'; import '../effects/plug_pro/EFX.dart'; import '../effects/plug_pro/Amps.dart'; import '../effects/plug_pro/Cabinet.dart'; import '../effects/plug_pro/Modulation.dart'; import '../effects/plug_pro/Delay.dart'; import '../effects/plug_pro/Reverb.dart'; import 'Preset.dart'; class MightyMk2Preset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override List get channelColorsList => PresetConstants.channelColorsPro; @override int get qrDataLength => 113; double _volume = 0; @override double get volume => _volume; @override set volume(double vol) { setVolume(vol, true); } final NoiseGatePro noiseGate = NoiseGatePro(); @override List get amplifierList => _amplifierList; final List _efxList = []; final List _amplifierList = []; final List _cabinetList = []; final List _modulationList = []; final List _delayList = []; final List _reverbList = []; @override List get cabinetList => _cabinetList; bool noiseGateEnabled = true; bool efxEnabled = true; bool ampEnabled = true; bool cabEnabled = true; bool modulationEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedEfx = 0; int selectedAmp = 0; int selectedCabinet = 0; int selectedMod = 0; int selectedDelay = 0; int selectedReverb = 0; LiteMK2Version version = LiteMK2Version.LiteMK2v1; MightyMk2Preset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { _modulationList.addAll([ ModCE1(), ModCE2(), STChorusPro(), Vibrato(), FlangerLiteMk2(), Phase90LiteMk2(), Phase100LiteMk2(), SCFLiteMk2(), VibeLiteMk2(), TremoloLiteMk2(), SCH1LiteMk2(), ]); _efxList.addAll([ DistortionPlus(), RCBoost(), ACBoost(), DistOne(), TSDrive(), BluesDrive(), MorningDrive(), EatDist(), RedDirt(), Crunch(), MuffFuzz(), Katana(), STSinger(), RoseCompLiteMk2(), KCompLiteMk2(), TouchWahLiteMk2(), TremoloEFXLiteMk2(), VibeEFXLiteMk2(), PH100LiteMk2() ]); _amplifierList.addAll([ JazzClean(), DeluxeRvb(), BassMate(), Tweedy(), //this one and VibroKing cause crashes or ear piercing feedbacks TwinRvb(), HiWire(), CaliCrunch(), ClassA15(), ClassA30(), Plexi100(), Plexi45(), Brit800(), Pl1987x50(), Slo100(), FiremanHBE(), DualRect(), DIEVH4(), VibroKing(), Budda(), MrZ38(), SuperRvb(), BritBlues(), MatchD30(), Brit2000(), UberHiGain(), AGL(), MLD(), OptimaAir(), Stageman(), ]); _cabinetList.addAll([ JZ120Pro(), DR112Pro(), TR212Pro(), HIWIRE412(), CALI112(), A112(), GB412Pro(), M1960AX(), M1960AV(), M1960TV(), SLO412(), FIREMAN412(), RECT412(), DIE412(), MATCH212(), UBER412(), BS410(), A212Pro(), M1960AHW(), M1936(), BUDDA112(), Z212(), SUPERVERB410(), VIBROKING310(), AGLDB810(), AMPSV212(), AMPSV410(), AMPSV810(), BASSGUY410(), EDEN410(), MKB410(), GHBIRDPro(), GJ15Pro(), MD45Pro(), ]); //add the user cabs for (int i = 0; i < PlugProCommunication.customIRsCount; i++) { var userCab = UserCab(); userCab.setNuxIndex(i + PlugProCommunication.customIRStart + 1); if (i == 0) { userCab.isSeparator = true; userCab.category = "User IRs"; } _cabinetList.add(userCab); } _delayList.addAll([ AnalogDelayLiteMk2(), DigitalDelayLiteV2(), ModDelayLiteMk2(), TapeEchoLiteMk2(), PhiDelayLiteMk2() ]); //reverb is available in all presets _reverbList.addAll([ RoomReverbLiteMk2(), HallReverbLiteMk2(), PlateReverb(), SpringReverb(), DampReverbLiteMk2() ]); } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { switch (index) { case 0: return noiseGateEnabled; case 1: return efxEnabled; case 2: return ampEnabled; case 3: return cabEnabled; case 4: return modulationEnabled; case 5: return delayEnabled; case 6: return reverbEnabled; default: return true; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { switch (index) { case 0: noiseGateEnabled = value; break; case 1: efxEnabled = value; break; case 2: ampEnabled = value; break; case 3: cabEnabled = value; break; case 4: modulationEnabled = value; break; case 5: delayEnabled = value; break; case 6: reverbEnabled = value; break; default: return; } super.setSlotEnabled(index, value, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { switch (slot) { case 0: return [noiseGate]; case 1: return _efxList; case 2: return _amplifierList; case 3: return _cabinetList; case 4: return _modulationList; case 5: return _delayList; case 6: return _reverbList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { switch (slot) { case 0: return 0; case 1: return selectedEfx; case 2: return selectedAmp; case 3: return selectedCabinet; case 4: return selectedMod; case 5: return selectedDelay; case 6: return selectedReverb; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { switch (slot) { case 1: selectedEfx = index; break; case 2: selectedAmp = index; break; case 3: selectedCabinet = index; break; case 4: selectedMod = index; break; case 5: selectedDelay = index; break; case 6: selectedReverb = index; break; } super.setSelectedEffectForSlot(slot, index, notifyBT); } @override int getEffectArrayIndexFromNuxIndex(NuxFXID fxid, int nuxIndex) { List list = []; list = getEffectsForSlot(fxid.value); for (int i = 0; i < list.length; i++) { if (list[i].nuxIndex == nuxIndex) return i; } return 0; } @override Color effectColor(int index) { return device.processorList[index].color; } @override setFirmwareVersion(int ver) { version = LiteMK2Version.values[ver]; } @override void setVolume(double vol, bool btTransmit) { _volume = vol; if (btTransmit) { sendVolume(); } } @override void sendVolume() { (device.communication as LiteMk2Communication) .sendChannelVolume(device.decibelFormatter!.valueToMidi7Bit(_volume)); } @override void setupPresetFromNuxDataArray(List nuxData) { super.setupPresetFromNuxDataArray(nuxData); if (nuxData.length > PresetDataIndexPlugPro.MASTER) { _volume = device.decibelFormatter! .midi7BitToValue(nuxData[PresetDataIndexPlugPro.MASTER]); } else { debugPrint("Error: master volume outside of preset data!"); } } } ================================================ FILE: lib/bluetooth/devices/presets/MightyXXBTPreset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui'; import 'package:mighty_plug_manager/bluetooth/devices/presets/preset_constants.dart'; import '../NuxDevice.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/mighty_2040bt/Amps.dart'; import '../effects/mighty_2040bt/Modulation.dart'; import '../effects/mighty_2040bt/Delay.dart'; import '../effects/mighty_2040bt/Reverb.dart'; import 'Preset.dart'; class MXXBTPreset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override int get qrDataLength => 40; @override Color get channelColor => PresetConstants.channelColorsPlug[channel]; final NoiseGate1Param noiseGate = NoiseGate1Param(); @override final List amplifierList = []; final List modulationList = []; final List delayList = []; final List reverbList = []; bool noiseGateEnabled = true; bool modulationEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedMod = 0; int selectedDelay = 0; int selectedReverb = 0; MXXBTPreset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { //modulation is available everywhere modulationList.addAll([Phaser(), Chorus(), Tremolo()]); amplifierList.addAll([ Amp1(), // AmpClean2(), // AmpDrive1(), // AmpDrive2(), // AmpMetal1(), // AmpMetal2(), // AmpLead1(), // AmpLead2() ]); delayList.addAll([AnalogDelay(), ModulationDelay(), DigitalDelay()]); //reverb is available in all presets reverbList.addAll([HallReverb(), PlateReverb(), SpringReverb()]); } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { if (index == 1) return false; return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { switch (index) { case 0: return noiseGateEnabled; case 2: return modulationEnabled; case 3: return delayEnabled; case 4: return reverbEnabled; default: return true; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { switch (index) { case 0: noiseGateEnabled = value; break; case 2: modulationEnabled = value; break; case 3: delayEnabled = value; break; case 4: reverbEnabled = value; break; default: return; } super.setSlotEnabled(index, value, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { switch (slot) { case 0: return [noiseGate]; case 1: return amplifierList; case 2: return modulationList; case 3: return delayList; case 4: return reverbList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { switch (slot) { case 0: return 0; case 1: return 0; case 2: return selectedMod; case 3: return selectedDelay; case 4: return selectedReverb; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { switch (slot) { case 2: selectedMod = index; break; case 3: selectedDelay = index; break; case 4: selectedReverb = index; break; } super.setSelectedEffectForSlot(slot, index, notifyBT); } @override Color effectColor(int index) { if (index != 1) { return device.processorList[index].color; } else { return channelColor; } } @override setFirmwareVersion(int ver) {} } ================================================ FILE: lib/bluetooth/devices/presets/PlugAirPreset.dart ================================================ // (c) 2020-2021 Dian Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:ui'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugAir.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/plug_air/Ampsv2.dart'; import 'package:mighty_plug_manager/bluetooth/devices/presets/preset_constants.dart'; import '../NuxDevice.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/plug_air/EFX.dart'; import '../effects/plug_air/EFXv2.dart'; import '../effects/plug_air/Amps.dart'; import '../effects/plug_air/Cabinet.dart'; import '../effects/plug_air/Modulation.dart'; import '../effects/plug_air/Delay.dart'; import '../effects/plug_air/Reverb.dart'; import 'Preset.dart'; class PlugAirPreset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override List get channelColorsList { if ((device as NuxMightyPlug).ampVariant == PlugAirVariant.MightyAir) { return PresetConstants.channelColorsAir; } return PresetConstants.channelColorsPlug; } @override int get qrDataLength => 40; final NoiseGate2Param noiseGate = NoiseGate2Param(); List get efxList => version == PlugAirVersion.PlugAir21 ? efxListv2 : efxListv1; @override List get amplifierList => version == PlugAirVersion.PlugAir21 ? amplifierListv2 : amplifierListv1; @override final List cabinetList = []; List get modulationList => version == PlugAirVersion.PlugAir21 ? modulationListv2 : modulationListv1; List get delayList => version == PlugAirVersion.PlugAir21 ? delayList2 : delayList1; List get reverbList => version == PlugAirVersion.PlugAir21 ? reverbListv2 : reverbListv1; final List efxListv1 = []; final List efxListv2 = []; final List amplifierListv1 = []; final List amplifierListv2 = []; final List modulationListv1 = []; final List modulationListv2 = []; final List delayList1 = []; final List delayList2 = []; final List reverbListv1 = []; final List reverbListv2 = []; bool noiseGateEnabled = true; bool efxEnabled = true; bool modulationEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedEfx = 0; int selectedAmp = 0; int selectedCabinet = 0; int selectedMod = 0; int selectedDelay = 0; int selectedReverb = 0; PlugAirVersion version = PlugAirVersion.PlugAir15; PlugAirPreset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { modulationListv1 .addAll([Phaser(), Chorus(), STChorus(), Flanger(), Vibe(), Tremolo()]); modulationListv2 .addAll([PH100(), CE1(), STChorus(), SCF(), Vibe(), Tremolo()]); efxListv1.addAll([ TouchWah(), UniVibe(), TremoloEFX(), PhaserEFX(), Boost(), TSDrive(), BassTS(), ThreeBandEQ(), Muff(), Crunch(), RedDist(), MorningDrive(), DistOne(), ]); efxListv2.addAll([ TouchWah(), UniVibe(), TremoloEFX(), PH100EFX(), STSinger(), TSDrive(), Katana(), ThreeBandEQ(), Muff(), Crunch(), RedDirt(), MorningDrive(), DistOne(), RoseComp() ]); amplifierListv1.addAll([ TwinVerb(), JZ120(), TweedDlx(), Plexi(), TopBoost(), Lead100(), Fireman(), DIEVH4(), Recto(), Optima(), Stageman(), MLD(), AGL() ]); amplifierListv2.addAll([ JazzClean(), DeluxeRvb(), TwinRvbV2(), ClassA30(), Brit800(), Plexi1987x50(), FiremanHBE(), DualRect(), DIEVH4v2(), AGLv2(), Starlift(), MLDv2(), Stagemanv2(), ]); cabinetList.addAll([ V1960(), A212(), BS410(), DR112(), GB412(), JZ120IR(), TR212(), V412(), AGLDB810(), AMPSV810(), MKB410(), TRC410(), GHBird(), GJ15(), MD45(), GIBJ200(), GIBJ45(), TL314(), MHD28() ]); delayList1.addAll([AnalogDelay(), TapeEcho(), DigitalDelay(), PingPong()]); delayList2 .addAll([AnalogDelay(), DigitalDelayv2(), ModDelay(), PingPong()]); //reverb is available in all presets reverbListv1.addAll([ RoomReverb(), HallReverb(), PlateReverb(), SpringReverb(), ShimmerReverb() ]); reverbListv2.addAll( [RoomReverbv2(), HallReverbv2(), PlateReverbv2(), SpringReverb()]); } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { if (index == 2 || index == 3) return false; return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { switch (index) { case 0: return noiseGateEnabled; case 1: return efxEnabled; case 4: return modulationEnabled; case 5: return delayEnabled; case 6: return reverbEnabled; default: return true; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { switch (index) { case 0: noiseGateEnabled = value; break; case 1: efxEnabled = value; break; case 4: modulationEnabled = value; break; case 5: delayEnabled = value; break; case 6: reverbEnabled = value; break; default: return; } super.setSlotEnabled(index, value, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { switch (slot) { case 0: return [noiseGate]; case 1: return efxList; case 2: return amplifierList; case 3: return cabinetList; case 4: return modulationList; case 5: return delayList; case 6: return reverbList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { switch (slot) { case 0: return 0; case 1: return selectedEfx; case 2: return selectedAmp; case 3: return selectedCabinet; case 4: return selectedMod; case 5: return selectedDelay; case 6: return selectedReverb; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { switch (slot) { case 1: selectedEfx = index; break; case 2: selectedAmp = index; break; case 3: selectedCabinet = index; break; case 4: selectedMod = index; break; case 5: selectedDelay = index; break; case 6: selectedReverb = index; break; } super.setSelectedEffectForSlot(slot, index, notifyBT); } @override Color effectColor(int index) { return device.processorList[index].color; } @override setFirmwareVersion(int ver) { version = PlugAirVersion.values[ver]; //some special consideration for fx limit if (version == PlugAirVersion.PlugAir15 && selectedEfx >= efxListv1.length) { selectedEfx = efxListv1.length - 1; } if (version == PlugAirVersion.PlugAir21 && selectedReverb >= reverbListv2.length) { selectedReverb = reverbListv2.length - 1; } } @override String getAmpNameByNuxIndex(int index, int version) { try { var ver = PlugAirVersion.values[version]; switch (ver) { case PlugAirVersion.PlugAir15: return amplifierListv1[index].name; case PlugAirVersion.PlugAir21: return amplifierListv2[index].name; } } catch (e) { throw ("Unknown Mighty Plug/Air version: $version"); } } } ================================================ FILE: lib/bluetooth/devices/presets/PlugProPreset.dart ================================================ // (c) 2020-2021 Dian Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:convert/convert.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugPro.dart'; import 'package:mighty_plug_manager/bluetooth/devices/communication/plugProCommunication.dart'; import 'package:mighty_plug_manager/bluetooth/devices/effects/plug_pro/EmptyEffects.dart'; import '../../NuxDeviceControl.dart'; import '../NuxConstants.dart'; import '../NuxDevice.dart'; import '../NuxFXID.dart'; import '../effects/Processor.dart'; import '../effects/NoiseGate.dart'; import '../effects/plug_pro/Compressor.dart'; import '../effects/plug_pro/EFX.dart'; import '../effects/plug_pro/Amps.dart'; import '../effects/plug_pro/Cabinet.dart'; import '../effects/plug_pro/Modulation.dart'; import '../effects/plug_pro/Delay.dart'; import '../effects/plug_pro/Reverb.dart'; import '../effects/plug_pro/EQ.dart'; import 'Preset.dart'; import 'preset_constants.dart'; class PlugProPreset extends Preset { @override NuxDevice device; @override int channel; @override String channelName; @override List get channelColorsList => PresetConstants.channelColorsPro; @override int get qrDataLength => 113; final WahDummyPro wahDummy = WahDummyPro(); final NoiseGatePro noiseGate = NoiseGatePro(); final List _compressorList = []; final List efxList = []; @override final List cabinetList = []; final List modulationList = []; final List _reverbList = []; @override final List amplifierList = []; final List delayList = []; final List eqList = []; //presets stored in nux indexing (unused Wah is 0) List processorAtSlot = []; bool wahEnabled = true; bool noiseGateEnabled = true; bool compressorEnabled = true; bool efxEnabled = true; bool ampEnabled = true; bool irEnabled = true; bool modulationEnabled = true; bool eqEnabled = true; bool delayEnabled = true; bool reverbEnabled = true; int selectedComp = 0; int selectedEfx = 0; int selectedAmp = 0; int selectedCabinet = 0; int selectedMod = 0; int selectedEQ = 0; int selectedDelay = 0; int selectedReverb = 0; PlugProVersion version = PlugProVersion.PlugPro1; double _volume = 0; PlugProPreset( {required this.device, required this.channel, required this.channelName}) : super(channel: channel, channelName: channelName, device: device) { _compressorList.addAll([RoseCompPro(), KComp(), StudioComp()]); modulationList.addAll([ ModCE1(), ModCE2(), STChorusPro(), Vibrato(), Detune(), FlangerPro(), Phase90(), Phase100(), SCFPro(), VibePro(), TremoloPro(), Rotary(), SCH1Pro(), MonoOctave() ]); efxList.addAll([ DistortionPlus(), RCBoost(), ACBoost(), DistOne(), TSDrive(), BluesDrive(), MorningDrive(), EatDist(), RedDirt(), Crunch(), MuffFuzz(), Katana(), STSinger(), TouchWahPro() ]); amplifierList.addAll([ JazzClean(), DeluxeRvb(), BassMate(), Tweedy(), TwinRvb(), HiWire(), CaliCrunch(), ClassA15(), ClassA30(), Plexi100(), Plexi45(), Brit800(), Pl1987x50(), Slo100(), FiremanHBE(), DualRect(), DIEVH4(), VibroKing(), Budda(), MrZ38(), SuperRvb(), BritBlues(), MatchD30(), Brit2000(), UberHiGain(), AGL(), MLD(), OptimaAir(), Stageman(), ]); eqList.addAll([EQSixBand(), EQTenBand()]); cabinetList.addAll([ JZ120Pro(), DR112Pro(), TR212Pro(), HIWIRE412(), CALI112(), A112(), GB412Pro(), M1960AX(), M1960AV(), M1960TV(), SLO412(), FIREMAN412(), RECT412(), DIE412(), MATCH212(), UBER412(), BS410(), A212Pro(), M1960AHW(), M1936(), BUDDA112(), Z212(), SUPERVERB410(), VIBROKING310(), AGLDB810(), AMPSV212(), AMPSV410(), AMPSV810(), BASSGUY410(), EDEN410(), MKB410(), GHBIRDPro(), GJ15Pro(), MD45Pro(), ]); //add the user cabs for (int i = 0; i < PlugProCommunication.customIRsCount; i++) { var userCab = UserCab(); userCab.setNuxIndex(i + PlugProCommunication.customIRStart + 1); if (i == 0) { userCab.isSeparator = true; userCab.category = "User IRs"; } cabinetList.add(userCab); } delayList.addAll([ AnalogDelayV2(), DigitalDelay(), ModDelay(), TapeEcho(), PanDelay(), PhiDelayPro() ]); _reverbList.addAll([ RoomReverb(), HallReverb(), PlateReverb(), SpringReverb(), ShimmerReverb(), DampReverbPro() ]); for (int i = 0; i < PresetDataIndexPlugPro.defaultEffects.length; i++) { processorAtSlot.add(PresetDataIndexPlugPro.defaultEffects[i]); } } /// checks if the effect slot can be switched on and off @override bool slotSwitchable(int index) { return true; } //returns whether the specific slot is on or off @override bool slotEnabled(int index) { var proc = getFXIDFromSlot(index); return _FXIDEnabled(proc); } bool _FXIDEnabled(NuxFXID fxid) { switch (fxid.value) { case PresetDataIndexPlugPro.Head_iWAH: return wahEnabled; case PresetDataIndexPlugPro.Head_iNG: return noiseGateEnabled; case PresetDataIndexPlugPro.Head_iCMP: return compressorEnabled; case PresetDataIndexPlugPro.Head_iEFX: return efxEnabled; case PresetDataIndexPlugPro.Head_iAMP: return ampEnabled; case PresetDataIndexPlugPro.Head_iCAB: return irEnabled; case PresetDataIndexPlugPro.Head_iMOD: return modulationEnabled; case PresetDataIndexPlugPro.Head_iEQ: return eqEnabled; case PresetDataIndexPlugPro.Head_iDLY: return delayEnabled; case PresetDataIndexPlugPro.Head_iRVB: return reverbEnabled; default: return false; } } //turns slot on or off @override void setSlotEnabled(int index, bool value, bool notifyBT) { var proc = getFXIDFromSlot(index); _setFXIDEnabled(proc, value); super.setSlotEnabled(index, value, notifyBT); } void _setFXIDEnabled(NuxFXID fxid, bool value) { switch (fxid.value) { case PresetDataIndexPlugPro.Head_iWAH: wahEnabled = value; break; case PresetDataIndexPlugPro.Head_iNG: noiseGateEnabled = value; break; case PresetDataIndexPlugPro.Head_iCMP: compressorEnabled = value; break; case PresetDataIndexPlugPro.Head_iEFX: efxEnabled = value; break; case PresetDataIndexPlugPro.Head_iAMP: ampEnabled = value; break; case PresetDataIndexPlugPro.Head_iCAB: irEnabled = value; break; case PresetDataIndexPlugPro.Head_iMOD: modulationEnabled = value; break; case PresetDataIndexPlugPro.Head_iEQ: eqEnabled = value; break; case PresetDataIndexPlugPro.Head_iDLY: delayEnabled = value; break; case PresetDataIndexPlugPro.Head_iRVB: reverbEnabled = value; break; default: return; } } @override NuxFXID getFXIDFromSlot(int slot) { return processorAtSlot[slot]; } @override int? getSlotFromFXID(NuxFXID fxid) { for (int i = 0; i < processorAtSlot.length; i++) { if (processorAtSlot[i] == fxid) return i; } return null; } @override void setFXIDAtSlot(int slot, NuxFXID fxid) { processorAtSlot[slot] = fxid; } @override void swapProcessorSlots(int from, int to, notifyBT) { var fxFrom = processorAtSlot[from]; //shift all after 'from' one position to the left for (int i = from; i < device.processorList.length - 1; i++) { processorAtSlot[i] = processorAtSlot[i + 1]; } //shift all at and after 'to' one position to the right to make room for (int i = device.processorList.length - 1; i > to; i--) { processorAtSlot[i] = processorAtSlot[i - 1]; } //place the moved one processorAtSlot[to] = fxFrom; super.swapProcessorSlots(from, to, notifyBT); } //returns list of effects for given slot @override List getEffectsForSlot(int slot) { var proc = getFXIDFromSlot(slot); return _getEffectsForFXID(proc); } List _getEffectsForFXID(NuxFXID fxid) { switch (fxid.value) { case PresetDataIndexPlugPro.Head_iWAH: return [wahDummy]; case PresetDataIndexPlugPro.Head_iNG: return [noiseGate]; case PresetDataIndexPlugPro.Head_iCMP: return _compressorList; case PresetDataIndexPlugPro.Head_iEFX: return efxList; case PresetDataIndexPlugPro.Head_iAMP: return amplifierList; case PresetDataIndexPlugPro.Head_iCAB: return cabinetList; case PresetDataIndexPlugPro.Head_iMOD: return modulationList; case PresetDataIndexPlugPro.Head_iEQ: return eqList; case PresetDataIndexPlugPro.Head_iDLY: return delayList; case PresetDataIndexPlugPro.Head_iRVB: return _reverbList; } return []; } //returns which of the effects is selected for a given slot @override int getSelectedEffectForSlot(int slot) { var fxid = getFXIDFromSlot(slot); return _getSelectedEffectForFXID(fxid); } int _getSelectedEffectForFXID(NuxFXID fxid) { switch (fxid.value) { case PresetDataIndexPlugPro.Head_iCMP: return selectedComp; case PresetDataIndexPlugPro.Head_iEFX: return selectedEfx; case PresetDataIndexPlugPro.Head_iAMP: return selectedAmp; case PresetDataIndexPlugPro.Head_iCAB: return selectedCabinet; case PresetDataIndexPlugPro.Head_iMOD: return selectedMod; case PresetDataIndexPlugPro.Head_iEQ: return selectedEQ; case PresetDataIndexPlugPro.Head_iDLY: return selectedDelay; case PresetDataIndexPlugPro.Head_iRVB: return selectedReverb; default: return 0; } } //sets the effect for the given slot @override void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { var proc = getFXIDFromSlot(slot); _setSelectedEffectForFXID(proc, index); super.setSelectedEffectForSlot(slot, index, notifyBT); } void _setSelectedEffectForFXID(NuxFXID fxid, int index) { switch (fxid.value) { case PresetDataIndexPlugPro.Head_iCMP: selectedComp = index; break; case PresetDataIndexPlugPro.Head_iEFX: selectedEfx = index; break; case PresetDataIndexPlugPro.Head_iAMP: selectedAmp = index; break; case PresetDataIndexPlugPro.Head_iCAB: selectedCabinet = index; break; case PresetDataIndexPlugPro.Head_iMOD: selectedMod = index; break; case PresetDataIndexPlugPro.Head_iEQ: selectedEQ = index; break; case PresetDataIndexPlugPro.Head_iDLY: selectedDelay = index; break; case PresetDataIndexPlugPro.Head_iRVB: selectedReverb = index; break; } } @override int getEffectArrayIndexFromNuxIndex(NuxFXID fxid, int nuxIndex) { List list = []; list = _getEffectsForFXID(fxid); for (int i = 0; i < list.length; i++) { if (list[i].nuxIndex == nuxIndex) return i; } return 0; } @override Color effectColor(int index) { var fxid = getFXIDFromSlot(index); return device.getProcessorInfoByFXID(fxid)?.color ?? Colors.grey; } @override setFirmwareVersion(int version) { this.version = PlugProVersion.values[version]; } @override void setupPresetFromNuxDataArray(List nuxData) { if (nuxData.length < 10) return; var loadedPreset = hex.encode(nuxData); NuxDeviceControl.instance().diagData.lastNuxPreset = loadedPreset; NuxDeviceControl.instance().updateDiagnosticsData(nuxPreset: loadedPreset); for (int i = 0; i < PresetDataIndexPlugPro.effectTypesIndex.length; i++) { int nuxSlot = PresetDataIndexPlugPro.effectTypesIndex[i]; NuxFXID fxid = NuxFXID.fromInt(nuxSlot); //set proper effect int effectParam = nuxData[nuxSlot]; int effectIndex = effectParam & 0x3f; bool effectOn = (effectParam & 0x40) == 0; effectIndex = getEffectArrayIndexFromNuxIndex(fxid, effectIndex); _setSelectedEffectForFXID(fxid, effectIndex); //enable/disable effect _setFXIDEnabled(fxid, effectOn); _getEffectsForFXID(fxid)[effectIndex].setupFromNuxPayload(nuxData); } if (nuxData.length > PresetDataIndexPlugPro.MASTER) { _volume = device.decibelFormatter! .midi7BitToValue(nuxData[PresetDataIndexPlugPro.MASTER]); } else { debugPrint("Error: master volume outside of preset data!"); } //effects chain arrangement int start = PresetDataIndexPlugPro.LINK1; if (nuxData.length <= start) { debugPrint("Error: preset doesn't contain FX chain order settings"); return; } //fix for QR for (int i = 0; i < 3; i++) { if (!PresetDataIndexPlugPro.effectTypesIndex.contains(nuxData[start])) { start++; } } for (int i = 0; i < device.effectsChainLength; i++) { processorAtSlot[i] = NuxFXID.fromInt(nuxData[start + i]); } } @override List createNuxDataFromPreset() { List data = List.filled(qrDataLength, 0); List qrData = []; qrData.add(device.deviceQRId); qrData.add(device.deviceQRVersion); data[PresetDataIndexPlugPro.MASTER] = device.decibelFormatter!.valueToMidi7Bit(_volume); for (int i = 0; i < PresetDataIndexPlugPro.effectTypesIndex.length; i++) { var slot = PresetDataIndexPlugPro.effectTypesIndex[i]; NuxFXID fxid = NuxFXID.fromInt(slot); _getEffectsForFXID(fxid)[_getSelectedEffectForFXID(fxid)] .getNuxPayload(data, _FXIDEnabled(fxid)); } //fx chain order int start = PresetDataIndexPlugPro.LINK1; //store fx chain for (int i = 0; i < device.effectsChainLength; i++) { data[start + i] = processorAtSlot[i].toInt(); } qrData.addAll(data); return qrData; } @override double get volume => _volume; @override set volume(double vol) { setVolume(vol, true); } @override void setVolume(double vol, bool btTransmit) { _volume = vol; if (btTransmit) { sendVolume(); } } @override void sendVolume() { (device.communication as PlugProCommunication) .sendChannelVolume(device.decibelFormatter!.valueToMidi7Bit(_volume)); } void setVolumeRaw(int vol) { _volume = device.decibelFormatter!.midi7BitToValue(vol); } } ================================================ FILE: lib/bluetooth/devices/presets/Preset.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:convert'; import 'dart:ui'; import 'package:convert/convert.dart'; import 'package:qr_utils/qr_utils.dart'; import 'package:undo/undo.dart'; import '../../NuxDeviceControl.dart'; import '../NuxDevice.dart'; import '../NuxFXID.dart'; import '../effects/Processor.dart'; import 'preset_constants.dart'; abstract class Preset { int get qrDataLength; NuxDevice device; int channel; String channelName; Color get channelColor => channelColorsList[channel]; List get channelColorsList => PresetConstants.channelColorsPlug; List get amplifierList; List? get cabinetList => null; final _changeStack = ChangeStack(); ChangeStack get changes => _changeStack; List> nuxDataPieces = []; Preset( {required this.device, required this.channel, required this.channelName}); //checks if the effect slot can be switched on and off bool slotSwitchable(int index); //returns whether the specific slot is on or off bool slotEnabled(int index); //override in reorderable fx chain NuxFXID getFXIDFromSlot(int slot) { return NuxFXID.fromInt(slot); } int? getSlotFromFXID(NuxFXID fxid) { return fxid.toInt(); } void setupPresetFromNuxDataArray(List nuxData) { if (nuxData.length < 10) return; var loadedPreset = hex.encode(nuxData); NuxDeviceControl.instance().diagData.lastNuxPreset = loadedPreset; NuxDeviceControl.instance().updateDiagnosticsData(nuxPreset: loadedPreset); for (int i = 0; i < device.effectsChainLength; i++) { bool fxFound = false; var effects = getEffectsForSlot(i); if (effects.isEmpty) continue; //set proper effect if (effects[0].nuxEffectTypeIndex != null) { int effectData = nuxData[effects[0].nuxEffectTypeIndex!]; int effectIndex = effectData; if (effects[0].nuxEffectTypeIndex == effects[0].nuxEnableIndex) { effectIndex &= ~effects[0].nuxEnableMask; } //find array index by nux index for (int j = 0; j < effects.length; j++) { if (effects[j].nuxIndex == effectIndex) { effectIndex = j; fxFound = true; break; } } setSelectedEffectForSlot(i, effectIndex, false); } //enable/disable effect if (fxFound && effects[0].nuxEnableIndex != null) { int enableData = nuxData[effects[0].nuxEnableIndex!] & effects[0].nuxEnableMask; bool enabled = (enableData != 0) ^ effects[0].nuxEnableInverted; setSlotEnabled(i, enabled, false); getEffectsForSlot(i)[getSelectedEffectForSlot(i)] .setupFromNuxPayload(nuxData); } else { setSlotEnabled(i, false, false); } } } void setFXIDAtSlot(int slot, NuxFXID fxid) {} void swapProcessorSlots(int from, int to, bool notifyBT) { if (notifyBT) device.slotSwapped.add(to); } //turns slot on or off void setSlotEnabled(int index, bool value, bool notifyBT) { if (notifyBT) device.effectSwitched.add(index); } //returns list of effects for given slot List getEffectsForSlot(int slot); //returns which of the effects is selected for a given slot int getSelectedEffectForSlot(int slot); //sets the effect for the given slot void setSelectedEffectForSlot(int slot, int index, bool notifyBT) { if (notifyBT) device.effectChanged.add(slot); } void setFirmwareVersion(int version); //change a parameter and announce it void setParameterValue(Parameter param, double value, {bool notify = true}) { param.value = value; if (notify) { device.parameterChanged.add(param); } } //override in more complex FX chains int getEffectArrayIndexFromNuxIndex(NuxFXID fxid, int nuxIndex) { return nuxIndex; } Color effectColor(int index); void resetNuxData() { nuxDataPieces = []; } //receives data chunk from a device void addNuxPayloadPiece(List data, int part, int total) { if (total == 0) return; if (nuxDataPieces.length != total) { nuxDataPieces = List.filled(total, []); } nuxDataPieces[part] = data; } bool payloadPiecesReady() { for (int i = 0; i < nuxDataPieces.length; i++) { if (nuxDataPieces[i].isEmpty) return false; } return true; } //this is for QR export List createNuxDataFromPreset() { List data = List.filled(qrDataLength, 0); List qrData = []; qrData.add(device.deviceQRId); qrData.add(device.deviceQRVersion); for (int i = 0; i < device.effectsChainLength; i++) { getEffectsForSlot(i)[getSelectedEffectForSlot(i)] .getNuxPayload(data, slotEnabled(i)); } qrData.addAll(data); return qrData; } void setupPresetFromNuxData() { List nuxData = []; for (int i = 0; i < nuxDataPieces.length; i++) { nuxData.addAll(nuxDataPieces[i]); } setupPresetFromNuxDataArray(nuxData); } PresetQRError setupPresetFromQRData(String qrData) { if (qrData.contains(QrUtils.nuxQRPrefix)) { var b64Data = qrData.substring(QrUtils.nuxQRPrefix.length); var data = base64Decode(b64Data); if (device.checkQRValid(data[0], data[1])) { setupPresetFromNuxDataArray(data.sublist(2)); device.deviceControl.sendFullPresetSettings(); return PresetQRError.Ok; } if (data[0] != device.deviceQRId) return PresetQRError.WrongDevice; return PresetQRError.WrongFWVersion; } return PresetQRError.UnsupportedFormat; } String getAmpNameByNuxIndex(int index, int version) { var ampIndex = getFXIDFromSlot(device.amplifierSlotIndex); index = getEffectArrayIndexFromNuxIndex(ampIndex, index); return amplifierList[index].name; } double get volume => 0; set volume(double vol) => {}; void setVolume(double vol, bool btTransmit) {} void sendVolume() {} } ================================================ FILE: lib/bluetooth/devices/presets/preset_constants.dart ================================================ import 'dart:ui'; import 'package:flutter/material.dart'; class PresetConstants { static const List channelColorsPlug = [ Color.fromARGB(255, 0, 255, 0), Color.fromARGB(255, 240, 160, 10), Color.fromARGB(255, 255, 0, 0), Color.fromARGB(220, 230, 230, 255), Color.fromARGB(255, 130, 225, 255), Color.fromARGB(255, 210, 140, 250), Color.fromARGB(255, 71, 167, 245), Color.fromARGB(230, 230, 230, 255), ]; static const List channelColorsAir = [ Color.fromARGB(255, 0, 255, 0), Color.fromARGB(255, 212, 202, 0), Color.fromARGB(255, 255, 0, 0), Color.fromARGB(220, 255, 0, 255), Color.fromARGB(255, 0, 191, 255), Color.fromARGB(255, 224, 142, 0), Color.fromARGB(255, 20, 125, 255), ]; static const List channelColorsPro = [ Color.fromARGB(255, 0, 255, 0), Color.fromARGB(255, 240, 160, 10), Color.fromARGB(255, 220, 0, 0), Colors.blue, Color.fromARGB(255, 130, 225, 255), Color.fromARGB(255, 231, 120, 215), Color(0xFFE1BEE7), ]; } ================================================ FILE: lib/bluetooth/devices/value_formatters/DecibelFormatter.dart ================================================ import 'ValueFormatter.dart'; class DecibelFormatterMP2 extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int get min => -6; @override int get max => 6; @override int valueToMidi7Bit(double value) { return ((value + 6) / 12 * 127).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 127) * 12 - 6; } @override String toLabel(double value) { return "${value.toStringAsFixed(1)} db"; } } class DecibelFormatterMPPro extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int get min => -12; @override int get max => 12; @override int valueToMidi7Bit(double value) { return ((value + 12) / 24 * 100).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 100) * 24 - 12; } @override String toLabel(double value) { return "${value.toStringAsFixed(1)} db"; } } class DecibelFormatterEQ extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int get min => -15; @override int get max => 15; @override int valueToMidi7Bit(double value) { return ((value + 15) / 30 * 100).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 100) * 30 - 15; } @override String toLabel(double value) { return "${value.toStringAsFixed(1)} db"; } } ================================================ FILE: lib/bluetooth/devices/value_formatters/FrequencyFormatter.dart ================================================ import 'ValueFormatter.dart'; import 'dart:math'; double log10(num x) => log(x) / ln10; class LowFrequencyFormatter extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int get min => 20; @override int get max => 300; @override int valueToMidi7Bit(double value) { return ((value - 20) / 280 * 100).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 100) * 280 + 20; } @override String toLabel(double value) { return "${value.toStringAsFixed(0)} Hz"; } } class HighFrequencyFormatter extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int get min => 0; @override int get max => 100; double _valueToFreq(double value) { final a = log10(5e3) + (log10(2e4) - log10(5e3)) * (value / 100); return pow(10, a).toDouble(); } double _freqToValue(double freq) { double a = log10(freq); var value = (a - log10(5e3)) / (log10(2e4) - log10(5e3)); return value * 100; } @override int valueToMidi7Bit(double value) { return value.round(); } @override double midi7BitToValue(int midi7bit) { return midi7bit.toDouble(); } @override String toLabel(double value) { return "${_valueToFreq(value).toStringAsFixed(0)} Hz"; } @override double toHumanInput(double value) { return _valueToFreq(value); } @override double fromHumanInput(double value) { return _freqToValue(value); } } ================================================ FILE: lib/bluetooth/devices/value_formatters/PercentageFormatter.dart ================================================ import 'ValueFormatter.dart'; class PercentageFormatter extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int valueToMidi7Bit(double value) { return (value / 100 * 127).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 127.0) * 100; } @override String toLabel(double value) { return "${value.round()} %"; } } class PercentageFormatterMPPro extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; @override int valueToMidi7Bit(double value) { return value.round(); } @override double midi7BitToValue(int midi7bit) { return midi7bit.toDouble(); } @override String toLabel(double value) { return "${value.round()} %"; } } ================================================ FILE: lib/bluetooth/devices/value_formatters/SwitchFormatters.dart ================================================ import 'ValueFormatter.dart'; abstract class SwitchFormatter extends ValueFormatter { String get labelTitle; @override InputType get inputType => InputType.SwitchInput; List get labelValues; List get midiValues; @override double midi7BitToValue(int midi7bit) { return midi7bit.toDouble(); } @override String toLabel(double value) { // TODO: implement toLabel throw UnimplementedError(); } @override int valueToMidi7Bit(double value) { return value.round(); } } class BrightModeFormatter extends SwitchFormatter { @override String get labelTitle => "Bright:"; @override List get labelValues => ["Off", "On"]; @override List get midiValues => [0, 127]; } class BrightModeFormatterMPPro extends SwitchFormatter { @override String get labelTitle => "Bright:"; @override List get labelValues => ["Off", "On"]; @override List get midiValues => [0, 1]; } class BoostModeFormatter extends SwitchFormatter { @override String get labelTitle => "Boost:"; @override List get labelValues => ["Off", "On"]; @override List get midiValues => [0, 127]; } class BoostModeFormatterMPPro extends SwitchFormatter { @override String get labelTitle => "Boost:"; @override List get labelValues => ["Off", "On"]; @override List get midiValues => [0, 1]; } class VibeModeFormatter extends SwitchFormatter { @override String get labelTitle => "Mode:"; @override List get labelValues => ["Vibe", "Chorus"]; @override List get midiValues => [0, 127]; } class VibeModeFormatterPro extends SwitchFormatter { @override String get labelTitle => "Mode:"; @override List get labelValues => ["Chorus", "Vibrato"]; @override List get midiValues => [0, 1]; } class ContourModeFormatter extends SwitchFormatter { @override String get labelTitle => "Contour:"; @override List get labelValues => ["Vintage", "Off", "Modern"]; @override List get midiValues => [0, 64, 127]; } class SCFModeFormatter extends SwitchFormatter { @override String get labelTitle => "Mode:"; @override List get labelValues => ["Chorus", "P.M.", "Flanger"]; @override List get midiValues => [0, 1, 2]; } class TouchWahModeFormatter extends SwitchFormatter { @override String get labelTitle => "Type:"; @override List get labelValues => ["Cry", "VX", "Full", "Talk"]; @override List get midiValues => [0, 32, 64, 96]; } class TouchWahModeFormatterLiteMk2 extends SwitchFormatter { @override String get labelTitle => "Type:"; @override List get labelValues => ["Cry", "VX", "Full", "Talk"]; @override List get midiValues => [0, 1, 2, 3]; } class TouchWahDirectionFormatterPro extends SwitchFormatter { @override String get labelTitle => "Up/Down Switch:"; @override List get labelValues => ["Down", "Up"]; @override List get midiValues => [0, 1]; } ================================================ FILE: lib/bluetooth/devices/value_formatters/TempoFormatter.dart ================================================ import '../../../UI/pages/settings.dart'; import '../../../platform/simpleSharedPrefs.dart'; import 'ValueFormatter.dart'; class TempoFormatter extends ValueFormatter { @override InputType get inputType => InputType.SliderInput; static const delayTimeMstable = [ .07972789115646259, .16124716553287982, .5031292517006802, .7398412698412699, 1.1972789115646258 ]; List get delayMsTable => delayTimeMstable; double percentageToTime(double p) { double t = p / 25; int lo = t.floor(); int hi = t.ceil(); var hiF = t - lo; var loF = 1 - hiF; return (delayMsTable[lo] * loF + delayMsTable[hi] * hiF); } double percentageToBPM(double p) { return 60 / percentageToTime(p); } double bpmToPercentage(double b) { return timeToPercentage(60 / b); } double timeToPercentage(t) { return (t < delayMsTable[0] ? 0 : t < delayMsTable[1] ? 25 * (t - delayMsTable[0]) / (delayMsTable[1] - delayMsTable[0]) : t < delayMsTable[2] ? 25 * (t - delayMsTable[1]) / (delayMsTable[2] - delayMsTable[1]) + 25 : t < delayMsTable[3] ? 25 * (t - delayMsTable[2]) / (delayMsTable[3] - delayMsTable[2]) + 50 : t < delayMsTable[4] ? 25 * (t - delayMsTable[3]) / (delayMsTable[4] - delayMsTable[3]) + 75 : 100); } @override int valueToMidi7Bit(double value) { return (value / 100 * 127).floor(); } @override double midi7BitToValue(int midi7bit) { return (midi7bit / 127.0) * 100; } @override String toLabel(double value) { var unit = SharedPrefs().getValue(SettingsKeys.timeUnit, TimeUnit.BPM.index); if (unit == TimeUnit.BPM.index) { return "${percentageToBPM(value).toStringAsFixed(2)} BPM"; } return "${percentageToTime(value).toStringAsFixed(2)} s"; } @override double toHumanInput(double value) { var unit = TimeUnit.values[ SharedPrefs().getValue(SettingsKeys.timeUnit, TimeUnit.BPM.index)]; if (unit == TimeUnit.BPM) return percentageToBPM(value); return percentageToTime(value); } @override double fromHumanInput(double value) { var unit = TimeUnit.values[ SharedPrefs().getValue(SettingsKeys.timeUnit, TimeUnit.BPM.index)]; if (unit == TimeUnit.BPM) return bpmToPercentage(value); return timeToPercentage(value); } } //Tempo formatter for digital and Pan Delay class TempoFormatterPro extends TempoFormatter { static const delayTimeMstable = [ .07972789115646259, .16124716553287982, .5031292517006802, .7398412698412699, .9902292 ]; @override List get delayMsTable => delayTimeMstable; @override int valueToMidi7Bit(double value) { return value.round(); } @override double midi7BitToValue(int midi7bit) { return midi7bit.toDouble(); } } class TempoFormatterProMod extends TempoFormatterPro { static const delayTimeMstable = [ 0.01825, 0.198292, 0.5982083, 1.0399583, 1.1918125 ]; @override List get delayMsTable => delayTimeMstable; } class TempoFormatterProAnalog extends TempoFormatterPro { static const delayTimeMstable = [ 0.0402708333333333, 0.1602916666666667, 0.2803125, 0.3307291666666667, 0.4007708333333333 ]; @override List get delayMsTable => delayTimeMstable; } class TempoFormatterProTapeEcho extends TempoFormatterPro { static const delayTimeMstable = [ 0.0533125, 0.1883125, 0.3980416666666667, 0.4881458333333333, 0.5459375 ]; @override List get delayMsTable => delayTimeMstable; } ================================================ FILE: lib/bluetooth/devices/value_formatters/ValueFormatter.dart ================================================ import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/FrequencyFormatter.dart'; import 'package:mighty_plug_manager/bluetooth/devices/value_formatters/SwitchFormatters.dart'; import 'TempoFormatter.dart'; import 'DecibelFormatter.dart'; import 'PercentageFormatter.dart'; enum InputType { SliderInput, SwitchInput } class ValueFormatters { static PercentageFormatter percentage = PercentageFormatter(); static PercentageFormatterMPPro percentageMPPro = PercentageFormatterMPPro(); static DecibelFormatterMP2 decibelMP2 = DecibelFormatterMP2(); static DecibelFormatterMPPro decibelMPPro = DecibelFormatterMPPro(); static DecibelFormatterEQ decibelEQ = DecibelFormatterEQ(); static TempoFormatter tempo = TempoFormatter(); static TempoFormatterPro tempoPro = TempoFormatterPro(); static TempoFormatterProMod tempoProMod = TempoFormatterProMod(); static TempoFormatterProAnalog tempoProAnalog = TempoFormatterProAnalog(); static TempoFormatterProTapeEcho tempoProTapeEcho = TempoFormatterProTapeEcho(); static BrightModeFormatter brightMode = BrightModeFormatter(); static BrightModeFormatterMPPro brightModePro = BrightModeFormatterMPPro(); static BoostModeFormatter boostMode = BoostModeFormatter(); static BoostModeFormatterMPPro boostModePro = BoostModeFormatterMPPro(); static VibeModeFormatter vibeMode = VibeModeFormatter(); static VibeModeFormatterPro vibeModePro = VibeModeFormatterPro(); static ContourModeFormatter contourMode = ContourModeFormatter(); static SCFModeFormatter scfMode = SCFModeFormatter(); static LowFrequencyFormatter lowFreqFormatter = LowFrequencyFormatter(); static HighFrequencyFormatter highFreqFormatter = HighFrequencyFormatter(); static TouchWahModeFormatter touchWahFormatter = TouchWahModeFormatter(); static TouchWahModeFormatterLiteMk2 touchWahFormatterLiteMk2 = TouchWahModeFormatterLiteMk2(); static TouchWahDirectionFormatterPro touchWahDirectionFormatterPro = TouchWahDirectionFormatterPro(); } abstract class ValueFormatter { InputType get inputType; int get min => 0; int get max => 100; int valueToMidi7Bit(double value); double midi7BitToValue(int midi7bit); String toLabel(double value); double toHumanInput(double value) { return value; } double fromHumanInput(double value) { return value; } } ================================================ FILE: lib/main.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/UI/pages/DebugConsolePage.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; //pages import 'UI/mainTabs.dart'; import 'UI/theme.dart'; import 'audio/trackdata/trackData.dart'; import 'bluetooth/NuxDeviceControl.dart'; //recreate this file with your own api keys //import 'configKeys.dart'; import 'modules/cloud/cloudManager.dart'; //able to create snackbars/messages everywhere final navigatorKey = GlobalKey(); final bucketGlobal = PageStorageBucket(); void main() { runZoned(() { //configuration data is needed before start of the app WidgetsFlutterBinding.ensureInitialized(); SharedPrefs prefs = SharedPrefs(); prefs.waitLoading().then((value) { PresetsStorage storage = PresetsStorage(); storage.init().then((value) => mainRunApp()); }); }, zoneSpecification: ZoneSpecification( print: (Zone self, ZoneDelegate parent, Zone zone, String line) { parent.print(zone, line); DebugConsole.print(line); })); } mainRunApp() { if (kDebugMode) CloudManager.instance.initialize(); // Run the app within a zone runApp(const App()); } class App extends StatefulWidget { const App({Key? key}) : super(key: key); @override State createState() => _AppState(); } class _AppState extends State { NuxDeviceControl device = NuxDeviceControl.instance(); SharedPrefs prefs = SharedPrefs(); TrackData trackData = TrackData(); @override Widget build(BuildContext context) { return MaterialApp( title: 'Mightier Amp', theme: getTheme(), home: MainTabs(), scrollBehavior: const MaterialScrollBehavior().copyWith( dragDevices: { PointerDeviceKind.mouse, PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind.unknown }, ), //showSemanticsDebugger: true, navigatorKey: navigatorKey, ); } } ================================================ FILE: lib/midi/BleMidiManager.dart ================================================ import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import '../bluetooth/ble_controllers/BLEController.dart'; import 'ControllerConstants.dart'; import 'MidiControllerManager.dart'; import 'controllers/BleMidiController.dart'; class BleMidiManager extends ChangeNotifier { //List _devices = []; bool get isScanning => BLEMidiHandler.instance().isScanning; bool _firstTimeScanned = false; final Function(HotkeyControl) onHotkeyReceived; List get controllers => _controllers; final List _controllers = []; bool usbMidiSupported = false; StreamSubscription? _bleScanSub; BleMidiManager(this.onHotkeyReceived) { BLEMidiHandler.instance().status.listen(_bleStatusListener); } startScan() { if (BLEMidiHandler.instance().isScanning) return; for (int i = controllers.length - 1; i >= 0; i--) { if (!controllers[i].connected) controllers.removeAt(i); } _bleScanSub = BLEMidiHandler.instance().isScanningStream.listen(_scanStatusListener); BLEMidiHandler.instance().startScanning(true); } stopScan() { BLEMidiHandler.instance().stopScanning(); _unsubscribeScanListener(); } createControllers() { var ctrls = BLEMidiHandler.instance().controllerDevices; for (var ctl in ctrls) { var blectl = BleMidiController(ctl, onHotkeyReceived); if (!_controllers.contains(blectl)) { _controllers.add(BleMidiController(ctl, onHotkeyReceived)); } } } _unsubscribeScanListener() { _bleScanSub?.cancel(); } _scanStatusListener(bool scanning) { if (scanning == false) _unsubscribeScanListener(); notifyListeners(); } _bleStatusListener(MidiSetupStatus status) { switch (status) { case MidiSetupStatus.bluetoothOff: // TODO: Handle this case. break; case MidiSetupStatus.deviceIdle: if (!_firstTimeScanned) { _firstTimeScanned = true; MidiControllerManager().connectAvailableBLEDevices(); } break; case MidiSetupStatus.deviceSearching: // TODO: Handle this case. break; case MidiSetupStatus.deviceFound: createControllers(); break; case MidiSetupStatus.deviceConnecting: // TODO: Handle this case. break; case MidiSetupStatus.deviceConnected: // TODO: Handle this case. break; case MidiSetupStatus.deviceDisconnected: // TODO: Handle this case. break; case MidiSetupStatus.unknown: // TODO: Handle this case. break; } notifyListeners(); } } ================================================ FILE: lib/midi/ControllerConstants.dart ================================================ import 'package:flutter/material.dart'; import '../UI/mightierIcons.dart'; class MidiConstants { static const NoteOn = 0x90; static const NoteOff = 0x80; static const PolyAfterTouch = 0xa0; static const ControlChange = 0xb0; static const ProgramChange = 0xc0; static const ChannelPressure = 0xd0; static const PitchBend = 0xe0; } enum HotkeyControl { PreviousChannel, NextChannel, ChannelByIndex, EffectSlotEnable, EffectSlotDisable, EffectSlotToggle, ParameterSet, DelayTapTempo, MasterVolumeSet, EffectDecrement, EffectIncrement, DrumsStartStop, DrumsVolume, DrumsTempoMinus1, DrumsTempoPlus1, DrumsTempoMinus5, DrumsTempoPlus5, DrumsTempoTap, DrumsPreviousStyle, DrumsNextStyle, LooperRecord, LooperStop, LooperClear, LooperUndoRedo, LooperLevel, JamTracksPlayPause, JamTracksPreviousTrack, JamTracksNextTrack, JamTracksRewind, JamTracksFF, JamTracksABRepeat, PreviousPresetGlobal, NextPresetGlobal, PreviousPresetCategory, NextPresetCategory, ToggleTuner } extension HotkeyLabel on HotkeyControl { String? get label { switch (this) { case HotkeyControl.DrumsStartStop: return 'Start/Stop'; case HotkeyControl.DrumsVolume: return 'Volume'; case HotkeyControl.DrumsTempoMinus1: return 'Tempo -1'; case HotkeyControl.DrumsTempoPlus1: return 'Tempo +1'; case HotkeyControl.DrumsTempoMinus5: return 'Tempo -5'; case HotkeyControl.DrumsTempoPlus5: return 'Tempo +5'; case HotkeyControl.DrumsTempoTap: return "Tap Tempo"; case HotkeyControl.DrumsPreviousStyle: return "Previous Style"; case HotkeyControl.DrumsNextStyle: return "Next Style"; case HotkeyControl.LooperRecord: return 'Record/Play/Overdub'; case HotkeyControl.LooperStop: return "Stop"; case HotkeyControl.LooperClear: return "Clear"; case HotkeyControl.LooperUndoRedo: return "Undo/Redo"; case HotkeyControl.LooperLevel: return "Level"; case HotkeyControl.JamTracksPlayPause: return "Play/Pause"; case HotkeyControl.JamTracksPreviousTrack: return "Previous Track"; case HotkeyControl.JamTracksNextTrack: return "Next Track"; case HotkeyControl.JamTracksRewind: return "Rewind"; case HotkeyControl.JamTracksFF: return "Fast Forward"; case HotkeyControl.JamTracksABRepeat: return "A-B Repeat"; case HotkeyControl.ToggleTuner: return "Toggle Tuner"; default: return null; } } IconData? get icon { switch (this) { case HotkeyControl.DrumsStartStop: return Icons.play_arrow; case HotkeyControl.DrumsVolume: return Icons.volume_up; case HotkeyControl.DrumsTempoMinus1: return Icons.keyboard_arrow_left; case HotkeyControl.DrumsTempoPlus1: return Icons.keyboard_arrow_right; case HotkeyControl.DrumsTempoMinus5: return Icons.keyboard_double_arrow_left; case HotkeyControl.DrumsTempoPlus5: return Icons.keyboard_double_arrow_right; case HotkeyControl.DrumsTempoTap: return Icons.touch_app; case HotkeyControl.DrumsPreviousStyle: return Icons.keyboard_arrow_up; case HotkeyControl.DrumsNextStyle: return Icons.keyboard_arrow_down; case HotkeyControl.LooperRecord: return Icons.fiber_manual_record; case HotkeyControl.LooperStop: return Icons.stop; case HotkeyControl.LooperClear: return Icons.clear; case HotkeyControl.LooperUndoRedo: return Icons.undo; case HotkeyControl.LooperLevel: return Icons.volume_up; case HotkeyControl.JamTracksPlayPause: return Icons.play_arrow; case HotkeyControl.JamTracksPreviousTrack: return Icons.skip_previous; case HotkeyControl.JamTracksNextTrack: return Icons.skip_next; case HotkeyControl.JamTracksRewind: return Icons.fast_rewind; case HotkeyControl.JamTracksFF: return Icons.fast_forward; case HotkeyControl.JamTracksABRepeat: return Icons.repeat; case HotkeyControl.ToggleTuner: return MightierIcons.tuner; default: return null; } } bool get sliderMode { switch (this) { case HotkeyControl.ParameterSet: case HotkeyControl.DrumsVolume: case HotkeyControl.MasterVolumeSet: case HotkeyControl.LooperLevel: return true; default: return false; } } } enum HotkeyCategory { Channels, EffectSlots, EffectParameters, Drums, JamTracks, Looper, Misc } ================================================ FILE: lib/midi/MidiControllerManager.dart ================================================ import 'dart:async'; import 'dart:convert'; import 'dart:io'; import 'package:flutter/widgets.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import 'package:mighty_plug_manager/midi/UsbMidiManager.dart'; import 'package:mighty_plug_manager/midi/controllers/BleMidiController.dart'; import 'package:mighty_plug_manager/midi/controllers/HidController.dart'; import 'package:path/path.dart' as path; import '../bluetooth/ble_controllers/BLEController.dart'; import '../platform/platformUtils.dart'; import 'BleMidiManager.dart'; import 'ControllerConstants.dart'; import 'controllers/MidiController.dart'; typedef MidiDataOverride = void Function( MidiController ctrl, int code, int? sliderValue, String name); class MidiControllerManager extends ChangeNotifier { static final MidiControllerManager _controller = MidiControllerManager._(); late BleMidiManager _bleMidiManager; late UsbMidiManager _usbMidiManager; bool get isScanning => _bleMidiManager.isScanning; List get controllers => _controllers; final List _controllers = []; late MidiController _hidController; MidiDataOverride? dataOverride; final StreamController _midiCommandController = StreamController.broadcast(); Stream get controllerStream => _midiCommandController.stream; //file stuff for saving controller assignments static const controllersFile = "midicontrollers.json"; String filePath = ""; late Directory? storageDirectory; late File _controllersFile; List _controllersData = []; factory MidiControllerManager() { return _controller; } MidiControllerManager._() { _bleMidiManager = BleMidiManager(_onHotkeyReceived); _usbMidiManager = UsbMidiManager(_onHotkeyReceived, scanUsb); _hidController = HidController(_onHotkeyReceived); _controllers.add(_hidController); _bleMidiManager.addListener(_onBleMidiManagerChanged); loadConfig().then( (_) async { await Future.delayed(const Duration(seconds: 1)); scanUsb(); }, ); BLEMidiHandler.instance().status.listen(_statusListener); } void _statusListener(statusValue) { switch (statusValue) { case MidiSetupStatus.deviceFound: // check if this is valid nux device for (var dev in BLEMidiHandler.instance().controllerDevices) { //don't autoconnect on manual scan if (!BLEMidiHandler.instance().manualScan) { //_midiHandler.connectToDevice(dev.device); } } break; } } startScan() { notifyListeners(); _controllers.clear(); //add the hid controller by default _controllers.add(_hidController); _loadControllerHotkeys(_hidController); //scan for usb midi devices scanUsb(); _bleMidiManager.startScan(); } scanUsb() { _usbMidiManager.getDevices().then(_connectAvailableUsbDevices); } stopScan() { _bleMidiManager.stopScan(); notifyListeners(); } _connectAvailableUsbDevices(List devices) { for (var dev in devices) { if (_controllers.contains(dev)) { _controllers.remove(dev); } _controllers.add(dev); dev.setOnStatus(onControllerStatus); dev.setOnDataReceived(onControllerData); if (_loadControllerHotkeys(dev) == true && !dev.connected) { dev.connect(); } } notifyListeners(); } connectAvailableBLEDevices() { for (var c in _controllers) { if (c is BleMidiController) { if (!c.connected) c.connect(); } } } _onBleMidiManagerChanged() { //check for new device for (var dev in _bleMidiManager.controllers) { if (!_controllers.contains(dev)) { _controllers.add(dev); dev.setOnStatus(onControllerStatus); dev.setOnDataReceived(onControllerData); _loadControllerHotkeys(dev); } } notifyListeners(); } onControllerStatus(MidiController ctrl, ControllerStatus status) { notifyListeners(); } onControllerData(MidiController ctrl, List data) { bool consumed = false; int code = 0; int? value = 0; String name = ""; for (int i = 0; i < data.length - 1; i++) { //check midi message start if (data[i] >= 0x80 && data[i + 1] < 0x80) { int status = data[i] & 0xf0; switch (status) { case MidiConstants.NoteOn: if (data.length - i < 3) break; code = data[i] << 16 | data[i + 1] << 8; value = data[i + 2]; if (value == 0) return; if (dataOverride != null) { name = "NO ${data[i + 1].toRadixString(16)}"; } consumed = true; break; case MidiConstants.PolyAfterTouch: if (data.length - i < 3) break; code = data[i] << 8 | data[i + 1] << 8; value = data[i + 2]; if (dataOverride != null) { name = "PKP ${data[i + 1].toRadixString(16).padLeft(2, '0')}"; } consumed = true; break; case MidiConstants.ControlChange: if (data.length - i < 3) break; code = data[i] << 16 | data[i + 1] << 8 | data[i + 2]; value = data[i + 2]; if (dataOverride != null) { name = "CC ${data[i + 1].toRadixString(16).padLeft(2, '0')} ${data[i + 2].toRadixString(16).padLeft(2, '0')}"; } consumed = true; break; case MidiConstants.ProgramChange: if (data.length - i < 2) break; code = data[i] << 16 | data[i + 1] << 8; value = null; if (dataOverride != null) { name = "PC ${data[i + 1].toRadixString(16).padLeft(2, '0')}"; } consumed = true; break; case MidiConstants.ChannelPressure: if (data.length - i < 2) break; code = data[i] << 8; value = data[i + 1]; name = "CP"; consumed = true; break; case MidiConstants.PitchBend: if (data.length - i < 3) break; code = data[i] << 8; value = data[i + 1] | data[i + 2] << 7; name = "PB"; consumed = true; break; } } if (consumed) break; } //decode message _onControlMessage(ctrl, code, value, name); } onHIDData(RawKeyEvent event) { _onControlMessage(_hidController, event.physicalKey.usbHidUsage, null, event.logicalKey.keyLabel); } _onControlMessage( MidiController ctrl, int code, int? sliderValue, String name) { //do whatever you do if (dataOverride != null) { dataOverride!.call(ctrl, code, sliderValue, name); } else { //execute function var hk = ctrl.getHotkeyByCode(code, false); hk?.execute(sliderValue); } } overrideOnData(MidiDataOverride override) { dataOverride = override; } cancelOnDataOverride() { dataOverride = null; } Future loadConfig() async { await _getDirectory(); try { var exists = await _controllersFile.exists(); if (exists) { var ctrlJson = await _controllersFile.readAsString(); _controllersData = json.decode(ctrlJson); _loadControllerHotkeys(_hidController); } } catch (e) { debugPrint(e.toString()); } } saveConfig() async { //generate controllers data _controllersData.clear(); //while json encode does this, it's needed here as well //so prepare it manually for (var c in _controllers) { _controllersData.add(c.toJson()); } String jsonData = json.encode(_controllersData); await _controllersFile.writeAsString(jsonData); } _getDirectory() async { storageDirectory = await PlatformUtils.getAppDataDirectory(); filePath = path.join(storageDirectory?.path ?? "", controllersFile); _controllersFile = File(filePath); } bool _loadControllerHotkeys(MidiController ctrl) { for (var config in _controllersData) { if (config is Map) { if (config["name"] == ctrl.name) { ctrl.fromJson(config, _onHotkeyReceived); return true; } } } return false; } void _onHotkeyReceived(HotkeyControl hotkey) { _midiCommandController.add(hotkey); } } ================================================ FILE: lib/midi/UsbMidiManager.dart ================================================ import 'package:flutter/foundation.dart'; import 'package:flutter_midi_command/flutter_midi_command.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:mighty_plug_manager/midi/MidiControllerManager.dart'; import 'package:mighty_plug_manager/midi/controllers/UsbMidiController.dart'; import '../platform/platformUtils.dart'; import 'ControllerConstants.dart'; import 'controllers/MidiController.dart'; class UsbMidiManager { List _devices = []; final Function(HotkeyControl) onHotkeyReceived; final Function() onMidiDeviceFound; final List _controllers = []; bool usbMidiSupported = false; UsbMidiManager(this.onHotkeyReceived, this.onMidiDeviceFound) { _init(); } _init() async { if (PlatformUtils.isAndroid) { var deviceInfoPlugin = DeviceInfoPlugin(); final androidInfo = await deviceInfoPlugin.androidInfo; usbMidiSupported = (androidInfo.version.sdkInt) >= 23; } else if (PlatformUtils.isIOS) { //TODO: Check if all ios versions support midi usbMidiSupported = true; } if (usbMidiSupported) { MidiCommand().onMidiDataReceived!.listen(_onDataReceive); MidiCommand().onMidiSetupChanged!.listen(_onMidiSetupChanged); } } Future> getDevices() async { if (!usbMidiSupported) return []; _devices = await MidiCommand().devices ?? []; _controllers.clear(); for (var dev in _devices) { var udev = UsbMidiController(dev, onHotkeyReceived); _controllers.add(udev); } return _controllers; } // connectToDevice(MidiDevice device) { // MidiCommand().connectToDevice(device); // } _onMidiSetupChanged(String data) { //deviceFound - when plugged in - might be used for scanning //deviceLost - for disconnect //deviceOpened - for connect //onDeviceStatusChanged - for connect probably var ctls = MidiControllerManager().controllers; if (data == "deviceLost") { for (var ctl in ctls) { if (ctl is UsbMidiController) ctl.checkForDisconnection(); } } else if (data == "deviceFound") { onMidiDeviceFound(); } else if (data == "deviceOpened") {} debugPrint("OnMidiSetupChanged: $data"); } _onDataReceive(MidiPacket event) { //find which device this belongs to var ctls = MidiControllerManager().controllers; for (var ctl in ctls) { if (ctl.id == event.device.id) { (ctl as UsbMidiController).onDataReceivedLoopback(event.data); } } } } ================================================ FILE: lib/midi/controllers/BleMidiController.dart ================================================ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:mighty_plug_manager/bluetooth/bleMidiHandler.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; import '../../bluetooth/ble_controllers/BLEController.dart'; class BleMidiController extends MidiController { final BLEScanResult _scanResult; BLEConnection? _bleConnection; StreamSubscription? _characteristicSubscription; StreamSubscription? _deviceStatusSubscription; @override ControllerType get type => ControllerType.MidiBle; BleMidiController(this._scanResult, super.onHotkeyReceived); @override String get id => _scanResult.id; @override String get name => _scanResult.name; @override bool get connected => _connected; bool _connected = false; @override Future connect() async { _bleConnection = await BLEMidiHandler.instance().connectToDevice(_scanResult.device); if (_bleConnection != null) { _onConnected(); } return _bleConnection != null; } _onConnected() { _deviceStatusSubscription = _scanResult.device.state.listen(_deviceStateListener); _connected = true; _characteristicSubscription = _bleConnection!.data.listen(_onDataReceivedEvent); } _onDataReceivedEvent(List data) { onDataReceived?.call(this, data); } _deviceStateListener(BleDeviceState event) { if (event == BleDeviceState.disconnected) { //remove device from the list debugPrint("Midi controller disconnected"); _connected = false; onStatus?.call(this, ControllerStatus.Disconnected); _characteristicSubscription?.cancel(); _deviceStatusSubscription?.cancel(); } } } ================================================ FILE: lib/midi/controllers/ControllerHotkey.dart ================================================ import 'package:mighty_plug_manager/audio/setlist_player/setlistPlayerState.dart'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:mighty_plug_manager/utilities/DelayTapTimer.dart'; import '../../bluetooth/devices/NuxDevice.dart'; import '../../bluetooth/devices/effects/MidiControllerHandles.dart'; import '../../bluetooth/devices/effects/Processor.dart'; import '../../bluetooth/devices/features/looper.dart'; import '../../bluetooth/devices/presets/Preset.dart'; import '../../bluetooth/devices/value_formatters/ValueFormatter.dart'; import '../../utilities/MathEx.dart'; import '../../bluetooth/devices/value_formatters/TempoFormatter.dart'; import '../../modules/tempo_trainer.dart'; import '../ControllerConstants.dart'; class ControllerHotkey { //type of value it controls HotkeyControl control; //friendly name String hotkeyName; //code that activates it - either 16 bit midi message or HID code int hotkeyCode; //main parameter - i.e. channel or slot int index; //sub parameter - which slider for example int subIndex; //whether to invert knob/slider style value bool invertSlider; final Function(HotkeyControl) onHotkeyReceived; NuxDevice? _cachedDevice; int? _cachedSlot; int? _cachedFX; int? _cachedParameter; ControllerHotkey( {required this.onHotkeyReceived, required this.control, required this.index, required this.subIndex, required this.hotkeyCode, required this.hotkeyName, required this.invertSlider}); execute(int? value) { var device = NuxDeviceControl().device; int channel = device.selectedChannel; switch (control) { case HotkeyControl.PreviousChannel: do { channel--; if (channel < 0) channel = device.channelsCount - 1; } while (!device.getChannelActive(channel)); device.setSelectedChannel(channel, notifyBT: true, sendFullPreset: false, notifyUI: true); device.getPreset(device.selectedChannel).setupPresetFromNuxData(); break; case HotkeyControl.NextChannel: do { channel++; if (channel >= device.channelsCount) channel = 0; } while (!device.getChannelActive(channel)); device.setSelectedChannel(channel, notifyBT: true, sendFullPreset: false, notifyUI: true); device.getPreset(device.selectedChannel).setupPresetFromNuxData(); break; case HotkeyControl.ChannelByIndex: device.setSelectedChannel(index, notifyBT: true, sendFullPreset: false, notifyUI: true); device.getPreset(device.selectedChannel).setupPresetFromNuxData(); break; case HotkeyControl.EffectSlotEnable: var p = device.getPreset(device.selectedChannel); var slot = _findSlotByFunction(control); if (slot != null) { p.setSlotEnabled(slot, true, true); NuxDeviceControl.instance().forceNotifyListeners(); } break; case HotkeyControl.EffectSlotDisable: var p = device.getPreset(device.selectedChannel); var slot = _findSlotByFunction(control); if (slot != null) { p.setSlotEnabled(slot, false, true); NuxDeviceControl.instance().forceNotifyListeners(); } break; case HotkeyControl.EffectSlotToggle: var p = device.getPreset(device.selectedChannel); var slot = _findSlotByFunction(control); if (slot != null) { p.setSlotEnabled(slot, !p.slotEnabled(slot), true); NuxDeviceControl.instance().forceNotifyListeners(); } break; case HotkeyControl.EffectDecrement: var p = device.getPreset(device.selectedChannel); var slot = _findSlotByFunction(control); if (slot != null) { var effects = p.getEffectsForSlot(slot); var effect = p.getSelectedEffectForSlot(slot) - 1; if (effect < 0) effect = effects.length - 1; p.setSelectedEffectForSlot(slot, effect, true); NuxDeviceControl.instance().forceNotifyListeners(); } break; case HotkeyControl.EffectIncrement: var p = device.getPreset(device.selectedChannel); var slot = _findSlotByFunction(control); if (slot != null) { var effects = p.getEffectsForSlot(slot); var effect = p.getSelectedEffectForSlot(slot) + 1; if (effect > effects.length - 1) effect = 0; p.setSelectedEffectForSlot(slot, effect, true); NuxDeviceControl.instance().forceNotifyListeners(); } break; case HotkeyControl.MasterVolumeSet: var val = midiToPercentage(value); if (device.fakeMasterVolume) { NuxDeviceControl.instance().masterVolume = val; } else { NuxDeviceControl.instance().masterVolume = _mapValueToFormatter(val, device.decibelFormatter!); } break; case HotkeyControl.ParameterSet: if (index >= ControllerHandleId.values.length) return; _hotkeyParameterSet(value, device); break; case HotkeyControl.DelayTapTempo: if (index >= ControllerHandleId.values.length) return; _delayTapTempo(device); break; case HotkeyControl.DrumsStartStop: if (!device.deviceControl.isConnected) return; device.setDrumsEnabled(!device.drumsEnabled); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.DrumsVolume: device.setDrumsLevel(midiToPercentage(value), true); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.DrumsTempoMinus1: _modifyTempo(device, -1); break; case HotkeyControl.DrumsTempoMinus5: _modifyTempo(device, -5); break; case HotkeyControl.DrumsTempoPlus1: _modifyTempo(device, 1); break; case HotkeyControl.DrumsTempoPlus5: _modifyTempo(device, 5); break; case HotkeyControl.DrumsTempoTap: _tapTempo(device); break; case HotkeyControl.DrumsPreviousStyle: var ds = device.selectedDrumStyle - 1; if (ds < 0) { ds = device.getDrumStylesCount() - 1; } device.setDrumsStyle(ds); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.DrumsNextStyle: var ds = device.selectedDrumStyle + 1; if (ds >= device.getDrumStylesCount()) { ds = 0; } device.setDrumsStyle(ds); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.LooperRecord: if (device is! Looper || !device.deviceControl.isConnected) return; if (TempoTrainer.instance().enable == true) { TempoTrainer.instance().enable = false; } (device as Looper).looperRecordPlay(); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.LooperStop: if (device is! Looper || !device.deviceControl.isConnected) return; (device as Looper).looperStop(); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.LooperClear: if (device is! Looper || !device.deviceControl.isConnected) return; (device as Looper).looperClear(); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.LooperUndoRedo: if (device is! Looper || !device.deviceControl.isConnected) return; (device as Looper).looperUndoRedo(); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.LooperLevel: if (device is! Looper || !device.deviceControl.isConnected) return; (device as Looper).looperLevel(midiToPercentage(value).toInt()); NuxDeviceControl.instance().forceNotifyListeners(); break; case HotkeyControl.JamTracksPlayPause: SetlistPlayerState.instance().playPause(); break; case HotkeyControl.JamTracksPreviousTrack: SetlistPlayerState.instance().previous(); break; case HotkeyControl.JamTracksNextTrack: SetlistPlayerState.instance().next(); break; case HotkeyControl.JamTracksRewind: SetlistPlayerState.instance().setPosition( (SetlistPlayerState.instance().currentPosition - const Duration(seconds: 5)) .inMilliseconds); break; case HotkeyControl.JamTracksFF: SetlistPlayerState.instance().setPosition( (SetlistPlayerState.instance().currentPosition + const Duration(seconds: 5)) .inMilliseconds); break; case HotkeyControl.JamTracksABRepeat: SetlistPlayerState.instance().toggleABRepeat(); break; case HotkeyControl.PreviousPresetGlobal: _changeToAdjacentPreset(device, true, PresetChangeDirection.previous); break; case HotkeyControl.NextPresetGlobal: _changeToAdjacentPreset(device, true, PresetChangeDirection.next); break; case HotkeyControl.PreviousPresetCategory: _changeToAdjacentPreset(device, false, PresetChangeDirection.previous); break; case HotkeyControl.NextPresetCategory: _changeToAdjacentPreset(device, false, PresetChangeDirection.next); break; default: onHotkeyReceived(control); } } double midiToPercentage(int? midiVal) { var val = midiVal ?? 0; if (invertSlider) val = 127 - val; return (val / 127) * 100; } void _changeToAdjacentPreset( NuxDevice device, bool acrossCategories, PresetChangeDirection dir) { var uuid = NuxDeviceControl.instance().presetUUID; for (int i = 0; i < 200; i++) { var preset = PresetsStorage().findAdjacentPreset(uuid, acrossCategories, dir); if (preset != null && preset["uuid"] != uuid && device.isPresetSupported(preset)) { device.presetFromJson(preset, null); break; } else if (preset != null) { uuid = preset["uuid"]; } } } void _modifyTempo(NuxDevice device, double amount) { double newTempo = device.drumsTempo + amount; device.setDrumsTempo(newTempo, true); NuxDeviceControl.instance().forceNotifyListeners(); } void _tapTempo(NuxDevice device) { DelayTapTimer.addClickTime(); var bpm = DelayTapTimer.calculateBpm(); if (bpm != false) { device.setDrumsTempo(bpm, true); NuxDeviceControl.instance().forceNotifyListeners(); } } void _delayTapTempo(NuxDevice device) { var p = _getEffectCached(device); if (_cachedSlot == null || _cachedSlot! >= device.effectsChainLength) { return; } DelayTapTimer.addClickTime(); var bpm = DelayTapTimer.calculate(); if (bpm != false) { var selectedFX = p.getSelectedEffectForSlot(_cachedSlot!); var effect = p.getEffectsForSlot(_cachedSlot!)[selectedFX]; var param = effect.parameters[_cachedParameter!]; var newValue = (param.formatter as TempoFormatter).timeToPercentage(bpm / 1000); p.setParameterValue(param, newValue); NuxDeviceControl.instance().forceNotifyListeners(); } } void _hotkeyParameterSet(int? value, NuxDevice device) { var p = _getEffectCached(device); if (_cachedSlot == null || _cachedSlot! >= device.effectsChainLength) { return; } var selectedFX = p.getSelectedEffectForSlot(_cachedSlot!); var effect = p.getEffectsForSlot(_cachedSlot!)[selectedFX]; double val = midiToPercentage(value); //Translate the 0-100 value into the range of the parameter val = _mapValueToFormatter( val, effect.parameters[_cachedParameter!].formatter); p.setParameterValue(effect.parameters[_cachedParameter!], val); NuxDeviceControl.instance().forceNotifyListeners(); } double _mapValueToFormatter(double value, ValueFormatter formatter) { return MathEx.map( value, 0, 100, formatter.min.toDouble(), formatter.max.toDouble()); } Preset _getEffectCached(NuxDevice device) { ControllerHandleId id = ControllerHandleId.values[index]; bool deviceChanged = device != _cachedDevice; _cachedDevice = device; var p = device.getPreset(device.selectedChannel); //find slot and cache it if (deviceChanged || _cachedSlot == null || _cachedFX != p.getSelectedEffectForSlot(_cachedSlot!)) { _cachedSlot = null; _cachedFX = null; _cachedParameter = null; for (int i = 0; i < device.effectsChainLength; i++) { var selectedFX = p.getSelectedEffectForSlot(i); var effect = p.getEffectsForSlot(i)[selectedFX]; var paramIndex = _findParameterByControllerHandleId(effect, id); if (paramIndex != null) { _cachedSlot = i; _cachedFX = selectedFX; _cachedParameter = paramIndex; break; } } } return p; } int? _findSlotByFunction(HotkeyControl func) { var device = NuxDeviceControl().device; if (index >= ControllerHandleId.values.length) return null; ControllerHandleId id = ControllerHandleId.values[index]; var p = device.getPreset(device.selectedChannel); int? slot; for (int i = 0; i < device.effectsChainLength; i++) { if (func == HotkeyControl.EffectSlotDisable && p.getEffectsForSlot(i)[0].midiControlOff?.id == id) { slot = i; break; } else if (func == HotkeyControl.EffectSlotEnable && p.getEffectsForSlot(i)[0].midiControlOn?.id == id) { slot = i; break; } else if (func == HotkeyControl.EffectSlotToggle && p.getEffectsForSlot(i)[0].midiControlToggle?.id == id) { slot = i; break; } else if (func == HotkeyControl.EffectDecrement && p.getEffectsForSlot(i)[0].midiControlPrev?.id == id) { slot = i; break; } else if (func == HotkeyControl.EffectIncrement && p.getEffectsForSlot(i)[0].midiControlNext?.id == id) { slot = i; break; } } return slot; } int? _findParameterByControllerHandleId( Processor proc, ControllerHandleId id) { for (int i = 0; i < proc.parameters.length; i++) { if (proc.parameters[i].midiControllerHandle?.id == id) return i; } return null; } Map toJson() { var data = {}; data["name"] = hotkeyName; data["control"] = control.toString(); data["code"] = hotkeyCode; data["index"] = index; data["subIndex"] = subIndex; data["invert"] = invertSlider; return data; } factory ControllerHotkey.fromJson( dynamic json, Function(HotkeyControl) onReceived) { ControllerHotkey hk = ControllerHotkey( control: getHKFromString(json["control"]), hotkeyCode: json["code"], hotkeyName: json["name"], index: json["index"], subIndex: json["subIndex"], invertSlider: json["invert"] ?? false, onHotkeyReceived: onReceived); return hk; } static HotkeyControl getHKFromString(String controlAsString) { for (var element in HotkeyControl.values) { if (element.toString() == controlAsString) { return element; } } throw Exception("Error: Unknown HotkeyControl type: $controlAsString"); } } ================================================ FILE: lib/midi/controllers/HidController.dart ================================================ import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; class HidController extends MidiController { HidController(super.onHotkeyReceived); @override Future connect() { return Future.value(true); } @override // HID is always connected bool get connected => true; @override // TODO: implement id String get id => "__hid__"; @override // TODO: implement name String get name => "HID Input"; @override // TODO: implement type ControllerType get type => ControllerType.Hid; } ================================================ FILE: lib/midi/controllers/MidiController.dart ================================================ import 'package:flutter/material.dart'; import 'package:mighty_plug_manager/midi/ControllerConstants.dart'; import 'ControllerHotkey.dart'; enum ControllerType { Hid, MidiUsb, MidiBle } enum ControllerStatus { Connected, Disconnected } abstract class MidiController { String get name; String get id; ControllerType get type; final Function(HotkeyControl) onHotkeyReceived; MidiController(this.onHotkeyReceived); final List _hotkeys = []; //faster access by code final Map _hotkeysDictionary = {}; assignHotkey(HotkeyControl ctrl, int index, int subindex, int keyCode, String hotkeyName, bool invert) { //find if already set for this function if (ctrl == HotkeyControl.ParameterSet) keyCode &= 0xffffff00; var hk = getHotkeyByFunction(ctrl, index, subindex); if (hk == null) { hk = ControllerHotkey( control: ctrl, index: index, subIndex: subindex, hotkeyCode: keyCode, hotkeyName: hotkeyName, invertSlider: invert, onHotkeyReceived: onHotkeyReceived); } else { hk.hotkeyCode = keyCode; hk.hotkeyName = hotkeyName; } if (!_hotkeys.contains(hk)) { _hotkeys.add(hk); } _rebuildDictionary(); } removeHotkey(ControllerHotkey? hk) { if (hk != null) { _hotkeys.remove(hk); _rebuildDictionary(); } } removeHotkeyByFunction(HotkeyControl ctrl, int index, int subindex) { var hk = getHotkeyByFunction(ctrl, index, subindex); removeHotkey(hk); } ControllerHotkey? getHotkeyByCode(int code, bool ignoreLowByte) { if (_hotkeysDictionary.containsKey(code)) return _hotkeysDictionary[code]; //now enumerate the dictionary and find keys with the lower byte set to 0 var mainCode = code & 0xffffff00; for (var key in _hotkeysDictionary.keys) { var _key = key & 0xffffff00; if (_key == mainCode && (ignoreLowByte || _hotkeysDictionary[key]!.control.sliderMode)) { return _hotkeysDictionary[key]; } } return null; } ControllerHotkey? getHotkeyByFunction( HotkeyControl ctrl, int index, int subindex) { for (var hk in _hotkeys) { if (hk.control == ctrl && hk.index == index && hk.subIndex == subindex) { return hk; } } return null; } _rebuildDictionary() { _hotkeysDictionary.clear(); for (var hk in _hotkeys) { _hotkeysDictionary[hk.hotkeyCode] = hk; } } @protected void Function(MidiController, ControllerStatus)? onStatus; @protected void Function(MidiController, List)? onDataReceived; setOnStatus(Function(MidiController, ControllerStatus) event) { onStatus = event; } setOnDataReceived(Function(MidiController, List) event) { onDataReceived = event; } bool get connected; @override bool operator ==(other) { return (other is MidiController) && other.name == name; } @override int get hashCode => super.hashCode; Future connect(); Map toJson() { var data = {}; data["name"] = name; data["id"] = id; List> hk = []; for (int i = 0; i < _hotkeys.length; i++) { hk.add(_hotkeys[i].toJson()); } data["hotkeys"] = hk; return data; } fromJson(dynamic json, Function(HotkeyControl) onReceived) { if (json["hotkeys"] != null) { _hotkeys.clear(); for (var hk in json["hotkeys"]) { try { var hotkey = ControllerHotkey.fromJson(hk, onReceived); _hotkeys.add(hotkey); } on Exception catch (e) { print(e); } finally {} } _rebuildDictionary(); } } } ================================================ FILE: lib/midi/controllers/UsbMidiController.dart ================================================ import 'package:flutter_midi_command/flutter_midi_command.dart'; import 'package:mighty_plug_manager/midi/controllers/MidiController.dart'; class UsbMidiController extends MidiController { MidiDevice device; @override ControllerType get type => ControllerType.MidiUsb; UsbMidiController(this.device, super.onHotkeyReceived); @override String get id => device.id; String? _name; @override String get name { if (_name == null) { _name = device.name; // Some androids are adding #XXX where XXX is a random number to the name // of the midi controller. This RegEx strips it from the name RegExp regex = RegExp(r'#\d+'); _name = _name!.replaceAll(regex, ''); } return _name!; } @override bool get connected => device.connected; @override Future connect() async { MidiCommand().connectToDevice(device); //wait for up to 2 seconds for (int i = 0; i < 4; i++) { var devs = await MidiCommand().devices; if (devs != null) { for (var d in devs) { if (d.name == name && d.id == id && d.connected) device = d; } } await Future.delayed(const Duration(milliseconds: 500)); if (device.connected) { onStatus?.call(this, ControllerStatus.Connected); return true; } } return device.connected; } void checkForDisconnection() async { bool found = false; var devs = await MidiCommand().devices; if (devs != null) { for (var d in devs) { if (d.name == name && d.id == id) { device = d; found = true; } } } //a shitty hack to work around missing functionality if (found == false) device.connected = false; if (!device.connected) onStatus?.call(this, ControllerStatus.Disconnected); } void onDataReceivedLoopback(List data) { if (data[0] != 248 && data[0] != 254) onDataReceived?.call(this, data); } } ================================================ FILE: lib/modules/cloud/cloudManager.dart ================================================ import 'dart:convert'; import 'package:flutter/widgets.dart'; import 'package:mighty_plug_manager/modules/cloud/cloudStorageListener.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:pocketbase/pocketbase.dart'; import 'customAuthStore.dart'; class CloudManager extends ChangeNotifier { final pb = PocketBase('https://mightier-amp.pockethost.io/', authStore: CustomAuthStore()); /// private constructor CloudManager._(); /// the one and only instance of this singleton static final instance = CloudManager._(); bool _signedIn = false; bool get signedIn => _signedIn; String get userId => pb.authStore.model?.id ?? ""; String get userIdFilter => 'user_id="${CloudManager.instance.userId}"'; late final CloudStorageListener _storageListener = CloudStorageListener(pb); void initialize() async { pb.authStore.onChange.listen(_onAuthChange); _signedIn = pb.authStore.isValid; print("PocketBase initialized. Signed in = $_signedIn"); //used for syncing across devices //PresetsStorage().registerPresetStorageListener(_storageListener); //TEST syncing or sth if (_signedIn) { refreshToken(); // var sw = Stopwatch()..start(); // syncPresets().then((value) { // sw.stop(); // print("List time ${sw.elapsedMilliseconds} ms"); // }); } } Future signIn({required String email, required String password}) { email = email.toLowerCase(); return pb.collection('users').authWithPassword(email, password); } Future refreshToken() { return pb.collection('users').authRefresh(); } Future register({required String email, required String password}) { email = email.toLowerCase(); return pb.collection('users').create(body: { "email": email, "password": password, "passwordConfirm": password, //username: "Random Name" }); } Future requestValidation(String email) { email = email.toLowerCase(); return pb.collection('users').requestVerification(email); } void signOut() { pb.authStore.clear(); } _onAuthChange(AuthStoreEvent event) { _signedIn = event.model != null; notifyListeners(); } /// Presets handling Future createPreset(Map preset, String categoryId) { Map copy = jsonDecode(jsonEncode(preset)); copy.remove("inactiveEffects"); return pb.collection('presets').create(body: { 'name': copy["name"], 'uuid': copy['uuid'], 'data': copy, "category_id": categoryId, "user_id": CloudManager.instance.userId }); } Future updatePreset(Map preset) async { final pData = await pb .collection('presets') .getFirstListItem('uuid="${preset["uuid"]}"'); Map copy = jsonDecode(jsonEncode(preset)); copy.remove("inactiveEffects"); return await pb .collection('presets') .update(pData.id, body: {'name': preset["name"], 'data': copy}); } void syncPresets() async { var sw = Stopwatch()..start(); var futures = >[]; //first create all categories for (int i = 0; i < PresetsStorage().presetsData.length; i++) { var cat = PresetsStorage().presetsData[i]; futures.add(pb.collection('categories').create(body: { 'name': cat["name"], "uuid": cat["uuid"], "user_id": CloudManager.instance.userId, "position": i })); } List results = await Future.wait(futures); futures.clear(); print("categories ready"); //now create presets for (var cat in PresetsStorage().presetsData) { for (var preset in cat["presets"]) { var catId = results .firstWhere((element) => element.data["name"] == cat["name"]); futures.add(createPreset(preset, catId.id)); } } results = await Future.wait(futures); // await pb.collection('presets').create(body: { // 'name': "AllPresets", // 'uuid': "95533e39-f0b8-4edc-940a-b72496c2b2a8", // 'data': data, // "user_id": CloudManager.instance.userId // }); sw.stop(); print("List time ${sw.elapsedMilliseconds} ms"); } } ================================================ FILE: lib/modules/cloud/cloudStorageListener.dart ================================================ import 'dart:collection'; import 'package:mighty_plug_manager/modules/cloud/cloudManager.dart'; import 'package:mighty_plug_manager/platform/presetStorageListener.dart'; import 'package:mighty_plug_manager/platform/presetsStorage.dart'; import 'package:pocketbase/pocketbase.dart'; class CloudStorageListener implements PresetStorageListener { final PocketBase pb; CloudStorageListener(this.pb); final ListQueue> _creationQueue = ListQueue(); final ListQueue> _updateQueue = ListQueue(); final ListQueue _deletionQueue = ListQueue(); @override void onPresetCreated(Map preset) { var queueLength = _creationQueue.length; _creationQueue.add(preset); if (queueLength == 0) _creationQueueHandler(); } @override void onPresetUpdated(Map preset) { var queueLength = _updateQueue.length; _updateQueue.add(preset); if (queueLength == 0) _updateQueueHandler(); } @override void onPresetDeleted(String uuid) { var queueLength = _deletionQueue.length; _deletionQueue.add(uuid); if (queueLength == 0) _deletionQueueHandler(); } void _creationQueueHandler() async { while (_creationQueue.isNotEmpty) { var data = _creationQueue.first; try { var sw = Stopwatch()..start(); final record = await pb.collection('presets').create(body: { 'name': data["name"], 'uuid': data['uuid'], 'data': data, "user_id": CloudManager.instance.userId }); _creationQueue.removeFirst(); sw.stop(); print("Created in ${sw.elapsedMilliseconds} ms"); } on ClientException catch (e) { print(e); _creationQueue.removeFirst(); } finally {} } } void _updateQueueHandler() async { while (_updateQueue.isNotEmpty) { var data = _updateQueue.first; try { var sw = Stopwatch()..start(); await CloudManager.instance.updatePreset(data); _updateQueue.removeFirst(); sw.stop(); print("Created in ${sw.elapsedMilliseconds} ms"); } on ClientException catch (e) { print(e); _updateQueue.removeFirst(); } finally {} } } void _deletionQueueHandler() async { while (_deletionQueue.isNotEmpty) { var data = _deletionQueue.first; try { var sw = Stopwatch()..start(); var result = await pb.collection('presets').getFirstListItem('uuid="$data"'); var delresult = await pb.collection('presets').delete(result.id); _deletionQueue.removeFirst(); sw.stop(); print("Deleted in ${sw.elapsedMilliseconds} ms"); } on ClientException catch (e) { print(e); //await Future.delayed(Duration(milliseconds: 500)); _deletionQueue.removeFirst(); } finally {} } } @override void onCategoryReordered(int from, int to) async { var categories = await pb .collection("categories") .getFullList(filter: CloudManager.instance.userIdFilter); var changed = 0; var futures = >[]; for (int i = 0; i < PresetsStorage().presetsData.length; i++) { var category = PresetsStorage().presetsData[i]; var pbCategory = categories .firstWhere((element) => element.data["uuid"] == category["uuid"]); if (pbCategory.data["position"] != i) { futures.add(pb .collection("categories") .update(pbCategory.id, body: {"position": i})); changed++; } } await Future.wait(futures); print("Changed categories: $changed"); } } ================================================ FILE: lib/modules/cloud/customAuthStore.dart ================================================ import 'dart:convert'; import 'package:pocketbase/pocketbase.dart'; import '../../platform/simpleSharedPrefs.dart'; class CustomAuthStore extends AuthStore { final String key; CustomAuthStore({this.key = "pb_auth"}) { final String? raw = SharedPrefs().getValue(key, null); if (raw != null && raw.isNotEmpty) { final decoded = jsonDecode(raw); final token = (decoded as Map)["token"] as String? ?? ""; final model = RecordModel.fromJson(decoded["model"] as Map? ?? {}); save(token, model); } } @override void save( String newToken, dynamic /* RecordModel|AdminModel|null */ newModel, ) { super.save(newToken, newModel); final encoded = jsonEncode({"token": newToken, "model": newModel}); SharedPrefs().setValue(key, encoded); } @override void clear() { super.clear(); SharedPrefs().remove(key); } } ================================================ FILE: lib/modules/cloud/presetEncoder.dart ================================================ class PresetEncoder { //The algorithm is super simple, but works better than any of the //standard algorithms like zlib,bzip etc... //the data is always 7 bit and quite often has long run of zeros //therefore I replace the run of zeros with a byte wiht highest bit set //and the run length. Even if there's just one zero, the run-lenght of it //doesn't take more space. For MPPro presets this achieves ~50% recduction static List encode(List data) { List out = []; int zeroRle = 0; for (var i = 0; i < data.length; i++) { if (data[i] != 0) { out.add(data[i]); } else { zeroRle++; if (i == data.length - 1 || data[i + 1] != 0) { //end of zero run var rle = 0x80 | zeroRle; out.add(rle); zeroRle = 0; } } } print( "${data.length} vs ${out.length} R:${out.length / data.length * 100}"); return out; } static List decode(List data) { List decode = []; //decompress for (var i = 0; i < data.length; i++) { if (data[i] & 0x80 != 0) { int len = data[i] & 0x7f; for (var j = 0; j < len; j++) { decode.add(0); } } else { decode.add(data[i]); } } return decode; } } ================================================ FILE: lib/modules/tempo_trainer.dart ================================================ import 'dart:async'; import 'package:mighty_plug_manager/bluetooth/NuxDeviceControl.dart'; import 'package:mighty_plug_manager/platform/simpleSharedPrefs.dart'; import '../UI/widgets/thickRangeSlider.dart'; import '../bluetooth/devices/NuxDevice.dart'; enum TempoChangeMode { beat, time } class TempoTrainer { static final TempoTrainer _tempoTrainer = TempoTrainer._(); TempoTrainer._() { _loadConfig(); } NuxDevice get _device => NuxDeviceControl.instance().device; factory TempoTrainer.instance() { return _tempoTrainer; } Timer? _timer; SliderRangeValues tempoRange = SliderRangeValues(80, 200); int tempoStep = 5; TempoChangeMode changeMode = TempoChangeMode.beat; //this how much beats or seconds to the next change int changeUnits = 8; bool _enable = false; DateTime _expiryTime = DateTime.now(); double _durationMs = 0; bool get enable => _enable; set enable(enable) { _enable = enable; _device.setDrumsEnabled(enable); NuxDeviceControl.instance().forceNotifyListeners(); if (enable) { _startTrainer(); } else { _timer?.cancel(); } } void _startTrainer() { //reset tempo from beginning and setup timer _device.setDrumsTempo(tempoRange.start, true); _setupTimer(); } void _setupTimer() { //setup for the next iteration of the trainer _durationMs = changeMode == TempoChangeMode.beat ? ((59.9 / _device.drumsTempo) * changeUnits.toDouble()) * 1000 : changeUnits.toDouble() * 1000; _expiryTime = DateTime.now().add(Duration(milliseconds: _durationMs.round())); _timer = Timer(Duration(milliseconds: _durationMs.round()), _onTimerStep); } double getTimerCountdown() { if (!_enable) return 0; return _expiryTime.difference(DateTime.now()).inMilliseconds / _durationMs; } void _onTimerStep() { //increment to the next tempo value var tempo = _device.drumsTempo; tempo += tempoStep; if (tempo > tempoRange.end) tempo = tempoRange.end; _device.setDrumsTempo(tempo, true); NuxDeviceControl.instance().forceNotifyListeners(); _setupTimer(); } void _loadConfig() { tempoRange.start = SharedPrefs().getValue(SettingsKeys.tempoTrainerTempoMin, 80.0); tempoRange.end = SharedPrefs() .getValue(SettingsKeys.tempoTrainerTempoMax, 200.0) as double; tempoStep = SharedPrefs().getInt(SettingsKeys.tempoTrainerStep, 5); changeMode = TempoChangeMode .values[SharedPrefs().getInt(SettingsKeys.tempoTrainerChangeMode, 0)]; changeUnits = SharedPrefs().getInt(SettingsKeys.tempoTrainerChangeUnits, 5); } void saveConfig() { SharedPrefs().setValue(SettingsKeys.tempoTrainerTempoMin, tempoRange.start); SharedPrefs().setValue(SettingsKeys.tempoTrainerTempoMax, tempoRange.end); SharedPrefs().setInt(SettingsKeys.tempoTrainerStep, tempoStep); SharedPrefs().setInt(SettingsKeys.tempoTrainerChangeMode, changeMode.index); SharedPrefs().setInt(SettingsKeys.tempoTrainerChangeUnits, changeUnits); } } ================================================ FILE: lib/platform/fileSaver.dart ================================================ import 'package:flutter/services.dart'; Future saveFileString(String mime, String name, String data) async { const platform = MethodChannel("com.msvcode.filesaver/files"); //unique channel identifier try { final result = await platform.invokeMethod("saveFile", { "mime": mime, "name": name, "data": data, "byteArray": false }); //name in native code return result; } on PlatformException { return Future.error("Error saving file"); } } Future saveFile(String mime, String name, List data) async { const platform = MethodChannel("com.msvcode.filesaver/files"); //unique channel identifier try { final result = await platform.invokeMethod("saveFile", { "mime": mime, "name": name, "data": data, "byteArray": true }); //name in native code return result; } on PlatformException { return Future.error("Error saving file"); } } Future openFileString(String mime) async { const platform = MethodChannel("com.msvcode.filesaver/files"); //unique channel identifier try { final result = await platform.invokeMethod( "openFile", {"mime": mime, "byte_array": false}); //name in native code return result; } on PlatformException { //fails native call //handle error return Future.error("Can't open text file"); } } Future> openFile(String mime) async { const platform = MethodChannel("com.msvcode.filesaver/files"); //unique channel identifier try { final result = await platform.invokeMethod( "openFile", {"mime": mime, "byte_array": true}); //name in native code return result; } on PlatformException { //fails native call //handle error return Future.error("Can't open byte array file"); } } ================================================ FILE: lib/platform/platformUtils.dart ================================================ import "dart:io" as io; import 'package:flutter/foundation.dart'; import 'package:path_provider/path_provider.dart'; class PlatformUtils { static get isMobile { return !kIsWeb && (io.Platform.isAndroid || io.Platform.isIOS); } static get isWeb => kIsWeb; static get isAndroid => !kIsWeb && io.Platform.isAndroid; static get isIOS => !kIsWeb && io.Platform.isIOS; static get isWindows => !kIsWeb && io.Platform.isWindows; static get isLinux => !kIsWeb && io.Platform.isLinux; static Future getAppDataDirectory() async { if (PlatformUtils.isAndroid) { return getExternalStorageDirectory(); } else if (PlatformUtils.isIOS) { return getApplicationDocumentsDirectory(); } return Future.error("getAppDataDirectory(): Platform not supported"); } } ================================================ FILE: lib/platform/presetStorageListener.dart ================================================ abstract class PresetStorageListener { void onPresetCreated(Map preset); void onPresetUpdated(Map preset); void onPresetDeleted(String uuid); void onCategoryReordered(int from, int to); } ================================================ FILE: lib/platform/presetsStorage.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:io'; import 'package:mighty_plug_manager/bluetooth/devices/NuxMightyPlugAir.dart'; import 'package:path/path.dart' as path; import 'package:uuid/uuid.dart'; import '../../../platform/platformUtils.dart'; import 'presetStorageListener.dart'; enum PresetChangeDirection { previous, next } class PresetsStorage extends ChangeNotifier { static final PresetsStorage _storage = PresetsStorage._(); static const presetsFile = "presets.json"; static const presetsVersion = 2; static const presetsSingle = "preset-single"; static const presetsMultiple = "preset-multiple"; //Preset JSON keys static const inactiveEffectsKey = "inactiveEffects"; static const uuidKey = "uuid"; final Uuid uuid = const Uuid(); factory PresetsStorage() { return _storage; } String presetsPath = ""; Directory? storageDirectory; File? _presetsFile; bool _presetsReady = false; final List _changeListeners = []; List presetsData = []; List _categoriesCache = []; PresetsStorage._(); Future init() async { _categoriesCache = []; await _getDirectory(); await _loadPresets(); } _getDirectory() async { try { storageDirectory = await PlatformUtils.getAppDataDirectory(); if (storageDirectory != null) { presetsPath = path.join(storageDirectory!.path, presetsFile); _presetsFile = File(presetsPath); } } catch (_) {} } _loadPresets() async { try { if (_presetsFile != null) { var _presetJson = await _presetsFile!.readAsString(); var data = json.decode(_presetJson); if (data is List) { debugPrint("Old preset format"); //fix any old compatibility issues for (int i = 0; i < data.length; i++) { data[i] = fixPresetCompatibility(data[i]); } data = _convertOldToNewFormat(data); presetsData = data["Categories"]; _savePresets(); } else { presetsData = data["Categories"]; if (data["Version"] < presetsVersion) { upgradeDataVersion(data["Version"]); _savePresets(); } } _buildCategoryCache(); _presetsReady = true; } } catch (e) { _presetsReady = true; } } _savePresets() async { _buildCategoryCache(); Map file = _createFileOuterObject(presetsData); String jsonData = json.encode(file); await _presetsFile!.writeAsString(jsonData); notifyListeners(); } _createFileOuterObject(List data) { Map file = {"Version": presetsVersion, "Categories": data}; return file; } Future waitLoading() async { for (int i = 0; i < 20; i++) { if (_presetsReady) break; await Future.delayed(const Duration(milliseconds: 200)); } } List getCategories() { return _categoriesCache; } _buildCategoryCache() { _categoriesCache.clear(); for (var element in presetsData) { _categoriesCache.add(element["name"]); } } Map? _findCategory(String category) { for (Map cat in presetsData) { if (cat["name"] == category) return cat; } return null; } bool presetExists(String name, String category) => findPreset(name, category) != null; Map? findPreset(String name, String category) { var cat = _findCategory(category); return findPresetInCategory(name, cat); } Map? findPresetInCategory( String name, Map? category) { if (category != null) { for (Map preset in category["presets"]) { if (preset["name"] == name) return preset; } } return null; } dynamic findPresetByUuid(String uuid) { for (var cat in presetsData) { for (var preset in cat["presets"]) { if (preset[uuidKey] == uuid) return preset; } } return null; } dynamic findAdjacentPreset( String uuid, bool acrossCategories, PresetChangeDirection direction) { int catsCount = presetsData.length; int catIndex = 0; if (uuid.isEmpty) { return _getAdjacentPreset(0, -1, direction, acrossCategories); } for (catIndex = 0; catIndex < catsCount; catIndex++) { int pIndex = 0; var cat = presetsData[catIndex]; var presets = cat["presets"]; int pCount = presets.length; for (pIndex = 0; pIndex < pCount; pIndex++) { if (presets[pIndex]?["uuid"] == uuid) { return _getAdjacentPreset( catIndex, pIndex, direction, acrossCategories); } } } return _getAdjacentPreset(0, -1, direction, acrossCategories); } Map? findCategoryOfPreset(Map preset) { for (var cat in presetsData) { for (var pr in cat["presets"]) { if (pr[uuidKey] == preset[uuidKey]) return cat; } } return null; } Map _findOrCreateCategory(String name) { var category = _findCategory(name); if (category == null) { category = {"name": name, "uuid": uuid.v4(), "presets": []}; presetsData.add(category); } return category; } String savePreset( Map preset, String name, String categoryName) { preset["name"] = name; String uuid; bool newPreset = false; var category = _findOrCreateCategory(categoryName); var data = findPresetInCategory(name, category); if (data != null) { uuid = data[uuidKey]; data.clear(); //overwrite preset for (var key in preset.keys) { if (key != uuidKey) data[key] = preset[key]; } data[uuidKey] = uuid; } else { _addUuid(preset); category["presets"].add(preset); uuid = preset[uuidKey]; newPreset = true; } if (newPreset) { _presetCreated(preset); } else { _presetUpdated(preset); } _savePresets(); return uuid; } Future deletePreset(Map preset) { var cat = findCategoryOfPreset(preset); if (cat != null) { _presetDeleted(preset["uuid"]); (cat["presets"] as List).remove(preset); return _savePresets(); } return Future.error("Preset not found"); } Future duplicatePreset(String category, String name) { var cat = _findCategory(category); if (cat != null) { List presets = cat["presets"]; for (int i = 0; i < presets.length; i++) { if (presets[i]["name"] == name) { var clone = json.decode(json.encode(presets[i])); //get new uuid _addUuid(clone); String? lName = _findFreeName(name, category); if (lName != null) { clone["name"] = lName; cat["presets"].insert(i + 1, clone); return _savePresets(); } } } } return Future.error("Can't clone preset"); } Future renamePreset(Map preset, String newName) { preset["name"] = newName; _presetUpdated(preset); return _savePresets(); } void reorderCategories(int oldListIndex, int newListIndex) { var movedList = presetsData.removeAt(oldListIndex); presetsData.insert(newListIndex, movedList); _categoryReordered(oldListIndex, newListIndex); _savePresets(); } bool reorderPresets( int oldItemIndex, int oldListIndex, int newItemIndex, int newListIndex) { var preset = presetsData[oldListIndex]["presets"][oldItemIndex]; var newCatName = presetsData[newListIndex]; //if preset with the same name exists, avoid reordering if (oldListIndex != newListIndex && findPresetInCategory(preset["name"], newCatName) != null) { return false; } var movedItem = presetsData[oldListIndex]["presets"].removeAt(oldItemIndex); presetsData[newListIndex]["presets"].insert(newItemIndex, movedItem); _savePresets(); return true; } clearNewFlag(Map preset) { if (preset.containsKey("new")) { preset.remove("new"); _savePresets(); } } Future changeChannel(Map preset, int channel) { preset["channel"] = channel; return _savePresets(); } Future changePresetCategory( String category, String name, String newCategory) { var cat1 = _findCategory(category); var cat2 = _findCategory(newCategory); if (cat1 != null && cat2 != null) { var p = findPresetInCategory(name, cat1); if (p != null) { (cat1["presets"] as List).remove(p); (cat2["presets"] as List).add(p); return _savePresets(); } } return Future.error("Preset not found"); } Future> deleteCategory(String category) async { var cat = _findCategory(category); if (cat != null) { List uuids = []; List presets = cat["presets"]; for (var p in presets) { uuids.add(p[uuidKey]); } presetsData.remove(cat); for (var uuid in uuids) { _presetDeleted(uuid); } await _savePresets(); return uuids; } return Future.error("Category not found"); } Future renameCategory(String category, String newName) { var cat = _findCategory(category); if (cat != null) { cat["name"] = newName; return _savePresets(); } return Future.error("Category not found"); } String? presetToJson(String category, String name) { var finalData = {}; var p = findPreset(name, category); if (p != null) { var copy = json.decode(json.encode(p)); finalData["type"] = presetsSingle; copy["category"] = category; finalData["data"] = copy; return json.encode(finalData); } return null; } //converts a category to json //if parameter left empty, then the full preset list is converted String? presetsToJson([String? category]) { //TODO: These presets don't have the category key List presets = []; if (category == null || category.isEmpty) { for (var cat in presetsData) { for (var p in cat["presets"]) { var copy = json.decode(json.encode(p)); copy["category"] = cat["name"]; presets.add(copy); } } } else { for (var p in _findCategory(category)?["presets"]) { var copy = json.decode(json.encode(p)); copy["category"] = category; presets.add(copy); } } if (presets.isNotEmpty) { var finalData = {}; finalData["type"] = presetsMultiple; finalData["data"] = presets; return json.encode(finalData); } return null; } Future presetsFromJson(String jsonData) async { try { Map data = json.decode(jsonData); if (!data.containsKey("type")) return Future.error("Wrong File"); if (data["type"] == presetsSingle) { //single preset Map pr = data["data"]; bool loaded = await _presetFromJson(pr["category"], pr["name"], pr); return loaded ? 1 : 0; } else if (data["type"] == presetsMultiple) { int count = 0; //this is array of presets List pr = data["data"]; for (Map item in pr) { bool loaded = await _presetFromJson(item["category"], item["name"], item); if (loaded) count++; } return count; } } on FormatException { return Future.error("Wrong File"); } return 0; } Future _presetFromJson( String category, String name, Map presetData) async { var p = findPreset(name, category); presetData = fixPresetCompatibility(presetData); presetData.remove("category"); String? _name = name; //check if exists if (p != null) { if (_presetsEquivalent(presetData, p)) return false; //difference - find free name and save as that _name = _findFreeName(name, category); } //highlight that the preset is new presetData["new"] = true; //save preset if (_name != null) savePreset(presetData, _name, category); return true; } dynamic _getAdjacentPreset(int catIndex, int pIndex, PresetChangeDirection direction, bool acrossCategory) { if (presetsData.length <= catIndex) return null; var catLength = presetsData[catIndex]["presets"].length; if (direction == PresetChangeDirection.previous) { pIndex--; } else { pIndex++; } if (pIndex < 0) { if (!acrossCategory) { pIndex = catLength - 1; } else { do { catIndex--; if (catIndex < 0) { catIndex = presetsData.length - 1; } } while (presetsData[catIndex]["presets"].length == 0); pIndex = presetsData[catIndex]["presets"].length - 1; } } else if (pIndex >= catLength) { if (!acrossCategory) { pIndex = 0; } else { do { catIndex++; if (catIndex >= presetsData.length) { catIndex = 0; } } while (presetsData[catIndex]["presets"].length == 0); pIndex = 0; } } return presetsData[catIndex]["presets"][pIndex]; } String? _findFreeName(String name, String category) { for (int i = 1; i < 1000; i++) { RegExp regex = RegExp(r"\((\d+)\)$"); String newName = ""; RegExpMatch? match = regex.firstMatch(name); if (match != null) { //already has a number in the name String? numStr = match.group(1); if (numStr != null) { int? num = int.tryParse(numStr); if (num != null) { num++; newName = name.replaceFirst(regex, "($num)"); name = newName; } } } if (newName == "") { newName = "$name ($i)"; } if (findPreset(newName, category) == null) return newName; } return null; } bool _presetsEquivalent(Map p1, Map p2) { for (String k in p1.keys) { if (k == "uuid") continue; if (k == "inactiveEffects") continue; if (!p2.containsKey(k)) return false; //check sub-maps if (p1[k] is Map && p2[k] is Map) { bool equal = _presetsEquivalent(p1[k], p2[k]); if (equal == false) return false; continue; } if (p1[k] != p2[k]) return false; } return true; } Map fixPresetCompatibility(Map presetData) { //old style preset didn't contain mighty plug if (!presetData.containsKey("product_id")) { presetData["product_id"] = NuxMightyPlug.defaultNuxId; } if (!presetData.containsKey(uuidKey)) { _addUuid(presetData); } return presetData; } void upgradeDataVersion(int version) { if (version < 2) { //add guids to categories for (Map cat in presetsData) { if (!cat.containsKey("uuid")) { cat["uuid"] = uuid.v4(); } } } } List _getPresetsInCategoryOldFormat( List oldPresets, String category) { List presets = []; for (int i = 0; i < oldPresets.length; i++) { if (oldPresets[i]["category"] == category) presets.add(oldPresets[i]); } return presets; } Map _convertOldToNewFormat(List oldFormat) { _buildCategoryCache(); //build categories list List categoriesList = []; for (var element in oldFormat) { if (!categoriesList.contains(element["category"])) { categoriesList.add(element["category"]); } } List> categories = []; for (var cat in categoriesList) { Map category = {}; category["name"] = cat; var presets = _getPresetsInCategoryOldFormat(oldFormat, cat); for (Map preset in presets) { preset.remove("category"); } category["presets"] = presets; categories.add(category); } Map file = _createFileOuterObject(categories); return file; } void _addUuid(Map preset) { bool unique = true; do { String id = uuid.v4(); // check unique for (var cat in presetsData) { for (var p in cat["presets"]) { if (p[uuidKey] == id) unique = false; } } preset[uuidKey] = id; } while (unique == false); } void registerPresetStorageListener(PresetStorageListener listener) { _changeListeners.add(listener); } void _presetCreated(Map preset) { for (var listener in _changeListeners) { listener.onPresetCreated(preset); } } void _presetUpdated(Map preset) { for (var listener in _changeListeners) { listener.onPresetUpdated(preset); } } void _presetDeleted(String uuid) { for (var listener in _changeListeners) { listener.onPresetDeleted(uuid); } } void _categoryReordered(int from, int to) { for (var listener in _changeListeners) { listener.onCategoryReordered(from, to); } } } ================================================ FILE: lib/platform/simpleSharedPrefs.dart ================================================ // (c) 2020-2021 Dian Iliev (Tuntorius) // This code is licensed under MIT license (see LICENSE.md for details) import 'dart:convert'; import 'dart:io'; import 'package:path/path.dart' as path; import 'package:wakelock_plus/wakelock_plus.dart'; import 'platformUtils.dart'; class SettingsKeys { static const String latency = "audioLatency"; static const String screenAlwaysOn = "screenAlwaysOn"; static const String timeUnit = "timeUnit"; static const String changeCabs = "changeCabs"; static const String device = "device"; static const String deviceVersion = "deviceVersion"; static const String masterVolume = "volume"; static const String customCabinets = "customCabinets"; static const String legacyDecoder = "legacyDecoder"; static const String hiddenSources = "hiddenSources"; static const String hideNotApplicablePresets = "hideNotApplicablePresets"; static const String tempoTrainerTempoMin = "trainerTempoMin"; static const String tempoTrainerTempoMax = "trainerTempoMax"; static const String tempoTrainerStep = "trainerStep"; static const String tempoTrainerChangeMode = "trainerChangeMode"; static const String tempoTrainerChangeUnits = "trainerChangeUnits"; static const String trackGain = "jamTracksGain"; } class SharedPrefs { static final SharedPrefs _storage = SharedPrefs._(); static const prefsFile = "prefs.json"; factory SharedPrefs() { return _storage; } String prefsPath = ""; Directory? storageDirectory; File? _prefsFile; bool _prefsReady = false; Map _prefsData = {}; SharedPrefs._() { _init(); } _init() async { await _getDirectory(); await _loadPrefs(); bool value = getValue(SettingsKeys.screenAlwaysOn, false); WakelockPlus.toggle(enable: value); } _getDirectory() async { storageDirectory = await PlatformUtils.getAppDataDirectory(); if (storageDirectory != null) { prefsPath = path.join(storageDirectory!.path, prefsFile); _prefsFile = File(prefsPath); } } _loadPrefs() async { try { if (_prefsFile != null) { var _presetJson = await _prefsFile!.readAsString(); _prefsData = json.decode(_presetJson); _prefsReady = true; } } catch (e) { _prefsReady = true; // //no file // print("Presets file not available"); } } Future waitLoading() async { for (int i = 0; i < 20; i++) { if (_prefsReady) break; await Future.delayed(const Duration(milliseconds: 200)); } } _savePrefs() async { if (_prefsFile != null) { String _json = json.encode(_prefsData); await _prefsFile?.writeAsString(_json); } } void setInt(String key, int value) { _prefsData[key] = value; _savePrefs(); } int getInt(String key, int _default) { if (_prefsData.containsKey(key)) return _prefsData[key]; return _default; } void setValue(String key, dynamic value) { _prefsData[key] = value; _savePrefs(); } void remove(String key) { _prefsData.remove(key); _savePrefs(); } dynamic getValue(String key, dynamic _default) { if (_prefsData.containsKey(key)) return _prefsData[key]; return _default; } String? getCustomCabinetName(String productId, int cabIndex) { return _prefsData[SettingsKeys.customCabinets]?[productId] ?[cabIndex.toString()]; } setCustomCabinetName(String productId, int cabIndex, String name) { if (!_prefsData.containsKey(SettingsKeys.customCabinets)) { _prefsData[SettingsKeys.customCabinets] = >{}; } if (!_prefsData[SettingsKeys.customCabinets].containsKey(productId)) { _prefsData[SettingsKeys.customCabinets][productId] = {}; } _prefsData[SettingsKeys.customCabinets][productId][cabIndex.toString()] = name; _savePrefs(); } } ================================================ FILE: lib/utilities/DelayTapTimer.dart ================================================ class DelayTapTimer { DelayTapTimer._(); static const _timeout = 1800; static const _maxSamples = 20; static List timeArray = []; static addClickTime() { var now = DateTime.now(); if (timeArray.isNotEmpty && now.difference(timeArray.last).inMilliseconds > _timeout) { timeArray.clear(); } timeArray.add(now); while (timeArray.length > _maxSamples) { timeArray.removeAt(0); } } static calculate() { if (timeArray.length < 2) return false; int sum = 0; //get the sum of all differences and calculate average for (int i = 0; i < timeArray.length - 1; i++) { sum += timeArray[i + 1].difference(timeArray[i]).inMilliseconds; } return sum / (timeArray.length - 1); } static calculateBpm() { var result = calculate(); if (result != false) result = 60 / (result / 1000); return result; } } ================================================ FILE: lib/utilities/MathEx.dart ================================================ class MathEx { static double map( double x, double inMin, double inMax, double outMin, double outMax) { return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } } ================================================ FILE: lib/utilities/list_extenstions.dart ================================================ extension ListStringExtension on List { bool containsPartial(String partialString) { for (var str in this) { if (partialString.contains(str)) { return true; } } return false; } } ================================================ FILE: lib/utilities/string_extensions.dart ================================================ extension StringExtensions on String { bool containsIgnoreCase(String secondString) => toLowerCase().contains(secondString.toLowerCase()); } ================================================ FILE: linux/.gitignore ================================================ flutter/ephemeral ================================================ FILE: linux/CMakeLists.txt ================================================ # Project-level configuration. cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "mighty_plug_manager") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.tuntori.mighty_plug_manager") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) # Load bundled libraries from the lib/ directory relative to the binary. set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() # Define build configuration options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction() # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") # Define the application target. To change its name, change BINARY_NAME above, # not the value here, or `flutter run` will no longer work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) # Add dependency libraries. Add any application-specific dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of # the default top-level location. set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ================================================ FILE: linux/flutter/CMakeLists.txt ================================================ # This file controls Flutter-level build steps. It should not be edited. cmake_minimum_required(VERSION 3.10) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") # Configuration provided via flutter tool. include(${EPHEMERAL_DIR}/generated_config.cmake) # TODO: Move the rest of this into files in ephemeral. See # https://github.com/flutter/flutter/issues/57146. # Serves the same purpose as list(TRANSFORM ... PREPEND ...), # which isn't available in 3.10. function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() # === Flutter Library === # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) add_dependencies(flutter flutter_assemble) # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/_phony_ COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ================================================ FILE: linux/flutter/generated_plugin_registrant.cc ================================================ // // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } ================================================ FILE: linux/flutter/generated_plugin_registrant.h ================================================ // // Generated file. Do not edit. // // clang-format off #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ #include // Registers Flutter plugins. void fl_register_plugins(FlPluginRegistry* registry); #endif // GENERATED_PLUGIN_REGISTRANT_ ================================================ FILE: linux/flutter/generated_plugins.cmake ================================================ # # Generated file, do not edit. # list(APPEND FLUTTER_PLUGIN_LIST url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST ) set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) endforeach(ffi_plugin) ================================================ FILE: linux/main.cc ================================================ #include "my_application.h" int main(int argc, char** argv) { g_autoptr(MyApplication) app = my_application_new(); return g_application_run(G_APPLICATION(app), argc, argv); } ================================================ FILE: linux/my_application.cc ================================================ #include "my_application.h" #include #ifdef GDK_WINDOWING_X11 #include #endif #include "flutter/generated_plugin_registrant.h" struct _MyApplication { GtkApplication parent_instance; char** dart_entrypoint_arguments; }; G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); // Use a header bar when running in GNOME as this is the common style used // by applications and is the setup most users will be using (e.g. Ubuntu // desktop). // If running on X and not using GNOME then just use a traditional title bar // in case the window manager does more exotic layout, e.g. tiling. // If running on Wayland assume the header bar will work (may need changing // if future cases occur). gboolean use_header_bar = TRUE; #ifdef GDK_WINDOWING_X11 GdkScreen* screen = gtk_window_get_screen(window); if (GDK_IS_X11_SCREEN(screen)) { const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); if (g_strcmp0(wm_name, "GNOME Shell") != 0) { use_header_bar = FALSE; } } #endif if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); gtk_header_bar_set_title(header_bar, "mighty_plug_manager"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { gtk_window_set_title(window, "mighty_plug_manager"); } gtk_window_set_default_size(window, 1280, 720); gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { g_warning("Failed to register: %s", error->message); *exit_status = 1; return TRUE; } g_application_activate(application); *exit_status = 0; return TRUE; } // Implements GObject::dispose. static void my_application_dispose(GObject* object) { MyApplication* self = MY_APPLICATION(object); g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); G_OBJECT_CLASS(my_application_parent_class)->dispose(object); } static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, nullptr)); } ================================================ FILE: linux/my_application.h ================================================ #ifndef FLUTTER_MY_APPLICATION_H_ #define FLUTTER_MY_APPLICATION_H_ #include G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, GtkApplication) /** * my_application_new: * * Creates a new Flutter-based application. * * Returns: a new #MyApplication. */ MyApplication* my_application_new(); #endif // FLUTTER_MY_APPLICATION_H_ ================================================ FILE: mightieramp.code-workspace ================================================ { "folders": [ { "path": "." } ], "settings": {} } ================================================ FILE: plugins/audio_picker/.gitignore ================================================ .DS_Store .dart_tool/ .packages .pub/ build/ ================================================ FILE: plugins/audio_picker/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled and should not be manually edited. version: revision: cc949a8e8b9cf394b9290a8e80f87af3e207dce5 channel: stable project_type: plugin ================================================ FILE: plugins/audio_picker/CHANGELOG.md ================================================ ## [1.0.0] - 2019-10-27 * Initial Release ================================================ FILE: plugins/audio_picker/LICENSE ================================================ MIT License Copyright (c) 2017 ChiragShenoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: plugins/audio_picker/README.md ================================================ # audio_picker A Flutter plugin for Android and iOS to pick local Audio files. This supports choosing Audio files from the Music App in iOS, and from the File Explorer in Android. ## Introduction This plugin opens a picker to get the absolute path of Audio files from your phone. If you ever wanted to play songs in your app, or upload audio files to your server, this plugin helps you get the **absolute path** of the audio file that you select. ## Android Add the following line in your AndroidManifest.xml ## iOS Add the following line in your Info.plist NSAppleMusicUsageDescription Explain why your app uses music In the case of iOS, it exports the audio file that you choose from the Music App. ## Usage var path = await AudioPicker.pickAudio(); That's it ! You now have the absolute path of the audio file that you selected. Note : In the case of iOS, since we are retrieving the file from the Music App, the export operation may take a few seconds to complete. Hence it's advisable to show a loading indicator to the user while the `await` call executes. Also note that DRM protected files won't return a path, and instead will return `null` as the path. ## Upcoming features - * Retrieve metadata of the audio file (Name, Duration, etc) * Multiselect audio files * Filter based on file extension Pull Requests and feature requests are welcome ! ## LICENSE ``` MIT License Copyright (c) 2017 ChiragShenoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ================================================ FILE: plugins/audio_picker/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures ================================================ FILE: plugins/audio_picker/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java ================================================ package io.flutter.plugins; import io.flutter.plugin.common.PluginRegistry; import com.audio_picker.audio_picker.AudioPickerPlugin; /** * Generated file. Do not edit. */ public final class GeneratedPluginRegistrant { public static void registerWith(PluginRegistry registry) { if (alreadyRegisteredWith(registry)) { return; } AudioPickerPlugin.registerWith(registry.registrarFor("com.audio_picker.audio_picker.AudioPickerPlugin")); } private static boolean alreadyRegisteredWith(PluginRegistry registry) { final String key = GeneratedPluginRegistrant.class.getCanonicalName(); if (registry.hasPlugin(key)) { return true; } registry.registrarFor(key); return false; } } ================================================ FILE: plugins/audio_picker/android/build.gradle ================================================ group 'com.audio_picker.audio_picker' version '1.0-SNAPSHOT' buildscript { ext.kotlin_version = '1.6.10' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } rootProject.allprojects { repositories { google() jcenter() } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { compileSdkVersion 31 namespace 'com.audio_picker.audio_picker' kotlinOptions { jvmTarget = "17" } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 16 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.core:core-ktx:1.1.0' } ================================================ FILE: plugins/audio_picker/android/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip ================================================ FILE: plugins/audio_picker/android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M org.gradle.java.home=C:/AndroidSDK/jdk-17.0.9 android.enableR8=true ================================================ FILE: plugins/audio_picker/android/gradlew ================================================ #!/usr/bin/env bash ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn ( ) { echo "$*" } die ( ) { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; esac # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { JVM_OPTS=("$@") } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" ================================================ FILE: plugins/audio_picker/android/gradlew.bat ================================================ @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windowz variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: plugins/audio_picker/android/settings.gradle ================================================ rootProject.name = 'audio_picker' ================================================ FILE: plugins/audio_picker/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/audio_picker/android/src/main/java/com/audio_picker/audio_picker/FileUtils.java ================================================ package com.audio_picker.audio_picker; import android.annotation.SuppressLint; import android.content.ContentUris; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Environment; import android.provider.DocumentsContract; import android.provider.MediaStore; import android.provider.OpenableColumns; import android.text.TextUtils; import android.util.Log; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.util.List; public class FileUtils { private static Uri contentUri = null; @SuppressLint("NewApi") public static String getPath(final Context context, final Uri uri) { // check here to KITKAT or new version final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; String selection = null; String[] selectionArgs = null; // DocumentProvider if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { Log.i("MIGHTIER", "Document provider"); // ExternalStorageProvider if (isExternalStorageDocument(uri)) { Log.i("MIGHTIER", "ExternalStorageProvider"); final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); final String type = split[0]; Log.i("MIGHTIER", docId); String fullPath = getPathFromExtSD(split); if (fullPath != "") { return fullPath; } else { return null; } } // DownloadsProvider else if (isDownloadsDocument(uri)) { Log.i("MIGHTIER", "DownloadsProvider"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { final String id; Cursor cursor = null; try { cursor = context.getContentResolver().query(uri, new String[]{MediaStore.MediaColumns.DISPLAY_NAME}, null, null, null); if (cursor != null && cursor.moveToFirst()) { String fileName = cursor.getString(0); String path = Environment.getExternalStorageDirectory().toString() + "/Download/" + fileName; if (!TextUtils.isEmpty(path)) { return path; } } } finally { if (cursor != null) cursor.close(); } id = DocumentsContract.getDocumentId(uri); if (!TextUtils.isEmpty(id)) { if (id.startsWith("raw:")) { return id.replaceFirst("raw:", ""); } String[] contentUriPrefixesToTry = new String[]{ "content://downloads/public_downloads", "content://downloads/my_downloads" }; for (String contentUriPrefix : contentUriPrefixesToTry) { try { final Uri contentUri = ContentUris.withAppendedId(Uri.parse(contentUriPrefix), Long.valueOf(id)); return getDataColumn(context, contentUri, null, null); } catch (NumberFormatException e) { //In Android 8 and Android P the id is not a number return uri.getPath().replaceFirst("^/document/raw:", "").replaceFirst("^raw:", ""); } } } } else { final String id = DocumentsContract.getDocumentId(uri); final boolean isOreo = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; if (id.startsWith("raw:")) { return id.replaceFirst("raw:", ""); } try { contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); } catch (NumberFormatException e) { e.printStackTrace(); } if (contentUri != null) { return getDataColumn(context, contentUri, null, null); } } } // MediaProvider else if (isMediaDocument(uri)) { Log.i("MIGHTIER", "MediaProvider"); return uri.toString(); /*final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); final String type = split[0]; Uri contentUri = null; if ("image".equals(type)) { contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; } else if ("video".equals(type)) { contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; } else if ("audio".equals(type)) { contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; } selection = "_id=?"; selectionArgs = new String[]{split[1]}; return getDataColumn(context, contentUri, selection, selectionArgs);*/ } else if (isGoogleDriveUri(uri)) { Log.i("MIGHTIER", "GoogleDrive"); return getDriveFilePath(uri, context); } } // MediaStore (and general) else if ("content".equalsIgnoreCase(uri.getScheme())) { Log.i("MIGHTIER", "MediaStore provider"); if (isGooglePhotosUri(uri)) { return uri.getLastPathSegment(); } if (isGoogleDriveUri(uri)) { return getDriveFilePath(uri, context); } if( Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { // return getFilePathFromURI(context,uri); return getMediaFilePathForN(uri, context); // return getRealPathFromURI(context,uri); }else { return getDataColumn(context, uri, null, null); } } // File else if ("file".equalsIgnoreCase(uri.getScheme())) { return uri.getPath(); } return null; } private static boolean fileExists(String filePath) { File file = new File(filePath); return file.exists(); } private static String getPathFromExtSD(String[] pathData) { final String type = pathData[0]; final String relativePath = "/" + pathData[1]; String fullPath = ""; Log.i("MIGHTIER", "External:" + Environment.getExternalStorageDirectory() ); // on my Sony devices (4.4.4 & 5.1.1), `type` is a dynamic string // something like "71F8-2C0A", some kind of unique id per storage // don't know any API that can get the root path of that storage based on its id. // // so no "primary" type, but let the check here for other devices //if ("primary".equalsIgnoreCase(type)) { fullPath = Environment.getExternalStorageDirectory() + relativePath; Log.i("MIGHTIER", "Primary:" + fullPath); if (fileExists(fullPath)) { return fullPath; } //} // Environment.isExternalStorageRemovable() is `true` for external and internal storage // so we cannot relay on it. // // instead, for each possible path, check if file exists // we'll start with secondary storage as this could be our (physically) removable sd card fullPath = System.getenv("SECONDARY_STORAGE") + relativePath; Log.i("MIGHTIER", "SECONDARY_STORAGE:" + fullPath); if (fileExists(fullPath)) { return fullPath; } fullPath = System.getenv("EXTERNAL_STORAGE") + relativePath; Log.i("MIGHTIER", "EXTERNAL_STORAGE:" + fullPath); if (fileExists(fullPath)) { return fullPath; } fullPath = type + relativePath; Log.i("MIGHTIER", "Typed:" + fullPath); if (fileExists(fullPath)) { return fullPath; } fullPath = "/storage/" + type + relativePath; Log.i("MIGHTIER", "storage Typed:" + fullPath); if (fileExists(fullPath)) { return fullPath; } Log.i("MIGHTIER", "NONE:" + fullPath); return relativePath; } private static String getDriveFilePath(Uri uri, Context context) { Uri returnUri = uri; Cursor returnCursor = context.getContentResolver().query(returnUri, null, null, null, null); int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); int sizeIndex = returnCursor.getColumnIndex(OpenableColumns.SIZE); returnCursor.moveToFirst(); String name = (returnCursor.getString(nameIndex)); String size = (Long.toString(returnCursor.getLong(sizeIndex))); File file = new File(context.getCacheDir(), name); try { InputStream inputStream = context.getContentResolver().openInputStream(uri); FileOutputStream outputStream = new FileOutputStream(file); int read = 0; int maxBufferSize = 1 * 1024 * 1024; int bytesAvailable = inputStream.available(); //int bufferSize = 1024; int bufferSize = Math.min(bytesAvailable, maxBufferSize); final byte[] buffers = new byte[bufferSize]; while ((read = inputStream.read(buffers)) != -1) { outputStream.write(buffers, 0, read); } Log.e("File Size", "Size " + file.length()); inputStream.close(); outputStream.close(); Log.e("File Path", "Path " + file.getPath()); Log.e("File Size", "Size " + file.length()); } catch (Exception e) { Log.e("Exception", e.getMessage()); } return file.getPath(); } private static String getMediaFilePathForN(Uri uri, Context context) { Uri returnUri = uri; Cursor returnCursor = context.getContentResolver().query(returnUri, null, null, null, null); int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); int sizeIndex = returnCursor.getColumnIndex(OpenableColumns.SIZE); returnCursor.moveToFirst(); String name = (returnCursor.getString(nameIndex)); String size = (Long.toString(returnCursor.getLong(sizeIndex))); File file = new File(context.getFilesDir(), name); try { InputStream inputStream = context.getContentResolver().openInputStream(uri); FileOutputStream outputStream = new FileOutputStream(file); int read = 0; int maxBufferSize = 1 * 1024 * 1024; int bytesAvailable = inputStream.available(); //int bufferSize = 1024; int bufferSize = Math.min(bytesAvailable, maxBufferSize); final byte[] buffers = new byte[bufferSize]; while ((read = inputStream.read(buffers)) != -1) { outputStream.write(buffers, 0, read); } Log.e("File Size", "Size " + file.length()); inputStream.close(); outputStream.close(); Log.e("File Path", "Path " + file.getPath()); Log.e("File Size", "Size " + file.length()); } catch (Exception e) { Log.e("Exception", e.getMessage()); } return file.getPath(); } private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { Cursor cursor = null; final String column = "_data"; final String[] projection = {column}; try { cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); if (cursor != null && cursor.moveToFirst()) { final int index = cursor.getColumnIndexOrThrow(column); return cursor.getString(index); } } finally { if (cursor != null) cursor.close(); } return null; } private static boolean isExternalStorageDocument(Uri uri) { return "com.android.externalstorage.documents".equals(uri.getAuthority()); } private static boolean isDownloadsDocument(Uri uri) { return "com.android.providers.downloads.documents".equals(uri.getAuthority()); } private static boolean isMediaDocument(Uri uri) { return "com.android.providers.media.documents".equals(uri.getAuthority()); } private static boolean isGooglePhotosUri(Uri uri) { return "com.google.android.apps.photos.content".equals(uri.getAuthority()); } private static boolean isGoogleDriveUri(Uri uri) { return "com.google.android.apps.docs.storage".equals(uri.getAuthority()) || "com.google.android.apps.docs.storage.legacy".equals(uri.getAuthority()); } } ================================================ FILE: plugins/audio_picker/android/src/main/kotlin/com/audio_picker/audio_picker/AudioPickerPlugin.kt ================================================ package com.audio_picker.audio_picker import android.Manifest.permission.READ_EXTERNAL_STORAGE import android.app.Activity import android.content.Context import android.content.Intent import android.net.Uri import android.os.Environment import android.util.Log import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.activity.ActivityAware import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result import android.provider.MediaStore import android.media.MediaMetadataRetriever import java.io.File.separator class AudioPickerPlugin: FlutterPlugin, MethodCallHandler, ActivityAware { private lateinit var channel: MethodChannel private var activity: Activity? = null private var context: Context? = null companion object { private const val CHANNEL_NAME = "audio_picker" private const val REQUEST_CODE = 0x2324 private const val TAG = "AudioPicker" private var pendingResult: Result? = null } override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { channel = MethodChannel(binding.binaryMessenger, CHANNEL_NAME) channel.setMethodCallHandler(this) context = binding.applicationContext } override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { channel.setMethodCallHandler(null) context = null } override fun onAttachedToActivity(binding: ActivityPluginBinding) { activity = binding.activity binding.addActivityResultListener { requestCode, resultCode, data -> handleActivityResult(requestCode, resultCode, data) } } override fun onDetachedFromActivity() { activity = null } override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { onAttachedToActivity(binding) } override fun onDetachedFromActivityForConfigChanges() { onDetachedFromActivity() } override fun onMethodCall(call: MethodCall, result: Result) { when (call.method) { "pick_audio" -> { pendingResult = result openAudioPicker(false) } "pick_audio_multiple" -> { pendingResult = result openAudioPicker(true) } "get_metadata" -> { pendingResult = result val uriString = call.argument("uri") val uri = Uri.parse(uriString) context?.let { getAudioMetadata(uri, it) } } else -> result.notImplemented() } } private fun openAudioPicker(multiple: Boolean) { val intent = Intent(Intent.ACTION_GET_CONTENT).apply { val uri = Uri.parse(Environment.getExternalStorageDirectory().path + separator) setDataAndType(uri, "audio/*") type = "audio/*" addCategory(Intent.CATEGORY_OPENABLE) if (multiple) { putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true) } } activity?.let { if (intent.resolveActivity(it.packageManager) != null) { it.startActivityForResult(intent, REQUEST_CODE) } else { Log.e(TAG, "Can't find a valid activity to handle the request. Make sure you've a file explorer installed.") pendingResult?.error(TAG, "Can't handle the provided file type.", null) } } ?: run { pendingResult?.error(TAG, "Activity is not available", null) } } private fun getAudioMetadata(uri: Uri, context: Context) { val metadataRetriever = MediaMetadataRetriever() val metadataMap = HashMap() try { metadataRetriever.setDataSource(context, uri) metadataMap["title"] = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE) metadataMap["artist"] = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST) } catch (e: Exception) { Log.e(TAG, "Error retrieving audio metadata: ${e.message}") e.printStackTrace() } finally { metadataRetriever.release() pendingResult?.success(metadataMap) } } private fun handleActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean { if (requestCode != REQUEST_CODE) return false when (resultCode) { Activity.RESULT_OK -> { Thread { when { data?.data != null -> handleSingleFile(data.data!!) data?.clipData != null -> handleMultipleFiles(data) else -> runOnUiThread("Unknown activity error, please file an issue.", false) } }.start() } Activity.RESULT_CANCELED -> { pendingResult?.success(null) } else -> { pendingResult?.error(TAG, "Unknown activity error, please file an issue.", null) } } return true } private fun handleSingleFile(uri: Uri) { val fullPath = context?.let { FileUtils.getPath(it, uri) } if (fullPath != null) { Log.i(TAG, "Absolute file path: $fullPath") runOnUiThread(fullPath, true) } else { runOnUiThread("Failed to retrieve path.", false) } } private fun handleMultipleFiles(data: Intent) { val list = ArrayList() for (i in 0 until data.clipData!!.itemCount) { val uri = data.clipData!!.getItemAt(i).uri context?.let { FileUtils.getPath(it, uri) }?.let { list.add(it) } } runOnUiThread(list, true) } private fun runOnUiThread(result: Any, success: Boolean) { activity?.runOnUiThread { if (success) { pendingResult?.success(result) } else { pendingResult?.error(TAG, result as String, null) } } } } ================================================ FILE: plugins/audio_picker/ios/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig /Flutter/flutter_export_environment.sh ================================================ FILE: plugins/audio_picker/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/audio_picker/ios/Classes/AudioPickerPlugin.h ================================================ #import @interface AudioPickerPlugin : NSObject @end ================================================ FILE: plugins/audio_picker/ios/Classes/AudioPickerPlugin.m ================================================ #import "AudioPickerPlugin.h" #import @implementation AudioPickerPlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftAudioPickerPlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/audio_picker/ios/Classes/SwiftAudioPickerPlugin.swift ================================================ import Flutter import UIKit import AVFoundation import MediaPlayer public class SwiftAudioPickerPlugin: NSObject, FlutterPlugin, MPMediaPickerControllerDelegate, UIDocumentPickerDelegate { let bookmarkPrefix = "iosbm://" var _viewController : UIViewController? var _audioPickerController : MPMediaPickerController? var _flutterResult : FlutterResult? var _channel : FlutterMethodChannel? public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "audio_picker", binaryMessenger: registrar.messenger()) let viewController = UIApplication.shared.delegate?.window??.rootViewController let instance = SwiftAudioPickerPlugin(viewController: viewController) instance._channel = channel registrar.addMethodCallDelegate(instance, channel: channel) } init(viewController: UIViewController?) { super.init() self._viewController = viewController } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { if(call.method == "pick_audio"){ _flutterResult = result openAudioPicker(multiple:false) } if(call.method == "pick_audio_multiple") { _flutterResult = result openAudioPicker(multiple:true) } if(call.method == "pick_audio_file"){ _flutterResult = result openFilePicker(multiple:false) } if(call.method == "pick_audio_file_multiple"){ _flutterResult = result openFilePicker(multiple:true) } if (call.method=="pick_audio_bookmark_to_url") { _flutterResult = result; if let args = call.arguments as? [String: Any], let bookmark = args["bookmark"] as? String { bookmarkToUrl(from: bookmark) } else { result(FlutterError(code: "invalid_argument", message: "Invalid arguments", details: nil)) } } if (call.method=="pick_audio_release_security_scope") { if let args = call.arguments as? [String: Any], let url = args["url"] as? String { releaseUrlSecurityScopedAccess(from: url) result(true) } else { result(FlutterError(code: "invalid_argument", message: "Invalid arguments", details: nil)) } } if (call.method=="get_metadata") { if let args = call.arguments as? [String: Any], let assetUrl = args["assetUrl"] as? String { let metadata = getArtistAndTitle(from: assetUrl) result(metadata) } else { result(FlutterError(code: "invalid_argument", message: "Invalid arguments", details: nil)) } } } enum ExportError: Error { case unableToCreateExporter } public func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) { mediaPicker.dismiss(animated: true, completion: nil) let count = mediaItemCollection.count; if (count == 1) { let mediaItem = mediaItemCollection.items.first if (mediaItem?.assetURL != nil) { self._flutterResult?(mediaItem?.assetURL?.absoluteString) } } else { var uniquePaths = Set() for item in mediaItemCollection.items { if let path = item.assetURL?.absoluteString { uniquePaths.insert(path) } } let pathList = Array(uniquePaths) self._flutterResult?(pathList) } } public func mediaPickerDidCancel(_ mediaPicker: MPMediaPickerController) { _flutterResult?(nil) _flutterResult = nil mediaPicker.dismiss(animated: true, completion: nil) } func openAudioPicker(multiple: Bool) { _audioPickerController = MPMediaPickerController.self(mediaTypes:MPMediaType.music) _audioPickerController?.delegate = self _audioPickerController?.showsCloudItems = true _audioPickerController?.showsItemsWithProtectedAssets = false _audioPickerController?.allowsPickingMultipleItems = multiple _audioPickerController?.modalPresentationStyle = UIModalPresentationStyle.currentContext _viewController?.present(_audioPickerController!, animated: true, completion: nil) } func openFilePicker(multiple: Bool) { // Present the UIDocumentPickerViewController let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.audio"], in: .open) documentPicker.delegate = self documentPicker.allowsMultipleSelection = multiple documentPicker.modalPresentationStyle = .formSheet _viewController?.present(documentPicker, animated: true, completion: nil) } public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { var bookmarkURLs: [String] = [] for url in urls { do { // Start accessing the security-scoped resource if url.startAccessingSecurityScopedResource() { // Create a bookmark data for the URL let bookmarkData = try url.bookmarkData(options: [], includingResourceValuesForKeys: nil, relativeTo: nil) // Convert the bookmark data to a base64 encoded string let bookmarkString = bookmarkPrefix + bookmarkData.base64EncodedString() // Append the bookmark string to the array bookmarkURLs.append(bookmarkString) // Stop accessing the security-scoped resource url.stopAccessingSecurityScopedResource() } else { // Handle the case where access to the security-scoped resource is denied // You can choose to skip this URL or handle the error accordingly } } catch { // Handle error print(error.localizedDescription) } } self._flutterResult?(bookmarkURLs) } func getArtistAndTitle(from assetUrl: String) -> [String: String] { if assetUrl.hasPrefix("iosbm://") { guard let url = getUrlFromBookmark(from: assetUrl) else { return ["artist": "", "title": ""] } if url.startAccessingSecurityScopedResource() { let asset = AVAsset(url: url) let metadata = asset.metadata var artist = "" var title = "" for item in metadata { if let key = item.commonKey?.rawValue, let value = item.value { if key == "title" { title = value as? String ?? "" } else if key == "artist" { artist = value as? String ?? "" } } } url.stopAccessingSecurityScopedResource() if artist.isEmpty, title.isEmpty { //if the track has no metadata - return the filename //cause flutter can't access it and would use the bookmark b64 data let fileName = url.deletingPathExtension().lastPathComponent return ["artist": fileName, "title": ""] } else { return ["artist": artist, "title": title] } } } else { let query = MPMediaQuery.songs() let predicate = MPMediaPropertyPredicate(value: assetUrl, forProperty: MPMediaItemPropertyPersistentID) query.addFilterPredicate(predicate) if let result = query.items?.first { let title = result.title ?? "" let artist = result.artist ?? "" return ["artist": artist, "title": title] } } return ["artist": "", "title": ""] } func getUrlFromBookmark(from bookmarkB64: String) -> URL? { var bookmarkString = bookmarkB64 bookmarkString = bookmarkString.replacingOccurrences(of: bookmarkPrefix, with: "") if let bookmarkData = Data(base64Encoded: bookmarkString) { do { var isStale = false let url = try URL(resolvingBookmarkData: bookmarkData, options: [], relativeTo: nil, bookmarkDataIsStale: &isStale) if isStale { print("it's stale - update it") let newBookmark = try url.bookmarkData(options: [], includingResourceValuesForKeys: nil, relativeTo: nil) let newBookmarkString = bookmarkPrefix + newBookmark.base64EncodedString() _channel?.invokeMethod("updateBookmark", arguments: [bookmarkB64, newBookmarkString]) } return url } catch { print(error.localizedDescription) } } return nil } func bookmarkToUrl(from bookmarkString: String) { guard let url = getUrlFromBookmark(from: bookmarkString) else { return } if url.startAccessingSecurityScopedResource() { print("Obtaining a security scoped access for URL: \(url.absoluteString)") self._flutterResult?(url.absoluteString) //url.stopAccessingSecurityScopedResource() } } func releaseUrlSecurityScopedAccess(from urlString: String) { guard let url = URL(string: urlString) else { print("Invalid URL string") return } url.stopAccessingSecurityScopedResource() print("Released security scoped access for URL: \(urlString)") } } ================================================ FILE: plugins/audio_picker/ios/audio_picker.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'audio_picker' s.version = '0.0.1' s.summary = 'A new Flutter project.' s.description = <<-DESC A new Flutter project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.ios.deployment_target = '8.0' end ================================================ FILE: plugins/audio_picker/lib/audio_picker.dart ================================================ import 'dart:async'; import 'dart:io'; import 'package:flutter/services.dart'; typedef StaleBookmarkCallback = void Function(String old, String updated); class AudioPicker { static const MethodChannel _channel = MethodChannel('audio_picker'); static AudioPicker? _instance; StaleBookmarkCallback? _onStaleBookmark; factory AudioPicker() { _instance ??= AudioPicker._(); return _instance!; } AudioPicker._() { // Attach handlers to the platform channel here _channel.setMethodCallHandler((call) async { // Check if the method name is updateBookmark if (call.method == "updateBookmark") { // Get the old and new bookmark data from the arguments var oldBookmark = call.arguments[0] as String; var newBookmark = call.arguments[1] as String; _onStaleBookmark?.call(oldBookmark, newBookmark); } }); } void regusterOnStaleBookmark(StaleBookmarkCallback callback) { _onStaleBookmark = callback; } Future pickAudio() async { final String absolutePath = await _channel.invokeMethod('pick_audio'); return absolutePath; } Future> pickAudioMultiple() async { final absolutePath = await _channel.invokeMethod('pick_audio_multiple'); if (absolutePath is String) return [absolutePath]; if (absolutePath != null) return List.from(absolutePath); return []; } Future> pickAudioFiles() async { final absolutePath = await _channel.invokeMethod('pick_audio_file_multiple'); if (absolutePath != null) return List.from(absolutePath); return absolutePath; } Future iosBookmarkToUrl(String bookmark) async { var url = await _channel .invokeMethod('pick_audio_bookmark_to_url', {'bookmark': bookmark}); return url; } void iosReleaseSecurityScope(String url) { _channel.invokeMethod('pick_audio_release_security_scope', {'url': url}); } Future> getMetadata(String assetUrl) async { if (Platform.isIOS) { if (assetUrl.contains("ipod-library://")) { String url = assetUrl; Uri uri = Uri.parse(url); assetUrl = uri.queryParameters["id"] ?? assetUrl; } final result = await _channel.invokeMethod('get_metadata', {'assetUrl': assetUrl}); return Map.from(result); } else if (Platform.isAndroid) { final result = await _channel.invokeMethod('get_metadata', {'uri': assetUrl}); return Map.from(result); } return Future.error("Unsupported platform"); } } ================================================ FILE: plugins/audio_picker/pubspec.yaml ================================================ name: audio_picker description: This plugin helps open a picker to get the absolute path of Audio files from your phone. If you ever wanted to play songs in your app, or upload audio files to your server, this plugin helps you get the absolute path of the audio file that you select. version: 1.0.0 homepage: https://github.com/chiragshenoy/audio_picker environment: sdk: ">=2.12.0 <3.0.0" dependencies: flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter flutter: plugin: androidPackage: com.audio_picker.audio_picker pluginClass: AudioPickerPlugin ================================================ FILE: plugins/audio_waveform/.gitignore ================================================ # General build/ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ # IntelliJ related *.iml *.ipr *.iws .idea/ # Visual Studio Code related .project .classpath .settings/ .vscode/ # Flutter/Dart/Pub related **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ coverage/ pubspec.lock # Web related generated_plugin_registrant.dart # Android related **/gradle-wrapper.jar .gradle captures/ gradlew gradlew.bat local.properties **/GeneratedPluginRegistrant.java # Android Studio will place build artifacts here **/android/app/debug **/android/app/profile **/android/app/release # Symbolication related app.*.symbols # Obfuscation related app.*.map.json # iOS/macOS/XCode related *.mode1v3 *.mode2v3 *.moved-aside *.pbxuser *.perspectivev3 *sync/ .sconsign.dblite .tags* .vagrant/ DerivedData/ **/ios/**/Icon? Pods/ .symlinks/ profile xcuserdata .generated/ **/Flutter/App.framework **/Flutter/Flutter.podspec **/Flutter/Flutter.framework **/Flutter/Generated.xcconfig **/Flutter/ephemeral **/Flutter/app.flx **/Flutter/app.zip **/Flutter/flutter_assets/ **/Flutter/flutter_export_environment.sh ServiceDefinitions.json GeneratedPluginRegistrant.* # Exceptions !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 ================================================ FILE: plugins/audio_waveform/README.md ================================================ # just_waveform This plugin extracts waveform data from an audio file that can be used to render waveform visualisations. waveform screenshot ## Usage ```dart final progressStream = AudiotWaveform.extract( audioInFile: '/path/to/audio.mp3', zoom: const WaveformZoom.pixelsPerSecond(100), ); progressStream.listen((waveformProgress) { print('Progress: %${(100 * waveformProgress.progress).toInt()}'); if (waveformProgress.waveform != null) { // Use the waveform. } }); ``` ================================================ FILE: plugins/audio_waveform/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures ================================================ FILE: plugins/audio_waveform/android/build.gradle ================================================ group 'com.tuntori.audio_waveform' version '1.0' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:4.1.0' } } rootProject.allprojects { repositories { google() mavenCentral() } } apply plugin: 'com.android.library' android { namespace 'com.tuntori.audio_waveform' compileSdkVersion 31 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 16 } } ================================================ FILE: plugins/audio_waveform/android/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip ================================================ FILE: plugins/audio_waveform/android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true ================================================ FILE: plugins/audio_waveform/android/settings.gradle ================================================ rootProject.name = 'audio_waveform' ================================================ FILE: plugins/audio_waveform/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/audio_waveform/android/src/main/java/com/tuntori/audio_waveform/AudioWaveformPlugin.java ================================================ package com.tuntori.audio_waveform; import androidx.annotation.NonNull; import android.content.Context; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import android.os.Handler; import java.util.List; /** AudioWaveformPlugin */ public class AudioWaveformPlugin implements FlutterPlugin, MethodCallHandler { private MethodChannel channel; private Context context; private WaveformExtractor decoder = new WaveformExtractor(); @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { context = flutterPluginBinding.getApplicationContext(); channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "com.tuntori.audio_waveform"); channel.setMethodCallHandler(this); } @Override public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) { switch (call.method) { case "open": String audioInPath = call.argument("path"); boolean legacy = call.argument("legacy"); decoder.open(audioInPath, context, legacy); result.success(null); break; case "next": if (decoder != null) { byte[] buffer = decoder.readShortData(); result.success(buffer); } else { result.error("decoder_unavailable", "you must open a file first", null); } break; case "close": if (decoder != null) { decoder.release(); } result.success(null); break; case "duration": if (decoder != null) { long dur = decoder.getDuration(); result.success(dur); } else { result.error("decoder_unavailable", "you must open a file first", null); } break; case "sampleRate": if (decoder != null) { int sr = decoder.getSampleRate(); result.success(sr); } else { result.error("decoder_unavailable", "you must open a file first", null); } break; default: result.notImplemented(); break; } } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { if (decoder != null) { decoder.release(); } channel.setMethodCallHandler(null); channel = null; context = null; } } ================================================ FILE: plugins/audio_waveform/android/src/main/java/com/tuntori/audio_waveform/SimpleEncoder.java ================================================ package com.tuntori.audio_waveform; //https://imnotyourson.com/enhance-poor-performance-of-decoding-audio-with-mediaextractor-and-mediacodec-to-pcm/ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.ShortBuffer; import java.util.Arrays; import java.util.LinkedList; import android.content.Context; import android.content.res.AssetFileDescriptor; import android.media.MediaCodec; import android.media.MediaExtractor; import android.media.MediaFormat; import android.net.Uri; import android.util.Log; public class SimpleEncoder { private Boolean VERBOSE = false; private String TAG = "SimpleEncoder"; private int DECODE_INPUT_SIZE = 524288; // 524288 Bytes = 0.5 MB private int BUFFER_OVERFLOW_SAFE_GATE = 5000; // Analog audio is recorded by sampling it 44,100 times per second, and then these samples are used to reconstruct the audio signal when playing it back. // ref:https://en.wikipedia.org/wiki/44,100_Hz#Related_rates public static final int DEFAULT_SAMPLE_RATE = 44100; private ProgressListener mProgressListener = null; // Member variables representing frame data private int mFileSize; private int mSampleRate; private int mChannels; private long mDuration; private int mNumSamples; // total number of samples per channel in audio file private ByteBuffer mDecodedBytes; // Raw audio data private byte[] mDecodedData; // shared buffer with mDecodedBytes. // mDecodedSamples has the following format: // {s1c1, s1c2, ..., s1cM, s2c1, ..., s2cM, ..., sNc1, ..., sNcM} // where sicj is the ith sample of the jth channel (a sample is a signed short) // M is the number of channels (e.g. 2 for stereo) and N is the number of samples per channel. private MediaCodec mAudioDecoder = null; private MediaFormat mDecoderOutputAudioFormat = null; private boolean mAudioExtractorDone = false; private boolean mAudioInputBufferEOF = false; private boolean mAudioDecoderDone = false; private MediaExtractor mAudioExtractor = null; private int mAudioExtractedFrameCount = 0; private int mAudioDecodedFrameCount = 0; private int mAudioExtractedTotalSize = 0; private int decodedSamplesSize = 0; // size of the output buffer containing decoded samples. private byte[] decodedSamples = null; private int sampleStep = 1; private LinkedList mPendingAudioDecoderOutputBufferIndices; private LinkedList mPendingAudioDecoderOutputBufferInfos; // Progress listener interface. public interface ProgressListener { // // Will be called by the SoundFile class periodically // with values between 0.0 and 1.0. Return true to continue // loading the file or recording the audio, and false to cancel or stop recording. /// boolean reportProgress(double fractionComplete); } // Custom exception for invalid inputs. public class InvalidInputException extends Exception { public InvalidInputException(String message) { super(message); } } // Create and return a SimpleEncoder object using the file fileName. public static SimpleEncoder create(String fileName, Context context, ProgressListener progressListener) throws FileNotFoundException, java.io.IOException, InvalidInputException { SimpleEncoder simpleEncoder = new SimpleEncoder(); simpleEncoder.setProgressListener(progressListener); simpleEncoder.ReadFile(fileName, context); return simpleEncoder; } public int getFileSizeBytes() { return mFileSize; } public int getSampleRate() { return mSampleRate; } public int getChannels() { return mChannels; } public long getDuration() { return mDuration; } public int getNumSamples() { return mNumSamples; // Number of samples per channel. } public byte[] getSamples() { return mDecodedData; } private SimpleEncoder() { } private void setProgressListener(ProgressListener progressListener) { mProgressListener = progressListener; } private void logState() { if (VERBOSE) { Log.d(TAG, String.format( "loop: " + "{" + "extracted:%d(done:%b) " + "decoded:%d(done:%b) ", mAudioExtractedFrameCount, mAudioExtractorDone, mAudioDecodedFrameCount, mAudioDecoderDone )); } } private void decodeAudio() { if (mPendingAudioDecoderOutputBufferIndices.size() == 0) { return; } int decoderIndex = mPendingAudioDecoderOutputBufferIndices.poll(); MediaCodec.BufferInfo info = mPendingAudioDecoderOutputBufferInfos.poll(); int size = info.size; long presentationTime = info.presentationTimeUs; if (VERBOSE) { Log.d(TAG, "audio decoder: processing pending buffer: " + decoderIndex); Log.d(TAG, "audio decoder: pending buffer of size " + size); Log.d(TAG, "audio decoder: pending buffer for time " + presentationTime); } if (size >= 0) { ByteBuffer decoderOutputBuffer = mAudioDecoder.getOutputBuffer(decoderIndex).duplicate(); if (decodedSamplesSize < info.size) { decodedSamplesSize = info.size; decodedSamples = new byte[decodedSamplesSize]; } decoderOutputBuffer.get(decodedSamples, 0, info.size); mAudioDecoder.releaseOutputBuffer(decoderIndex, false); // Check if buffer is big enough. Resize it if it's too small. if (mDecodedBytes.remaining() < info.size) { // Getting a rough estimate of the total size, allocate 20% more, and // make sure to allocate at least 5MB more than the initial size. int position = mDecodedBytes.position(); int newSize = (int) ((position * (1.0 * mFileSize / mAudioExtractedTotalSize)) * 1.2); if (newSize - position < info.size + 5 * (1 << 20)) { newSize = position + info.size + 5 * (1 << 20); } ByteBuffer newDecodedBytes = null; // Try to allocate memory. If we are OOM, try to run the garbage collector. int retry = 10; while (retry > 0) { try { newDecodedBytes = ByteBuffer.allocate(newSize); break; } catch (OutOfMemoryError oome) { // setting android:largeHeap="true" in seem to help not // reaching this section. retry--; } } if (retry == 0) { // Failed to allocate memory... Stop reading more data and finalize the // instance with the data decoded so far. Log.e(TAG, "Failed to allocate memory... Stop reading more data"); } //ByteBuffer newDecodedBytes = ByteBuffer.allocate(newSize); mDecodedBytes.rewind(); newDecodedBytes.put(mDecodedBytes); mDecodedBytes = newDecodedBytes; mDecodedBytes.position(position); } mDecodedBytes.put(decodedSamples, 0, info.size); } if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { Log.d(TAG, "audio decoder: EOS"); synchronized (this) { mAudioDecoderDone = true; notifyAll(); } } logState(); } // // Creates a decoder for the given format. // // @param inputFormat the format of the stream to decode // private MediaCodec createAudioDecoder(MediaFormat inputFormat) throws IOException { inputFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, DECODE_INPUT_SIZE); // huge throughput MediaCodec decoder = MediaCodec.createDecoderByType(inputFormat.getString(MediaFormat.KEY_MIME)); decoder.setCallback(new MediaCodec.Callback() { public void onError(MediaCodec codec, MediaCodec.CodecException exception) { Log.e(TAG, exception.toString()); } public void onOutputFormatChanged(MediaCodec codec, MediaFormat format) { mDecoderOutputAudioFormat = codec.getOutputFormat(); if (VERBOSE) { Log.d(TAG, "audio decoder: output format changed: " + mDecoderOutputAudioFormat); } } public void onInputBufferAvailable(MediaCodec codec, int index) { ByteBuffer decoderInputBuffer = codec.getInputBuffer(index); while (!mAudioExtractorDone && !mAudioInputBufferEOF) { int bufferChunkSize = 0; long presentationTime = 0; while (true) { ByteBuffer tempBuffer = ByteBuffer.allocate(1 << 10); int size = mAudioExtractor.readSampleData(tempBuffer, 0); if (size > 0) { bufferChunkSize += size; decoderInputBuffer.put(tempBuffer); mAudioExtractedTotalSize += size; presentationTime += mAudioExtractor.getSampleTime(); if (VERBOSE) { Log.d(TAG, "audio extractor: returned buffer of size " + size); Log.d(TAG, "audio extractor: returned buffer for time " + presentationTime); } } mAudioExtractorDone = !mAudioExtractor.advance() && size == -1; mAudioExtractedFrameCount++; if (bufferChunkSize > (DECODE_INPUT_SIZE - BUFFER_OVERFLOW_SAFE_GATE) || size == -1 || mAudioDecoderDone) { break; } } if (bufferChunkSize >= 0) { codec.queueInputBuffer( index, 0, bufferChunkSize, presentationTime, mAudioExtractor.getSampleFlags()); } else if (mAudioExtractorDone) { if (VERBOSE) { Log.d(TAG, "audio extractor: EOS"); } codec.queueInputBuffer( index, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM); } if (mProgressListener != null) { if (!mProgressListener.reportProgress((float) (mAudioExtractedTotalSize) / mFileSize)) { // We are asked to stop reading the file. Returning immediately. The // SoundFile object is invalid and should NOT be used afterward! synchronized (this) { mAudioDecoderDone = true; notifyAll(); } } } logState(); if (bufferChunkSize >= 0) break; } } public void onOutputBufferAvailable(MediaCodec codec, int index, MediaCodec.BufferInfo info) { if (VERBOSE) { Log.d(TAG, "audio decoder: returned output buffer: " + index); } if (VERBOSE) { Log.d(TAG, "audio decoder: returned buffer of size " + info.size); } if ((info.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) { if (VERBOSE) { Log.d(TAG, "audio decoder: codec config buffer"); } codec.releaseOutputBuffer(index, false); return; } if (VERBOSE) { Log.d(TAG, "audio decoder: returned buffer for time " + info.presentationTimeUs); } mPendingAudioDecoderOutputBufferIndices.add(index); mPendingAudioDecoderOutputBufferInfos.add(info); mAudioDecodedFrameCount++; logState(); decodeAudio(); } }); decoder.configure(inputFormat, null, null, 0); decoder.start(); int duration = (int)Math.round(getDuration() / 1000000.0); sampleStep = Math.max(duration / 10, 1); return decoder; } private void ReadFile(String inputFile, Context context) throws FileNotFoundException, java.io.IOException, InvalidInputException { mAudioExtractor = new MediaExtractor(); MediaFormat format = null; int i; Uri uri = Uri.parse(inputFile); //AssetFileDescriptor fileDescriptor = context.getContentResolver().openAssetFileDescriptor(uri , "r"); mFileSize = 4000000;//(int)fileDescriptor.getLength(); mAudioExtractor.setDataSource(context, uri, null); int numTracks = mAudioExtractor.getTrackCount(); // find and select the first audio track present in the file. for (i = 0; i < numTracks; i++) { format = mAudioExtractor.getTrackFormat(i); if (format.getString(MediaFormat.KEY_MIME).startsWith("audio/")) { mAudioExtractor.selectTrack(i); break; } } if (i == numTracks) { throw new InvalidInputException("No audio track found in " + inputFile); } mChannels = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT); mSampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE); mDuration = format.getLong(MediaFormat.KEY_DURATION); // Set the size of the decoded samples buffer to 1MB (~6sec of a stereo stream at 44.1kHz). // For longer streams, the buffer size will be increased later on, calculating a rough // estimate of the total size needed to store all the samples in order to resize the buffer // only once. mDecodedBytes = ByteBuffer.allocate(1 << 20); Log.i(TAG, "start decoding"); mPendingAudioDecoderOutputBufferIndices = new LinkedList(); mPendingAudioDecoderOutputBufferInfos = new LinkedList(); mAudioDecoder = createAudioDecoder(format); synchronized (this) { while (!mAudioDecoderDone) { try { wait(); } catch (InterruptedException ie) { } } } Log.i(TAG, "all set"); mNumSamples = mDecodedBytes.position() / (mChannels * 2); // One sample = 2 bytes. mDecodedBytes.rewind(); mDecodedBytes.order(ByteOrder.LITTLE_ENDIAN); mDecodedData = simplifyData(mDecodedBytes, mDecodedBytes.remaining()); mAudioExtractor.release(); mAudioExtractor = null; mAudioDecoder.stop(); mAudioDecoder.release(); mAudioDecoder = null; Log.i(TAG, "all done"); } public byte[] simplifyData(ByteBuffer buffer, int size) { int cursor = 0; byte[] samples = new byte[size / (4 * sampleStep)]; int pos = 0; for (int i = 0; i < size; i++) { if (cursor % (sampleStep * 4) == 1) { byte val = (byte) Math.abs(buffer.get(i)); // do a rudimentary dynamic range expansion if (val < 30) { val = (byte) Math.round(val * 0.2); } if (val > 40) { val = (byte) Math.round(val * 1.5); } if (pos < samples.length) { samples[pos++] = val; } } cursor++; } return samples; } } ================================================ FILE: plugins/audio_waveform/android/src/main/java/com/tuntori/audio_waveform/WaveformExtractor.java ================================================ /* WaveformExtractor Author: Andrew Stubbs (based on some examples from the docs) This class opens a file, reads the first audio channel it finds, and returns raw audio data. Usage: WaveformExtractor decoder = new WaveformExtractor("myfile.m4a"); short[] data; while ((data = decoder.readShortData()) != null) { // process data here } */ //here is a promised faster decoding //https://imnotyourson.com/enhance-poor-performance-of-decoding-audio-with-mediaextractor-and-mediacodec-to-pcm/ package com.tuntori.audio_waveform; import java.io.Console; import java.nio.ByteBuffer; import java.nio.*; import android.media.MediaCodec; import android.media.MediaCodec.BufferInfo; import android.media.MediaExtractor; import android.media.MediaFormat; import android.media.AudioFormat; import android.net.Uri; import android.util.Log; import android.content.Context; public class WaveformExtractor { private static final String TAG = "WaveformExtractor"; private final boolean DEBUG = false; private int DECODE_INPUT_SIZE = 524288; // 524288 Bytes = 0.5 MB private MediaExtractor extractor; private MediaCodec decoder; private MediaFormat inputFormat; private ByteBuffer[] inputBuffers; private boolean end_of_input_file; private ByteBuffer[] outputBuffers; private int outputBufferIndex = -1; private int sampleStep = 1; private boolean isMPEG = false; private boolean useLegacy = false; public WaveformExtractor(){} public void open(String inputFilename, Context context, boolean legacyMode) { useLegacy = legacyMode; extractor = new MediaExtractor(); try { extractor.setDataSource(context, Uri.parse(inputFilename), null); } catch(Exception e) { System.out.println("Extractor.sedDataSource exception"); System.out.println(e); return; } if (DEBUG) System.out.println("Decoding track"); // Select the first audio track we find. int numTracks = extractor.getTrackCount(); System.out.println("tracks " + numTracks); for (int i = 0; i < numTracks; ++i) { MediaFormat format = extractor.getTrackFormat(i); String mime = format.getString(MediaFormat.KEY_MIME); System.out.println("mime " + mime); if (mime.startsWith("audio/")) { isMPEG = mime.endsWith("mpeg"); extractor.selectTrack(i); try { decoder = MediaCodec.createDecoderByType(mime); } catch(Exception e) { System.out.println("Extractor.selectTrack exception"); System.out.println(e); return; } decoder.configure(format, null, null, 0); /* when adding encoder, use these settings format.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 1); format.setInteger(MediaFormat.KEY_SAMPLE_RATE, 8000); format.setInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_8BIT); decoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);*/ format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, DECODE_INPUT_SIZE); // huge throughput inputFormat = format; break; } } if (decoder == null) { throw new IllegalArgumentException("No decoder for file format"); } decoder.start(); inputBuffers = decoder.getInputBuffers(); outputBuffers = decoder.getOutputBuffers(); end_of_input_file = false; int duration = (int)Math.round(getDuration() / 1000000.0); sampleStep = Math.max(duration / 10, 1); } public void release() { if (decoder!=null) { decoder.stop(); decoder.release(); } extractor.release(); } // Read the raw data from MediaCodec. // The caller should copy the data out of the ByteBuffer before calling this again // or else it may get overwritten. private BufferInfo readData() { if (decoder == null) return null; BufferInfo info = new BufferInfo(); while (true) { // Read data from the file into the codec. if (!end_of_input_file) { int inputBufferIndex = decoder.dequeueInputBuffer(10000); if (inputBufferIndex >= 0) { int bufferChunkSize = 0; long presentationTime = 0; for(int b=0;b<50;b++) { long sSize = extractor.getSampleSize(); if (sSize<0 || inputBuffers[inputBufferIndex].remaining() < sSize) break; ByteBuffer tempBuffer = ByteBuffer.allocate((int)sSize); int size = extractor.readSampleData(tempBuffer, 0); if (size > 0) { bufferChunkSize += size; inputBuffers[inputBufferIndex].put(tempBuffer); presentationTime += extractor.getSampleTime(); } else break; extractor.advance(); } if (bufferChunkSize == 0) { // End Of File decoder.queueInputBuffer(inputBufferIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM); end_of_input_file = true; if (DEBUG) System.out.println("EndOfFile"); } else { decoder.queueInputBuffer(inputBufferIndex, 0, bufferChunkSize, presentationTime, 0); } } } // Read the output from the codec. if (outputBufferIndex >= 0) // Ensure that the data is placed at the start of the buffer outputBuffers[outputBufferIndex].position(0); outputBufferIndex = decoder.dequeueOutputBuffer(info, 10000); if (outputBufferIndex >= 0) { // Handle EOF if (info.flags != 0) { if (DEBUG) System.out.println("EndOfFile Output"); decoder.stop(); decoder.release(); decoder = null; return null; } //release output buffer removed from here! return info; } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { // This usually happens once at the start of the file. if (DEBUG) System.out.println("BuffersChanged"); outputBuffers = decoder.getOutputBuffers(); } } } // Read the raw data from MediaCodec. // The caller should copy the data out of the ByteBuffer before calling this again // or else it may get overwritten. private BufferInfo readDataLegacy() { if (decoder == null) return null; BufferInfo info = new BufferInfo(); for (;;) { // Read data from the file into the codec. if (!end_of_input_file) { int inputBufferIndex = decoder.dequeueInputBuffer(10000); //System.out.println("DequeueInputBuffer"); if (inputBufferIndex >= 0) { int size = extractor.readSampleData(inputBuffers[inputBufferIndex], 0); //System.out.println("readSampleData"); if (size < 0) { // End Of File decoder.queueInputBuffer(inputBufferIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM); end_of_input_file = true; if (DEBUG) System.out.println("EndOfFile"); } else { decoder.queueInputBuffer(inputBufferIndex, 0, size, extractor.getSampleTime(), 0); extractor.advance(); //System.out.println("advance"); } } } // Read the output from the codec. if (outputBufferIndex >= 0) // Ensure that the data is placed at the start of the buffer outputBuffers[outputBufferIndex].position(0); outputBufferIndex = decoder.dequeueOutputBuffer(info, 10000); //System.out.println("dequeueOutputBuffer"); if (outputBufferIndex >= 0) { // Handle EOF if (info.flags != 0) { if (DEBUG) System.out.println("EndOfFile Output"); decoder.stop(); decoder.release(); decoder = null; return null; } //release output buffer removed from here! return info; } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { // This usually happens once at the start of the file. if (DEBUG) System.out.println("BuffersChanged"); outputBuffers = decoder.getOutputBuffers(); } } } private ByteBuffer currentBuffer() { return outputBuffers[outputBufferIndex]; } private void releaseBuffer() { // Release the buffer so MediaCodec can use it again. // The data should stay there until the next time we are called. decoder.releaseOutputBuffer(outputBufferIndex, false); } // Return the Audio sample rate, in samples/sec. public int getSampleRate() { return inputFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE); } public long getDuration() { return inputFormat.getLong(MediaFormat.KEY_DURATION); } // Read the raw audio data in 16-bit format // Returns null on EOF public byte[] readShortData() { BufferInfo info; if (isMPEG && !useLegacy) info = readData(); else info = readDataLegacy(); if (info==null) return null; ByteBuffer data = currentBuffer(); if (data == null) return null; byte[] returnData = null; if (DEBUG) { System.out.println("buffer info " + info.size); System.out.println("buffer stuff " + data.position() + " " + data.capacity()); } if (info.size>0) returnData = simplifyData(data, info.size); else returnData = new byte[0]; releaseBuffer(); return returnData; } public byte[] simplifyData(ByteBuffer buffer, int size) { int cursor = 0; byte[] samples = new byte[size / (4 * sampleStep)]; int pos = 0; for (int i = 0; i < size; i++) { if (cursor % (sampleStep * 4) == 1) { byte val = (byte) Math.abs(buffer.get(i)); // do a rudimentary dynamic range expansion if (val < 30) { val = (byte) Math.round(val * 0.2); } if (val > 40) { val = (byte) Math.round(val * 1.5); } if (pos < samples.length) { samples[pos++] = val; } } cursor++; } return samples; } } ================================================ FILE: plugins/audio_waveform/darwin/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig /Flutter/ephemeral/ /Flutter/flutter_export_environment.sh ================================================ FILE: plugins/audio_waveform/darwin/Classes/AudioWaveformPlugin.m ================================================ #if 0 #import "AudioWaveformPlugin.h" @implementation AudioWaveformPlugin { AudioStreamBasicDescription fileFormat; FlutterMethodChannel *_channel; ExtAudioFileRef audioFileRef; SInt64 expectedSampleCount; OSStatus status; int mSampleRate; int mDuration; } + (void)registerWithRegistrar:(NSObject*)registrar { [[AudioWaveformPlugin alloc] initWithRegistrar:registrar]; } - (instancetype)initWithRegistrar:(NSObject *)registrar { self = [super init]; NSAssert(self, @"super init cannot be nil"); _channel = [FlutterMethodChannel methodChannelWithName:@"com.tuntori.audio_waveform" binaryMessenger:[registrar messenger]]; [registrar addMethodCallDelegate:self channel:_channel]; return self; } - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { NSDictionary *request = (NSDictionary *)call.arguments; if ([@"open" isEqualToString:call.method]) { NSString *audioInPath = (NSString *)request[@"path"]; //open and prepare the audio here //store duration and sample rate UInt32 size; CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)audioInPath, kCFURLPOSIXPathStyle, false); status = ExtAudioFileOpenURL(url, &audioFileRef); if (status != noErr) { NSLog(@"ExtAudioOpenURL error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"ExtAudioOpenURL error" message:@"ExtAudioOpenURL error" details:nil]); }); return; } size = sizeof(fileFormat); status = ExtAudioFileGetProperty(audioFileRef, kExtAudioFileProperty_FileDataFormat, &size, &fileFormat); if (status != noErr) { NSLog(@"ExtAudioFileGetProperty error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"Error reading file format" message:@"Error reading file format" details:nil]); }); return; } expectedSampleCount = 0; size = sizeof(expectedSampleCount); status = ExtAudioFileGetProperty(audioFileRef, kExtAudioFileProperty_FileLengthFrames, &size, &expectedSampleCount); if (status != noErr) { NSLog(@"ExtAudioFileGetProperty error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"Error reading sample count" message:@"Error reading sample count" details:nil]); }); return; } mSampleRate = (int)fileFormat.mSampleRate; mDuration = (int)(expectedSampleCount / fileFormat.mSampleRate); } else if ([@"next" isEqualToString:call.method]) { //just get the next buffer here } else if ([@"close" isEqualToString:call.method]) { } else if ([@"duration" isEqualToString:call.method]) { result([NSNumber numberWithInteger:mDuration]); } else if ([@"sampleRate" isEqualToString:call.method]) { result([NSNumber numberWithInteger:mSampleRate]); } if ([@"extract" isEqualToString:call.method]) { NSString *audioInPath = (NSString *)request[@"audioInPath"]; NSString *waveOutPath = (NSString *)request[@"waveOutPath"]; NSNumber *samplesPerPixelArg = (NSNumber *)request[@"samplesPerPixel"]; NSNumber *pixelsPerSecondArg = (NSNumber *)request[@"pixelsPerSecond"]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ /* OSStatus status; UInt32 size; CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)audioInPath, kCFURLPOSIXPathStyle, false); status = ExtAudioFileOpenURL(url, &audioFileRef); if (status != noErr) { NSLog(@"ExtAudioOpenURL error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"ExtAudioOpenURL error" message:@"ExtAudioOpenURL error" details:nil]); }); return; } AudioStreamBasicDescription fileFormat; size = sizeof(fileFormat); status = ExtAudioFileGetProperty(audioFileRef, kExtAudioFileProperty_FileDataFormat, &size, &fileFormat); if (status != noErr) { NSLog(@"ExtAudioFileGetProperty error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"Error reading file format" message:@"Error reading file format" details:nil]); }); return; } SInt64 expectedSampleCount = 0; size = sizeof(expectedSampleCount); status = ExtAudioFileGetProperty(audioFileRef, kExtAudioFileProperty_FileLengthFrames, &size, &expectedSampleCount); if (status != noErr) { NSLog(@"ExtAudioFileGetProperty error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"Error reading sample count" message:@"Error reading sample count" details:nil]); }); return; } */ //NSLog(@"channel count = %d", fileFormat.mChannelsPerFrame); //NSLog(@"Sample rate = %f", fileFormat.mSampleRate); //NSLog(@"expected sample count = %d", expectedSampleCount); //NSLog(@"frames per packet: %d", fileFormat.mFramesPerPacket); int samplesPerPixel; if (samplesPerPixelArg != (id)[NSNull null]) { samplesPerPixel = [samplesPerPixelArg intValue]; } else { samplesPerPixel = (int)(fileFormat.mSampleRate / [pixelsPerSecondArg intValue]); } // Multiply by 2 since 2 bytes are needed for each short, and multiply by 2 again because for each sample we store a pair of (min,max) UInt32 scaledByteSamplesLength = 2*2*(UInt32)(expectedSampleCount / samplesPerPixel); UInt32 waveLength = (UInt32)(scaledByteSamplesLength / 2); // better name: numPixels? //NSLog(@"wave length = %d", waveLength); int bytesPerChannel = 2; AudioStreamBasicDescription clientFormat; clientFormat.mSampleRate = fileFormat.mSampleRate; clientFormat.mFormatID = kAudioFormatLinearPCM; clientFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger; clientFormat.mBitsPerChannel = bytesPerChannel * 8; clientFormat.mChannelsPerFrame = fileFormat.mChannelsPerFrame; clientFormat.mBytesPerFrame = clientFormat.mChannelsPerFrame * bytesPerChannel; clientFormat.mFramesPerPacket = 1; clientFormat.mBytesPerPacket = clientFormat.mFramesPerPacket * clientFormat.mBytesPerFrame; status = ExtAudioFileSetProperty(self->audioFileRef, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), &clientFormat); if (status != noErr) { NSLog(@"ExtAudioFileSetProperty error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"Error setting client format" message:@"Error setting client format" details:nil]); }); return; } UInt32 packetsPerBuffer = 4096; // samples/frames per buffer UInt32 outputBufferSize = packetsPerBuffer * clientFormat.mBytesPerPacket; AudioBufferList convertedData; convertedData.mNumberBuffers = 1; convertedData.mBuffers[0].mNumberChannels = clientFormat.mChannelsPerFrame; convertedData.mBuffers[0].mDataByteSize = outputBufferSize; // XXX: Do we need to free this on iOS? convertedData.mBuffers[0].mData = (UInt8 *)malloc(sizeof(UInt8 *) * outputBufferSize); UInt32 frameCount = packetsPerBuffer; UInt32 sampleIdx = 0; short minSample = 32767; short maxSample = -32768; int waveHeaderLength = 20; UInt32 waveFileContentLength = waveHeaderLength + sizeof(short *) * waveLength; UInt8 *waveFileContent = (UInt8 *)malloc(waveFileContentLength); UInt32 *waveHeader = (UInt32 *)waveFileContent; short *wave = (short *)(waveFileContent + waveHeaderLength); UInt32 scaledSampleIdx = 0; int progress = 0; while (frameCount > 0) { status = ExtAudioFileRead(self->audioFileRef, &frameCount, &convertedData); if (status != noErr) { NSLog(@"ExtAudioFileRead error: %i", status); dispatch_async(dispatch_get_main_queue(), ^{ result([FlutterError errorWithCode:@"ExtAudioFileRead error" message:@"ExtAudioFileRead error" details:nil]); }); break; } if (frameCount > 0) { AudioBuffer audioBuffer = convertedData.mBuffers[0]; short *samples = (short *)audioBuffer.mData; // Each frame may have two channels making 2*frameCount individual L/R samples. int sampleCount = clientFormat.mChannelsPerFrame * frameCount; for (int i = 0; i < sampleCount; i += clientFormat.mChannelsPerFrame) { long sample = 0; for (int j = 0; j < clientFormat.mChannelsPerFrame; j++) { sample += samples[i+j]; } sample /= clientFormat.mChannelsPerFrame; if (sample < -32768) sample = -32768; if (sample > 32767) sample = 32767; if (sample < minSample) minSample = (short)sample; if (sample > maxSample) maxSample = (short)sample; sampleIdx++; if (sampleIdx % samplesPerPixel == 0) { if (scaledSampleIdx + 1 < waveLength) { wave[scaledSampleIdx++] = minSample; wave[scaledSampleIdx++] = maxSample; int newProgress = (int)(100 * scaledSampleIdx / waveLength); if (newProgress != progress && newProgress <= 100) { progress = newProgress; //TODO: send buffer data here, but it looks like it's not a buffer at all, but //each single value separately //NSLog(@"Progress: %d percent", progress); dispatch_async(dispatch_get_main_queue(), ^{ [self->_channel invokeMethod:@"onProgress" arguments:@(progress)]; }); } //NSLog(@"pixel[%d] %d: %d\t%d", scaledSampleIdx - 2, sampleIdx, minSample, maxSample); minSample = 32767; maxSample = -32768; } } } } } // Set header, compatible with audiowaveform format. waveHeader[0] = 1; // version waveHeader[1] = 0; // flags - 16 bit waveHeader[2] = (UInt32)fileFormat.mSampleRate; waveHeader[3] = samplesPerPixel; waveHeader[4] = (UInt32)(scaledSampleIdx / 2); //for (int i = 0; i < 5; i++) { // NSLog(@"waveHeader[%d] = %d", i, waveHeader[i]); //} NSData *waveData = [NSData dataWithBytesNoCopy:(void *)waveFileContent length:(waveHeaderLength + 2*scaledSampleIdx)]; [waveData writeToFile:waveOutPath atomically:NO]; //NSLog(@"Total scaled samples: %d", scaledSampleIdx); status = ExtAudioFileDispose(self->audioFileRef); dispatch_async(dispatch_get_main_queue(), ^{ result(nil); }); }); } else { result(FlutterMethodNotImplemented); } } @end #endif ================================================ FILE: plugins/audio_waveform/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/audio_waveform/ios/Classes/AudioWaveformPlugin.h ================================================ #import #import #import @interface AudioWaveformPlugin : NSObject @end ================================================ FILE: plugins/audio_waveform/ios/Classes/AudioWaveformPlugin.m ================================================ #import "AudioWaveformPlugin.h" #if __has_include() #import #else // Support project import fallback if the generated compatibility header // is not copied when this plugin is created as a library. // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 #import "audio_waveform-Swift.h" #endif @implementation AudioWaveformPlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftAudioWaveformPlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/audio_waveform/ios/Classes/SwiftWaveformPlugin.swift ================================================ import Flutter import AVFoundation public class SwiftAudioWaveformPlugin: NSObject, FlutterPlugin { private var channel: FlutterMethodChannel? private var waveformExtractor: WaveformExtractor? public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "com.tuntori.audio_waveform", binaryMessenger: registrar.messenger()) let instance = SwiftAudioWaveformPlugin() instance.channel = channel registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { switch call.method { case "open": guard let args = call.arguments as? Dictionary, let path = args["path"] as? String else { result(FlutterError(code: "invalid_arguments", message: "Invalid arguments for method 'open'", details: nil)) return } waveformExtractor = WaveformExtractor() if let waveformExtractor = waveformExtractor { do { try waveformExtractor.open(inputFilename: path) } catch let error as NSError { let errorMessage = error.localizedDescription result(FlutterError(code: "decoder_unavailable", message: "waveformExtractor open failed", details: errorMessage)) return } } else { result(FlutterError(code: "decoder_unavailable", message: "Error: waveformExtractor is nil.", details: nil)) } result(nil) case "next": guard let args = call.arguments as? Dictionary, let frameCount = args["frameCount"] as? UInt32 else { result(FlutterError(code: "invalid_arguments", message: "Invalid arguments for method 'next'", details: nil)) return } guard let waveformExtractor = waveformExtractor else { result(FlutterError(code: "decoder_unavailable", message: "You must open a file first", details: nil)) return } if waveformExtractor != nil { let buffer = waveformExtractor.readShortData(chunkSize: AVAudioFrameCount(frameCount)) result(buffer) } else { result(FlutterError(code: "decoder_unavailable", message: "You must open a file first", details: nil)) } case "close": waveformExtractor?.release() waveformExtractor = nil result(nil) case "duration": guard let waveformExtractor = waveformExtractor else { result(FlutterError(code: "decoder_unavailable", message: "You must open a file first", details: nil)) return } let duration = waveformExtractor.getDuration() result(duration) case "sampleRate": guard let waveformExtractor = waveformExtractor else { result(FlutterError(code: "decoder_unavailable", message: "You must open a file first", details: nil)) return } let sampleRate = waveformExtractor.getSampleRate() result(sampleRate) default: result(FlutterMethodNotImplemented) } } } ================================================ FILE: plugins/audio_waveform/ios/Classes/WaveformExtractor.swift ================================================ import AVFoundation import MediaPlayer class WaveformExtractor { private var audioFile: AVAudioFile? private var audioFileLengthInFrames: AVAudioFramePosition = 0 private var audioFileSampleRate: Int = 0 private var sampleStep: Int = 0 func getFileURL(from mediaLibraryItemID: String) -> URL? { let query = MPMediaQuery.songs() let predicate = MPMediaPropertyPredicate(value: mediaLibraryItemID, forProperty: MPMediaItemPropertyPersistentID) query.addFilterPredicate(predicate) guard let mediaItem = query.items?.first else { return URL(string: mediaLibraryItemID) } return mediaItem.assetURL } func open(inputFilename: String) throws { if let url = getFileURL(from: inputFilename) { print(url.description) audioFile = try AVAudioFile(forReading: url) audioFileLengthInFrames = audioFile!.length audioFileSampleRate = Int(audioFile!.processingFormat.sampleRate) let duration = Int(round(Double(getDuration()) / 1000000.0)) sampleStep = max(duration / 10, 1) } else { print("Error: could not create URL from inputFilename") return } } func release() { audioFile = nil audioFileLengthInFrames = 0 audioFileSampleRate = 0 } // Read the raw audio data in 16-bit format // This function should return a small chunk of the entire data // and called repeatedly until EOF // Returns nil on EOF func readShortData(chunkSize: AVAudioFrameCount) -> [UInt8]? { guard let audioFile = audioFile else { return nil } guard let audioFileBuffer = AVAudioPCMBuffer(pcmFormat: audioFile.processingFormat, frameCapacity: chunkSize) else { return nil } do { try audioFile.read(into: audioFileBuffer) } catch { return nil } guard let audioData = audioFileBuffer.floatChannelData?[0] else { return nil } let audioDataCount = Int(audioFileBuffer.frameLength) * Int(audioFileBuffer.format.channelCount) let audioDataBuffer = UnsafeBufferPointer(start: audioData, count: audioDataCount) let samples = [Float](audioDataBuffer) return simplifyData(samples: samples); } func simplifyData(samples: [Float]) -> [UInt8] { let finalSize = samples.count / (2 * sampleStep) + 1 var simplifiedSamples = [UInt8](repeating: 0, count: finalSize) for i in stride(from: 0, to: samples.count/2, by: sampleStep) { var val = UInt16(abs(samples[i])*256) // do a rudimentary dynamic range expansion if val < 30 { val = val / 5 } else if val > 40 { val = (val * 15) / 10 if val>255 { val=255 } } //if i / (sampleStep * 2) < simplifiedSamples.count { simplifiedSamples[i / (sampleStep)] = UInt8(truncatingIfNeeded: val) //} } return simplifiedSamples } // Return the Audio sample rate, in samples/sec. func getSampleRate() -> Int { return audioFileSampleRate } // Return the duration of the audio file in microseconds. func getDuration() -> Int64 { let duration = Double(audioFileLengthInFrames) / Double(audioFileSampleRate) return Int64(duration * 1_000_000) } } ================================================ FILE: plugins/audio_waveform/ios/audio_waveform.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint audio_waveform.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'audio_waveform' s.version = '0.1.0' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A new flutter plugin project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.platform = :ios, '8.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } end ================================================ FILE: plugins/audio_waveform/lib/audio_waveform.dart ================================================ import 'dart:async'; import 'dart:io'; import 'dart:math'; import 'package:flutter/services.dart'; class AudioWaveformDecoder { static const platform = const MethodChannel("com.tuntori.audio_waveform"); int size = 0; double _durationms = 0; List _samples = []; List get samples => _samples; double get duration => _durationms; Future open(String path, bool legacy) async { if (Platform.isIOS) { if (path.contains("ipod-library://")) { String url = path; Uri uri = Uri.parse(url); path = uri.queryParameters["id"] ?? path; } } try { print("opening $path"); size = 0; var sendMap = {"path": path, "legacy": legacy}; await platform.invokeMethod("open", sendMap); print("File opened"); } catch (e) { print(e); } } Future?> nextBuffer() async { if (Platform.isIOS) { var result = await platform.invokeMethod("next", {"frameCount": 242144}); return result?.cast() ?? null; } try { return await platform.invokeMethod("next"); } catch (e) {} return null; } Future _duration() async { return await platform.invokeMethod("duration"); } Future _sampleRate() async { return await platform.invokeMethod("sampleRate"); } Future release() async { try { await platform.invokeMethod("close"); } catch (e) { print(e); } } void decode(void Function() onStart, bool Function() onProgress, void Function() onFinish) async { //get audio duration _durationms = await _duration() / 1000000; int sampleRate = await _sampleRate(); print("$_durationms seconds"); //calc approx buffer size and create it int bytes = ((_durationms) * sampleRate).ceil(); int bufferIndex = 0; int sampleStep = max(_durationms.round() / 10, 1).floor(); print("sample step $sampleStep"); int expectedSize = (bytes / sampleStep).ceil(); _samples = List.filled(expectedSize, 0, growable: true); int pos = 0; onStart(); Stopwatch stopwatch = Stopwatch()..start(); do { List? list = await nextBuffer(); if (list == null) { break; } int listEndIndex = pos + list.length; if (listEndIndex > _samples.length) { listEndIndex = _samples.length; } _samples.setRange(pos, listEndIndex, list); pos += listEndIndex - pos; bufferIndex++; //update on every hundredth sample or so var skip = Platform.isAndroid ? 200 : 2; if (bufferIndex % skip == 0) { // inform for progress and check whether to continue if (!onProgress()) { await release(); return; } } } while (true); print("Length: $pos"); print( "expected length ${(bytes / sampleStep).ceil()}, final length ${_samples.length}"); print('decode executed in ${stopwatch.elapsed}'); await release(); onFinish(); } } ================================================ FILE: plugins/audio_waveform/macos/Assets/.gitkeep ================================================ ================================================ FILE: plugins/audio_waveform/macos/Classes/AudioWaveformPlugin.h ================================================ #import #import #import @interface AudioWaveformPlugin : NSObject @end ================================================ FILE: plugins/audio_waveform/macos/audio_waveform.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint just_waveform.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'audio_waveform' s.version = '0.1.0' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A new flutter plugin project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } end ================================================ FILE: plugins/audio_waveform/pubspec.yaml ================================================ name: audio_waveform description: Extracts waveform data from an audio file suitable for visually rendering the waveform. version: 0.1.0 environment: sdk: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" dependencies: flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter flutter: plugin: platforms: android: package: com.tuntori.audio_waveform pluginClass: AudioWaveformPlugin ios: pluginClass: AudioWaveformPlugin macos: pluginClass: AudioWaveformPlugin ================================================ FILE: plugins/audio_waveform/test/audio_waveform_test.dart ================================================ //import 'package:flutter/services.dart'; //import 'package:flutter_test/flutter_test.dart'; //import 'package:audio_waveform/audio_waveform.dart'; // //void main() { // const MethodChannel channel = MethodChannel('audio_waveform'); // // TestWidgetsFlutterBinding.ensureInitialized(); // // setUp(() { // channel.setMockMethodCallHandler((MethodCall methodCall) async { // return '42'; // }); // }); // // tearDown(() { // channel.setMockMethodCallHandler(null); // }); // // test('getPlatformVersion', () async { // expect(await AudioWaveform.platformVersion, '42'); // }); //} ================================================ FILE: plugins/drag_and_drop_list/.gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ # IntelliJ related *.iml *.ipr *.iws .idea/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter/Dart/Pub related **/doc/api/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ build/ pubspec.lock # Android related **/android/**/gradle-wrapper.jar **/android/.gradle **/android/captures/ **/android/gradlew **/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java # iOS/XCode related **/ios/**/*.mode1v3 **/ios/**/*.mode2v3 **/ios/**/*.moved-aside **/ios/**/*.pbxuser **/ios/**/*.perspectivev3 **/ios/**/*sync/ **/ios/**/.sconsign.dblite **/ios/**/.tags* **/ios/**/.vagrant/ **/ios/**/DerivedData/ **/ios/**/Icon? **/ios/**/Pods/ **/ios/**/.symlinks/ **/ios/**/profile **/ios/**/xcuserdata **/ios/.generated/ **/ios/Flutter/App.framework **/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.podspec **/ios/Flutter/Generated.xcconfig **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ **/ios/Flutter/flutter_export_environment.sh **/ios/ServiceDefinitions.json **/ios/Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !**/ios/**/default.mode1v3 !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages ================================================ FILE: plugins/drag_and_drop_list/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled and should not be manually edited. version: revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe channel: stable project_type: package ================================================ FILE: plugins/drag_and_drop_list/CHANGELOG.md ================================================ # Changelog [0.3.3] - 4 August 2022 * Update to flutter 3 (thanks [@mauriceraguseinit](https://github.com/mauriceraguseinit)) [0.3.2+2] - 21 October 2021 * Replace flutter deprecated elements [0.3.2+1] - 21 October 2021 * Fix last list target for horizontal lists (thanks [@nvloc120](https://github.com/nvloc120)). * Add ability to remove top padding when there is a widget before the DragAndDropLists (See [flutter/flutter#14842](https://github.com/flutter/flutter/issues/14842), thanks [@aliasgarlabs](https://github.com/aliasgarlabs)) ## [0.3.2] - 20 April 2021 * Add optional feedback widget to items (thanks [@svoza10](https://github.com/svoza10)). ## [0.3.1] - 15 April 2021 * Fix scrolling in wrong direction when text direction is right-to-left. * Fix drag-and-drop feedback widget alignment when text direction is right-to-left. ## [0.3.0+1] - 2 April 2021 * Fix null crash and wrong drag handle used (thanks [@vbuberen](https://github.com/vbuberen)). ## [0.3.0] - 30 March 2021 * DragHandle moved to own widget. To create any drag handle, use the new properties `listDragHandle` and `itemDragHandle` in `DragAndDropLists`. * Support null safety, see [details on migration](https://dart.dev/null-safety/migration-guide). ## [0.2.10] - 14 December 2020 * Bug fix where `listDecorationWhileDragging` wasn't always being applied. * Allow DragAndDropLists to be contained in an external ListView when `disableScrolling` is set to `true`. ## [0.2.9+2] - 17 November 2020 * Prevent individual lists inside of a horizontal DragAndDropLists from scrolling when `disableScrolling` is set to true. ## [0.2.9+1] - 13 November 2020 * Bug fix to also not allow scrolling when `disableScrolling` is set to true when dragging and dropping items. ## [0.2.9] - 9 November 2020 * Added `disableScrolling` parameter to `DragAndDropLists`. ## [0.2.8] - 6 November 2020 * Added `listDividerOnLastChild` parameter to `DragAndDropLists`. This allows not showing a list divider after the last list (thanks [@Zexuz](https://github.com/Zexuz)). ## [0.2.7] - 21 October 2020 * Added `onItemDraggingChanged` and `onListDraggingChanged` parameters to `DragAndDropLists`. This allows certain use cases where it is useful to be notified when dragging starts and ends * Refactored `DragAndDropItemWrapper` to accept a `DragAndDropBuilderParameters` instead of all the other parameters independently to allow for simpler and more consistent changes ## [0.2.6] - 20 October 2020 * Always check mounted status when setting state ## [0.2.5] - 15 October 2020 * Added `constrainDraggingAxis` parameter in `DragAndDropLists`. This is useful when setting custom drag targets outside of the DragAndDropLists. ## [0.2.4] - 15 October 2020 * Added drag handle vertical alignment customization. See `listDragHandleVerticalAlignment` and `itemDragHandleVerticalAlignment` parameters in `DragAndDropLists` * Added mouse cursor change on web when hovering on drag handle * Fixed [itemDecorationWhileDragging only applied when dragHandle is provided?](https://github.com/philip-brink/DragAndDropLists/issues/11) (thanks [kjmj](https://github.com/kjmj)) * Fixed bug where setState() was called after dispose when dragging items in a long list (See issue [Error in debug console when dragging item in long list](https://github.com/philip-brink/DragAndDropLists/issues/9), thanks [mivoligo](https://github.com/mivoligo)) * Apply the itemDivider property to items in the DragAndDropListExpansion widget and use the lastItemTargetHeight instead of the constant value of 20 (thanks [kjmj](https://github.com/kjmj)) ## [0.2.3] - 8 October 2020 * Added `disableTopAndBottomBorders` parameter to `DragAndDropListExpansion` and `ProgrammaticExpansionTile` to allow for more styling options. ## [0.2.2] - 7 October 2020 * Added function parameters for customizing the criteria for where an item or list can be dropped. See the parameters `listOnWillAccept`, `listTargetOnWillAccept`, `itemOnWillAccept` and `itemTargetOnWillAccept` in `DragAndDropLists` * Added function parameters for directly accessing items or lists that have been dropped. See the parameters `listOnAccept`, `listTargetOnAccept`, `itemOnAccept` and `itemTargetOnAccept` in `DragAndDropLists` ## [0.2.1] - 6 October 2020 * Fixed bug where auto scrolling could occur even when not dragging an item (thanks [@ElenaKova](https://github.com/ElenaKova)) ## [0.2.0] - 5 October 2020 * Added option for drag handles. See `dragHandle` and `dragHandleOnLeft` parameters in `DragAndDropLists` * Added new example for drag handles * Added option for item dividers. See the `itemDivider` parameter in `DragAndDropLists` * Added option for inner list box decoration. See the `listInnerDecoration` parameter in `DragAndDropLists` * Added option for decoration while dragging lists and items. See the `itemDecorationWhileDragging` and `itemDecorationWhileDragging` parameters in `DragAndDropLists` * Removed unused `itemDecoration` parameter in `DragAndDropLists` * Fixed unused `itemDraggingWidth` parameter in `DragAndDropLists` * Configurable bottom padding for list and items. See the `lastItemTargetHeight`, `addLastItemTargetHeightToTop` and `lastListTargetSize` parameters in `DragAndDropLists` * Remove `pubspec.lock` (thanks [@freitzzz](https://github.com/freitzzz)) ## [0.1.0] - 21 September 2020 * Added canDrag option for lists * **Interface Change:** Any classes implementing `DragAndDropListInterface` need to add `canDrag` ## [0.0.6] - 24 July 2020 * Fixed wrong parameter order for onItemAdd (thanks [@khauns](https://github.com/khauns)) * ProgrammaticExpansionTile: include option for isThreeLine of ListTile * ProgrammaticExpansionTile: Remove required annotation for leading ## [0.0.5] - 24 July 2020 * ProgrammaticExpansionTile: ensure that parent widget will always know its expanded/collapsed state ## [0.0.4] - 21 July 2020 * Updated example project for web compatibility ## [0.0.3] - 21 July 2020 * Formatted all with dartfmt ## [0.0.2] - 21 July 2020 * Added API documentation ## [0.0.1] - 21 July 2020 * Initial release ================================================ FILE: plugins/drag_and_drop_list/LICENSE ================================================ Copyright 2020 Philip Brink. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: plugins/drag_and_drop_list/README.md ================================================ # drag\_and\_drop\_lists Two-level drag and drop reorderable lists. ## Features - Reorder elements between multiple lists - Reorder lists - Drag and drop new elements from outside of the lists - Vertical or horizontal layout - Use with drag handles, long presses, or short presses - Expandable lists - Can be used in slivers - Prevent individual lists/elements from being able to be dragged - Easy to extend with custom layouts

## Known Issues There is currently (as of flutter v. 1.24.0-1.0.pre) an issue only on web where dragging an item with some descendant that includes an InkWell widget with an onTap method will throw an exception. This includes having a ListTile with an onTap method defined. This seems to be resolved by using a GestureDetector and its onTap method instead of the InkWell. See the following issues: * [#14](https://github.com/philip-brink/DragAndDropLists/issues/14) * [Flutter #69774](https://github.com/flutter/flutter/issues/69774) * [Flutter #67044](https://github.com/flutter/flutter/issues/67044) * [Flutter #66887](https://github.com/flutter/flutter/issues/66887) ## Usage To use this plugin, add `drag_and_drop_lists` as a [dependency in your pubspec.yaml file.](https://flutter.dev/docs/development/packages-and-plugins/using-packages) For example: ``` dependencies: drag_and_drop_lists: ^0.2.1 ``` Now in your Dart code, you can use: `import 'package:drag_and_drop_lists/drag_and_drop_lists.dart';` To add the lists, add a `DragAndDropLists` widget. Set its children to a list of `DragAndDropList`. Likewise, set the children of `DragAndDropList` to a list of `DragAndDropItem`. For example: ``` // Outer list List _contents; @override void initState() { super.initState(); // Generate a list _contents = List.generate(10, (index) { return DragAndDropList( header: Text('Header $index'), children: [ DragAndDropItem( child: Text('$index.1'), ), DragAndDropItem( child: Text('$index.2'), ), DragAndDropItem( child: Text('$index.3'), ), ], ); }); } @override Widget build(BuildContext context) { // Add a DragAndDropLists. The only required parameters are children, // onItemReorder, and onListReorder. All other parameters are used for // styling the lists and changing its behaviour. See the samples in the // example app for many more ways to configure this. return DragAndDropLists( children: _contents, onItemReorder: _onItemReorder, onListReorder: _onListReorder, ); } _onItemReorder(int oldItemIndex, int oldListIndex, int newItemIndex, int newListIndex) { setState(() { var movedItem = _contents[oldListIndex].children.removeAt(oldItemIndex); _contents[newListIndex].children.insert(newItemIndex, movedItem); }); } _onListReorder(int oldListIndex, int newListIndex) { setState(() { var movedList = _contents.removeAt(oldListIndex); _contents.insert(newListIndex, movedList); }); } ``` For further examples, see the example app or [view the example code](https://github.com/philip-brink/DragAndDropLists/tree/master/example/lib) directly. ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_builder_parameters.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/drag_and_drop_lists.dart'; import 'package:flutter/widgets.dart'; typedef OnPointerMove = void Function(PointerMoveEvent event); typedef OnPointerUp = void Function(PointerUpEvent event); typedef OnPointerDown = void Function(PointerDownEvent event); typedef OnItemReordered = void Function( DragAndDropItem reorderedItem, DragAndDropItem receiverItem, ); typedef OnItemDropOnLastTarget = void Function( DragAndDropItem newOrReorderedItem, DragAndDropListInterface parentList, DragAndDropItemTarget receiver, ); typedef OnListReordered = void Function( DragAndDropListInterface reorderedList, DragAndDropListInterface receiverList, ); class DragAndDropBuilderParameters { final OnPointerMove? onPointerMove; final OnPointerUp? onPointerUp; final OnPointerDown? onPointerDown; final OnItemReordered? onItemReordered; final OnItemDropOnLastTarget? onItemDropOnLastTarget; final OnListReordered? onListReordered; final ListOnWillAccept? listOnWillAccept; final ListTargetOnWillAccept? listTargetOnWillAccept; final OnListDraggingChanged? onListDraggingChanged; final ItemOnWillAccept? itemOnWillAccept; final ItemTargetOnWillAccept? itemTargetOnWillAccept; final OnItemDraggingChanged? onItemDraggingChanged; final Axis axis; final CrossAxisAlignment verticalAlignment; final double? listDraggingWidth; final bool dragOnLongPress; final int itemSizeAnimationDuration; final Function(Widget)? itemGhost; final double itemGhostOpacity; final Widget? itemDivider; final double? itemDraggingWidth; final Decoration? itemDecorationWhileDragging; final int listSizeAnimationDuration; final Widget? listGhost; final double listGhostOpacity; final EdgeInsets? listPadding; final Decoration? listDecoration; final Decoration? listDecorationWhileDragging; final Decoration? listInnerDecoration; final double listWidth; final double lastItemTargetHeight; final bool addLastItemTargetHeightToTop; final DragHandle? listDragHandle; final DragHandle? itemDragHandle; final Offset? itemDragOffset; final bool constrainDraggingAxis; final bool disableScrolling; DragAndDropBuilderParameters({ this.onPointerMove, this.onPointerUp, this.onPointerDown, this.onItemReordered, this.onItemDropOnLastTarget, this.onListReordered, this.listDraggingWidth, this.listOnWillAccept, this.listTargetOnWillAccept, this.onListDraggingChanged, this.itemOnWillAccept, this.itemTargetOnWillAccept, this.onItemDraggingChanged, this.dragOnLongPress = true, this.axis = Axis.vertical, this.verticalAlignment = CrossAxisAlignment.start, this.itemSizeAnimationDuration = 150, this.itemGhostOpacity = 0.3, this.itemGhost, this.itemDivider, this.itemDraggingWidth, this.itemDecorationWhileDragging, this.listSizeAnimationDuration = 150, this.listGhostOpacity = 0.3, this.listGhost, this.listPadding, this.listDecoration, this.listDecorationWhileDragging, this.listInnerDecoration, this.listWidth = double.infinity, this.lastItemTargetHeight = 20, this.addLastItemTargetHeightToTop = false, this.listDragHandle, this.itemDragHandle, this.itemDragOffset, this.constrainDraggingAxis = true, this.disableScrolling = false, }); } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_interface.dart ================================================ abstract class DragAndDropInterface {} ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_item.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_interface.dart'; import 'package:flutter/widgets.dart'; class DragAndDropItem implements DragAndDropInterface { /// The child widget of this item. final Widget child; /// Widget when draggable final Widget? feedbackWidget; /// Whether or not this item can be dragged. /// Set to true if it can be reordered. /// Set to false if it must remain fixed. final bool canDrag; DragAndDropItem({ required this.child, this.feedbackWidget, this.canDrag = true, }); } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_item_target.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/drag_and_drop_lists.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; class DragAndDropItemTarget extends StatefulWidget { final Widget child; final DragAndDropListInterface? parent; final DragAndDropBuilderParameters parameters; final OnItemDropOnLastTarget onReorderOrAdd; const DragAndDropItemTarget( {required this.child, required this.onReorderOrAdd, required this.parameters, this.parent, Key? key}) : super(key: key); @override State createState() => _DragAndDropItemTarget(); } class _DragAndDropItemTarget extends State with TickerProviderStateMixin { DragAndDropItem? _hoveredDraggable; @override Widget build(BuildContext context) { return Stack( children: [ Column( crossAxisAlignment: widget.parameters.verticalAlignment, children: [ _hoveredDraggable != null ? Opacity( opacity: widget.parameters.itemGhostOpacity, child: widget.parameters.itemGhost != null ? widget.parameters.itemGhost!(_hoveredDraggable!.child) : _hoveredDraggable!.child, ) : Container(), widget.child, ], ), Positioned.fill( child: DragTarget( builder: (context, candidateData, rejectedData) { if (candidateData.isNotEmpty) {} return Container(); }, onWillAccept: (incoming) { bool accept = true; if (widget.parameters.itemTargetOnWillAccept != null) { accept = widget.parameters.itemTargetOnWillAccept!(incoming, widget); } if (accept && mounted) { setState(() { _hoveredDraggable = incoming; }); } return accept; }, onLeave: (incoming) { if (mounted) { setState(() { _hoveredDraggable = null; }); } }, onAccept: (incoming) { if (mounted) { setState(() { widget.onReorderOrAdd(incoming, widget.parent!, widget); _hoveredDraggable = null; }); } }, ), ), ], ); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_item_wrapper.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_lists.dart'; import 'package:drag_and_drop_lists/measure_size.dart'; import 'package:flutter/material.dart'; class DragAndDropItemWrapper extends StatefulWidget { final DragAndDropItem child; final DragAndDropBuilderParameters? parameters; const DragAndDropItemWrapper( {required this.child, required this.parameters, Key? key}) : super(key: key); @override State createState() => _DragAndDropItemWrapper(); } class _DragAndDropItemWrapper extends State with TickerProviderStateMixin { DragAndDropItem? _hoveredDraggable; bool _dragging = false; Size _containerSize = Size.zero; Size _dragHandleSize = Size.zero; @override Widget build(BuildContext context) { Widget draggable; if (widget.child.canDrag) { if (widget.parameters!.itemDragHandle != null) { Widget feedback = SizedBox( width: widget.parameters!.itemDraggingWidth ?? _containerSize.width, child: Stack( children: [ widget.child.child, Positioned( right: widget.parameters!.itemDragHandle!.onLeft ? null : 0, left: widget.parameters!.itemDragHandle!.onLeft ? 0 : null, top: widget.parameters!.itemDragHandle!.verticalAlignment == DragHandleVerticalAlignment.bottom ? null : 0, bottom: widget.parameters!.itemDragHandle!.verticalAlignment == DragHandleVerticalAlignment.top ? null : 0, child: widget.parameters!.itemDragHandle!, ), ], ), ); var positionedDragHandle = Positioned( right: widget.parameters!.itemDragHandle!.onLeft ? null : 0, left: widget.parameters!.itemDragHandle!.onLeft ? 0 : null, top: widget.parameters!.itemDragHandle!.verticalAlignment == DragHandleVerticalAlignment.bottom ? null : 0, bottom: widget.parameters!.itemDragHandle!.verticalAlignment == DragHandleVerticalAlignment.top ? null : 0, child: MouseRegion( cursor: SystemMouseCursors.grab, child: Draggable( data: widget.child, axis: widget.parameters!.axis == Axis.vertical && widget.parameters!.constrainDraggingAxis ? Axis.vertical : null, feedback: Transform.translate( offset: _feedbackContainerOffset(), child: Material( color: Colors.transparent, child: Container( decoration: widget.parameters!.itemDecorationWhileDragging, child: Directionality( textDirection: Directionality.of(context), child: feedback, ), ), ), ), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: MeasureSize( onSizeChange: (size) { setState(() { _dragHandleSize = size!; }); }, child: widget.parameters!.itemDragHandle, ), ), ), ); draggable = MeasureSize( onSizeChange: _setContainerSize, child: Stack( children: [ Visibility( visible: !_dragging, child: widget.child.child, ), // dragAndDropListContents, positionedDragHandle, ], ), ); } else if (widget.parameters!.dragOnLongPress) { draggable = MeasureSize( onSizeChange: _setContainerSize, child: LongPressDraggable( data: widget.child, axis: widget.parameters!.axis == Axis.vertical && widget.parameters!.constrainDraggingAxis ? Axis.vertical : null, feedback: Transform.translate( //Tuntori - item offset offset: widget.parameters!.itemDragOffset ?? Offset(0, 0), child: SizedBox( width: widget.parameters!.itemDraggingWidth ?? _containerSize.width, child: Material( color: Colors.transparent, child: Container( decoration: widget.parameters!.itemDecorationWhileDragging, child: Directionality( textDirection: Directionality.of(context), child: widget.child.feedbackWidget ?? widget.child.child), ), ), ), ), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: widget.child.child, ), ); } else { draggable = MeasureSize( onSizeChange: _setContainerSize, child: Draggable( data: widget.child, axis: widget.parameters!.axis == Axis.vertical && widget.parameters!.constrainDraggingAxis ? Axis.vertical : null, feedback: SizedBox( width: widget.parameters!.itemDraggingWidth ?? _containerSize.width, child: Material( color: Colors.transparent, child: Container( decoration: widget.parameters!.itemDecorationWhileDragging, child: Directionality( textDirection: Directionality.of(context), child: widget.child.feedbackWidget ?? widget.child.child, ), ), ), ), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: widget.child.child, ), ); } } else { draggable = _hoveredDraggable != null ? Container() : widget.child.child; } return Stack( children: [ Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: widget.parameters!.verticalAlignment, children: [ _hoveredDraggable != null ? Opacity( opacity: widget.parameters!.itemGhostOpacity, child: widget.parameters!.itemGhost != null ? widget .parameters!.itemGhost!(_hoveredDraggable!.child) : _hoveredDraggable!.child, ) : Container(), Listener( onPointerMove: _onPointerMove, onPointerDown: widget.parameters!.onPointerDown, onPointerUp: widget.parameters!.onPointerUp, child: draggable, ), ], ), Positioned.fill( child: DragTarget( builder: (context, candidateData, rejectedData) { if (candidateData.isNotEmpty) {} return Container(); }, onWillAccept: (incoming) { bool accept = true; if (widget.parameters!.itemOnWillAccept != null) { accept = widget.parameters!.itemOnWillAccept!( incoming, widget.child); } if (accept && mounted) { setState(() { _hoveredDraggable = incoming; }); } return accept; }, onLeave: (incoming) { if (mounted) { setState(() { _hoveredDraggable = null; }); } }, onAccept: (incoming) { if (mounted) { setState(() { if (widget.parameters!.onItemReordered != null) { widget.parameters!.onItemReordered!(incoming, widget.child); } _hoveredDraggable = null; }); } }, ), ) ], ); } Offset _feedbackContainerOffset() { double xOffset; double yOffset; if (widget.parameters!.itemDragHandle!.onLeft) { xOffset = 0; } else { xOffset = -_containerSize.width + _dragHandleSize.width; } if (widget.parameters!.itemDragHandle!.verticalAlignment == DragHandleVerticalAlignment.bottom) { yOffset = -_containerSize.height + _dragHandleSize.width; } else { yOffset = 0; } return Offset(xOffset, yOffset); } void _setContainerSize(Size? size) { if (mounted) { setState(() { _containerSize = size!; }); } } void _setDragging(bool dragging) { if (_dragging != dragging && mounted) { setState(() { _dragging = dragging; }); if (widget.parameters!.onItemDraggingChanged != null) { widget.parameters!.onItemDraggingChanged!(widget.child, dragging); } } } void _onPointerMove(PointerMoveEvent event) { if (_dragging) widget.parameters!.onPointerMove!(event); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_list.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item_target.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item_wrapper.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; class DragAndDropList implements DragAndDropListInterface { /// The widget that is displayed at the top of the list. final Widget? header; /// The widget that is displayed at the bottom of the list. final Widget? footer; /// The widget that is displayed to the left of the list. final Widget? leftSide; /// The widget that is displayed to the right of the list. final Widget? rightSide; /// The widget to be displayed when a list is empty. /// If this is not null, it will override that set in [DragAndDropLists.contentsWhenEmpty]. final Widget? contentsWhenEmpty; /// The widget to be displayed as the last element in the list that will accept /// a dragged item. final Widget? lastTarget; /// The decoration displayed around a list. /// If this is not null, it will override that set in [DragAndDropLists.listDecoration]. final Decoration? decoration; /// The vertical alignment of the contents in this list. /// If this is not null, it will override that set in [DragAndDropLists.verticalAlignment]. final CrossAxisAlignment verticalAlignment; /// The horizontal alignment of the contents in this list. /// If this is not null, it will override that set in [DragAndDropLists.horizontalAlignment]. final MainAxisAlignment horizontalAlignment; /// The child elements that will be contained in this list. /// It is possible to not provide any children when an empty list is desired. @override final List children; /// Whether or not this item can be dragged. /// Set to true if it can be reordered. /// Set to false if it must remain fixed. @override final bool canDrag; DragAndDropList({ required this.children, this.header, this.footer, this.leftSide, this.rightSide, this.contentsWhenEmpty, this.lastTarget, this.decoration, this.horizontalAlignment = MainAxisAlignment.start, this.verticalAlignment = CrossAxisAlignment.start, this.canDrag = true, }); @override Widget generateWidget(DragAndDropBuilderParameters params) { var contents = []; if (header != null) { contents.add(Flexible(child: header!)); } Widget intrinsicHeight = IntrinsicHeight( child: Row( mainAxisAlignment: horizontalAlignment, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: _generateDragAndDropListInnerContents(params), ), ); if (params.axis == Axis.horizontal) { intrinsicHeight = SizedBox( width: params.listWidth, child: intrinsicHeight, ); } if (params.listInnerDecoration != null) { intrinsicHeight = Container( decoration: params.listInnerDecoration, child: intrinsicHeight, ); } contents.add(intrinsicHeight); if (footer != null) { contents.add(Flexible(child: footer!)); } return Container( width: params.axis == Axis.vertical ? double.infinity : params.listWidth - params.listPadding!.horizontal, decoration: decoration ?? params.listDecoration, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: verticalAlignment, children: contents, ), ); } List _generateDragAndDropListInnerContents( DragAndDropBuilderParameters parameters) { var contents = []; if (leftSide != null) { contents.add(leftSide!); } if (children.isNotEmpty) { List allChildren = []; if (parameters.addLastItemTargetHeightToTop) { allChildren.add(Padding( padding: EdgeInsets.only(top: parameters.lastItemTargetHeight), )); } for (int i = 0; i < children.length; i++) { allChildren.add(DragAndDropItemWrapper( child: children[i], parameters: parameters, )); if (parameters.itemDivider != null && i < children.length - 1) { allChildren.add(parameters.itemDivider!); } } allChildren.add(DragAndDropItemTarget( parent: this, parameters: parameters, onReorderOrAdd: parameters.onItemDropOnLastTarget!, child: lastTarget ?? Container( height: parameters.lastItemTargetHeight, ), )); contents.add( Expanded( child: SingleChildScrollView( physics: const NeverScrollableScrollPhysics(), child: Column( crossAxisAlignment: verticalAlignment, mainAxisSize: MainAxisSize.max, children: allChildren, ), ), ), ); } else { contents.add( Expanded( child: SingleChildScrollView( physics: const NeverScrollableScrollPhysics(), child: Column( mainAxisSize: MainAxisSize.max, children: [ contentsWhenEmpty ?? const Text( 'Empty list', style: TextStyle( fontStyle: FontStyle.italic, ), ), DragAndDropItemTarget( parent: this, parameters: parameters, onReorderOrAdd: parameters.onItemDropOnLastTarget!, child: lastTarget ?? Container( height: parameters.lastItemTargetHeight, ), ), ], ), ), ), ); } if (rightSide != null) { contents.add(rightSide!); } return contents; } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_list_expansion.dart ================================================ import 'dart:async'; import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item_target.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item_wrapper.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/programmatic_expansion_tile.dart'; import 'package:flutter/material.dart'; typedef OnExpansionChanged = void Function(bool expanded); /// This class mirrors flutter's [ExpansionTile], with similar options. class DragAndDropListExpansion implements DragAndDropListExpansionInterface { final Widget? title; final Widget? subtitle; final Widget? trailing; final Widget? leading; final bool initiallyExpanded; /// Set this to a unique key that will remain unchanged over the lifetime of the list. /// Used to maintain the expanded/collapsed states final Key listKey; /// This function will be called when the expansion of a tile is changed. final OnExpansionChanged? onExpansionChanged; final Color? titleColor; final Color? titleColorExpanded; final Color itemsBackgroundColor; @override final List? children; final Widget? contentsWhenEmpty; final Widget? lastTarget; /// Whether or not this item can be dragged. /// Set to true if it can be reordered. /// Set to false if it must remain fixed. @override final bool canDrag; /// Disable to borders displayed at the top and bottom when expanded final bool disableTopAndBottomBorders; final ValueNotifier _expanded = ValueNotifier(true); final GlobalKey _expansionKey = GlobalKey(); DragAndDropListExpansion({ this.children, this.title, this.subtitle, this.trailing, this.leading, this.initiallyExpanded = false, this.titleColor, this.titleColorExpanded, this.itemsBackgroundColor = Colors.grey, this.onExpansionChanged, this.contentsWhenEmpty, this.lastTarget, required this.listKey, this.canDrag = true, this.disableTopAndBottomBorders = false, }) { _expanded.value = initiallyExpanded; } @override Widget generateWidget(DragAndDropBuilderParameters params) { var contents = _generateDragAndDropListInnerContents(params); Widget expandable = ProgrammaticExpansionTile( title: title, listKey: listKey, subtitle: subtitle, trailing: trailing, leading: leading, disableTopAndBottomBorders: disableTopAndBottomBorders, titleColor: titleColor, titleColorExpanded: titleColorExpanded, itemsBackgroundColor: itemsBackgroundColor, initiallyExpanded: initiallyExpanded, onExpansionChanged: _onSetExpansion, key: _expansionKey, children: contents, ); if (params.listDecoration != null) { expandable = Container( decoration: params.listDecoration, child: expandable, ); } if (params.listPadding != null) { expandable = Padding( padding: params.listPadding!, child: expandable, ); } Widget toReturn = ValueListenableBuilder( valueListenable: _expanded, child: expandable, builder: (context, dynamic error, child) { if (!_expanded.value) { return Stack(children: [ child!, Positioned.fill( child: DragTarget( builder: (context, candidateData, rejectedData) { if (candidateData.isNotEmpty) {} return Container(); }, onWillAccept: (incoming) { _startExpansionTimer(); return false; }, onLeave: (incoming) { _stopExpansionTimer(); }, onAccept: (incoming) {}, ), ) ]); } else { return child!; } }, ); return toReturn; } List _generateDragAndDropListInnerContents( DragAndDropBuilderParameters parameters) { var contents = []; if (children != null && children!.isNotEmpty) { for (int i = 0; i < children!.length; i++) { contents.add(DragAndDropItemWrapper( child: children![i], parameters: parameters, )); if (parameters.itemDivider != null && i < children!.length - 1) { contents.add(parameters.itemDivider!); } } contents.add(DragAndDropItemTarget( parent: this, parameters: parameters, onReorderOrAdd: parameters.onItemDropOnLastTarget!, child: lastTarget ?? SizedBox( height: parameters.lastItemTargetHeight, ), )); } else { /*contents.add( contentsWhenEmpty ?? const Text( 'Empty list', style: TextStyle( fontStyle: FontStyle.italic, ), ), );*/ contents.add( DragAndDropItemTarget( parent: this, parameters: parameters, onReorderOrAdd: parameters.onItemDropOnLastTarget!, child: lastTarget ?? SizedBox( height: 58, child: Center( child: Text( "Empty", style: TextStyle(color: Colors.grey), )), ), ), ); } return contents; } @override toggleExpanded() { if (isExpanded) { collapse(); } else { expand(); } } @override collapse() { if (!isExpanded) { _expanded.value = false; _expansionKey.currentState!.collapse(); } } @override expand() { if (!isExpanded) { _expanded.value = true; _expansionKey.currentState!.expand(); } } _onSetExpansion(bool expanded) { _expanded.value = expanded; if (onExpansionChanged != null) onExpansionChanged!(expanded); } @override get isExpanded => _expanded.value; late Timer _expansionTimer; _startExpansionTimer() async { _expansionTimer = Timer(const Duration(milliseconds: 400), _expansionCallback); } _stopExpansionTimer() async { if (_expansionTimer.isActive) { _expansionTimer.cancel(); } } _expansionCallback() { expand(); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_list_interface.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_interface.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item.dart'; import 'package:flutter/material.dart'; abstract class DragAndDropListInterface implements DragAndDropInterface { List? get children; /// Whether or not this item can be dragged. /// Set to true if it can be reordered. /// Set to false if it must remain fixed. bool get canDrag; Widget generateWidget(DragAndDropBuilderParameters params); } abstract class DragAndDropListExpansionInterface implements DragAndDropListInterface { @override final List? children; DragAndDropListExpansionInterface({this.children}); get isExpanded; toggleExpanded(); expand(); collapse(); } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_list_target.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; typedef OnDropOnLastTarget = void Function( DragAndDropListInterface newOrReordered, DragAndDropListTarget receiver, ); class DragAndDropListTarget extends StatefulWidget { final Widget? child; final DragAndDropBuilderParameters parameters; final OnDropOnLastTarget onDropOnLastTarget; final double lastListTargetSize; const DragAndDropListTarget( {this.child, required this.parameters, required this.onDropOnLastTarget, this.lastListTargetSize = 110, Key? key}) : super(key: key); @override State createState() => _DragAndDropListTarget(); } class _DragAndDropListTarget extends State with TickerProviderStateMixin { DragAndDropListInterface? _hoveredDraggable; @override Widget build(BuildContext context) { Widget visibleContents = Column( children: [ _hoveredDraggable != null ? Opacity( opacity: widget.parameters.listGhostOpacity, child: widget.parameters.listGhost ?? _hoveredDraggable!.generateWidget(widget.parameters), ) : Container(), widget.child ?? SizedBox( height: widget.parameters.axis == Axis.vertical ? widget.lastListTargetSize : null, width: widget.parameters.axis == Axis.horizontal ? widget.lastListTargetSize : null, ), ], ); if (widget.parameters.listPadding != null) { visibleContents = Padding( padding: widget.parameters.listPadding!, child: visibleContents, ); } if (widget.parameters.axis == Axis.horizontal) { visibleContents = SingleChildScrollView(child: visibleContents); } return Stack( children: [ visibleContents, Positioned.fill( child: DragTarget( builder: (context, candidateData, rejectedData) { if (candidateData.isNotEmpty) {} return Container(); }, onWillAccept: (incoming) { bool accept = true; if (widget.parameters.listTargetOnWillAccept != null) { accept = widget.parameters.listTargetOnWillAccept!(incoming, widget); } if (accept && mounted) { setState(() { _hoveredDraggable = incoming; }); } return accept; }, onLeave: (incoming) { if (mounted) { setState(() { _hoveredDraggable = null; }); } }, onAccept: (incoming) { if (mounted) { setState(() { widget.onDropOnLastTarget(incoming, widget); _hoveredDraggable = null; }); } }, ), ), ], ); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_list_wrapper.dart ================================================ import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/drag_handle.dart'; import 'package:drag_and_drop_lists/measure_size.dart'; import 'package:flutter/material.dart'; class DragAndDropListWrapper extends StatefulWidget { final DragAndDropListInterface dragAndDropList; final DragAndDropBuilderParameters parameters; const DragAndDropListWrapper( {required this.dragAndDropList, required this.parameters, Key? key}) : super(key: key); @override State createState() => _DragAndDropListWrapper(); } class _DragAndDropListWrapper extends State with TickerProviderStateMixin { DragAndDropListInterface? _hoveredDraggable; bool _dragging = false; Size _containerSize = Size.zero; Size _dragHandleSize = Size.zero; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { Widget dragAndDropListContents = widget.dragAndDropList.generateWidget(widget.parameters); Widget draggable; if (widget.dragAndDropList.canDrag) { if (widget.parameters.listDragHandle != null) { Widget dragHandle = MouseRegion( cursor: SystemMouseCursors.grab, child: widget.parameters.listDragHandle, ); Widget feedback = buildFeedbackWithHandle(dragAndDropListContents, dragHandle); draggable = MeasureSize( onSizeChange: (size) { setState(() { _containerSize = size!; }); }, child: Stack( children: [ Visibility( visible: !_dragging, child: dragAndDropListContents, ), // dragAndDropListContents, Positioned( right: widget.parameters.listDragHandle!.onLeft ? null : 0, left: widget.parameters.listDragHandle!.onLeft ? 0 : null, top: _dragHandleDistanceFromTop(), child: Draggable( data: widget.dragAndDropList, axis: draggableAxis(), feedback: Transform.translate( offset: _feedbackContainerOffset(), child: feedback, ), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: MeasureSize( onSizeChange: (size) { setState(() { _dragHandleSize = size!; }); }, child: dragHandle, ), ), ), ], ), ); } else if (widget.parameters.dragOnLongPress) { draggable = LongPressDraggable( data: widget.dragAndDropList, axis: draggableAxis(), feedback: buildFeedbackWithoutHandle(context, dragAndDropListContents), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: dragAndDropListContents, ); } else { draggable = Draggable( data: widget.dragAndDropList, axis: draggableAxis(), feedback: buildFeedbackWithoutHandle(context, dragAndDropListContents), childWhenDragging: Container(), onDragStarted: () => _setDragging(true), onDragCompleted: () => _setDragging(false), onDraggableCanceled: (_, __) => _setDragging(false), onDragEnd: (_) => _setDragging(false), child: dragAndDropListContents, ); } } else { draggable = dragAndDropListContents; } var rowOrColumnChildren = [ _hoveredDraggable != null ? Opacity( opacity: widget.parameters.listGhostOpacity, child: widget.parameters.listGhost ?? Container( padding: widget.parameters.axis == Axis.vertical ? const EdgeInsets.all(0) : EdgeInsets.symmetric( horizontal: widget.parameters.listPadding!.horizontal), child: _hoveredDraggable!.generateWidget(widget.parameters), ), ) : const SizedBox(), Listener( onPointerMove: _onPointerMove, onPointerDown: widget.parameters.onPointerDown, onPointerUp: widget.parameters.onPointerUp, child: draggable, ), ]; var stack = Stack( children: [ widget.parameters.axis == Axis.vertical ? Column( children: rowOrColumnChildren, ) : Row( crossAxisAlignment: CrossAxisAlignment.start, children: rowOrColumnChildren, ), Positioned.fill( child: DragTarget( builder: (context, candidateData, rejectedData) { if (candidateData.isNotEmpty) {} return const SizedBox(); }, onWillAccept: (incoming) { bool accept = true; if (widget.parameters.listOnWillAccept != null) { accept = widget.parameters.listOnWillAccept!( incoming, widget.dragAndDropList); } if (accept && mounted) { setState(() { _hoveredDraggable = incoming; }); } return accept; }, onLeave: (incoming) { if (_hoveredDraggable != null) { if (mounted) { setState(() { _hoveredDraggable = null; }); } } }, onAccept: (incoming) { if (mounted) { setState(() { widget.parameters.onListReordered!( incoming, widget.dragAndDropList); _hoveredDraggable = null; }); } }, ), ), ], ); Widget toReturn = stack; if (widget.parameters.listPadding != null) { toReturn = Padding( padding: widget.parameters.listPadding!, child: stack, ); } if (widget.parameters.axis == Axis.horizontal && !widget.parameters.disableScrolling) { toReturn = SingleChildScrollView( child: Container( child: toReturn, ), ); } return toReturn; } Material buildFeedbackWithHandle( Widget dragAndDropListContents, Widget dragHandle) { return Material( color: Colors.transparent, child: Container( decoration: widget.parameters.listDecorationWhileDragging, child: SizedBox( width: widget.parameters.listDraggingWidth ?? _containerSize.width, child: Stack( children: [ Directionality( textDirection: Directionality.of(context), child: dragAndDropListContents, ), Positioned( right: widget.parameters.listDragHandle!.onLeft ? null : 0, left: widget.parameters.listDragHandle!.onLeft ? 0 : null, top: widget.parameters.listDragHandle!.verticalAlignment == DragHandleVerticalAlignment.bottom ? null : 0, bottom: widget.parameters.listDragHandle!.verticalAlignment == DragHandleVerticalAlignment.top ? null : 0, child: dragHandle, ), ], ), ), ), ); } Widget buildFeedbackWithoutHandle( BuildContext context, Widget dragAndDropListContents) { return Transform.translate( //Tuntori - category offset offset: const Offset(20, -10), child: SizedBox( width: widget.parameters.axis == Axis.vertical ? (widget.parameters.listDraggingWidth ?? MediaQuery.of(context).size.width) : (widget.parameters.listDraggingWidth ?? widget.parameters.listWidth), child: Material( color: Colors.transparent, child: Container( decoration: widget.parameters.listDecorationWhileDragging, child: Directionality( textDirection: Directionality.of(context), child: dragAndDropListContents, ), ), ), ), ); } Axis? draggableAxis() { return widget.parameters.axis == Axis.vertical && widget.parameters.constrainDraggingAxis ? Axis.vertical : null; } double _dragHandleDistanceFromTop() { switch (widget.parameters.listDragHandle!.verticalAlignment) { case DragHandleVerticalAlignment.top: return 0; case DragHandleVerticalAlignment.center: return (_containerSize.height / 2.0) - (_dragHandleSize.height / 2.0); case DragHandleVerticalAlignment.bottom: return _containerSize.height - _dragHandleSize.height; default: return 0; } } Offset _feedbackContainerOffset() { double xOffset; double yOffset; if (widget.parameters.listDragHandle!.onLeft) { xOffset = 0; } else { xOffset = -_containerSize.width + _dragHandleSize.width; } if (widget.parameters.listDragHandle!.verticalAlignment == DragHandleVerticalAlignment.bottom) { yOffset = -_containerSize.height + _dragHandleSize.width; } else { yOffset = 0; } return Offset(xOffset, yOffset); } //Tuntori: Called when dragging state is started or stopped void _setDragging(bool dragging) { if (_dragging != dragging && mounted) { setState(() { _dragging = dragging; }); if (widget.parameters.onListDraggingChanged != null) { widget.parameters.onListDraggingChanged!( widget.dragAndDropList, dragging); } } } void _onPointerMove(PointerMoveEvent event) { if (_dragging) widget.parameters.onPointerMove!(event); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_and_drop_lists.dart ================================================ /// Drag and drop list reordering for two level lists. /// /// [DragAndDropLists] is the main widget, and contains numerous options for controlling overall list presentation. /// /// The children of [DragAndDropLists] are [DragAndDropList] or another class that inherits from /// [DragAndDropListInterface] such as [DragAndDropListExpansion]. These lists can be reordered at will. /// Each list contains its own properties, and can be styled separately if the defaults provided to [DragAndDropLists] /// should be overridden. /// /// The children of a [DragAndDropListInterface] are [DragAndDropItem]. These are the individual elements and can be /// reordered within their own list and into other lists. If they should not be able to be reordered, they can also /// be locked individually. library drag_and_drop_lists; import 'dart:math'; import 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item.dart'; import 'package:drag_and_drop_lists/drag_and_drop_item_target.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_target.dart'; import 'package:drag_and_drop_lists/drag_and_drop_list_wrapper.dart'; import 'package:drag_and_drop_lists/drag_handle.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; export 'package:drag_and_drop_lists/drag_and_drop_builder_parameters.dart'; export 'package:drag_and_drop_lists/drag_and_drop_item.dart'; export 'package:drag_and_drop_lists/drag_and_drop_item_target.dart'; export 'package:drag_and_drop_lists/drag_and_drop_item_wrapper.dart'; export 'package:drag_and_drop_lists/drag_and_drop_list.dart'; export 'package:drag_and_drop_lists/drag_and_drop_list_expansion.dart'; export 'package:drag_and_drop_lists/drag_and_drop_list_target.dart'; export 'package:drag_and_drop_lists/drag_and_drop_list_wrapper.dart'; export 'package:drag_and_drop_lists/drag_handle.dart'; typedef OnItemReorder = void Function( int oldItemIndex, int oldListIndex, int newItemIndex, int newListIndex, ); typedef OnItemAdd = void Function( DragAndDropItem newItem, int listIndex, int newItemIndex, ); typedef OnListAdd = void Function( DragAndDropListInterface newList, int newListIndex); typedef OnListReorder = void Function(int oldListIndex, int newListIndex); typedef OnListDraggingChanged = void Function( DragAndDropListInterface? list, bool dragging, ); typedef ListOnWillAccept = bool Function( DragAndDropListInterface? incoming, DragAndDropListInterface? target, ); typedef ListOnAccept = void Function( DragAndDropListInterface incoming, DragAndDropListInterface target, ); typedef ListTargetOnWillAccept = bool Function( DragAndDropListInterface? incoming, DragAndDropListTarget target); typedef ListTargetOnAccept = void Function( DragAndDropListInterface incoming, DragAndDropListTarget target); typedef OnItemDraggingChanged = void Function( DragAndDropItem item, bool dragging, ); typedef ItemOnWillAccept = bool Function( DragAndDropItem? incoming, DragAndDropItem target, ); typedef ItemOnAccept = void Function( DragAndDropItem incoming, DragAndDropItem target, ); typedef ItemTargetOnWillAccept = bool Function( DragAndDropItem? incoming, DragAndDropItemTarget target); typedef ItemTargetOnAccept = void Function( DragAndDropItem incoming, DragAndDropListInterface parentList, DragAndDropItemTarget target, ); class DragAndDropLists extends StatefulWidget { /// The child lists to be displayed. /// If any of these children are [DragAndDropListExpansion] or inherit from /// [DragAndDropListExpansionInterface], [listGhost] must not be null. final List children; /// Calls this function when a list element is reordered. /// Takes into account the index change when removing an item, so the /// [newItemIndex] can be used directly when inserting. final OnItemReorder onItemReorder; /// Calls this function when a list is reordered. /// Takes into account the index change when removing a list, so the /// [newListIndex] can be used directly when inserting. final OnListReorder onListReorder; /// Calls this function when a new item has been added. final OnItemAdd? onItemAdd; /// Calls this function when a new list has been added. final OnListAdd? onListAdd; /// Set in order to provide custom acceptance criteria for when a list can be /// dropped onto a specific other list final ListOnWillAccept? listOnWillAccept; /// Set in order to get the lists involved in a drag and drop operation after /// a list has been accepted. For general use cases where only reordering is /// necessary, only [onListReorder] or [onListAdd] is needed, and this should /// be left null. [onListReorder] or [onListAdd] will be called after this. final ListOnAccept? listOnAccept; /// Set in order to provide custom acceptance criteria for when a list can be /// dropped onto a specific target. This target always exists as the last /// target the DragAndDropLists, and also can be used independently. final ListTargetOnWillAccept? listTargetOnWillAccept; /// Set in order to get the list and target involved in a drag and drop /// operation after a list has been accepted. For general use cases where only /// reordering is necessary, only [onListReorder] or [onListAdd] is needed, /// and this should be left null. [onListReorder] or [onListAdd] will be /// called after this. final ListTargetOnAccept? listTargetOnAccept; /// Called when a list dragging is starting or ending final OnListDraggingChanged? onListDraggingChanged; /// Set in order to provide custom acceptance criteria for when a item can be /// dropped onto a specific other item final ItemOnWillAccept? itemOnWillAccept; /// Set in order to get the items involved in a drag and drop operation after /// an item has been accepted. For general use cases where only reordering is /// necessary, only [onItemReorder] or [onItemAdd] is needed, and this should /// be left null. [onItemReorder] or [onItemAdd] will be called after this. final ItemOnAccept? itemOnAccept; /// Set in order to provide custom acceptance criteria for when a item can be /// dropped onto a specific target. This target always exists as the last /// target for list of items, and also can be used independently. final ItemTargetOnWillAccept? itemTargetOnWillAccept; /// Set in order to get the item and target involved in a drag and drop /// operation after a item has been accepted. For general use cases where only /// reordering is necessary, only [onItemReorder] or [onItemAdd] is needed, /// and this should be left null. [onItemReorder] or [onItemAdd] will be /// called after this. final ItemTargetOnAccept? itemTargetOnAccept; /// Called when an item dragging is starting or ending final OnItemDraggingChanged? onItemDraggingChanged; /// Width of a list item when it is being dragged. final double? itemDraggingWidth; /// The widget that will be displayed at a potential drop position in a list /// when an item is being dragged. final Function(Widget)? itemGhost; /// The opacity of the [itemGhost]. This must be between 0 and 1. final double itemGhostOpacity; /// If true, drag an item after doing a long press. If false, drag immediately. final bool itemDragOnLongPress; /// The decoration surrounding an item while it is in the process of being dragged. final Decoration? itemDecorationWhileDragging; /// A widget that will be displayed between each individual item. final Widget? itemDivider; /// The width of a list when dragging. final double? listDraggingWidth; /// The widget to be displayed as the last element in the DragAndDropLists, /// where a list will be accepted as the last list. final Widget? listTarget; /// The widget to be displayed at a potential list position while a list is being dragged. /// This must not be null when [children] includes one or more /// [DragAndDropListExpansion] or other class that inherit from [DragAndDropListExpansionInterface]. final Widget? listGhost; /// The opacity of [listGhost]. It must be between 0 and 1. final double listGhostOpacity; /// Whether a list should be dragged on a long or short press. /// When true, the list will be dragged after a long press. /// When false, it will be dragged immediately. final bool listDragOnLongPress; /// The decoration surrounding a list. final Decoration? listDecoration; /// The decoration surrounding a list while it is in the process of being dragged. final Decoration? listDecorationWhileDragging; /// The decoration surrounding the inner list of items. final Decoration? listInnerDecoration; /// A widget that will be displayed between each individual list. final Widget? listDivider; /// Whether it should put a divider on the last list or not. final bool listDividerOnLastChild; /// The padding between each individual list. final EdgeInsets? listPadding; /// A widget that will be displayed whenever a list contains no items. final Widget? contentsWhenEmpty; /// A widget that will be displayed on top, as a header final Widget? headerWidget; /// The width of each individual list. This must be set to a finite value when /// [axis] is set to Axis.horizontal. final double listWidth; /// The height of the target for the last item in a list. This should be large /// enough to easily drag an item into the last position of a list. final double lastItemTargetHeight; /// Add the same height as the lastItemTargetHeight to the top of the list. /// This is useful when setting the [listInnerDecoration] to maintain visual /// continuity between the top and the bottom final bool addLastItemTargetHeightToTop; /// The height of the target for the last list. This should be large /// enough to easily drag a list to the last position in the DragAndDropLists. final double lastListTargetSize; /// The default vertical alignment of list contents. final CrossAxisAlignment verticalAlignment; /// The default horizontal alignment of list contents. final MainAxisAlignment horizontalAlignment; /// Determines whether the DragAndDropLists are displayed in a horizontal or /// vertical manner. /// Set [axis] to Axis.vertical for vertical arrangement of the lists. /// Set [axis] to Axis.horizontal for horizontal arrangement of the lists. /// If [axis] is set to Axis.horizontal, [listWidth] must be set to some finite number. final Axis axis; /// Whether or not to return a widget or a sliver-compatible list. /// Set to true if using as a sliver. If true, a [scrollController] must be provided. /// Set to false if using in a widget only. final bool sliverList; /// A scroll controller that can be used for the scrolling of the first level lists. /// This must be set if [sliverList] is set to true. final ScrollController? scrollController; /// Set to true in order to disable all scrolling of the lists. /// Note: to disable scrolling for sliver lists, it is also necessary in your /// parent CustomScrollView to set physics to NeverScrollableScrollPhysics() final bool disableScrolling; /// Set a custom drag handle to use iOS-like handles to drag rather than long /// or short presses final DragHandle? listDragHandle; /// Set a custom drag handle to use iOS-like handles to drag rather than long /// or short presses final DragHandle? itemDragHandle; /// Offset to shift the dragged item preview final Offset? itemDragOffset; /// Constrain the dragging axis in a vertical list to only allow dragging on /// the vertical axis. By default this is set to true. This may be useful to /// disable when setting customDragTargets final bool constrainDraggingAxis; /// If you put a widget before DragAndDropLists there's an unexpected padding /// before the list renders. This is the default behaviour for ListView which /// is used internally. To remove the padding, set this field to true /// https://github.com/flutter/flutter/issues/14842#issuecomment-371344881 final bool removeTopPadding; DragAndDropLists({ required this.children, required this.onItemReorder, required this.onListReorder, this.onItemAdd, this.onListAdd, this.onListDraggingChanged, this.listOnWillAccept, this.listOnAccept, this.listTargetOnWillAccept, this.listTargetOnAccept, this.onItemDraggingChanged, this.itemOnWillAccept, this.itemOnAccept, this.itemTargetOnWillAccept, this.itemTargetOnAccept, this.itemDraggingWidth, this.itemGhost, this.itemGhostOpacity = 0.3, this.itemDragOnLongPress = true, this.itemDecorationWhileDragging, this.itemDivider, this.listDraggingWidth, this.listTarget, this.listGhost, this.listGhostOpacity = 0.3, this.listDragOnLongPress = true, this.listDecoration, this.listDecorationWhileDragging, this.listInnerDecoration, this.listDivider, this.listDividerOnLastChild = true, this.listPadding, this.contentsWhenEmpty, this.headerWidget, this.listWidth = double.infinity, this.lastItemTargetHeight = 20, this.addLastItemTargetHeightToTop = false, this.lastListTargetSize = 110, this.verticalAlignment = CrossAxisAlignment.start, this.horizontalAlignment = MainAxisAlignment.start, this.axis = Axis.vertical, this.sliverList = false, this.scrollController, this.disableScrolling = false, this.listDragHandle, this.itemDragHandle, this.itemDragOffset, this.constrainDraggingAxis = true, this.removeTopPadding = false, Key? key, }) : super(key: key) { if (listGhost == null && children.whereType().isNotEmpty) { throw Exception( 'If using DragAndDropListExpansion, you must provide a non-null listGhost'); } if (sliverList && scrollController == null) { throw Exception( 'A scroll controller must be provided when using sliver lists'); } if (axis == Axis.horizontal && listWidth == double.infinity) { throw Exception( 'A finite width must be provided when setting the axis to horizontal'); } if (axis == Axis.horizontal && sliverList) { throw Exception( 'Combining a sliver list with a horizontal list is currently unsupported'); } } @override State createState() => DragAndDropListsState(); } class DragAndDropListsState extends State { ScrollController? _scrollController; bool _pointerDown = false; double? _pointerYPosition; double? _pointerXPosition; bool _scrolling = false; //final PageStorageBucket _pageStorageBucket = PageStorageBucket(); @override void initState() { if (widget.scrollController != null) { _scrollController = widget.scrollController; } else { _scrollController = ScrollController(); } super.initState(); } @override Widget build(BuildContext context) { var parameters = DragAndDropBuilderParameters( listGhost: widget.listGhost, listGhostOpacity: widget.listGhostOpacity, listDraggingWidth: widget.listDraggingWidth, itemDraggingWidth: widget.itemDraggingWidth, dragOnLongPress: widget.listDragOnLongPress, listPadding: widget.listPadding, onPointerDown: _onPointerDown, onPointerUp: _onPointerUp, onPointerMove: _onPointerMove, onItemReordered: _internalOnItemReorder, onItemDropOnLastTarget: _internalOnItemDropOnLastTarget, onListReordered: _internalOnListReorder, onItemDraggingChanged: widget.onItemDraggingChanged, onListDraggingChanged: widget.onListDraggingChanged, listOnWillAccept: widget.listOnWillAccept, listTargetOnWillAccept: widget.listTargetOnWillAccept, itemOnWillAccept: widget.itemOnWillAccept, itemTargetOnWillAccept: widget.itemTargetOnWillAccept, itemGhostOpacity: widget.itemGhostOpacity, itemDivider: widget.itemDivider, itemDecorationWhileDragging: widget.itemDecorationWhileDragging, verticalAlignment: widget.verticalAlignment, axis: widget.axis, itemGhost: widget.itemGhost, listDecoration: widget.listDecoration, listDecorationWhileDragging: widget.listDecorationWhileDragging, listInnerDecoration: widget.listInnerDecoration, listWidth: widget.listWidth, lastItemTargetHeight: widget.lastItemTargetHeight, addLastItemTargetHeightToTop: widget.addLastItemTargetHeightToTop, listDragHandle: widget.listDragHandle, itemDragHandle: widget.itemDragHandle, itemDragOffset: widget.itemDragOffset, constrainDraggingAxis: widget.constrainDraggingAxis, disableScrolling: widget.disableScrolling, ); DragAndDropListTarget dragAndDropListTarget = DragAndDropListTarget( parameters: parameters, onDropOnLastTarget: _internalOnListDropOnLastTarget, lastListTargetSize: widget.lastListTargetSize, child: widget.listTarget, ); if (widget.children.isNotEmpty) { Widget outerListHolder; if (widget.sliverList) { outerListHolder = _buildSliverList(dragAndDropListTarget, parameters); } else if (widget.disableScrolling) { outerListHolder = _buildUnscrollableList(dragAndDropListTarget, parameters); } else { outerListHolder = _buildListView(parameters, dragAndDropListTarget); } // if (widget.children // .whereType() // .isNotEmpty) { // outerListHolder = PageStorage( // bucket: _pageStorageBucket, // child: outerListHolder, // ); // } return outerListHolder; } else { if (widget.sliverList) return widget.contentsWhenEmpty ?? const Text("Empty"); return Column( children: [ if (widget.headerWidget != null) widget.headerWidget!, Expanded( child: Center( child: widget.contentsWhenEmpty ?? const Text('Empty'), ), ), ], ); } } SliverList _buildSliverList(DragAndDropListTarget dragAndDropListTarget, DragAndDropBuilderParameters parameters) { bool includeSeparators = widget.listDivider != null; int childrenCount = _calculateChildrenCount(includeSeparators); return SliverList( delegate: SliverChildBuilderDelegate( (context, index) { return _buildInnerList(index, childrenCount, dragAndDropListTarget, includeSeparators, parameters); }, childCount: childrenCount, ), ); } Widget _buildUnscrollableList(DragAndDropListTarget dragAndDropListTarget, DragAndDropBuilderParameters parameters) { if (widget.axis == Axis.vertical) { return Column( children: _buildOuterList(dragAndDropListTarget, parameters), ); } else { return Row( children: _buildOuterList(dragAndDropListTarget, parameters), ); } } Widget _buildListView(DragAndDropBuilderParameters parameters, DragAndDropListTarget dragAndDropListTarget) { Widget listView = ListView( scrollDirection: widget.axis, controller: _scrollController, children: _buildOuterList(dragAndDropListTarget, parameters), ); return widget.removeTopPadding ? MediaQuery.removePadding( removeTop: true, context: context, child: listView, ) : listView; } List _buildOuterList(DragAndDropListTarget dragAndDropListTarget, DragAndDropBuilderParameters parameters) { bool includeSeparators = widget.listDivider != null; int childrenCount = _calculateChildrenCount(includeSeparators); var list = List.generate(childrenCount, (index) { return _buildInnerList(index, childrenCount, dragAndDropListTarget, includeSeparators, parameters); }); if (widget.headerWidget != null) list.insert(0, widget.headerWidget!); return list; } int _calculateChildrenCount(bool includeSeparators) { if (includeSeparators) { return (widget.children.length * 2) - (widget.listDividerOnLastChild ? 0 : 1) + 1; } else { return widget.children.length + 1; } } Widget _buildInnerList( int index, int childrenCount, DragAndDropListTarget dragAndDropListTarget, bool includeSeparators, DragAndDropBuilderParameters parameters) { if (index == childrenCount - 1) { return dragAndDropListTarget; } else if (includeSeparators && index.isOdd) { return widget.listDivider!; } else { return DragAndDropListWrapper( dragAndDropList: widget.children[(includeSeparators ? index / 2 : index).toInt()], parameters: parameters, ); } } _internalOnItemReorder(DragAndDropItem reordered, DragAndDropItem receiver) { if (widget.itemOnAccept != null) { widget.itemOnAccept!(reordered, receiver); } int reorderedListIndex = -1; int reorderedItemIndex = -1; int receiverListIndex = -1; int receiverItemIndex = -1; for (int i = 0; i < widget.children.length; i++) { if (reorderedItemIndex == -1) { reorderedItemIndex = widget.children[i].children!.indexWhere((e) => reordered == e); if (reorderedItemIndex != -1) reorderedListIndex = i; } if (receiverItemIndex == -1) { receiverItemIndex = widget.children[i].children!.indexWhere((e) => receiver == e); if (receiverItemIndex != -1) receiverListIndex = i; } if (reorderedItemIndex != -1 && receiverItemIndex != -1) { break; } } if (reorderedItemIndex == -1) { // this is a new item if (widget.onItemAdd != null) { widget.onItemAdd!(reordered, receiverListIndex, receiverItemIndex); } } else { if (reorderedListIndex == receiverListIndex && receiverItemIndex > reorderedItemIndex) { // same list, so if the new position is after the old position, the removal of the old item must be taken into account receiverItemIndex--; } widget.onItemReorder(reorderedItemIndex, reorderedListIndex, receiverItemIndex, receiverListIndex); } } _internalOnListReorder( DragAndDropListInterface reordered, DragAndDropListInterface receiver) { int reorderedListIndex = widget.children.indexWhere((e) => reordered == e); int receiverListIndex = widget.children.indexWhere((e) => receiver == e); int newListIndex = receiverListIndex; if (widget.listOnAccept != null) widget.listOnAccept!(reordered, receiver); if (reorderedListIndex == -1) { // this is a new list if (widget.onListAdd != null) widget.onListAdd!(reordered, newListIndex); } else { if (newListIndex > reorderedListIndex) { // same list, so if the new position is after the old position, the removal of the old item must be taken into account newListIndex--; } widget.onListReorder(reorderedListIndex, newListIndex); } } _internalOnItemDropOnLastTarget(DragAndDropItem newOrReordered, DragAndDropListInterface parentList, DragAndDropItemTarget receiver) { if (widget.itemTargetOnAccept != null) { widget.itemTargetOnAccept!(newOrReordered, parentList, receiver); } int reorderedListIndex = -1; int reorderedItemIndex = -1; int receiverListIndex = -1; int receiverItemIndex = -1; if (widget.children.isNotEmpty) { for (int i = 0; i < widget.children.length; i++) { if (reorderedItemIndex == -1) { reorderedItemIndex = widget.children[i].children ?.indexWhere((e) => newOrReordered == e) ?? -1; if (reorderedItemIndex != -1) reorderedListIndex = i; } if (receiverItemIndex == -1 && widget.children[i] == parentList) { receiverListIndex = i; receiverItemIndex = widget.children[i].children?.length ?? -1; } if (reorderedItemIndex != -1 && receiverItemIndex != -1) { break; } } } if (reorderedItemIndex == -1) { if (widget.onItemAdd != null) { widget.onItemAdd!( newOrReordered, receiverListIndex, reorderedItemIndex); } } else { if (reorderedListIndex == receiverListIndex && receiverItemIndex > reorderedItemIndex) { // same list, so if the new position is after the old position, the removal of the old item must be taken into account receiverItemIndex--; } widget.onItemReorder(reorderedItemIndex, reorderedListIndex, receiverItemIndex, receiverListIndex); } } _internalOnListDropOnLastTarget( DragAndDropListInterface newOrReordered, DragAndDropListTarget receiver) { // determine if newOrReordered is new or existing int reorderedListIndex = widget.children.indexWhere((e) => newOrReordered == e); if (widget.listOnAccept != null) { widget.listTargetOnAccept!(newOrReordered, receiver); } if (reorderedListIndex >= 0) { widget.onListReorder(reorderedListIndex, widget.children.length - 1); } else { if (widget.onListAdd != null) { widget.onListAdd!(newOrReordered, reorderedListIndex); } } } _onPointerMove(PointerMoveEvent event) { if (_pointerDown) { _pointerYPosition = event.position.dy; _pointerXPosition = event.position.dx; _scrollList(); } } _onPointerDown(PointerDownEvent event) { _pointerDown = true; _pointerYPosition = event.position.dy; _pointerXPosition = event.position.dx; } _onPointerUp(PointerUpEvent event) { _pointerDown = false; } final int _duration = 30; // in ms final int _scrollAreaSize = 20; final double _overDragMin = 5.0; final double _overDragMax = 20.0; final double _overDragCoefficient = 3.3; _scrollList() async { if (!widget.disableScrolling && !_scrolling && _pointerDown && _pointerYPosition != null && _pointerXPosition != null) { double? newOffset; var rb = context.findRenderObject()!; late Size size; if (rb is RenderBox) { size = rb.size; } else if (rb is RenderSliver) { size = rb.paintBounds.size; } var topLeftOffset = localToGlobal(rb, Offset.zero); var bottomRightOffset = localToGlobal(rb, size.bottomRight(Offset.zero)); if (widget.axis == Axis.vertical) { newOffset = _scrollListVertical(topLeftOffset, bottomRightOffset); } else { var directionality = Directionality.of(context); if (directionality == TextDirection.ltr) { newOffset = _scrollListHorizontalLtr(topLeftOffset, bottomRightOffset); } else { newOffset = _scrollListHorizontalRtl(topLeftOffset, bottomRightOffset); } } if (newOffset != null) { _scrolling = true; await _scrollController!.animateTo(newOffset, duration: Duration(milliseconds: _duration), curve: Curves.linear); _scrolling = false; if (_pointerDown) _scrollList(); } } } double? _scrollListVertical(Offset topLeftOffset, Offset bottomRightOffset) { double top = topLeftOffset.dy; double bottom = bottomRightOffset.dy; double? newOffset; var pointerYPosition = _pointerYPosition; var scrollController = _scrollController; if (scrollController != null && pointerYPosition != null) { if (pointerYPosition < (top + _scrollAreaSize) && scrollController.position.pixels > scrollController.position.minScrollExtent) { final overDrag = max((top + _scrollAreaSize) - pointerYPosition, _overDragMax); newOffset = max(scrollController.position.minScrollExtent, scrollController.position.pixels - overDrag / _overDragCoefficient); } else if (pointerYPosition > (bottom - _scrollAreaSize) && scrollController.position.pixels < scrollController.position.maxScrollExtent) { final overDrag = max( pointerYPosition - (bottom - _scrollAreaSize), _overDragMax); newOffset = min(scrollController.position.maxScrollExtent, scrollController.position.pixels + overDrag / _overDragCoefficient); } } return newOffset; } double? _scrollListHorizontalLtr( Offset topLeftOffset, Offset bottomRightOffset) { double left = topLeftOffset.dx; double right = bottomRightOffset.dx; double? newOffset; var pointerXPosition = _pointerXPosition; var scrollController = _scrollController; if (scrollController != null && pointerXPosition != null) { if (pointerXPosition < (left + _scrollAreaSize) && scrollController.position.pixels > scrollController.position.minScrollExtent) { // scrolling toward minScrollExtent final overDrag = min( (left + _scrollAreaSize) - pointerXPosition + _overDragMin, _overDragMax); newOffset = max(scrollController.position.minScrollExtent, scrollController.position.pixels - overDrag / _overDragCoefficient); } else if (pointerXPosition > (right - _scrollAreaSize) && scrollController.position.pixels < scrollController.position.maxScrollExtent) { // scrolling toward maxScrollExtent final overDrag = min( pointerXPosition - (right - _scrollAreaSize) + _overDragMin, _overDragMax); newOffset = min(scrollController.position.maxScrollExtent, scrollController.position.pixels + overDrag / _overDragCoefficient); } } return newOffset; } double? _scrollListHorizontalRtl( Offset topLeftOffset, Offset bottomRightOffset) { double left = topLeftOffset.dx; double right = bottomRightOffset.dx; double? newOffset; var pointerXPosition = _pointerXPosition; var scrollController = _scrollController; if (scrollController != null && pointerXPosition != null) { if (pointerXPosition < (left + _scrollAreaSize) && scrollController.position.pixels < scrollController.position.maxScrollExtent) { // scrolling toward maxScrollExtent final overDrag = min( (left + _scrollAreaSize) - pointerXPosition + _overDragMin, _overDragMax); newOffset = min(scrollController.position.maxScrollExtent, scrollController.position.pixels + overDrag / _overDragCoefficient); } else if (pointerXPosition > (right - _scrollAreaSize) && scrollController.position.pixels > scrollController.position.minScrollExtent) { // scrolling toward minScrollExtent final overDrag = min( pointerXPosition - (right - _scrollAreaSize) + _overDragMin, _overDragMax); newOffset = max(scrollController.position.minScrollExtent, scrollController.position.pixels - overDrag / _overDragCoefficient); } } return newOffset; } static Offset localToGlobal(RenderObject object, Offset point, {RenderObject? ancestor}) { return MatrixUtils.transformPoint(object.getTransformTo(ancestor), point); } } ================================================ FILE: plugins/drag_and_drop_list/lib/drag_handle.dart ================================================ import 'package:flutter/widgets.dart'; enum DragHandleVerticalAlignment { top, center, bottom, } class DragHandle extends StatelessWidget { /// Set the drag handle to be on the left side instead of the default right side final bool onLeft; /// Align the list drag handle to the top, center, or bottom final DragHandleVerticalAlignment verticalAlignment; /// Child widget to displaying the drag handle final Widget child; const DragHandle({ Key? key, required this.child, this.onLeft = false, this.verticalAlignment = DragHandleVerticalAlignment.center, }) : super(key: key); @override Widget build(BuildContext context) { return child; } } ================================================ FILE: plugins/drag_and_drop_list/lib/measure_size.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; typedef OnWidgetSizeChange = void Function(Size? size); class MeasureSize extends StatefulWidget { final Widget? child; final OnWidgetSizeChange onSizeChange; const MeasureSize({ Key? key, required this.onSizeChange, required this.child, }) : super(key: key); @override State createState() => _MeasureSizeState(); } class _MeasureSizeState extends State { @override Widget build(BuildContext context) { SchedulerBinding.instance.addPostFrameCallback(postFrameCallback); return Container( key: widgetKey, child: widget.child, ); } var widgetKey = GlobalKey(); Size? oldSize; var topLeftPosition = Offset.zero; void postFrameCallback(_) { var context = widgetKey.currentContext; if (context == null) return; var newSize = context.size; if (oldSize != newSize) { widget.onSizeChange(newSize); oldSize = newSize; } } } ================================================ FILE: plugins/drag_and_drop_list/lib/programmatic_expansion_tile.dart ================================================ // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; const Duration _kExpand = Duration(milliseconds: 200); /// A single-line [ListTile] with a trailing button that expands or collapses /// the tile to reveal or hide the [children]. /// /// This widget is typically used with [ListView] to create an /// "expand / collapse" list entry. When used with scrolling widgets like /// [ListView], a unique [PageStorageKey] must be specified to enable the /// [ProgrammaticExpansionTile] to save and restore its expanded state when it is scrolled /// in and out of view. /// /// See also: /// /// * [ListTile], useful for creating expansion tile [children] when the /// expansion tile represents a sublist. /// * The "Expand/collapse" section of /// . class ProgrammaticExpansionTile extends StatefulWidget { /// Creates a single-line [ListTile] with a trailing button that expands or collapses /// the tile to reveal or hide the [children]. The [initiallyExpanded] property must /// be non-null. const ProgrammaticExpansionTile({ required Key key, required this.listKey, this.leading, required this.title, this.subtitle, this.isThreeLine = false, this.titleColor, this.titleColorExpanded, this.itemsBackgroundColor = Colors.grey, this.onExpansionChanged, this.children = const [], this.trailing, this.initiallyExpanded = false, this.disableTopAndBottomBorders = false, }) : super(key: key); final Key listKey; /// A widget to display before the title. /// /// Typically a [CircleAvatar] widget. final Widget? leading; /// The primary content of the list item. /// /// Typically a [Text] widget. final Widget? title; /// Additional content displayed below the title. /// /// Typically a [Text] widget. final Widget? subtitle; /// Additional content displayed below the title. /// /// Typically a [Text] widget. final bool isThreeLine; /// Called when the tile expands or collapses. /// /// When the tile starts expanding, this function is called with the value /// true. When the tile starts collapsing, this function is called with /// the value false. final ValueChanged? onExpansionChanged; /// The widgets that are displayed when the tile expands. /// /// Typically [ListTile] widgets. final List children; /// The color to display behind the sublist when expanded. final Color? titleColor; final Color? titleColorExpanded; final Color itemsBackgroundColor; /// A widget to display instead of a rotating arrow icon. final Widget? trailing; /// Specifies if the list tile is initially expanded (true) or collapsed (false, the default). final bool initiallyExpanded; /// Disable to borders displayed at the top and bottom when expanded final bool disableTopAndBottomBorders; @override ProgrammaticExpansionTileState createState() => ProgrammaticExpansionTileState(); } class ProgrammaticExpansionTileState extends State with SingleTickerProviderStateMixin { static final Animatable _easeOutTween = CurveTween(curve: Curves.easeOut); static final Animatable _easeInTween = CurveTween(curve: Curves.easeIn); static final Animatable _halfTween = Tween(begin: 0.0, end: 0.5); final ColorTween _borderColorTween = ColorTween(); final ColorTween _headerColorTween = ColorTween(); final ColorTween _iconColorTween = ColorTween(); final ColorTween _titleColorTween = ColorTween(); late AnimationController _controller; late Animation _iconTurns; late Animation _heightFactor; late Animation _borderColor; late Animation _headerColor; late Animation _iconColor; late Animation _titleColor; bool _isExpanded = false; @override void initState() { super.initState(); _controller = AnimationController(duration: _kExpand, vsync: this); _heightFactor = _controller.drive(_easeInTween); _iconTurns = _controller.drive(_halfTween.chain(_easeInTween)); _borderColor = _controller.drive(_borderColorTween.chain(_easeOutTween)); _headerColor = _controller.drive(_headerColorTween.chain(_easeInTween)); _iconColor = _controller.drive(_iconColorTween.chain(_easeInTween)); _titleColor = _controller.drive(_titleColorTween.chain(_easeOutTween)); _isExpanded = PageStorage.of(context) .readState(context, identifier: widget.listKey) as bool? ?? widget.initiallyExpanded; if (_isExpanded) _controller.value = 1.0; // Schedule the notification that widget has changed for after init // to ensure that the parent widget maintains the correct state SchedulerBinding.instance.addPostFrameCallback((Duration duration) { if (widget.onExpansionChanged != null && _isExpanded != widget.initiallyExpanded) { widget.onExpansionChanged!(_isExpanded); } }); } @override void dispose() { _controller.dispose(); super.dispose(); } void expand() { _setExpanded(true); } void collapse() { _setExpanded(false); } void toggle() { _setExpanded(!_isExpanded); } void _setExpanded(bool expanded) { if (_isExpanded != expanded) { setState(() { _isExpanded = expanded; if (_isExpanded) { _controller.forward(); } else { _controller.reverse().then((void value) { if (!mounted) return; setState(() { // Rebuild without widget.children. }); }); } PageStorage.of(context) .writeState(context, _isExpanded, identifier: widget.listKey); }); if (widget.onExpansionChanged != null) { widget.onExpansionChanged!(_isExpanded); } } } Widget _buildChildren(BuildContext context, Widget? child) { final Color borderSideColor = _borderColor.value ?? Colors.transparent; bool setBorder = !widget.disableTopAndBottomBorders; return Container( decoration: BoxDecoration( //color: _titleColor.value ?? Colors.transparent, border: setBorder ? Border( top: BorderSide(color: borderSideColor), bottom: BorderSide(color: borderSideColor), ) : null, ), child: Column( mainAxisSize: MainAxisSize.min, children: [ ListTileTheme.merge( iconColor: _iconColor.value, textColor: _headerColor.value, //Need this container to set the color because //ListTile tileColor has render bugs child: Container( color: _titleColor.value, child: ListTile( contentPadding: const EdgeInsets.only(left: 16, right: 0), onTap: toggle, leading: widget.leading ?? RotationTransition( turns: _iconTurns, child: const Icon(Icons.expand_more), ), minLeadingWidth: 0, title: widget.title, subtitle: widget.subtitle, isThreeLine: widget.isThreeLine, trailing: widget.trailing, ), ), ), ClipRect( child: Align( heightFactor: _heightFactor.value, child: Container(color: widget.itemsBackgroundColor, child: child), ), ), ], ), ); } @override void didChangeDependencies() { final ThemeData theme = Theme.of(context); _borderColorTween.end = theme.dividerColor; _headerColorTween ..begin = theme.textTheme.titleMedium!.color ..end = theme.colorScheme.secondary; _iconColorTween ..begin = theme.unselectedWidgetColor ..end = theme.colorScheme.secondary; _titleColorTween ..begin = widget.titleColor ..end = widget.titleColorExpanded; super.didChangeDependencies(); } @override Widget build(BuildContext context) { final bool closed = !_isExpanded && _controller.isDismissed; return AnimatedBuilder( animation: _controller.view, builder: _buildChildren, child: closed ? null : Column(children: widget.children as List), ); } } ================================================ FILE: plugins/drag_and_drop_list/pubspec.yaml ================================================ name: drag_and_drop_lists description: A flutter package to allow drag-and-drop reordering of two-level lists. version: 0.3.3 homepage: https://github.com/philip-brink/DragAndDropLists environment: sdk: '>=2.17.0 <3.0.0' flutter: '>=3.0.0' dependencies: flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # To add assets to your package, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # # For details regarding assets in packages, see # https://flutter.dev/assets-and-images/#from-packages # # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # To add custom fonts to your package, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts in packages, see # https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: plugins/drag_and_drop_list/test/drag_and_drop_lists_test.dart ================================================ import 'package:flutter_test/flutter_test.dart'; //import 'package:drag_and_drop_lists/drag_and_drop_lists.dart'; void main() { test('adds one to input values', () { // final calculator = Calculator(); // expect(calculator.addOne(2), 3); // expect(calculator.addOne(-7), -6); // expect(calculator.addOne(0), 1); // expect(() => calculator.addOne(null), throwsNoSuchMethodError); }); } ================================================ FILE: plugins/file_picker/.gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ migrate_working_dir/ # IntelliJ related *.iml *.ipr *.iws .idea/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter/Dart/Pub related # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. /pubspec.lock **/doc/api/ .dart_tool/ .packages build/ ================================================ FILE: plugins/file_picker/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled. version: revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 channel: stable project_type: plugin # Tracks metadata for the flutter migrate command migration: platforms: - platform: root create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 - platform: android create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 - platform: ios create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 # User provided section # List of Local paths (relative to this file) that should be # ignored by the migrate tool. # # Files that are not part of the templates will be ignored by default. unmanaged_files: - 'lib/main.dart' - 'ios/Runner.xcodeproj/project.pbxproj' ================================================ FILE: plugins/file_picker/CHANGELOG.md ================================================ ## 0.0.1 * TODO: Describe initial release. ================================================ FILE: plugins/file_picker/LICENSE ================================================ TODO: Add your license here. ================================================ FILE: plugins/file_picker/README.md ================================================ # file_picker A new Flutter plugin project. ## Getting Started This project is a starting point for a Flutter [plug-in package](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS. For help getting started with Flutter development, view the [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. ================================================ FILE: plugins/file_picker/analysis_options.yaml ================================================ include: package:flutter_lints/flutter.yaml # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options ================================================ FILE: plugins/file_picker/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures .cxx ================================================ FILE: plugins/file_picker/android/build.gradle ================================================ group 'com.example.file_picker' version '1.0-SNAPSHOT' buildscript { ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() mavenCentral() } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { compileSdkVersion 31 namespace 'com.example.file_picker' kotlinOptions { jvmTarget = "17" } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 16 } } ================================================ FILE: plugins/file_picker/android/settings.gradle ================================================ rootProject.name = 'file_picker' ================================================ FILE: plugins/file_picker/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/file_picker/android/src/main/kotlin/com/example/file_picker/FilePickerPlugin.kt ================================================ package com.example.file_picker import androidx.annotation.NonNull import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result /** FilePickerPlugin */ class FilePickerPlugin: FlutterPlugin, MethodCallHandler { /// The MethodChannel that will the communication between Flutter and native Android /// /// This local reference serves to register the plugin with the Flutter Engine and unregister it /// when the Flutter Engine is detached from the Activity private lateinit var channel : MethodChannel override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { channel = MethodChannel(flutterPluginBinding.binaryMessenger, "file_picker") channel.setMethodCallHandler(this) } override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { if (call.method == "getPlatformVersion") { result.success("Android ${android.os.Build.VERSION.RELEASE}") } else { result.notImplemented() } } override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { channel.setMethodCallHandler(null) } } ================================================ FILE: plugins/file_picker/ios/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig /Flutter/ephemeral/ /Flutter/flutter_export_environment.sh ================================================ FILE: plugins/file_picker/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/file_picker/ios/Classes/FilePickerPlugin.h ================================================ #import @interface FilePickerPlugin : NSObject @end ================================================ FILE: plugins/file_picker/ios/Classes/FilePickerPlugin.m ================================================ #import "FilePickerPlugin.h" #if __has_include() #import #else // Support project import fallback if the generated compatibility header // is not copied when this plugin is created as a library. // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 #import "file_picker-Swift.h" #endif @implementation FilePickerPlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftFilePickerPlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/file_picker/ios/Classes/SwiftFilePickerPlugin.swift ================================================ import Flutter import UIKit public class SwiftFilePickerPlugin: NSObject, FlutterPlugin, UIDocumentPickerDelegate { var documentPicker: UIDocumentPickerViewController? var result: FlutterResult? var fileContents: String? var isExporting = false public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "file_picker", binaryMessenger: registrar.messenger()) let instance = SwiftFilePickerPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { self.result = result if (call.method == "saveToFile") { if let args = call.arguments as? [String: Any], let contents = args["fileContents"] as? String, let fileName = args["fileName"] as? String { self.fileContents = contents openDocumentPicker(fileName: fileName) } else { result(FlutterError(code: "INVALID_ARGUMENTS", message: "Invalid arguments", details: nil)) } } else if (call.method == "readFile") { readDocument(result: result) } else { result(FlutterMethodNotImplemented) } } func openDocumentPicker(fileName: String) { isExporting = true DispatchQueue.main.async { guard let jsonData = self.fileContents?.data(using: .utf8) else { print("Error converting string to data") return } let tempDirectoryURL = FileManager.default.temporaryDirectory let fileURL = tempDirectoryURL.appendingPathComponent(fileName).appendingPathExtension("nuxpreset") do { try jsonData.write(to: fileURL) } catch { print("Error writing JSON data: \(error)") return } let documentPicker = UIDocumentPickerViewController(urls: [fileURL], in: .moveToService) documentPicker.delegate = self UIApplication.shared.keyWindow?.rootViewController?.present(documentPicker, animated: true, completion: nil) } } private func readDocument(result: @escaping FlutterResult) { isExporting = false let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.json", "com.tuntori.nuxpreset"], in: .import) documentPicker.delegate = self documentPicker.modalPresentationStyle = .formSheet UIApplication.shared.keyWindow?.rootViewController?.present(documentPicker, animated: true) } public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { if isExporting == false { let fileURL = urls[0] let fileData: Data do { fileData = try Data(contentsOf: fileURL) let fileContents = String(data: fileData, encoding: .utf8) result?(fileContents) } catch { print("Error reading file: \(error.localizedDescription)") result?(FlutterError(code: "ERROR", message: error.localizedDescription, details: nil)) } } } public func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) { self.result?(false) } } ================================================ FILE: plugins/file_picker/ios/file_picker.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint file_picker.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'file_picker' s.version = '0.0.1' s.summary = 'A new Flutter plugin project.' s.description = <<-DESC A new Flutter plugin project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' s.platform = :ios, '9.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' end ================================================ FILE: plugins/file_picker/lib/file_picker.dart ================================================ import 'file_picker_platform_interface.dart'; class FilePicker { Future readFile() { return FilePickerPlatform.instance.readFile(); } Future saveFile(String fileName, String fileContents) { return FilePickerPlatform.instance.saveFile(fileName, fileContents); } } ================================================ FILE: plugins/file_picker/lib/file_picker_method_channel.dart ================================================ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'file_picker_platform_interface.dart'; /// An implementation of [FilePickerPlatform] that uses method channels. class MethodChannelFilePicker extends FilePickerPlatform { /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('file_picker'); @override Future readFile() async { final data = await methodChannel.invokeMethod('readFile'); return data; } @override Future saveFile(String fileName, String fileContents) async { final version = await methodChannel .invokeMethod('saveToFile', { 'fileName':fileName, 'fileContents': fileContents}); return version; } } ================================================ FILE: plugins/file_picker/lib/file_picker_platform_interface.dart ================================================ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'file_picker_method_channel.dart'; abstract class FilePickerPlatform extends PlatformInterface { /// Constructs a FilePickerPlatform. FilePickerPlatform() : super(token: _token); static final Object _token = Object(); static FilePickerPlatform _instance = MethodChannelFilePicker(); /// The default instance of [FilePickerPlatform] to use. /// /// Defaults to [MethodChannelFilePicker]. static FilePickerPlatform get instance => _instance; /// Platform-specific implementations should set this with their own /// platform-specific class that extends [FilePickerPlatform] when /// they register themselves. static set instance(FilePickerPlatform instance) { PlatformInterface.verifyToken(instance, _token); _instance = instance; } Future readFile() { throw UnimplementedError('readFile() has not been implemented.'); } Future saveFile(String fileName, String fileContents) { throw UnimplementedError('saveFile() has not been implemented.'); } } ================================================ FILE: plugins/file_picker/pubspec.yaml ================================================ name: file_picker description: A new Flutter plugin project. version: 0.0.1 homepage: environment: sdk: '>=2.18.4 <3.0.0' flutter: ">=2.5.0" dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.0.2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # This section identifies this Flutter project as a plugin project. # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) # which should be registered in the plugin registry. This is required for # using method channels. # The Android 'package' specifies package in which the registered class is. # This is required for using method channels on Android. # The 'ffiPlugin' specifies that native code should be built and bundled. # This is required for using `dart:ffi`. # All these are used by the tooling to maintain consistency when # adding or updating assets for this project. plugin: platforms: android: package: com.example.file_picker pluginClass: FilePickerPlugin ios: pluginClass: FilePickerPlugin # To add assets to your plugin package, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # # For details regarding assets in packages, see # https://flutter.dev/assets-and-images/#from-packages # # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware # To add custom fonts to your plugin package, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts in packages, see # https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: plugins/flutter_blue_plus/CHANGELOG.md ================================================ ## 1.4.0 * Android: Add clear gatt cache method #142 (thanks to joistaus) * Android: Opt-out of the `neverForLocation` permission flag for the `BLUETOOTH_SCAN` permission. (thanks to navaronbracke) If `neverForLocation` is desired, opt back into the old behavior by adding an explicit entry to your Android Manifest: ``` ``` * Android: Scan BLE long range -devices #139 (thanks to jonik-dev) * Android: Prevent deprecation warnings #107 (thanks to sqcsabbey) * Allow native implementation to handle pairing request #109 (thanks to JRazek) ## 1.3.1 * Reverted: Ios: fixed manufacturer data parsing #104 (thanks to sqcsabbey) ## 1.3.0 * Ios: fixed manufacturer data parsing #104 (thanks to sqcsabbey) * Ios: Fixed an error when calling the connect method of a connected device #106 (thanks to figureai) * Android: Scan Filter by Mac Address #57 (thanks to Zyr00) * Upgrading to linter 2.0.1, excluding generated ProtoBuf files from linting. (thanks to MrCsabaToth) ## 1.2.0 * connect timeout fixed (thanks to crazy-rodney, sophisticode, SkuggaEdward, MousyBusiness and cthurston) * Add timestamp field to ScanResult class #59 (thanks to simon-iversen) * Add FlutterBlue.name to get the human readable device name #93 (thanks to mvo5) * Fix bug where if there were multiple subscribers to FlutterBlue.state and one cancelled it would accidentally cancel all subscribers (thank to MacMalainey and MrCsabaToth) ## 1.1.3 * Read RSSI from a connected BLE device #1 (thanks to sophisticode) * Fixed a crash on Android OS 12 (added check for BLUETOOTH_CONNECT permission) (fixed by dspells) * Added BluetoothDevice constructor from id (MAC address) (thanks to tanguypouriel) * The previous version wasn't disconnecting properly and the device could be still connected under the hood as the cancel() was not called. (fixed by killalad) * dependencies update (min micro version updating) ## 1.1.2 * Remove connect to BLE device after BLE device has disconnected #11 (fixed by sophisticode) * fixed Dart Analysis warnings ## 1.1.1 * Copyright reverted to Paul DeMarco ## 1.1.0 * Possible crash fix caused by wrong raw data (fixed by narrit) * Ios : try reconnect on unexpected disconnection (fixed by EB-Plum) * Android: Add missing break in switch, which causes exceptions (fixed by russelltg) * Android: Enforcing maxSdkVersion on the ACCESS_FINE_LOCATION permission will create issues for Android 12 devices that use location for purposes other than Bluetooth (such as using packages that actually need location). (fixed by rickcasson) ## 1.0.0 * First public release ## Versions made while fixing bugs in fork https://github.com/boskokg/flutter_blue: ## 0.12.0 Supporting Android 12 Bluetooth permissions. #940 ## 0.12.0 Delay Bluetooth permission & turn-on-Bluetooth system popups on iOS #964 ## 0.11.0 The timeout was throwing out of the Future's scope #941 Expose onValueChangedStream #882 Android: removed V1Embedding Android: removed graddle.properties Android: enable background usage Android: cannot handle devices that do not set CCCD_ID (2902) includes BLUNO #185 #797 Android: add method for getting bonded devices #586 Ios: remove support only for x86_64 simulators Ios: Don't initialize CBCentralManager until needed #599 ## 0.10.0 mtuRequest returns the negotiated MTU Android: functions to turn on/off bluetooth Android: add null check if channel is already teared down Android: code small refactoring (fixed AS warnings) Android: add null check if channel is already teared down Ios: widen protobuf version allowed ## 0.9.0 Android migrate to mavenCentral. Android support build on Macs M1 Android protobuf-gradle-plugin:0.8.15 -> 0.8.17 Ios example upgrade to latest flutter 2.5 deprecated/removed widgets fixed in example ================================================ FILE: plugins/flutter_blue_plus/LICENSE ================================================ Copyright 2021 Bosko Popovic. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Buffalo PC Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: plugins/flutter_blue_plus/README.md ================================================ [![pub package](https://img.shields.io/pub/v/flutter_blue_plus.svg)](https://pub.dartlang.org/packages/flutter_blue_plus)

FlutterBlue



## Introduction FlutterBluePlus is a bluetooth plugin for [Flutter](https://flutter.dev), a new app SDK to help developers build modern multi-platform apps. Note: this plugin is continuous work from FlutterBlue since maintaince stoped. ## Alpha version **This package must be tested on a real device.** ## Cross-Platform Bluetooth LE FlutterBluePlus aims to offer the most from both platforms (iOS and Android). Using the FlutterBluePlus instance, you can scan for and connect to nearby devices ([BluetoothDevice](#bluetoothdevice-api)). Once connected to a device, the BluetoothDevice object can discover services ([BluetoothService](lib/src/bluetooth_service.dart)), characteristics ([BluetoothCharacteristic](lib/src/bluetooth_characteristic.dart)), and descriptors ([BluetoothDescriptor](lib/src/bluetooth_descriptor.dart)). The BluetoothDevice object is then used to directly interact with characteristics and descriptors. ## Usage ### Obtain an instance ```dart FlutterBluePlus flutterBlue = FlutterBluePlus.instance; ``` ### Scan for devices ```dart // Start scanning flutterBlue.startScan(timeout: Duration(seconds: 4)); // Listen to scan results var subscription = flutterBlue.scanResults.listen((results) { // do something with scan results for (ScanResult r in results) { print('${r.device.name} found! rssi: ${r.rssi}'); } }); // Stop scanning flutterBlue.stopScan(); ``` ### Connect to a device ```dart // Connect to the device await device.connect(); // Disconnect from device device.disconnect(); ``` ### Discover services ```dart List services = await device.discoverServices(); services.forEach((service) { // do something with service }); ``` ### Read and write characteristics ```dart // Reads all characteristics var characteristics = service.characteristics; for(BluetoothCharacteristic c in characteristics) { List value = await c.read(); print(value); } // Writes to a characteristic await c.write([0x12, 0x34]) ``` ### Read and write descriptors ```dart // Reads all descriptors var descriptors = characteristic.descriptors; for(BluetoothDescriptor d in descriptors) { List value = await d.read(); print(value); } // Writes to a descriptor await d.write([0x12, 0x34]) ``` ### Set notifications and listen to changes ```dart await characteristic.setNotifyValue(true); characteristic.value.listen((value) { // do something with new value }); ``` ### Read the MTU and request larger size ```dart final mtu = await device.mtu.first; await device.requestMtu(512); ``` Note that iOS will not allow requests of MTU size, and will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185) ## Getting Started ### Change the minSdkVersion for Android flutter_blue_plus is compatible only from version 19 of Android SDK so you should change this in **android/app/build.gradle**: ```dart Android { defaultConfig { minSdkVersion: 19 ``` ### Add permissions for Bluetooth We need to add the permission to use Bluetooth and access location: #### **Android** In the **android/app/src/main/AndroidManifest.xml** let’s add: ```xml NSBluetoothAlwaysUsageDescription Need BLE permission NSBluetoothPeripheralUsageDescription Need BLE permission NSLocationAlwaysAndWhenInUseUsageDescription Need Location permission NSLocationAlwaysUsageDescription Need Location permission NSLocationWhenInUseUsageDescription Need Location permission ``` For location permissions on iOS see more at: [https://developer.apple.com/documentation/corelocation/requesting_authorization_for_location_services](https://developer.apple.com/documentation/corelocation/requesting_authorization_for_location_services) ## Reference ### FlutterBlue API | | Android | iOS | Description | | :--------------- | :----------------: | :------------------: | :-------------------------------- | | scan | :white_check_mark: | :white_check_mark: | Starts a scan for Bluetooth Low Energy devices. | | state | :white_check_mark: | :white_check_mark: | Stream of state changes for the Bluetooth Adapter. | | isAvailable | :white_check_mark: | :white_check_mark: | Checks whether the device supports Bluetooth. | | isOn | :white_check_mark: | :white_check_mark: | Checks if Bluetooth functionality is turned on. | ### BluetoothDevice API | | Android | iOS | Description | | :-------------------------- | :------------------: | :------------------: | :-------------------------------- | | connect | :white_check_mark: | :white_check_mark: | Establishes a connection to the device. | | disconnect | :white_check_mark: | :white_check_mark: | Cancels an active or pending connection to the device. | | discoverServices | :white_check_mark: | :white_check_mark: | Discovers services offered by the remote device as well as their characteristics and descriptors. | | services | :white_check_mark: | :white_check_mark: | Gets a list of services. Requires that discoverServices() has completed. | | state | :white_check_mark: | :white_check_mark: | Stream of state changes for the Bluetooth Device. | | mtu | :white_check_mark: | :white_check_mark: | Stream of mtu size changes. | | requestMtu | :white_check_mark: | | Request to change the MTU for the device. | | readRssi | :white_check_mark: | :white_check_mark: | Read RSSI from a connected device. | ### BluetoothCharacteristic API | | Android | iOS | Description | | :-------------------------- | :------------------: | :------------------: | :-------------------------------- | | read | :white_check_mark: | :white_check_mark: | Retrieves the value of the characteristic. | | write | :white_check_mark: | :white_check_mark: | Writes the value of the characteristic. | | setNotifyValue | :white_check_mark: | :white_check_mark: | Sets notifications or indications on the characteristic. | | value | :white_check_mark: | :white_check_mark: | Stream of characteristic's value when changed. | ### BluetoothDescriptor API | | Android | iOS | Description | | :-------------------------- | :------------------: | :------------------: | :-------------------------------- | | read | :white_check_mark: | :white_check_mark: | Retrieves the value of the descriptor. | | write | :white_check_mark: | :white_check_mark: | Writes the value of the descriptor. | ## Troubleshooting ### When I scan using a service UUID filter, it doesn't find any devices. Make sure the device is advertising which service UUID's it supports. This is found in the advertisement packet as **UUID 16 bit complete list** or **UUID 128 bit complete list**. ================================================ FILE: plugins/flutter_blue_plus/analysis_options.yaml ================================================ include: package:flutter_lints/flutter.yaml # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options analyzer: exclude: - /**.pbjson.dart - /**.pb.dart - /**.pbenum.dart ================================================ FILE: plugins/flutter_blue_plus/android/build.gradle ================================================ group 'com.boskokg.flutter_blue_plus' version '1.0' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.0.2' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.1' } } rootProject.allprojects { repositories { google() mavenCentral() } } apply plugin: 'com.android.library' apply plugin: 'com.google.protobuf' android { compileSdkVersion 34 namespace 'com.boskokg.flutter_blue_plus' compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } defaultConfig { minSdkVersion 19 } sourceSets { main { proto { srcDir '../protos' } } } } protobuf { protoc { if (project.hasProperty('protoc_platform')) { artifact = "com.google.protobuf:protoc:3.18.0:${protoc_platform}" } else { artifact = "com.google.protobuf:protoc:3.18.0" } } generateProtoTasks { all().each { task -> task.builtins { java { option "lite" } } } } } dependencies { implementation 'com.google.protobuf:protobuf-javalite:3.18.0' } ================================================ FILE: plugins/flutter_blue_plus/android/settings.gradle ================================================ rootProject.name = 'flutter_blue_plus' ================================================ FILE: plugins/flutter_blue_plus/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/flutter_blue_plus/android/src/main/java/com/boskokg/flutter_blue_plus/AdvertisementParser.java ================================================ // Copyright 2022, the Flutter project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.boskokg.flutter_blue_plus; import com.google.protobuf.ByteString; import com.boskokg.flutter_blue_plus.Protos.AdvertisementData; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.UUID; /** * Parser of Bluetooth Advertisement packets. */ class AdvertisementParser { /** * Parses packet data into {@link AdvertisementData} structure. * * @param rawData The scan record data. * @return An AdvertisementData proto object. * @throws ArrayIndexOutOfBoundsException if the input is truncated. */ static AdvertisementData parse(byte[] rawData) { ByteBuffer data = ByteBuffer.wrap(rawData).asReadOnlyBuffer().order(ByteOrder.LITTLE_ENDIAN); AdvertisementData.Builder ret = AdvertisementData.newBuilder(); boolean seenLongLocalName = false; do { int length = data.get() & 0xFF; if (length == 0) { break; } if (length > data.remaining()) { throw new ArrayIndexOutOfBoundsException("Not enough data."); } int type = data.get() & 0xFF; length--; switch (type) { case 0x08: // Short local name. case 0x09: { // Long local name. if (seenLongLocalName) { // Prefer the long name over the short. data.position(data.position() + length); break; } byte[] name = new byte[length]; data.get(name); try { ret.setLocalName(new String(name, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } if (type == 0x09) { seenLongLocalName = true; } break; } case 0x0A: { // Power level. ret.setTxPowerLevel(Protos.Int32Value.newBuilder().setValue(data.get())); break; } case 0x16: // Service Data with 16 bit UUID. case 0x20: // Service Data with 32 bit UUID. case 0x21: { // Service Data with 128 bit UUID. UUID uuid; int remainingDataLength = 0; if (type == 0x16 || type == 0x20) { long uuidValue; if (type == 0x16) { uuidValue = data.getShort() & 0xFFFF; remainingDataLength = length - 2; } else { uuidValue = data.getInt() & 0xFFFFFFFF; remainingDataLength = length - 4; } uuid = UUID.fromString(String.format("%08x-0000-1000-8000-00805f9b34fb", uuidValue)); } else { long msb = data.getLong(); long lsb = data.getLong(); uuid = new UUID(msb, lsb); remainingDataLength = length - 16; } byte[] remainingData = new byte[remainingDataLength]; data.get(remainingData); ret.putServiceData(uuid.toString(), ByteString.copyFrom(remainingData)); break; } case 0xFF: {// Manufacturer specific data. if(length < 2) { throw new ArrayIndexOutOfBoundsException("Not enough data for Manufacturer specific data."); } int manufacturerId = data.getShort(); if((length - 2) > 0) { byte[] msd = new byte[length - 2]; data.get(msd); ret.putManufacturerData(manufacturerId, ByteString.copyFrom(msd)); } break; } default: { data.position(data.position() + length); break; } } } while (true); return ret.build(); } } ================================================ FILE: plugins/flutter_blue_plus/android/src/main/java/com/boskokg/flutter_blue_plus/FlutterBluePlusPlugin.java ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. package com.boskokg.flutter_blue_plus; import android.Manifest; import android.annotation.TargetApi; import android.app.Application; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCallback; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.bluetooth.le.BluetoothLeScanner; import android.bluetooth.le.ScanCallback; import android.bluetooth.le.ScanFilter; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.os.ParcelUuid; import android.util.Log; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; import java.lang.reflect.Method; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.EventChannel; import io.flutter.plugin.common.EventChannel.EventSink; import io.flutter.plugin.common.EventChannel.StreamHandler; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener; public class FlutterBluePlusPlugin implements FlutterPlugin, MethodCallHandler, RequestPermissionsResultListener, ActivityAware { private static final String TAG = "FlutterBluePlugin"; private final Object initializationLock = new Object(); private final Object tearDownLock = new Object(); private Context context; private MethodChannel channel; private static final String NAMESPACE = "flutter_blue_plus"; private EventChannel stateChannel; private BluetoothManager mBluetoothManager; private BluetoothAdapter mBluetoothAdapter; private FlutterPluginBinding pluginBinding; private ActivityPluginBinding activityBinding; static final private UUID CCCD_ID = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"); private final Map mDevices = new HashMap<>(); private LogLevel logLevel = LogLevel.EMERGENCY; private interface OperationOnPermission { void op(boolean granted, String permission); } private int lastEventId = 1452; private final Map operationsOnPermission = new HashMap<>(); private final ArrayList macDeviceScanned = new ArrayList<>(); private boolean allowDuplicates = false; public FlutterBluePlusPlugin() {} @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { Log.d(TAG, "onAttachedToEngine"); pluginBinding = flutterPluginBinding; setup(pluginBinding.getBinaryMessenger(), (Application) pluginBinding.getApplicationContext()); } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { Log.d(TAG, "onDetachedFromEngine"); pluginBinding = null; tearDown(); } @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { Log.d(TAG, "onAttachedToActivity"); activityBinding = binding; activityBinding.addRequestPermissionsResultListener(this); } @Override public void onDetachedFromActivityForConfigChanges() { Log.d(TAG, "onDetachedFromActivityForConfigChanges"); onDetachedFromActivity(); } @Override public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { Log.d(TAG, "onReattachedToActivityForConfigChanges"); onAttachedToActivity(binding); } @Override public void onDetachedFromActivity() { Log.d(TAG, "onDetachedFromActivity"); activityBinding.removeRequestPermissionsResultListener(this); activityBinding = null; } private void setup( final BinaryMessenger messenger, final Application application) { synchronized (initializationLock) { Log.d(TAG, "setup"); this.context = application; channel = new MethodChannel(messenger, NAMESPACE + "/methods"); channel.setMethodCallHandler(this); stateChannel = new EventChannel(messenger, NAMESPACE + "/state"); stateChannel.setStreamHandler(stateHandler); mBluetoothManager = (BluetoothManager) application.getSystemService(Context.BLUETOOTH_SERVICE); mBluetoothAdapter = mBluetoothManager.getAdapter(); } } private void tearDown() { synchronized (tearDownLock) { Log.d(TAG, "teardown"); context = null; channel.setMethodCallHandler(null); channel = null; stateChannel.setStreamHandler(null); stateChannel = null; mBluetoothAdapter = null; mBluetoothManager = null; } } @Override public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { OperationOnPermission operation = operationsOnPermission.get(requestCode); if (operation != null && grantResults.length > 0) { operation.op(grantResults[0] == PackageManager.PERMISSION_GRANTED, permissions[0]); return true; } return false; } @Override public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { if(mBluetoothAdapter == null && !"isAvailable".equals(call.method)) { result.error("bluetooth_unavailable", "the device does not have bluetooth", null); return; } switch (call.method) { case "setLogLevel": { int logLevelIndex = (int)call.arguments; logLevel = LogLevel.values()[logLevelIndex]; result.success(null); break; } case "state": { Protos.BluetoothState.Builder p = Protos.BluetoothState.newBuilder(); try { switch(mBluetoothAdapter.getState()) { case BluetoothAdapter.STATE_OFF: p.setState(Protos.BluetoothState.State.OFF); break; case BluetoothAdapter.STATE_ON: p.setState(Protos.BluetoothState.State.ON); break; case BluetoothAdapter.STATE_TURNING_OFF: p.setState(Protos.BluetoothState.State.TURNING_OFF); break; case BluetoothAdapter.STATE_TURNING_ON: p.setState(Protos.BluetoothState.State.TURNING_ON); break; default: p.setState(Protos.BluetoothState.State.UNKNOWN); break; } } catch (SecurityException e) { p.setState(Protos.BluetoothState.State.UNAUTHORIZED); } result.success(p.build().toByteArray()); break; } case "isAvailable": { result.success(mBluetoothAdapter != null); break; } case "isOn": { result.success(mBluetoothAdapter.isEnabled()); break; } case "name": { String name = mBluetoothAdapter.getName(); if (name == null) name = ""; result.success(name); break; } case "turnOn": { if (!mBluetoothAdapter.isEnabled()) { result.success(mBluetoothAdapter.enable()); } break; } case "turnOff": { if (mBluetoothAdapter.isEnabled()) { result.success(mBluetoothAdapter.disable()); } break; } case "startScan": { ensurePermissionBeforeAction(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? Manifest.permission.BLUETOOTH_SCAN : Manifest.permission.ACCESS_FINE_LOCATION, (grantedScan, permissionScan) -> { if (grantedScan) { ensurePermissionBeforeAction(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? Manifest.permission.BLUETOOTH_CONNECT : null, (grantedConnect, permissionConnect) -> { if (grantedConnect) startScan(call, result); else result.error( "no_permissions", String.format("flutter_blue plugin requires %s for scanning", permissionConnect), null); }); } else result.error( "no_permissions", String.format("flutter_blue plugin requires %s for scanning", permissionScan), null); }); break; } case "stopScan": { stopScan(); result.success(null); break; } case "getConnectedDevices": { ensurePermissionBeforeAction(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? Manifest.permission.BLUETOOTH_CONNECT : null, (granted, permission) -> { if (!granted) { result.error( "no_permissions", String.format("flutter_blue plugin requires %s for obtaining connected devices", permission), null); return; } List devices = mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT); Protos.ConnectedDevicesResponse.Builder p = Protos.ConnectedDevicesResponse.newBuilder(); for (BluetoothDevice d : devices) { p.addDevices(ProtoMaker.from(d)); } result.success(p.build().toByteArray()); log(LogLevel.EMERGENCY, "mDevices size: " + mDevices.size()); }); break; } case "getBondedDevices": { final Set bondedDevices = mBluetoothAdapter.getBondedDevices(); Protos.ConnectedDevicesResponse.Builder p = Protos.ConnectedDevicesResponse.newBuilder(); for (BluetoothDevice d : bondedDevices) { p.addDevices(ProtoMaker.from(d)); } result.success(p.build().toByteArray()); log(LogLevel.EMERGENCY, "mDevices size: " + mDevices.size()); break; } case "connect": { ensurePermissionBeforeAction(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? Manifest.permission.BLUETOOTH_CONNECT : null, (granted, permission) -> { if (!granted) { result.error( "no_permissions", String.format("flutter_blue plugin requires %s for new connection", permission), null); return; } byte[] data = call.arguments(); Protos.ConnectRequest options; try { options = Protos.ConnectRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); return; } String deviceId = options.getRemoteId(); BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceId); boolean isConnected = mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT).contains(device); // If device is already connected, return error if(mDevices.containsKey(deviceId) && isConnected) { result.error("already_connected", "connection with device already exists", null); return; } // If device was connected to previously but is now disconnected, attempt a reconnect BluetoothDeviceCache bluetoothDeviceCache = mDevices.get(deviceId); if(bluetoothDeviceCache != null && !isConnected) { if(bluetoothDeviceCache.gatt.connect()){ result.success(null); } else { result.error("reconnect_error", "error when reconnecting to device", null); } return; } // New request, connect and add gattServer to Map BluetoothGatt gattServer; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { gattServer = device.connectGatt(context, options.getAndroidAutoConnect(), mGattCallback, BluetoothDevice.TRANSPORT_LE); } else { gattServer = device.connectGatt(context, options.getAndroidAutoConnect(), mGattCallback); } mDevices.put(deviceId, new BluetoothDeviceCache(gattServer)); result.success(null); }); break; } case "pair": { String deviceId = (String)call.arguments; BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceId); device.createBond(); result.success(null); break; } case "clearGattCache": { String deviceId = (String)call.arguments; BluetoothDeviceCache cache = mDevices.get(deviceId); Boolean hasCleared = false; if (cache != null) { BluetoothGatt gattServer = cache.gatt; try { final Method refresh = gattServer.getClass().getMethod("refresh"); if (refresh != null){ hasCleared = (Boolean) refresh.invoke(gattServer); } }catch (Exception e){ Log.d("clearGattCache", e.toString()); } Log.d("clearGattCache", "CLEAR GATT CACHE: " + hasCleared); result.success(null); } else { result.error("clearGattCache", "no instance of BluetoothGatt, have you connected first?", null); } break; } case "disconnect": { String deviceId = (String)call.arguments; BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceId); BluetoothDeviceCache cache = mDevices.remove(deviceId); if(cache != null) { BluetoothGatt gattServer = cache.gatt; gattServer.disconnect(); int state = mBluetoothManager.getConnectionState(device, BluetoothProfile.GATT); if(state == BluetoothProfile.STATE_DISCONNECTED) { gattServer.close(); } } result.success(null); break; } case "deviceState": { String deviceId = (String)call.arguments; BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceId); int state = mBluetoothManager.getConnectionState(device, BluetoothProfile.GATT); try { result.success(ProtoMaker.from(device, state).toByteArray()); } catch(Exception e) { result.error("device_state_error", e.getMessage(), e); } break; } case "discoverServices": { String deviceId = (String)call.arguments; try { BluetoothGatt gatt = locateGatt(deviceId); if(gatt.discoverServices()) { result.success(null); } else { result.error("discover_services_error", "unknown reason", null); } } catch(Exception e) { result.error("discover_services_error", e.getMessage(), e); } break; } case "services": { String deviceId = (String)call.arguments; try { BluetoothGatt gatt = locateGatt(deviceId); Protos.DiscoverServicesResult.Builder p = Protos.DiscoverServicesResult.newBuilder(); p.setRemoteId(deviceId); for(BluetoothGattService s : gatt.getServices()){ p.addServices(ProtoMaker.from(gatt.getDevice(), s, gatt)); } result.success(p.build().toByteArray()); } catch(Exception e) { result.error("get_services_error", e.getMessage(), e); } break; } case "readCharacteristic": { byte[] data = call.arguments(); Protos.ReadCharacteristicRequest request; try { request = Protos.ReadCharacteristicRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gattServer; BluetoothGattCharacteristic characteristic; try { gattServer = locateGatt(request.getRemoteId()); characteristic = locateCharacteristic(gattServer, request.getServiceUuid(), request.getSecondaryServiceUuid(), request.getCharacteristicUuid()); } catch(Exception e) { result.error("read_characteristic_error", e.getMessage(), null); return; } if(gattServer.readCharacteristic(characteristic)) { result.success(null); } else { result.error("read_characteristic_error", "unknown reason, may occur if readCharacteristic was called before last read finished.", null); } break; } case "readDescriptor": { byte[] data = call.arguments(); Protos.ReadDescriptorRequest request; try { request = Protos.ReadDescriptorRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gattServer; BluetoothGattCharacteristic characteristic; BluetoothGattDescriptor descriptor; try { gattServer = locateGatt(request.getRemoteId()); characteristic = locateCharacteristic(gattServer, request.getServiceUuid(), request.getSecondaryServiceUuid(), request.getCharacteristicUuid()); descriptor = locateDescriptor(characteristic, request.getDescriptorUuid()); } catch(Exception e) { result.error("read_descriptor_error", e.getMessage(), null); return; } if(gattServer.readDescriptor(descriptor)) { result.success(null); } else { result.error("read_descriptor_error", "unknown reason, may occur if readDescriptor was called before last read finished.", null); } break; } case "writeCharacteristic": { byte[] data = call.arguments(); Protos.WriteCharacteristicRequest request; try { request = Protos.WriteCharacteristicRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gattServer; BluetoothGattCharacteristic characteristic; try { gattServer = locateGatt(request.getRemoteId()); characteristic = locateCharacteristic(gattServer, request.getServiceUuid(), request.getSecondaryServiceUuid(), request.getCharacteristicUuid()); } catch(Exception e) { result.error("write_characteristic_error", e.getMessage(), null); return; } // Set characteristic to new value if(!characteristic.setValue(request.getValue().toByteArray())){ result.error("write_characteristic_error", "could not set the local value of characteristic", null); } // Apply the correct write type if(request.getWriteType() == Protos.WriteCharacteristicRequest.WriteType.WITHOUT_RESPONSE) { characteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE); } else { characteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT); } if(!gattServer.writeCharacteristic(characteristic)){ result.error("write_characteristic_error", "writeCharacteristic failed", null); return; } result.success(null); break; } case "writeDescriptor": { byte[] data = call.arguments(); Protos.WriteDescriptorRequest request; try { request = Protos.WriteDescriptorRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gattServer; BluetoothGattCharacteristic characteristic; BluetoothGattDescriptor descriptor; try { gattServer = locateGatt(request.getRemoteId()); characteristic = locateCharacteristic(gattServer, request.getServiceUuid(), request.getSecondaryServiceUuid(), request.getCharacteristicUuid()); descriptor = locateDescriptor(characteristic, request.getDescriptorUuid()); } catch(Exception e) { result.error("write_descriptor_error", e.getMessage(), null); return; } // Set descriptor to new value if(!descriptor.setValue(request.getValue().toByteArray())){ result.error("write_descriptor_error", "could not set the local value for descriptor", null); } if(!gattServer.writeDescriptor(descriptor)){ result.error("write_descriptor_error", "writeCharacteristic failed", null); return; } result.success(null); break; } case "setNotification": { byte[] data = call.arguments(); Protos.SetNotificationRequest request; try { request = Protos.SetNotificationRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gattServer; BluetoothGattCharacteristic characteristic; BluetoothGattDescriptor cccDescriptor; try { gattServer = locateGatt(request.getRemoteId()); characteristic = locateCharacteristic(gattServer, request.getServiceUuid(), request.getSecondaryServiceUuid(), request.getCharacteristicUuid()); cccDescriptor = characteristic.getDescriptor(CCCD_ID); if(cccDescriptor == null) { //Some devices - including the widely used Bluno do not actually set the CCCD_ID. //thus setNotifications works perfectly (tested on Bluno) without cccDescriptor log(LogLevel.INFO, "could not locate CCCD descriptor for characteristic: " + characteristic.getUuid().toString()); } } catch(Exception e) { result.error("set_notification_error", e.getMessage(), null); return; } byte[] value = null; if(request.getEnable()) { boolean canNotify = (characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0; boolean canIndicate = (characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_INDICATE) > 0; if(!canIndicate && !canNotify) { result.error("set_notification_error", "the characteristic cannot notify or indicate", null); return; } if(canIndicate) { value = BluetoothGattDescriptor.ENABLE_INDICATION_VALUE; } if(canNotify) { value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE; } } else { value = BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE; } if(!gattServer.setCharacteristicNotification(characteristic, request.getEnable())){ result.error("set_notification_error", "could not set characteristic notifications to :" + request.getEnable(), null); return; } if(cccDescriptor != null) { if (!cccDescriptor.setValue(value)) { result.error("set_notification_error", "error when setting the descriptor value to: " + Arrays.toString(value), null); return; } if (!gattServer.writeDescriptor(cccDescriptor)) { result.error("set_notification_error", "error when writing the descriptor", null); return; } } result.success(null); break; } case "mtu": { String deviceId = (String)call.arguments; BluetoothDeviceCache cache = mDevices.get(deviceId); if(cache != null) { Protos.MtuSizeResponse.Builder p = Protos.MtuSizeResponse.newBuilder(); p.setRemoteId(deviceId); p.setMtu(cache.mtu); result.success(p.build().toByteArray()); } else { result.error("mtu", "no instance of BluetoothGatt, have you connected first?", null); } break; } case "requestMtu": { byte[] data = call.arguments(); Protos.MtuSizeRequest request; try { request = Protos.MtuSizeRequest.newBuilder().mergeFrom(data).build(); } catch (InvalidProtocolBufferException e) { result.error("RuntimeException", e.getMessage(), e); break; } BluetoothGatt gatt; try { gatt = locateGatt(request.getRemoteId()); int mtu = request.getMtu(); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if(gatt.requestMtu(mtu)) { result.success(null); } else { result.error("requestMtu", "gatt.requestMtu returned false", null); } } else { result.error("requestMtu", "Only supported on devices >= API 21 (Lollipop). This device == " + Build.VERSION.SDK_INT, null); } } catch(Exception e) { result.error("requestMtu", e.getMessage(), e); } break; } case "readRssi": { String remoteId = (String)call.arguments; BluetoothGatt gatt; try { gatt = locateGatt(remoteId); if(gatt.readRemoteRssi()) { result.success(null); } else { result.error("readRssi", "gatt.readRemoteRssi returned false", null); } } catch(Exception e) { result.error("readRssi", e.getMessage(), e); } break; } default: { result.notImplemented(); break; } } } private void ensurePermissionBeforeAction(String permission, OperationOnPermission operation) { if (permission != null && ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) { operationsOnPermission.put(lastEventId, (granted, perm) -> { operationsOnPermission.remove(lastEventId); operation.op(granted, perm); }); ActivityCompat.requestPermissions( activityBinding.getActivity(), new String[]{permission}, lastEventId); lastEventId++; } else { operation.op(true, permission); } } private BluetoothGatt locateGatt(String remoteId) throws Exception { BluetoothDeviceCache cache = mDevices.get(remoteId); if(cache == null || cache.gatt == null) { throw new Exception("no instance of BluetoothGatt, have you connected first?"); } else { return cache.gatt; } } private BluetoothGattCharacteristic locateCharacteristic(BluetoothGatt gattServer, String serviceId, String secondaryServiceId, String characteristicId) throws Exception { BluetoothGattService primaryService = gattServer.getService(UUID.fromString(serviceId)); if(primaryService == null) { throw new Exception("service (" + serviceId + ") could not be located on the device"); } BluetoothGattService secondaryService = null; if(secondaryServiceId.length() > 0) { for(BluetoothGattService s : primaryService.getIncludedServices()){ if(s.getUuid().equals(UUID.fromString(secondaryServiceId))){ secondaryService = s; } } if(secondaryService == null) { throw new Exception("secondary service (" + secondaryServiceId + ") could not be located on the device"); } } BluetoothGattService service = (secondaryService != null) ? secondaryService : primaryService; BluetoothGattCharacteristic characteristic = service.getCharacteristic(UUID.fromString(characteristicId)); if(characteristic == null) { throw new Exception("characteristic (" + characteristicId + ") could not be located in the service ("+service.getUuid().toString()+")"); } return characteristic; } private BluetoothGattDescriptor locateDescriptor(BluetoothGattCharacteristic characteristic, String descriptorId) throws Exception { BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(descriptorId)); if(descriptor == null) { throw new Exception("descriptor (" + descriptorId + ") could not be located in the characteristic ("+characteristic.getUuid().toString()+")"); } return descriptor; } private final StreamHandler stateHandler = new StreamHandler() { private EventSink sink; private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) { final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); switch (state) { case BluetoothAdapter.STATE_OFF: sink.success(Protos.BluetoothState.newBuilder().setState(Protos.BluetoothState.State.OFF).build().toByteArray()); break; case BluetoothAdapter.STATE_TURNING_OFF: sink.success(Protos.BluetoothState.newBuilder().setState(Protos.BluetoothState.State.TURNING_OFF).build().toByteArray()); break; case BluetoothAdapter.STATE_ON: sink.success(Protos.BluetoothState.newBuilder().setState(Protos.BluetoothState.State.ON).build().toByteArray()); break; case BluetoothAdapter.STATE_TURNING_ON: sink.success(Protos.BluetoothState.newBuilder().setState(Protos.BluetoothState.State.TURNING_ON).build().toByteArray()); break; } } } }; @Override public void onListen(Object o, EventChannel.EventSink eventSink) { sink = eventSink; IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED); context.registerReceiver(mReceiver, filter); } @Override public void onCancel(Object o) { sink = null; context.unregisterReceiver(mReceiver); } }; private void startScan(MethodCall call, Result result) { byte[] data = call.arguments(); Protos.ScanSettings settings; try { settings = Protos.ScanSettings.newBuilder().mergeFrom(data).build(); allowDuplicates = settings.getAllowDuplicates(); macDeviceScanned.clear(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { startScan21(settings); } else { startScan18(settings); } result.success(null); } catch (Exception e) { result.error("startScan", e.getMessage(), e); } } private void stopScan() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { stopScan21(); } else { stopScan18(); } } private ScanCallback scanCallback21; @TargetApi(21) private ScanCallback getScanCallback21() { if(scanCallback21 == null){ scanCallback21 = new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); if(result != null){ if (!allowDuplicates && result.getDevice() != null && result.getDevice().getAddress() != null) { if (macDeviceScanned.contains(result.getDevice().getAddress())) { return; } macDeviceScanned.add(result.getDevice().getAddress()); } Protos.ScanResult scanResult = ProtoMaker.from(result.getDevice(), result); invokeMethodUIThread("ScanResult", scanResult.toByteArray()); } } @Override public void onBatchScanResults(List results) { super.onBatchScanResults(results); } @Override public void onScanFailed(int errorCode) { super.onScanFailed(errorCode); } }; } return scanCallback21; } @TargetApi(21) private void startScan21(Protos.ScanSettings proto) throws IllegalStateException { BluetoothLeScanner scanner = mBluetoothAdapter.getBluetoothLeScanner(); if(scanner == null) throw new IllegalStateException("getBluetoothLeScanner() is null. Is the Adapter on?"); int scanMode = proto.getAndroidScanMode(); List filters = fetchFilters(proto); ScanSettings settings; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { settings = new ScanSettings.Builder() .setPhy(ScanSettings.PHY_LE_ALL_SUPPORTED) .setLegacy(false) .setScanMode(scanMode) .build(); } else { settings = new ScanSettings.Builder().setScanMode(scanMode).build(); } scanner.startScan(filters, settings, getScanCallback21()); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private List fetchFilters(Protos.ScanSettings proto) { List filters; int macCount = proto.getMacAddressesCount(); int serviceCount = proto.getServiceUuidsCount(); int count = macCount > 0 ? macCount : serviceCount; filters = new ArrayList<>(count); for (int i = 0; i < count; i++) { ScanFilter f; if (macCount > 0) { String macAddress = proto.getMacAddresses(i); f = new ScanFilter.Builder().setDeviceAddress(macAddress).build(); } else { String uuid = proto.getServiceUuids(i); f = new ScanFilter.Builder().setServiceUuid(ParcelUuid.fromString(uuid)).build(); } filters.add(f); } return filters; } @TargetApi(21) private void stopScan21() { BluetoothLeScanner scanner = mBluetoothAdapter.getBluetoothLeScanner(); if(scanner != null) scanner.stopScan(getScanCallback21()); } private BluetoothAdapter.LeScanCallback scanCallback18; private BluetoothAdapter.LeScanCallback getScanCallback18() { if(scanCallback18 == null) { scanCallback18 = (bluetoothDevice, rssi, scanRecord) -> { if (!allowDuplicates && bluetoothDevice != null && bluetoothDevice.getAddress() != null) { if (macDeviceScanned.contains(bluetoothDevice.getAddress())) return; macDeviceScanned.add(bluetoothDevice.getAddress()); } Protos.ScanResult scanResult = ProtoMaker.from(bluetoothDevice, scanRecord, rssi); invokeMethodUIThread("ScanResult", scanResult.toByteArray()); }; } return scanCallback18; } @SuppressWarnings("deprecation") private void startScan18(Protos.ScanSettings proto) throws IllegalStateException { List serviceUuids = proto.getServiceUuidsList(); UUID[] uuids = new UUID[serviceUuids.size()]; for(int i = 0; i < serviceUuids.size(); i++) { uuids[i] = UUID.fromString(serviceUuids.get(i)); } boolean success = mBluetoothAdapter.startLeScan(uuids, getScanCallback18()); if(!success) throw new IllegalStateException("getBluetoothLeScanner() is null. Is the Adapter on?"); } @SuppressWarnings("deprecation") private void stopScan18() { mBluetoothAdapter.stopLeScan(getScanCallback18()); } private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { log(LogLevel.DEBUG, "[onConnectionStateChange] status: " + status + " newState: " + newState); if(newState == BluetoothProfile.STATE_DISCONNECTED) { if(!mDevices.containsKey(gatt.getDevice().getAddress())) { gatt.close(); } } invokeMethodUIThread("DeviceState", ProtoMaker.from(gatt.getDevice(), newState).toByteArray()); } @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { log(LogLevel.DEBUG, "[onServicesDiscovered] count: " + gatt.getServices().size() + " status: " + status); Protos.DiscoverServicesResult.Builder p = Protos.DiscoverServicesResult.newBuilder(); p.setRemoteId(gatt.getDevice().getAddress()); for(BluetoothGattService s : gatt.getServices()) { p.addServices(ProtoMaker.from(gatt.getDevice(), s, gatt)); } invokeMethodUIThread("DiscoverServicesResult", p.build().toByteArray()); } @Override public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { log(LogLevel.DEBUG, "[onCharacteristicRead] uuid: " + characteristic.getUuid().toString() + " status: " + status); Protos.ReadCharacteristicResponse.Builder p = Protos.ReadCharacteristicResponse.newBuilder(); p.setRemoteId(gatt.getDevice().getAddress()); p.setCharacteristic(ProtoMaker.from(gatt.getDevice(), characteristic, gatt)); invokeMethodUIThread("ReadCharacteristicResponse", p.build().toByteArray()); } @Override public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { log(LogLevel.DEBUG, "[onCharacteristicWrite] uuid: " + characteristic.getUuid().toString() + " status: " + status); Protos.WriteCharacteristicRequest.Builder request = Protos.WriteCharacteristicRequest.newBuilder(); request.setRemoteId(gatt.getDevice().getAddress()); request.setCharacteristicUuid(characteristic.getUuid().toString()); request.setServiceUuid(characteristic.getService().getUuid().toString()); Protos.WriteCharacteristicResponse.Builder p = Protos.WriteCharacteristicResponse.newBuilder(); p.setRequest(request); p.setSuccess(status == BluetoothGatt.GATT_SUCCESS); invokeMethodUIThread("WriteCharacteristicResponse", p.build().toByteArray()); } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { log(LogLevel.DEBUG, "[onCharacteristicChanged] uuid: " + characteristic.getUuid().toString()); Protos.OnCharacteristicChanged.Builder p = Protos.OnCharacteristicChanged.newBuilder(); p.setRemoteId(gatt.getDevice().getAddress()); p.setCharacteristic(ProtoMaker.from(gatt.getDevice(), characteristic, gatt)); invokeMethodUIThread("OnCharacteristicChanged", p.build().toByteArray()); } @Override public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { log(LogLevel.DEBUG, "[onDescriptorRead] uuid: " + descriptor.getUuid().toString() + " status: " + status); // Rebuild the ReadAttributeRequest and send back along with response Protos.ReadDescriptorRequest.Builder q = Protos.ReadDescriptorRequest.newBuilder(); q.setRemoteId(gatt.getDevice().getAddress()); q.setCharacteristicUuid(descriptor.getCharacteristic().getUuid().toString()); q.setDescriptorUuid(descriptor.getUuid().toString()); if(descriptor.getCharacteristic().getService().getType() == BluetoothGattService.SERVICE_TYPE_PRIMARY) { q.setServiceUuid(descriptor.getCharacteristic().getService().getUuid().toString()); } else { // Reverse search to find service for(BluetoothGattService s : gatt.getServices()) { for(BluetoothGattService ss : s.getIncludedServices()) { if(ss.getUuid().equals(descriptor.getCharacteristic().getService().getUuid())){ q.setServiceUuid(s.getUuid().toString()); q.setSecondaryServiceUuid(ss.getUuid().toString()); break; } } } } Protos.ReadDescriptorResponse.Builder p = Protos.ReadDescriptorResponse.newBuilder(); p.setRequest(q); p.setValue(ByteString.copyFrom(descriptor.getValue())); invokeMethodUIThread("ReadDescriptorResponse", p.build().toByteArray()); } @Override public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { log(LogLevel.DEBUG, "[onDescriptorWrite] uuid: " + descriptor.getUuid().toString() + " status: " + status); Protos.WriteDescriptorRequest.Builder request = Protos.WriteDescriptorRequest.newBuilder(); request.setRemoteId(gatt.getDevice().getAddress()); request.setDescriptorUuid(descriptor.getUuid().toString()); request.setCharacteristicUuid(descriptor.getCharacteristic().getUuid().toString()); request.setServiceUuid(descriptor.getCharacteristic().getService().getUuid().toString()); Protos.WriteDescriptorResponse.Builder p = Protos.WriteDescriptorResponse.newBuilder(); p.setRequest(request); p.setSuccess(status == BluetoothGatt.GATT_SUCCESS); invokeMethodUIThread("WriteDescriptorResponse", p.build().toByteArray()); if(descriptor.getUuid().compareTo(CCCD_ID) == 0) { // SetNotificationResponse Protos.SetNotificationResponse.Builder q = Protos.SetNotificationResponse.newBuilder(); q.setRemoteId(gatt.getDevice().getAddress()); q.setCharacteristic(ProtoMaker.from(gatt.getDevice(), descriptor.getCharacteristic(), gatt)); invokeMethodUIThread("SetNotificationResponse", q.build().toByteArray()); } } @Override public void onReliableWriteCompleted(BluetoothGatt gatt, int status) { log(LogLevel.DEBUG, "[onReliableWriteCompleted] status: " + status); } @Override public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) { log(LogLevel.DEBUG, "[onReadRemoteRssi] rssi: " + rssi + " status: " + status); if(status == BluetoothGatt.GATT_SUCCESS) { Protos.ReadRssiResult.Builder p = Protos.ReadRssiResult.newBuilder(); p.setRemoteId(gatt.getDevice().getAddress()); p.setRssi(rssi); invokeMethodUIThread("ReadRssiResult", p.build().toByteArray()); } } @Override public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) { log(LogLevel.DEBUG, "[onMtuChanged] mtu: " + mtu + " status: " + status); if(status == BluetoothGatt.GATT_SUCCESS) { if(mDevices.containsKey(gatt.getDevice().getAddress())) { BluetoothDeviceCache cache = mDevices.get(gatt.getDevice().getAddress()); if (cache != null) { cache.mtu = mtu; } Protos.MtuSizeResponse.Builder p = Protos.MtuSizeResponse.newBuilder(); p.setRemoteId(gatt.getDevice().getAddress()); p.setMtu(mtu); invokeMethodUIThread("MtuSize", p.build().toByteArray()); } } } }; private void log(LogLevel level, String message) { if(level.ordinal() <= logLevel.ordinal()) { Log.d(TAG, message); } } private void invokeMethodUIThread(final String name, final byte[] byteArray) { new Handler(Looper.getMainLooper()).post(() -> { synchronized (tearDownLock) { //Could already be teared down at this moment if (channel != null) { channel.invokeMethod(name, byteArray); } else { Log.w(TAG, "Tried to call " + name + " on closed channel"); } } }); } enum LogLevel { EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG } // BluetoothDeviceCache contains any other cached information not stored in Android Bluetooth API // but still needed Dart side. static class BluetoothDeviceCache { final BluetoothGatt gatt; int mtu; BluetoothDeviceCache(BluetoothGatt gatt) { this.gatt = gatt; mtu = 20; } } } ================================================ FILE: plugins/flutter_blue_plus/android/src/main/java/com/boskokg/flutter_blue_plus/ProtoMaker.java ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. package com.boskokg.flutter_blue_plus; import android.annotation.TargetApi; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothProfile; import android.bluetooth.le.ScanRecord; import android.bluetooth.le.ScanResult; import android.os.Build; import android.os.Parcel; import android.os.ParcelUuid; import android.util.Log; import android.util.SparseArray; import com.google.protobuf.ByteString; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.UUID; /** * Created by bosko on 30/01/22. */ public class ProtoMaker { private static final UUID CCCD_UUID = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"); static Protos.ScanResult from(BluetoothDevice device, byte[] advertisementData, int rssi) { Protos.ScanResult.Builder p = Protos.ScanResult.newBuilder(); p.setDevice(from(device)); if(advertisementData != null && advertisementData.length > 0) p.setAdvertisementData(AdvertisementParser.parse(advertisementData)); p.setRssi(rssi); return p.build(); } @TargetApi(21) static Protos.ScanResult from(BluetoothDevice device, ScanResult scanResult) { Protos.ScanResult.Builder p = Protos.ScanResult.newBuilder(); p.setDevice(from(device)); Protos.AdvertisementData.Builder a = Protos.AdvertisementData.newBuilder(); ScanRecord scanRecord = scanResult.getScanRecord(); if(Build.VERSION.SDK_INT >= 26) { a.setConnectable(scanResult.isConnectable()); } else { if(scanRecord != null) { int flags = scanRecord.getAdvertiseFlags(); a.setConnectable((flags & 0x2) > 0); } } if(scanRecord != null) { String deviceName = scanRecord.getDeviceName(); if(deviceName != null) { a.setLocalName(deviceName); } int txPower = scanRecord.getTxPowerLevel(); if(txPower != Integer.MIN_VALUE) { a.setTxPowerLevel(Protos.Int32Value.newBuilder().setValue(txPower)); } // Manufacturer Specific Data SparseArray msd = scanRecord.getManufacturerSpecificData(); if(msd != null) { for (int i = 0; i < msd.size(); i++) { int key = msd.keyAt(i); byte[] value = msd.valueAt(i); a.putManufacturerData(key, ByteString.copyFrom(value)); } } // Service Data Map serviceData = scanRecord.getServiceData(); if(serviceData != null) { for (Map.Entry entry : serviceData.entrySet()) { ParcelUuid key = entry.getKey(); byte[] value = entry.getValue(); a.putServiceData(key.getUuid().toString(), ByteString.copyFrom(value)); } } // Service UUIDs List serviceUuids = scanRecord.getServiceUuids(); if(serviceUuids != null) { for (ParcelUuid s : serviceUuids) { a.addServiceUuids(s.getUuid().toString()); } } } p.setRssi(scanResult.getRssi()); p.setAdvertisementData(a.build()); return p.build(); } static Protos.BluetoothDevice from(BluetoothDevice device) { Protos.BluetoothDevice.Builder p = Protos.BluetoothDevice.newBuilder(); p.setRemoteId(device.getAddress()); String name = device.getName(); if(name != null) { p.setName(name); } switch(device.getType()){ case BluetoothDevice.DEVICE_TYPE_LE: p.setType(Protos.BluetoothDevice.Type.LE); break; case BluetoothDevice.DEVICE_TYPE_CLASSIC: p.setType(Protos.BluetoothDevice.Type.CLASSIC); break; case BluetoothDevice.DEVICE_TYPE_DUAL: p.setType(Protos.BluetoothDevice.Type.DUAL); break; default: p.setType(Protos.BluetoothDevice.Type.UNKNOWN); break; } return p.build(); } static Protos.BluetoothService from(BluetoothDevice device, BluetoothGattService service, BluetoothGatt gatt) { Protos.BluetoothService.Builder p = Protos.BluetoothService.newBuilder(); p.setRemoteId(device.getAddress()); p.setUuid(service.getUuid().toString()); p.setIsPrimary(service.getType() == BluetoothGattService.SERVICE_TYPE_PRIMARY); for(BluetoothGattCharacteristic c : service.getCharacteristics()) { p.addCharacteristics(from(device, c, gatt)); } for(BluetoothGattService s : service.getIncludedServices()) { p.addIncludedServices(from(device, s, gatt)); } return p.build(); } static Protos.BluetoothCharacteristic from(BluetoothDevice device, BluetoothGattCharacteristic characteristic, BluetoothGatt gatt) { Protos.BluetoothCharacteristic.Builder p = Protos.BluetoothCharacteristic.newBuilder(); p.setRemoteId(device.getAddress()); p.setUuid(characteristic.getUuid().toString()); p.setProperties(from(characteristic.getProperties())); if(characteristic.getValue() != null) p.setValue(ByteString.copyFrom(characteristic.getValue())); for(BluetoothGattDescriptor d : characteristic.getDescriptors()) { p.addDescriptors(from(device, d)); } if(characteristic.getService().getType() == BluetoothGattService.SERVICE_TYPE_PRIMARY) { p.setServiceUuid(characteristic.getService().getUuid().toString()); } else { // Reverse search to find service for(BluetoothGattService s : gatt.getServices()) { for(BluetoothGattService ss : s.getIncludedServices()) { if(ss.getUuid().equals(characteristic.getService().getUuid())){ p.setServiceUuid(s.getUuid().toString()); p.setSecondaryServiceUuid(ss.getUuid().toString()); break; } } } } return p.build(); } static Protos.BluetoothDescriptor from(BluetoothDevice device, BluetoothGattDescriptor descriptor) { Protos.BluetoothDescriptor.Builder p = Protos.BluetoothDescriptor.newBuilder(); p.setRemoteId(device.getAddress()); p.setUuid(descriptor.getUuid().toString()); p.setCharacteristicUuid(descriptor.getCharacteristic().getUuid().toString()); p.setServiceUuid(descriptor.getCharacteristic().getService().getUuid().toString()); if(descriptor.getValue() != null) p.setValue(ByteString.copyFrom(descriptor.getValue())); return p.build(); } static Protos.CharacteristicProperties from(int properties) { return Protos.CharacteristicProperties.newBuilder() .setBroadcast((properties & 1) != 0) .setRead((properties & 2) != 0) .setWriteWithoutResponse((properties & 4) != 0) .setWrite((properties & 8) != 0) .setNotify((properties & 16) != 0) .setIndicate((properties & 32) != 0) .setAuthenticatedSignedWrites((properties & 64) != 0) .setExtendedProperties((properties & 128) != 0) .setNotifyEncryptionRequired((properties & 256) != 0) .setIndicateEncryptionRequired((properties & 512) != 0) .build(); } static Protos.DeviceStateResponse from(BluetoothDevice device, int state) { Protos.DeviceStateResponse.Builder p = Protos.DeviceStateResponse.newBuilder(); switch(state) { case BluetoothProfile.STATE_DISCONNECTING: p.setState(Protos.DeviceStateResponse.BluetoothDeviceState.DISCONNECTING); break; case BluetoothProfile.STATE_CONNECTED: p.setState(Protos.DeviceStateResponse.BluetoothDeviceState.CONNECTED); break; case BluetoothProfile.STATE_CONNECTING: p.setState(Protos.DeviceStateResponse.BluetoothDeviceState.CONNECTING); break; case BluetoothProfile.STATE_DISCONNECTED: p.setState(Protos.DeviceStateResponse.BluetoothDeviceState.DISCONNECTED); break; default: break; } p.setRemoteId(device.getAddress()); return p.build(); } } ================================================ FILE: plugins/flutter_blue_plus/ios/Classes/FlutterBluePlusPlugin.h ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #import #import #define NAMESPACE @"flutter_blue_plus" @interface FlutterBluePlusPlugin : NSObject @end @interface FlutterBluePlusStreamHandler : NSObject @property FlutterEventSink sink; @end ================================================ FILE: plugins/flutter_blue_plus/ios/Classes/FlutterBluePlusPlugin.m ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #import "FlutterBluePlusPlugin.h" #import "Flutterblueplus.pbobjc.h" @interface CBUUID (CBUUIDAdditionsFlutterBluePlus) - (NSString *)fullUUIDString; @end @implementation CBUUID (CBUUIDAdditionsFlutterBluePlus) - (NSString *)fullUUIDString { if(self.UUIDString.length == 4) { return [[NSString stringWithFormat:@"0000%@-0000-1000-8000-00805F9B34FB", self.UUIDString] lowercaseString]; } return [self.UUIDString lowercaseString]; } @end typedef NS_ENUM(NSUInteger, LogLevel) { emergency = 0, alert = 1, critical = 2, error = 3, warning = 4, notice = 5, info = 6, debug = 7 }; @interface FlutterBluePlusPlugin () @property(nonatomic, retain) NSObject *registrar; @property(nonatomic, retain) FlutterMethodChannel *channel; @property(nonatomic, retain) FlutterBluePlusStreamHandler *stateStreamHandler; @property(nonatomic, retain) CBCentralManager *centralManager; @property(nonatomic) NSMutableDictionary *scannedPeripherals; @property(nonatomic) NSMutableArray *servicesThatNeedDiscovered; @property(nonatomic) NSMutableArray *characteristicsThatNeedDiscovered; @property(nonatomic) LogLevel logLevel; @end @implementation FlutterBluePlusPlugin + (void)registerWithRegistrar:(NSObject*)registrar { FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:NAMESPACE @"/methods" binaryMessenger:[registrar messenger]]; FlutterEventChannel* stateChannel = [FlutterEventChannel eventChannelWithName:NAMESPACE @"/state" binaryMessenger:[registrar messenger]]; FlutterBluePlusPlugin* instance = [[FlutterBluePlusPlugin alloc] init]; instance.channel = channel; instance.scannedPeripherals = [NSMutableDictionary new]; instance.servicesThatNeedDiscovered = [NSMutableArray new]; instance.characteristicsThatNeedDiscovered = [NSMutableArray new]; instance.logLevel = emergency; // STATE FlutterBluePlusStreamHandler* stateStreamHandler = [[FlutterBluePlusStreamHandler alloc] init]; [stateChannel setStreamHandler:stateStreamHandler]; instance.stateStreamHandler = stateStreamHandler; [registrar addMethodCallDelegate:instance channel:channel]; } - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { if ([@"setLogLevel" isEqualToString:call.method]) { NSNumber *logLevelIndex = [call arguments]; _logLevel = (LogLevel)[logLevelIndex integerValue]; result(nil); return; } if (self.centralManager == nil) { self.centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; } if ([@"state" isEqualToString:call.method]) { FlutterStandardTypedData *data = [self toFlutterData:[self toBluetoothStateProto:self->_centralManager.state]]; result(data); } else if([@"isAvailable" isEqualToString:call.method]) { if(self.centralManager.state != CBManagerStateUnsupported && self.centralManager.state != CBManagerStateUnknown) { result(@(YES)); } else { result(@(NO)); } } else if([@"isOn" isEqualToString:call.method]) { if(self.centralManager.state == CBManagerStatePoweredOn) { result(@(YES)); } else { result(@(NO)); } } else if([@"name" isEqualToString:call.method]) { result([[UIDevice currentDevice] name]); } else if([@"startScan" isEqualToString:call.method]) { // Clear any existing scan results [self.scannedPeripherals removeAllObjects]; // TODO: Request Permission? FlutterStandardTypedData *data = [call arguments]; ProtosScanSettings *request = [[ProtosScanSettings alloc] initWithData:[data data] error:nil]; // UUID Service filter NSArray *uuids = [NSArray array]; for (int i = 0; i < [request serviceUuidsArray_Count]; i++) { NSString *u = [request.serviceUuidsArray objectAtIndex:i]; uuids = [uuids arrayByAddingObject:[CBUUID UUIDWithString:u]]; } NSMutableDictionary *scanOpts = [NSMutableDictionary new]; if (request.allowDuplicates) { [scanOpts setObject:[NSNumber numberWithBool:YES] forKey:CBCentralManagerScanOptionAllowDuplicatesKey]; } [self->_centralManager scanForPeripheralsWithServices:uuids options:scanOpts]; result(nil); } else if([@"stopScan" isEqualToString:call.method]) { [self->_centralManager stopScan]; result(nil); } else if([@"getConnectedDevices" isEqualToString:call.method]) { // Cannot pass blank UUID list for security reasons. Assume all devices have the Generic Access service 0x1800 NSArray *periphs = [self->_centralManager retrieveConnectedPeripheralsWithServices:@[[CBUUID UUIDWithString:@"1800"]]]; NSLog(@"getConnectedDevices periphs size: %lu", [periphs count]); result([self toFlutterData:[self toConnectedDeviceResponseProto:periphs]]); } else if([@"connect" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosConnectRequest *request = [[ProtosConnectRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { CBPeripheral *peripheral = [_scannedPeripherals objectForKey:remoteId]; if(peripheral == nil) { NSArray *periphs = [self->_centralManager retrieveConnectedPeripheralsWithServices:@[[CBUUID UUIDWithString:@"1800"]]]; for (CBPeripheral *p in periphs) { NSString *uuid = [[p identifier] UUIDString]; p.delegate = self; [_scannedPeripherals setObject:p forKey:uuid]; } peripheral = [_scannedPeripherals objectForKey:remoteId]; } if(peripheral == nil) { @throw [FlutterError errorWithCode:@"connect" message:@"Peripheral not found" details:nil]; } // TODO: Implement Connect options (#36) [_centralManager connectPeripheral:peripheral options:nil]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"disconnect" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; [_centralManager cancelPeripheralConnection:peripheral]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"deviceState" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; result([self toFlutterData:[self toDeviceStateProto:peripheral state:peripheral.state]]); } @catch(FlutterError *e) { result(e); } } else if([@"discoverServices" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Clear helper arrays [_servicesThatNeedDiscovered removeAllObjects]; [_characteristicsThatNeedDiscovered removeAllObjects ]; [peripheral discoverServices:nil]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"services" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; result([self toFlutterData:[self toServicesResultProto:peripheral]]); } @catch(FlutterError *e) { result(e); } } else if([@"readCharacteristic" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosReadCharacteristicRequest *request = [[ProtosReadCharacteristicRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { // Find peripheral CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Find characteristic CBCharacteristic *characteristic = [self locateCharacteristic:[request characteristicUuid] peripheral:peripheral serviceId:[request serviceUuid] secondaryServiceId:[request secondaryServiceUuid]]; // Trigger a read [peripheral readValueForCharacteristic:characteristic]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"readDescriptor" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosReadDescriptorRequest *request = [[ProtosReadDescriptorRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { // Find peripheral CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Find characteristic CBCharacteristic *characteristic = [self locateCharacteristic:[request characteristicUuid] peripheral:peripheral serviceId:[request serviceUuid] secondaryServiceId:[request secondaryServiceUuid]]; // Find descriptor CBDescriptor *descriptor = [self locateDescriptor:[request descriptorUuid] characteristic:characteristic]; [peripheral readValueForDescriptor:descriptor]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"writeCharacteristic" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosWriteCharacteristicRequest *request = [[ProtosWriteCharacteristicRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { // Find peripheral CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Find characteristic CBCharacteristic *characteristic = [self locateCharacteristic:[request characteristicUuid] peripheral:peripheral serviceId:[request serviceUuid] secondaryServiceId:[request secondaryServiceUuid]]; // Get correct write type CBCharacteristicWriteType type = ([request writeType] == ProtosWriteCharacteristicRequest_WriteType_WithoutResponse) ? CBCharacteristicWriteWithoutResponse : CBCharacteristicWriteWithResponse; // Write to characteristic [peripheral writeValue:[request value] forCharacteristic:characteristic type:type]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"writeDescriptor" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosWriteDescriptorRequest *request = [[ProtosWriteDescriptorRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { // Find peripheral CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Find characteristic CBCharacteristic *characteristic = [self locateCharacteristic:[request characteristicUuid] peripheral:peripheral serviceId:[request serviceUuid] secondaryServiceId:[request secondaryServiceUuid]]; // Find descriptor CBDescriptor *descriptor = [self locateDescriptor:[request descriptorUuid] characteristic:characteristic]; // Write descriptor [peripheral writeValue:[request value] forDescriptor:descriptor]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"setNotification" isEqualToString:call.method]) { FlutterStandardTypedData *data = [call arguments]; ProtosSetNotificationRequest *request = [[ProtosSetNotificationRequest alloc] initWithData:[data data] error:nil]; NSString *remoteId = [request remoteId]; @try { // Find peripheral CBPeripheral *peripheral = [self findPeripheral:remoteId]; // Find characteristic CBCharacteristic *characteristic = [self locateCharacteristic:[request characteristicUuid] peripheral:peripheral serviceId:[request serviceUuid] secondaryServiceId:[request secondaryServiceUuid]]; // Set notification value [peripheral setNotifyValue:[request enable] forCharacteristic:characteristic]; result(nil); } @catch(FlutterError *e) { result(e); } } else if([@"mtu" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; uint32_t mtu = [self getMtu:peripheral]; result([self toFlutterData:[self toMtuSizeResponseProto:peripheral mtu:mtu]]); } @catch(FlutterError *e) { result(e); } } else if([@"requestMtu" isEqualToString:call.method]) { result([FlutterError errorWithCode:@"requestMtu" message:@"iOS does not allow mtu requests to the peripheral" details:NULL]); } else if([@"readRssi" isEqualToString:call.method]) { NSString *remoteId = [call arguments]; @try { CBPeripheral *peripheral = [self findPeripheral:remoteId]; [peripheral readRSSI]; result(nil); } @catch(FlutterError *e) { result(e); } } else { result(FlutterMethodNotImplemented); } } - (CBPeripheral*)findPeripheral:(NSString*)remoteId { NSArray *peripherals = [_centralManager retrievePeripheralsWithIdentifiers:@[[[NSUUID alloc] initWithUUIDString:remoteId]]]; CBPeripheral *peripheral; for(CBPeripheral *p in peripherals) { if([[p.identifier UUIDString] isEqualToString:remoteId]) { peripheral = p; break; } } if(peripheral == nil) { @throw [FlutterError errorWithCode:@"findPeripheral" message:@"Peripheral not found" details:nil]; } return peripheral; } - (CBCharacteristic*)locateCharacteristic:(NSString*)characteristicId peripheral:(CBPeripheral*)peripheral serviceId:(NSString*)serviceId secondaryServiceId:(NSString*)secondaryServiceId { CBService *primaryService = [self getServiceFromArray:serviceId array:[peripheral services]]; if(primaryService == nil || [primaryService isPrimary] == false) { @throw [FlutterError errorWithCode:@"locateCharacteristic" message:@"service could not be located on the device" details:nil]; } CBService *secondaryService; if(secondaryServiceId.length) { secondaryService = [self getServiceFromArray:secondaryServiceId array:[primaryService includedServices]]; @throw [FlutterError errorWithCode:@"locateCharacteristic" message:@"secondary service could not be located on the device" details:secondaryServiceId]; } CBService *service = (secondaryService != nil) ? secondaryService : primaryService; CBCharacteristic *characteristic = [self getCharacteristicFromArray:characteristicId array:[service characteristics]]; if(characteristic == nil) { @throw [FlutterError errorWithCode:@"locateCharacteristic" message:@"characteristic could not be located on the device" details:nil]; } return characteristic; } - (CBDescriptor*)locateDescriptor:(NSString*)descriptorId characteristic:(CBCharacteristic*)characteristic { CBDescriptor *descriptor = [self getDescriptorFromArray:descriptorId array:[characteristic descriptors]]; if(descriptor == nil) { @throw [FlutterError errorWithCode:@"locateDescriptor" message:@"descriptor could not be located on the device" details:nil]; } return descriptor; } // Reverse search to find primary service - (CBService*)findPrimaryService:(CBService*)secondaryService peripheral:(CBPeripheral*)peripheral { for(CBService *s in [peripheral services]) { for(CBService *ss in [s includedServices]) { if([[ss.UUID UUIDString] isEqualToString:[secondaryService.UUID UUIDString]]) { return s; } } } return nil; } - (CBDescriptor*)findCCCDescriptor:(CBCharacteristic*)characteristic { for(CBDescriptor *d in characteristic.descriptors) { if([d.UUID.UUIDString isEqualToString:@"2902"]) { return d; } } return nil; } - (CBService*)getServiceFromArray:(NSString*)uuidString array:(NSArray*)array { for(CBService *s in array) { if([[s UUID] isEqual:[CBUUID UUIDWithString:uuidString]]) { return s; } } return nil; } - (CBCharacteristic*)getCharacteristicFromArray:(NSString*)uuidString array:(NSArray*)array { for(CBCharacteristic *c in array) { if([[c UUID] isEqual:[CBUUID UUIDWithString:uuidString]]) { return c; } } return nil; } - (CBDescriptor*)getDescriptorFromArray:(NSString*)uuidString array:(NSArray*)array { for(CBDescriptor *d in array) { if([[d UUID] isEqual:[CBUUID UUIDWithString:uuidString]]) { return d; } } return nil; } // // CBCentralManagerDelegate methods // - (void)centralManagerDidUpdateState:(nonnull CBCentralManager *)central { if(_stateStreamHandler.sink != nil) { FlutterStandardTypedData *data = [self toFlutterData:[self toBluetoothStateProto:self->_centralManager.state]]; self.stateStreamHandler.sink(data); } } - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { [self.scannedPeripherals setObject:peripheral forKey:[[peripheral identifier] UUIDString]]; ProtosScanResult *result = [self toScanResultProto:peripheral advertisementData:advertisementData RSSI:RSSI]; [_channel invokeMethod:@"ScanResult" arguments:[self toFlutterData:result]]; } - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral { NSLog(@"didConnectPeripheral"); // Register self as delegate for peripheral peripheral.delegate = self; // Send initial mtu size uint32_t mtu = [self getMtu:peripheral]; [_channel invokeMethod:@"MtuSize" arguments:[self toFlutterData:[self toMtuSizeResponseProto:peripheral mtu:mtu]]]; // Send connection state [_channel invokeMethod:@"DeviceState" arguments:[self toFlutterData:[self toDeviceStateProto:peripheral state:peripheral.state]]]; } - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error { NSLog(@"didDisconnectPeripheral"); // Unregister self as delegate for peripheral, not working #42 peripheral.delegate = nil; // Send connection state [_channel invokeMethod:@"DeviceState" arguments:[self toFlutterData:[self toDeviceStateProto:peripheral state:peripheral.state]]]; } - (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error { // TODO:? } // // CBPeripheralDelegate methods // - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error { NSLog(@"didDiscoverServices"); // Send negotiated mtu size uint32_t mtu = [self getMtu:peripheral]; [_channel invokeMethod:@"MtuSize" arguments:[self toFlutterData:[self toMtuSizeResponseProto:peripheral mtu:mtu]]]; // Loop through and discover characteristics and secondary services [_servicesThatNeedDiscovered addObjectsFromArray:peripheral.services]; for(CBService *s in [peripheral services]) { NSLog(@"Found service: %@", [s.UUID UUIDString]); [peripheral discoverCharacteristics:nil forService:s]; // [peripheral discoverIncludedServices:nil forService:s]; // Secondary services in the future (#8) } } - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error { NSLog(@"didDiscoverCharacteristicsForService"); // Loop through and discover descriptors for characteristics [_servicesThatNeedDiscovered removeObject:service]; [_characteristicsThatNeedDiscovered addObjectsFromArray:service.characteristics]; for(CBCharacteristic *c in [service characteristics]) { [peripheral discoverDescriptorsForCharacteristic:c]; } } - (void)peripheral:(CBPeripheral *)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { NSLog(@"didDiscoverDescriptorsForCharacteristic"); [_characteristicsThatNeedDiscovered removeObject:characteristic]; if(_servicesThatNeedDiscovered.count > 0 || _characteristicsThatNeedDiscovered.count > 0) { // Still discovering return; } // Send updated tree ProtosDiscoverServicesResult *result = [self toServicesResultProto:peripheral]; [_channel invokeMethod:@"DiscoverServicesResult" arguments:[self toFlutterData:result]]; } - (void)peripheral:(CBPeripheral *)peripheral didDiscoverIncludedServicesForService:(CBService *)service error:(NSError *)error { NSLog(@"didDiscoverIncludedServicesForService"); // Loop through and discover characteristics for secondary services for(CBService *ss in [service includedServices]) { [peripheral discoverCharacteristics:nil forService:ss]; } } - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { NSLog(@"didUpdateValueForCharacteristic %@", [peripheral.identifier UUIDString]); ProtosReadCharacteristicResponse *result = [[ProtosReadCharacteristicResponse alloc] init]; [result setRemoteId:[peripheral.identifier UUIDString]]; [result setCharacteristic:[self toCharacteristicProto:peripheral characteristic:characteristic]]; [_channel invokeMethod:@"ReadCharacteristicResponse" arguments:[self toFlutterData:result]]; // on iOS, this method also handles notification values ProtosOnCharacteristicChanged *onChangedResult = [[ProtosOnCharacteristicChanged alloc] init]; [onChangedResult setRemoteId:[peripheral.identifier UUIDString]]; [onChangedResult setCharacteristic:[self toCharacteristicProto:peripheral characteristic:characteristic]]; [_channel invokeMethod:@"OnCharacteristicChanged" arguments:[self toFlutterData:onChangedResult]]; } - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { NSLog(@"didWriteValueForCharacteristic"); ProtosWriteCharacteristicRequest *request = [[ProtosWriteCharacteristicRequest alloc] init]; [request setRemoteId:[peripheral.identifier UUIDString]]; [request setCharacteristicUuid:[characteristic.UUID fullUUIDString]]; [request setServiceUuid:[characteristic.service.UUID fullUUIDString]]; ProtosWriteCharacteristicResponse *result = [[ProtosWriteCharacteristicResponse alloc] init]; [result setRequest:request]; [result setSuccess:(error == nil)]; [_channel invokeMethod:@"WriteCharacteristicResponse" arguments:[self toFlutterData:result]]; } - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { NSLog(@"didUpdateNotificationStateForCharacteristic"); // Read CCC descriptor of characteristic CBDescriptor *cccd = [self findCCCDescriptor:characteristic]; if(cccd == nil || error != nil) { // Send error ProtosSetNotificationResponse *response = [[ProtosSetNotificationResponse alloc] init]; [response setRemoteId:[peripheral.identifier UUIDString]]; [response setCharacteristic:[self toCharacteristicProto:peripheral characteristic:characteristic]]; [response setSuccess:false]; [_channel invokeMethod:@"SetNotificationResponse" arguments:[self toFlutterData:response]]; return; } // Request a read [peripheral readValueForDescriptor:cccd]; } - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error { ProtosReadDescriptorRequest *q = [[ProtosReadDescriptorRequest alloc] init]; [q setRemoteId:[peripheral.identifier UUIDString]]; [q setCharacteristicUuid:[descriptor.characteristic.UUID fullUUIDString]]; [q setDescriptorUuid:[descriptor.UUID fullUUIDString]]; if([descriptor.characteristic.service isPrimary]) { [q setServiceUuid:[descriptor.characteristic.service.UUID fullUUIDString]]; } else { [q setSecondaryServiceUuid:[descriptor.characteristic.service.UUID fullUUIDString]]; CBService *primaryService = [self findPrimaryService:[descriptor.characteristic service] peripheral:[descriptor.characteristic.service peripheral]]; [q setServiceUuid:[primaryService.UUID fullUUIDString]]; } ProtosReadDescriptorResponse *result = [[ProtosReadDescriptorResponse alloc] init]; [result setRequest:q]; int value = [descriptor.value intValue]; [result setValue:[NSData dataWithBytes:&value length:sizeof(value)]]; [_channel invokeMethod:@"ReadDescriptorResponse" arguments:[self toFlutterData:result]]; // If descriptor is CCCD, send a SetNotificationResponse in case anything is awaiting if([descriptor.UUID.UUIDString isEqualToString:@"2902"]){ ProtosSetNotificationResponse *response = [[ProtosSetNotificationResponse alloc] init]; [response setRemoteId:[peripheral.identifier UUIDString]]; [response setCharacteristic:[self toCharacteristicProto:peripheral characteristic:descriptor.characteristic]]; [response setSuccess:true]; [_channel invokeMethod:@"SetNotificationResponse" arguments:[self toFlutterData:response]]; } } - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error { ProtosWriteDescriptorRequest *request = [[ProtosWriteDescriptorRequest alloc] init]; [request setRemoteId:[peripheral.identifier UUIDString]]; [request setCharacteristicUuid:[descriptor.characteristic.UUID fullUUIDString]]; [request setDescriptorUuid:[descriptor.UUID fullUUIDString]]; if([descriptor.characteristic.service isPrimary]) { [request setServiceUuid:[descriptor.characteristic.service.UUID fullUUIDString]]; } else { [request setSecondaryServiceUuid:[descriptor.characteristic.service.UUID fullUUIDString]]; CBService *primaryService = [self findPrimaryService:[descriptor.characteristic service] peripheral:[descriptor.characteristic.service peripheral]]; [request setServiceUuid:[primaryService.UUID fullUUIDString]]; } ProtosWriteDescriptorResponse *result = [[ProtosWriteDescriptorResponse alloc] init]; [result setRequest:request]; [result setSuccess:(error == nil)]; [_channel invokeMethod:@"WriteDescriptorResponse" arguments:[self toFlutterData:result]]; } - (void)peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)rssi error:(NSError *)error { ProtosReadRssiResult *result = [[ProtosReadRssiResult alloc] init]; [result setRemoteId:[peripheral.identifier UUIDString]]; [result setRssi:[rssi intValue]]; [_channel invokeMethod:@"ReadRssiResult" arguments:[self toFlutterData:result]]; } // // Proto Helper methods // - (FlutterStandardTypedData*)toFlutterData:(GPBMessage*)proto { FlutterStandardTypedData *data = [FlutterStandardTypedData typedDataWithBytes:[[proto data] copy]]; return data; } - (ProtosBluetoothState*)toBluetoothStateProto:(CBManagerState)state { ProtosBluetoothState *result = [[ProtosBluetoothState alloc] init]; switch(state) { case CBManagerStateResetting: [result setState:ProtosBluetoothState_State_TurningOn]; break; case CBManagerStateUnsupported: [result setState:ProtosBluetoothState_State_Unavailable]; break; case CBManagerStateUnauthorized: [result setState:ProtosBluetoothState_State_Unauthorized]; break; case CBManagerStatePoweredOff: [result setState:ProtosBluetoothState_State_Off]; break; case CBManagerStatePoweredOn: [result setState:ProtosBluetoothState_State_On]; break; default: [result setState:ProtosBluetoothState_State_Unknown]; break; } return result; } - (ProtosScanResult*)toScanResultProto:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { ProtosScanResult *result = [[ProtosScanResult alloc] init]; [result setDevice:[self toDeviceProto:peripheral]]; [result setRssi:[RSSI intValue]]; ProtosAdvertisementData *ads = [[ProtosAdvertisementData alloc] init]; [ads setConnectable:[advertisementData[CBAdvertisementDataIsConnectable] boolValue]]; [ads setLocalName:advertisementData[CBAdvertisementDataLocalNameKey]]; // Tx Power Level NSNumber *txPower = advertisementData[CBAdvertisementDataTxPowerLevelKey]; if(txPower != nil) { ProtosInt32Value *txPowerWrapper = [[ProtosInt32Value alloc] init]; [txPowerWrapper setValue:[txPower intValue]]; [ads setTxPowerLevel:txPowerWrapper]; } // Manufacturer Specific Data NSData *manufData = advertisementData[CBAdvertisementDataManufacturerDataKey]; if(manufData != nil && manufData.length > 2) { unsigned short manufacturerId; [manufData getBytes:&manufacturerId length:2]; [[ads manufacturerData] setObject:[manufData subdataWithRange:NSMakeRange(2, manufData.length - 2)] forKey:manufacturerId]; } // Service Data NSDictionary *serviceData = advertisementData[CBAdvertisementDataServiceDataKey]; if(serviceData != nil) { for (CBUUID *uuid in serviceData) { [[ads serviceData] setObject:serviceData[uuid] forKey:uuid.UUIDString]; } } // Service Uuids NSArray *serviceUuids = advertisementData[CBAdvertisementDataServiceUUIDsKey]; if(serviceUuids != nil) { for (CBUUID *uuid in serviceUuids) { [[ads serviceUuidsArray] addObject:uuid.UUIDString]; } } [result setAdvertisementData:ads]; return result; } - (ProtosBluetoothDevice*)toDeviceProto:(CBPeripheral *)peripheral { ProtosBluetoothDevice *result = [[ProtosBluetoothDevice alloc] init]; [result setName:[peripheral name]]; [result setRemoteId:[[peripheral identifier] UUIDString]]; [result setType:ProtosBluetoothDevice_Type_Le]; // TODO: Does iOS differentiate? return result; } - (ProtosDeviceStateResponse*)toDeviceStateProto:(CBPeripheral *)peripheral state:(CBPeripheralState)state { ProtosDeviceStateResponse *result = [[ProtosDeviceStateResponse alloc] init]; switch(state) { case CBPeripheralStateDisconnected: [result setState:ProtosDeviceStateResponse_BluetoothDeviceState_Disconnected]; break; case CBPeripheralStateConnecting: [result setState:ProtosDeviceStateResponse_BluetoothDeviceState_Connecting]; break; case CBPeripheralStateConnected: [result setState:ProtosDeviceStateResponse_BluetoothDeviceState_Connected]; break; case CBPeripheralStateDisconnecting: [result setState:ProtosDeviceStateResponse_BluetoothDeviceState_Disconnecting]; break; } [result setRemoteId:[[peripheral identifier] UUIDString]]; return result; } - (ProtosDiscoverServicesResult*)toServicesResultProto:(CBPeripheral *)peripheral { ProtosDiscoverServicesResult *result = [[ProtosDiscoverServicesResult alloc] init]; [result setRemoteId:[peripheral.identifier UUIDString]]; NSMutableArray *servicesProtos = [NSMutableArray new]; for(CBService *s in [peripheral services]) { [servicesProtos addObject:[self toServiceProto:peripheral service:s]]; } [result setServicesArray:servicesProtos]; return result; } - (ProtosConnectedDevicesResponse*)toConnectedDeviceResponseProto:(NSArray*)periphs { ProtosConnectedDevicesResponse *result = [[ProtosConnectedDevicesResponse alloc] init]; NSMutableArray *deviceProtos = [NSMutableArray new]; for(CBPeripheral *p in periphs) { [deviceProtos addObject:[self toDeviceProto:p]]; } [result setDevicesArray:deviceProtos]; return result; } - (ProtosBluetoothService*)toServiceProto:(CBPeripheral *)peripheral service:(CBService *)service { ProtosBluetoothService *result = [[ProtosBluetoothService alloc] init]; NSLog(@"peripheral uuid:%@", [peripheral.identifier UUIDString]); NSLog(@"service uuid:%@", [service.UUID fullUUIDString]); [result setRemoteId:[peripheral.identifier UUIDString]]; [result setUuid:[service.UUID fullUUIDString]]; [result setIsPrimary:[service isPrimary]]; // Characteristic Array NSMutableArray *characteristicProtos = [NSMutableArray new]; for(CBCharacteristic *c in [service characteristics]) { [characteristicProtos addObject:[self toCharacteristicProto:peripheral characteristic:c]]; } [result setCharacteristicsArray:characteristicProtos]; // Included Services Array NSMutableArray *includedServicesProtos = [NSMutableArray new]; for(CBService *s in [service includedServices]) { [includedServicesProtos addObject:[self toServiceProto:peripheral service:s]]; } [result setIncludedServicesArray:includedServicesProtos]; return result; } - (ProtosBluetoothCharacteristic*)toCharacteristicProto:(CBPeripheral *)peripheral characteristic:(CBCharacteristic *)characteristic { ProtosBluetoothCharacteristic *result = [[ProtosBluetoothCharacteristic alloc] init]; [result setUuid:[characteristic.UUID fullUUIDString]]; [result setRemoteId:[peripheral.identifier UUIDString]]; [result setProperties:[self toCharacteristicPropsProto:characteristic.properties]]; [result setValue:[characteristic value]]; NSLog(@"uuid: %@ value: %@", [characteristic.UUID fullUUIDString], [characteristic value]); NSMutableArray *descriptorProtos = [NSMutableArray new]; for(CBDescriptor *d in [characteristic descriptors]) { [descriptorProtos addObject:[self toDescriptorProto:peripheral descriptor:d]]; } [result setDescriptorsArray:descriptorProtos]; if([characteristic.service isPrimary]) { [result setServiceUuid:[characteristic.service.UUID fullUUIDString]]; } else { // Reverse search to find service and secondary service UUID [result setSecondaryServiceUuid:[characteristic.service.UUID fullUUIDString]]; CBService *primaryService = [self findPrimaryService:[characteristic service] peripheral:[characteristic.service peripheral]]; [result setServiceUuid:[primaryService.UUID fullUUIDString]]; } return result; } - (ProtosBluetoothDescriptor*)toDescriptorProto:(CBPeripheral *)peripheral descriptor:(CBDescriptor *)descriptor { ProtosBluetoothDescriptor *result = [[ProtosBluetoothDescriptor alloc] init]; [result setUuid:[descriptor.UUID fullUUIDString]]; [result setRemoteId:[peripheral.identifier UUIDString]]; [result setCharacteristicUuid:[descriptor.characteristic.UUID fullUUIDString]]; [result setServiceUuid:[descriptor.characteristic.service.UUID fullUUIDString]]; int value = [descriptor.value intValue]; [result setValue:[NSData dataWithBytes:&value length:sizeof(value)]]; return result; } - (ProtosCharacteristicProperties*)toCharacteristicPropsProto:(CBCharacteristicProperties)props { ProtosCharacteristicProperties *result = [[ProtosCharacteristicProperties alloc] init]; [result setBroadcast:(props & CBCharacteristicPropertyBroadcast) != 0]; [result setRead:(props & CBCharacteristicPropertyRead) != 0]; [result setWriteWithoutResponse:(props & CBCharacteristicPropertyWriteWithoutResponse) != 0]; [result setWrite:(props & CBCharacteristicPropertyWrite) != 0]; [result setNotify:(props & CBCharacteristicPropertyNotify) != 0]; [result setIndicate:(props & CBCharacteristicPropertyIndicate) != 0]; [result setAuthenticatedSignedWrites:(props & CBCharacteristicPropertyAuthenticatedSignedWrites) != 0]; [result setExtendedProperties:(props & CBCharacteristicPropertyExtendedProperties) != 0]; [result setNotifyEncryptionRequired:(props & CBCharacteristicPropertyNotifyEncryptionRequired) != 0]; [result setIndicateEncryptionRequired:(props & CBCharacteristicPropertyIndicateEncryptionRequired) != 0]; return result; } - (ProtosMtuSizeResponse*)toMtuSizeResponseProto:(CBPeripheral *)peripheral mtu:(uint32_t)mtu { ProtosMtuSizeResponse *result = [[ProtosMtuSizeResponse alloc] init]; [result setRemoteId:[[peripheral identifier] UUIDString]]; [result setMtu:mtu]; return result; } - (void)log:(LogLevel)level format:(NSString *)format, ... { if(level <= _logLevel) { va_list args; va_start(args, format); // NSString* formattedMessage = [[NSString alloc] initWithFormat:format arguments:args]; NSLog(format, args); va_end(args); } } - (uint32_t)getMtu:(CBPeripheral *)peripheral { if (@available(iOS 9.0, *)) { // Which type should we use? (issue #365) return (uint32_t)[peripheral maximumWriteValueLengthForType:CBCharacteristicWriteWithoutResponse]; } else { // Fallback to minimum on earlier versions. (issue #364) return 20; } } @end @implementation FlutterBluePlusStreamHandler - (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink { self.sink = eventSink; return nil; } - (FlutterError*)onCancelWithArguments:(id)arguments { self.sink = nil; return nil; } @end ================================================ FILE: plugins/flutter_blue_plus/ios/flutter_blue_plus.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint flutter_blue_plus.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'flutter_blue_plus' s.version = '0.0.1' s.summary = 'Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS' s.description = <<-DESC Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS DESC s.homepage = 'https://github.com/boskokg/flutter_blue_plus' s.license = { :file => '../LICENSE' } s.author = { 'Bosko Popovic' => 'boskokg@gmail.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*', 'gen/**/*' s.public_header_files = 'Classes/**/*.h', 'gen/**/*.h' s.dependency 'Flutter' s.platform = :ios, '9.0' s.framework = 'CoreBluetooth' s.subspec "Protos" do |ss| ss.source_files = "gen/*.pbobjc.{h,m}", "gen/**/*.pbobjc.{h,m}" ss.header_mappings_dir = "gen" ss.requires_arc = false ss.dependency "Protobuf", '~> 3.11' end # Flutter.framework does not contain a i386 slice. # s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', } end ================================================ FILE: plugins/flutter_blue_plus/ios/gen/Flutterblueplus.pbobjc.h ================================================ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: flutterblueplus.proto // This CPP symbol can be defined to use imports that match up to the framework // imports needed when using CocoaPods. #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import #else #import "GPBProtocolBuffers.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30004 #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. #endif #if 30004 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. #endif // @@protoc_insertion_point(imports) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" CF_EXTERN_C_BEGIN @class ProtosAdvertisementData; @class ProtosBluetoothCharacteristic; @class ProtosBluetoothDescriptor; @class ProtosBluetoothDevice; @class ProtosBluetoothService; @class ProtosCharacteristicProperties; @class ProtosInt32Value; @class ProtosReadDescriptorRequest; @class ProtosWriteCharacteristicRequest; @class ProtosWriteDescriptorRequest; NS_ASSUME_NONNULL_BEGIN #pragma mark - Enum ProtosBluetoothState_State typedef GPB_ENUM(ProtosBluetoothState_State) { /** * Value used if any message's field encounters a value that is not defined * by this enum. The message will also have C functions to get/set the rawValue * of the field. **/ ProtosBluetoothState_State_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, ProtosBluetoothState_State_Unknown = 0, ProtosBluetoothState_State_Unavailable = 1, ProtosBluetoothState_State_Unauthorized = 2, ProtosBluetoothState_State_TurningOn = 3, ProtosBluetoothState_State_On = 4, ProtosBluetoothState_State_TurningOff = 5, ProtosBluetoothState_State_Off = 6, }; GPBEnumDescriptor *ProtosBluetoothState_State_EnumDescriptor(void); /** * Checks to see if the given value is defined by the enum or was not known at * the time this source was generated. **/ BOOL ProtosBluetoothState_State_IsValidValue(int32_t value); #pragma mark - Enum ProtosBluetoothDevice_Type typedef GPB_ENUM(ProtosBluetoothDevice_Type) { /** * Value used if any message's field encounters a value that is not defined * by this enum. The message will also have C functions to get/set the rawValue * of the field. **/ ProtosBluetoothDevice_Type_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, ProtosBluetoothDevice_Type_Unknown = 0, ProtosBluetoothDevice_Type_Classic = 1, ProtosBluetoothDevice_Type_Le = 2, ProtosBluetoothDevice_Type_Dual = 3, }; GPBEnumDescriptor *ProtosBluetoothDevice_Type_EnumDescriptor(void); /** * Checks to see if the given value is defined by the enum or was not known at * the time this source was generated. **/ BOOL ProtosBluetoothDevice_Type_IsValidValue(int32_t value); #pragma mark - Enum ProtosWriteCharacteristicRequest_WriteType typedef GPB_ENUM(ProtosWriteCharacteristicRequest_WriteType) { /** * Value used if any message's field encounters a value that is not defined * by this enum. The message will also have C functions to get/set the rawValue * of the field. **/ ProtosWriteCharacteristicRequest_WriteType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, ProtosWriteCharacteristicRequest_WriteType_WithResponse = 0, ProtosWriteCharacteristicRequest_WriteType_WithoutResponse = 1, }; GPBEnumDescriptor *ProtosWriteCharacteristicRequest_WriteType_EnumDescriptor(void); /** * Checks to see if the given value is defined by the enum or was not known at * the time this source was generated. **/ BOOL ProtosWriteCharacteristicRequest_WriteType_IsValidValue(int32_t value); #pragma mark - Enum ProtosDeviceStateResponse_BluetoothDeviceState typedef GPB_ENUM(ProtosDeviceStateResponse_BluetoothDeviceState) { /** * Value used if any message's field encounters a value that is not defined * by this enum. The message will also have C functions to get/set the rawValue * of the field. **/ ProtosDeviceStateResponse_BluetoothDeviceState_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, ProtosDeviceStateResponse_BluetoothDeviceState_Disconnected = 0, ProtosDeviceStateResponse_BluetoothDeviceState_Connecting = 1, ProtosDeviceStateResponse_BluetoothDeviceState_Connected = 2, ProtosDeviceStateResponse_BluetoothDeviceState_Disconnecting = 3, }; GPBEnumDescriptor *ProtosDeviceStateResponse_BluetoothDeviceState_EnumDescriptor(void); /** * Checks to see if the given value is defined by the enum or was not known at * the time this source was generated. **/ BOOL ProtosDeviceStateResponse_BluetoothDeviceState_IsValidValue(int32_t value); #pragma mark - ProtosFlutterblueplusRoot /** * Exposes the extension registry for this file. * * The base class provides: * @code * + (GPBExtensionRegistry *)extensionRegistry; * @endcode * which is a @c GPBExtensionRegistry that includes all the extensions defined by * this file and all files that it depends on. **/ GPB_FINAL @interface ProtosFlutterblueplusRoot : GPBRootObject @end #pragma mark - ProtosInt32Value typedef GPB_ENUM(ProtosInt32Value_FieldNumber) { ProtosInt32Value_FieldNumber_Value = 1, }; /** * Wrapper message for `int32`. * * Allows for nullability of fields in messages **/ GPB_FINAL @interface ProtosInt32Value : GPBMessage /** The int32 value. */ @property(nonatomic, readwrite) int32_t value; @end #pragma mark - ProtosBluetoothState typedef GPB_ENUM(ProtosBluetoothState_FieldNumber) { ProtosBluetoothState_FieldNumber_State = 1, }; GPB_FINAL @interface ProtosBluetoothState : GPBMessage @property(nonatomic, readwrite) ProtosBluetoothState_State state; @end /** * Fetches the raw value of a @c ProtosBluetoothState's @c state property, even * if the value was not defined by the enum at the time the code was generated. **/ int32_t ProtosBluetoothState_State_RawValue(ProtosBluetoothState *message); /** * Sets the raw value of an @c ProtosBluetoothState's @c state property, allowing * it to be set to a value that was not defined by the enum at the time the code * was generated. **/ void SetProtosBluetoothState_State_RawValue(ProtosBluetoothState *message, int32_t value); #pragma mark - ProtosAdvertisementData typedef GPB_ENUM(ProtosAdvertisementData_FieldNumber) { ProtosAdvertisementData_FieldNumber_LocalName = 1, ProtosAdvertisementData_FieldNumber_TxPowerLevel = 2, ProtosAdvertisementData_FieldNumber_Connectable = 3, ProtosAdvertisementData_FieldNumber_ManufacturerData = 4, ProtosAdvertisementData_FieldNumber_ServiceData = 5, ProtosAdvertisementData_FieldNumber_ServiceUuidsArray = 6, }; GPB_FINAL @interface ProtosAdvertisementData : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *localName; @property(nonatomic, readwrite, strong, null_resettable) ProtosInt32Value *txPowerLevel; /** Test to see if @c txPowerLevel has been set. */ @property(nonatomic, readwrite) BOOL hasTxPowerLevel; @property(nonatomic, readwrite) BOOL connectable; /** Map of manufacturers to their data */ @property(nonatomic, readwrite, strong, null_resettable) GPBInt32ObjectDictionary *manufacturerData; /** The number of items in @c manufacturerData without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger manufacturerData_Count; /** Map of service UUIDs to their data. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *serviceData; /** The number of items in @c serviceData without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger serviceData_Count; @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *serviceUuidsArray; /** The number of items in @c serviceUuidsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger serviceUuidsArray_Count; @end #pragma mark - ProtosScanSettings typedef GPB_ENUM(ProtosScanSettings_FieldNumber) { ProtosScanSettings_FieldNumber_AndroidScanMode = 1, ProtosScanSettings_FieldNumber_ServiceUuidsArray = 2, ProtosScanSettings_FieldNumber_AllowDuplicates = 3, }; GPB_FINAL @interface ProtosScanSettings : GPBMessage @property(nonatomic, readwrite) int32_t androidScanMode; @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *serviceUuidsArray; /** The number of items in @c serviceUuidsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger serviceUuidsArray_Count; @property(nonatomic, readwrite) BOOL allowDuplicates; @end #pragma mark - ProtosScanResult typedef GPB_ENUM(ProtosScanResult_FieldNumber) { ProtosScanResult_FieldNumber_Device = 1, ProtosScanResult_FieldNumber_AdvertisementData = 2, ProtosScanResult_FieldNumber_Rssi = 3, }; GPB_FINAL @interface ProtosScanResult : GPBMessage /** The received peer's ID. */ @property(nonatomic, readwrite, strong, null_resettable) ProtosBluetoothDevice *device; /** Test to see if @c device has been set. */ @property(nonatomic, readwrite) BOOL hasDevice; @property(nonatomic, readwrite, strong, null_resettable) ProtosAdvertisementData *advertisementData; /** Test to see if @c advertisementData has been set. */ @property(nonatomic, readwrite) BOOL hasAdvertisementData; @property(nonatomic, readwrite) int32_t rssi; @end #pragma mark - ProtosConnectRequest typedef GPB_ENUM(ProtosConnectRequest_FieldNumber) { ProtosConnectRequest_FieldNumber_RemoteId = 1, ProtosConnectRequest_FieldNumber_AndroidAutoConnect = 2, }; GPB_FINAL @interface ProtosConnectRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite) BOOL androidAutoConnect; @end #pragma mark - ProtosBluetoothDevice typedef GPB_ENUM(ProtosBluetoothDevice_FieldNumber) { ProtosBluetoothDevice_FieldNumber_RemoteId = 1, ProtosBluetoothDevice_FieldNumber_Name = 2, ProtosBluetoothDevice_FieldNumber_Type = 3, }; GPB_FINAL @interface ProtosBluetoothDevice : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *name; @property(nonatomic, readwrite) ProtosBluetoothDevice_Type type; @end /** * Fetches the raw value of a @c ProtosBluetoothDevice's @c type property, even * if the value was not defined by the enum at the time the code was generated. **/ int32_t ProtosBluetoothDevice_Type_RawValue(ProtosBluetoothDevice *message); /** * Sets the raw value of an @c ProtosBluetoothDevice's @c type property, allowing * it to be set to a value that was not defined by the enum at the time the code * was generated. **/ void SetProtosBluetoothDevice_Type_RawValue(ProtosBluetoothDevice *message, int32_t value); #pragma mark - ProtosBluetoothService typedef GPB_ENUM(ProtosBluetoothService_FieldNumber) { ProtosBluetoothService_FieldNumber_Uuid = 1, ProtosBluetoothService_FieldNumber_RemoteId = 2, ProtosBluetoothService_FieldNumber_IsPrimary = 3, ProtosBluetoothService_FieldNumber_CharacteristicsArray = 4, ProtosBluetoothService_FieldNumber_IncludedServicesArray = 5, }; GPB_FINAL @interface ProtosBluetoothService : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *uuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; /** Indicates whether the type of service is primary or secondary. */ @property(nonatomic, readwrite) BOOL isPrimary; /** A list of characteristics that have been discovered in this service. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *characteristicsArray; /** The number of items in @c characteristicsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger characteristicsArray_Count; /** A list of included services that have been discovered in this service. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *includedServicesArray; /** The number of items in @c includedServicesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger includedServicesArray_Count; @end #pragma mark - ProtosBluetoothCharacteristic typedef GPB_ENUM(ProtosBluetoothCharacteristic_FieldNumber) { ProtosBluetoothCharacteristic_FieldNumber_Uuid = 1, ProtosBluetoothCharacteristic_FieldNumber_RemoteId = 2, ProtosBluetoothCharacteristic_FieldNumber_ServiceUuid = 3, ProtosBluetoothCharacteristic_FieldNumber_SecondaryServiceUuid = 4, ProtosBluetoothCharacteristic_FieldNumber_DescriptorsArray = 5, ProtosBluetoothCharacteristic_FieldNumber_Properties = 6, ProtosBluetoothCharacteristic_FieldNumber_Value = 7, }; GPB_FINAL @interface ProtosBluetoothCharacteristic : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *uuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; /** The service that this characteristic belongs to. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; /** The secondary service if nested */ @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; /** A list of descriptors that have been discovered in this characteristic. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *descriptorsArray; /** The number of items in @c descriptorsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger descriptorsArray_Count; /** The properties of the characteristic. */ @property(nonatomic, readwrite, strong, null_resettable) ProtosCharacteristicProperties *properties; /** Test to see if @c properties has been set. */ @property(nonatomic, readwrite) BOOL hasProperties; @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end #pragma mark - ProtosBluetoothDescriptor typedef GPB_ENUM(ProtosBluetoothDescriptor_FieldNumber) { ProtosBluetoothDescriptor_FieldNumber_Uuid = 1, ProtosBluetoothDescriptor_FieldNumber_RemoteId = 2, ProtosBluetoothDescriptor_FieldNumber_ServiceUuid = 3, ProtosBluetoothDescriptor_FieldNumber_CharacteristicUuid = 4, ProtosBluetoothDescriptor_FieldNumber_Value = 5, }; GPB_FINAL @interface ProtosBluetoothDescriptor : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *uuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; /** The service that this descriptor belongs to. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; /** The characteristic that this descriptor belongs to. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end #pragma mark - ProtosCharacteristicProperties typedef GPB_ENUM(ProtosCharacteristicProperties_FieldNumber) { ProtosCharacteristicProperties_FieldNumber_Broadcast = 1, ProtosCharacteristicProperties_FieldNumber_Read = 2, ProtosCharacteristicProperties_FieldNumber_WriteWithoutResponse = 3, ProtosCharacteristicProperties_FieldNumber_Write = 4, ProtosCharacteristicProperties_FieldNumber_Notify = 5, ProtosCharacteristicProperties_FieldNumber_Indicate = 6, ProtosCharacteristicProperties_FieldNumber_AuthenticatedSignedWrites = 7, ProtosCharacteristicProperties_FieldNumber_ExtendedProperties = 8, ProtosCharacteristicProperties_FieldNumber_NotifyEncryptionRequired = 9, ProtosCharacteristicProperties_FieldNumber_IndicateEncryptionRequired = 10, }; GPB_FINAL @interface ProtosCharacteristicProperties : GPBMessage @property(nonatomic, readwrite) BOOL broadcast; @property(nonatomic, readwrite) BOOL read; @property(nonatomic, readwrite) BOOL writeWithoutResponse; @property(nonatomic, readwrite) BOOL write; @property(nonatomic, readwrite) BOOL notify; @property(nonatomic, readwrite) BOOL indicate; @property(nonatomic, readwrite) BOOL authenticatedSignedWrites; @property(nonatomic, readwrite) BOOL extendedProperties; @property(nonatomic, readwrite) BOOL notifyEncryptionRequired; @property(nonatomic, readwrite) BOOL indicateEncryptionRequired; @end #pragma mark - ProtosDiscoverServicesResult typedef GPB_ENUM(ProtosDiscoverServicesResult_FieldNumber) { ProtosDiscoverServicesResult_FieldNumber_RemoteId = 1, ProtosDiscoverServicesResult_FieldNumber_ServicesArray = 2, }; GPB_FINAL @interface ProtosDiscoverServicesResult : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *servicesArray; /** The number of items in @c servicesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger servicesArray_Count; @end #pragma mark - ProtosReadCharacteristicRequest typedef GPB_ENUM(ProtosReadCharacteristicRequest_FieldNumber) { ProtosReadCharacteristicRequest_FieldNumber_RemoteId = 1, ProtosReadCharacteristicRequest_FieldNumber_CharacteristicUuid = 2, ProtosReadCharacteristicRequest_FieldNumber_ServiceUuid = 3, ProtosReadCharacteristicRequest_FieldNumber_SecondaryServiceUuid = 4, }; GPB_FINAL @interface ProtosReadCharacteristicRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; @end #pragma mark - ProtosReadCharacteristicResponse typedef GPB_ENUM(ProtosReadCharacteristicResponse_FieldNumber) { ProtosReadCharacteristicResponse_FieldNumber_RemoteId = 1, ProtosReadCharacteristicResponse_FieldNumber_Characteristic = 2, }; GPB_FINAL @interface ProtosReadCharacteristicResponse : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, strong, null_resettable) ProtosBluetoothCharacteristic *characteristic; /** Test to see if @c characteristic has been set. */ @property(nonatomic, readwrite) BOOL hasCharacteristic; @end #pragma mark - ProtosReadDescriptorRequest typedef GPB_ENUM(ProtosReadDescriptorRequest_FieldNumber) { ProtosReadDescriptorRequest_FieldNumber_RemoteId = 1, ProtosReadDescriptorRequest_FieldNumber_DescriptorUuid = 2, ProtosReadDescriptorRequest_FieldNumber_ServiceUuid = 3, ProtosReadDescriptorRequest_FieldNumber_SecondaryServiceUuid = 4, ProtosReadDescriptorRequest_FieldNumber_CharacteristicUuid = 5, }; GPB_FINAL @interface ProtosReadDescriptorRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *descriptorUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @end #pragma mark - ProtosReadDescriptorResponse typedef GPB_ENUM(ProtosReadDescriptorResponse_FieldNumber) { ProtosReadDescriptorResponse_FieldNumber_Request = 1, ProtosReadDescriptorResponse_FieldNumber_Value = 2, }; GPB_FINAL @interface ProtosReadDescriptorResponse : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) ProtosReadDescriptorRequest *request; /** Test to see if @c request has been set. */ @property(nonatomic, readwrite) BOOL hasRequest; @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end #pragma mark - ProtosWriteCharacteristicRequest typedef GPB_ENUM(ProtosWriteCharacteristicRequest_FieldNumber) { ProtosWriteCharacteristicRequest_FieldNumber_RemoteId = 1, ProtosWriteCharacteristicRequest_FieldNumber_CharacteristicUuid = 2, ProtosWriteCharacteristicRequest_FieldNumber_ServiceUuid = 3, ProtosWriteCharacteristicRequest_FieldNumber_SecondaryServiceUuid = 4, ProtosWriteCharacteristicRequest_FieldNumber_WriteType = 5, ProtosWriteCharacteristicRequest_FieldNumber_Value = 6, }; GPB_FINAL @interface ProtosWriteCharacteristicRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; @property(nonatomic, readwrite) ProtosWriteCharacteristicRequest_WriteType writeType; @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end /** * Fetches the raw value of a @c ProtosWriteCharacteristicRequest's @c writeType property, even * if the value was not defined by the enum at the time the code was generated. **/ int32_t ProtosWriteCharacteristicRequest_WriteType_RawValue(ProtosWriteCharacteristicRequest *message); /** * Sets the raw value of an @c ProtosWriteCharacteristicRequest's @c writeType property, allowing * it to be set to a value that was not defined by the enum at the time the code * was generated. **/ void SetProtosWriteCharacteristicRequest_WriteType_RawValue(ProtosWriteCharacteristicRequest *message, int32_t value); #pragma mark - ProtosWriteCharacteristicResponse typedef GPB_ENUM(ProtosWriteCharacteristicResponse_FieldNumber) { ProtosWriteCharacteristicResponse_FieldNumber_Request = 1, ProtosWriteCharacteristicResponse_FieldNumber_Success = 2, }; GPB_FINAL @interface ProtosWriteCharacteristicResponse : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) ProtosWriteCharacteristicRequest *request; /** Test to see if @c request has been set. */ @property(nonatomic, readwrite) BOOL hasRequest; @property(nonatomic, readwrite) BOOL success; @end #pragma mark - ProtosWriteDescriptorRequest typedef GPB_ENUM(ProtosWriteDescriptorRequest_FieldNumber) { ProtosWriteDescriptorRequest_FieldNumber_RemoteId = 1, ProtosWriteDescriptorRequest_FieldNumber_DescriptorUuid = 2, ProtosWriteDescriptorRequest_FieldNumber_ServiceUuid = 3, ProtosWriteDescriptorRequest_FieldNumber_SecondaryServiceUuid = 4, ProtosWriteDescriptorRequest_FieldNumber_CharacteristicUuid = 5, ProtosWriteDescriptorRequest_FieldNumber_Value = 6, }; GPB_FINAL @interface ProtosWriteDescriptorRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *descriptorUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end #pragma mark - ProtosWriteDescriptorResponse typedef GPB_ENUM(ProtosWriteDescriptorResponse_FieldNumber) { ProtosWriteDescriptorResponse_FieldNumber_Request = 1, ProtosWriteDescriptorResponse_FieldNumber_Success = 2, }; GPB_FINAL @interface ProtosWriteDescriptorResponse : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) ProtosWriteDescriptorRequest *request; /** Test to see if @c request has been set. */ @property(nonatomic, readwrite) BOOL hasRequest; @property(nonatomic, readwrite) BOOL success; @end #pragma mark - ProtosSetNotificationRequest typedef GPB_ENUM(ProtosSetNotificationRequest_FieldNumber) { ProtosSetNotificationRequest_FieldNumber_RemoteId = 1, ProtosSetNotificationRequest_FieldNumber_ServiceUuid = 2, ProtosSetNotificationRequest_FieldNumber_SecondaryServiceUuid = 3, ProtosSetNotificationRequest_FieldNumber_CharacteristicUuid = 4, ProtosSetNotificationRequest_FieldNumber_Enable = 5, }; GPB_FINAL @interface ProtosSetNotificationRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, copy, null_resettable) NSString *serviceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *secondaryServiceUuid; @property(nonatomic, readwrite, copy, null_resettable) NSString *characteristicUuid; @property(nonatomic, readwrite) BOOL enable; @end #pragma mark - ProtosSetNotificationResponse typedef GPB_ENUM(ProtosSetNotificationResponse_FieldNumber) { ProtosSetNotificationResponse_FieldNumber_RemoteId = 1, ProtosSetNotificationResponse_FieldNumber_Characteristic = 2, ProtosSetNotificationResponse_FieldNumber_Success = 3, }; GPB_FINAL @interface ProtosSetNotificationResponse : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, strong, null_resettable) ProtosBluetoothCharacteristic *characteristic; /** Test to see if @c characteristic has been set. */ @property(nonatomic, readwrite) BOOL hasCharacteristic; @property(nonatomic, readwrite) BOOL success; @end #pragma mark - ProtosOnCharacteristicChanged typedef GPB_ENUM(ProtosOnCharacteristicChanged_FieldNumber) { ProtosOnCharacteristicChanged_FieldNumber_RemoteId = 1, ProtosOnCharacteristicChanged_FieldNumber_Characteristic = 2, }; GPB_FINAL @interface ProtosOnCharacteristicChanged : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite, strong, null_resettable) ProtosBluetoothCharacteristic *characteristic; /** Test to see if @c characteristic has been set. */ @property(nonatomic, readwrite) BOOL hasCharacteristic; @end #pragma mark - ProtosDeviceStateResponse typedef GPB_ENUM(ProtosDeviceStateResponse_FieldNumber) { ProtosDeviceStateResponse_FieldNumber_RemoteId = 1, ProtosDeviceStateResponse_FieldNumber_State = 2, }; GPB_FINAL @interface ProtosDeviceStateResponse : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite) ProtosDeviceStateResponse_BluetoothDeviceState state; @end /** * Fetches the raw value of a @c ProtosDeviceStateResponse's @c state property, even * if the value was not defined by the enum at the time the code was generated. **/ int32_t ProtosDeviceStateResponse_State_RawValue(ProtosDeviceStateResponse *message); /** * Sets the raw value of an @c ProtosDeviceStateResponse's @c state property, allowing * it to be set to a value that was not defined by the enum at the time the code * was generated. **/ void SetProtosDeviceStateResponse_State_RawValue(ProtosDeviceStateResponse *message, int32_t value); #pragma mark - ProtosConnectedDevicesResponse typedef GPB_ENUM(ProtosConnectedDevicesResponse_FieldNumber) { ProtosConnectedDevicesResponse_FieldNumber_DevicesArray = 1, }; GPB_FINAL @interface ProtosConnectedDevicesResponse : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *devicesArray; /** The number of items in @c devicesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger devicesArray_Count; @end #pragma mark - ProtosMtuSizeRequest typedef GPB_ENUM(ProtosMtuSizeRequest_FieldNumber) { ProtosMtuSizeRequest_FieldNumber_RemoteId = 1, ProtosMtuSizeRequest_FieldNumber_Mtu = 2, }; GPB_FINAL @interface ProtosMtuSizeRequest : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite) uint32_t mtu; @end #pragma mark - ProtosMtuSizeResponse typedef GPB_ENUM(ProtosMtuSizeResponse_FieldNumber) { ProtosMtuSizeResponse_FieldNumber_RemoteId = 1, ProtosMtuSizeResponse_FieldNumber_Mtu = 2, }; GPB_FINAL @interface ProtosMtuSizeResponse : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite) uint32_t mtu; @end #pragma mark - ProtosReadRssiResult typedef GPB_ENUM(ProtosReadRssiResult_FieldNumber) { ProtosReadRssiResult_FieldNumber_RemoteId = 1, ProtosReadRssiResult_FieldNumber_Rssi = 2, }; GPB_FINAL @interface ProtosReadRssiResult : GPBMessage @property(nonatomic, readwrite, copy, null_resettable) NSString *remoteId; @property(nonatomic, readwrite) int32_t rssi; @end NS_ASSUME_NONNULL_END CF_EXTERN_C_END #pragma clang diagnostic pop // @@protoc_insertion_point(global_scope) ================================================ FILE: plugins/flutter_blue_plus/ios/gen/Flutterblueplus.pbobjc.m ================================================ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: flutterblueplus.proto // This CPP symbol can be defined to use imports that match up to the framework // imports needed when using CocoaPods. #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import #else #import "GPBProtocolBuffers_RuntimeSupport.h" #endif #import #import "Flutterblueplus.pbobjc.h" // @@protoc_insertion_point(imports) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #pragma mark - Objective C Class declarations // Forward declarations of Objective C classes that we can use as // static values in struct initializers. // We don't use [Foo class] because it is not a static value. GPBObjCClassDeclaration(ProtosAdvertisementData); GPBObjCClassDeclaration(ProtosBluetoothCharacteristic); GPBObjCClassDeclaration(ProtosBluetoothDescriptor); GPBObjCClassDeclaration(ProtosBluetoothDevice); GPBObjCClassDeclaration(ProtosBluetoothService); GPBObjCClassDeclaration(ProtosCharacteristicProperties); GPBObjCClassDeclaration(ProtosInt32Value); GPBObjCClassDeclaration(ProtosReadDescriptorRequest); GPBObjCClassDeclaration(ProtosWriteCharacteristicRequest); GPBObjCClassDeclaration(ProtosWriteDescriptorRequest); #pragma mark - ProtosFlutterblueplusRoot @implementation ProtosFlutterblueplusRoot // No extensions in the file and no imports, so no need to generate // +extensionRegistry. @end #pragma mark - ProtosFlutterblueplusRoot_FileDescriptor static GPBFileDescriptor *ProtosFlutterblueplusRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"" objcPrefix:@"Protos" syntax:GPBFileSyntaxProto3]; } return descriptor; } #pragma mark - ProtosInt32Value @implementation ProtosInt32Value @dynamic value; typedef struct ProtosInt32Value__storage_ { uint32_t _has_storage_[1]; int32_t value; } ProtosInt32Value__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosInt32Value_FieldNumber_Value, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosInt32Value__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeInt32, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosInt32Value class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosInt32Value__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosBluetoothState @implementation ProtosBluetoothState @dynamic state; typedef struct ProtosBluetoothState__storage_ { uint32_t _has_storage_[1]; ProtosBluetoothState_State state; } ProtosBluetoothState__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "state", .dataTypeSpecific.enumDescFunc = ProtosBluetoothState_State_EnumDescriptor, .number = ProtosBluetoothState_FieldNumber_State, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosBluetoothState__storage_, state), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeEnum, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosBluetoothState class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosBluetoothState__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end int32_t ProtosBluetoothState_State_RawValue(ProtosBluetoothState *message) { GPBDescriptor *descriptor = [ProtosBluetoothState descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosBluetoothState_FieldNumber_State]; return GPBGetMessageRawEnumField(message, field); } void SetProtosBluetoothState_State_RawValue(ProtosBluetoothState *message, int32_t value) { GPBDescriptor *descriptor = [ProtosBluetoothState descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosBluetoothState_FieldNumber_State]; GPBSetMessageRawEnumField(message, field, value); } #pragma mark - Enum ProtosBluetoothState_State GPBEnumDescriptor *ProtosBluetoothState_State_EnumDescriptor(void) { static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "Unknown\000Unavailable\000Unauthorized\000Turning" "On\000On\000TurningOff\000Off\000"; static const int32_t values[] = { ProtosBluetoothState_State_Unknown, ProtosBluetoothState_State_Unavailable, ProtosBluetoothState_State_Unauthorized, ProtosBluetoothState_State_TurningOn, ProtosBluetoothState_State_On, ProtosBluetoothState_State_TurningOff, ProtosBluetoothState_State_Off, }; GPBEnumDescriptor *worker = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(ProtosBluetoothState_State) valueNames:valueNames values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:ProtosBluetoothState_State_IsValidValue]; GPBEnumDescriptor *expected = nil; if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } return descriptor; } BOOL ProtosBluetoothState_State_IsValidValue(int32_t value__) { switch (value__) { case ProtosBluetoothState_State_Unknown: case ProtosBluetoothState_State_Unavailable: case ProtosBluetoothState_State_Unauthorized: case ProtosBluetoothState_State_TurningOn: case ProtosBluetoothState_State_On: case ProtosBluetoothState_State_TurningOff: case ProtosBluetoothState_State_Off: return YES; default: return NO; } } #pragma mark - ProtosAdvertisementData @implementation ProtosAdvertisementData @dynamic localName; @dynamic hasTxPowerLevel, txPowerLevel; @dynamic connectable; @dynamic manufacturerData, manufacturerData_Count; @dynamic serviceData, serviceData_Count; @dynamic serviceUuidsArray, serviceUuidsArray_Count; typedef struct ProtosAdvertisementData__storage_ { uint32_t _has_storage_[1]; NSString *localName; ProtosInt32Value *txPowerLevel; GPBInt32ObjectDictionary *manufacturerData; NSMutableDictionary *serviceData; NSMutableArray *serviceUuidsArray; } ProtosAdvertisementData__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "localName", .dataTypeSpecific.clazz = Nil, .number = ProtosAdvertisementData_FieldNumber_LocalName, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosAdvertisementData__storage_, localName), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "txPowerLevel", .dataTypeSpecific.clazz = GPBObjCClass(ProtosInt32Value), .number = ProtosAdvertisementData_FieldNumber_TxPowerLevel, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosAdvertisementData__storage_, txPowerLevel), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "connectable", .dataTypeSpecific.clazz = Nil, .number = ProtosAdvertisementData_FieldNumber_Connectable, .hasIndex = 2, .offset = 3, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "manufacturerData", .dataTypeSpecific.clazz = Nil, .number = ProtosAdvertisementData_FieldNumber_ManufacturerData, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosAdvertisementData__storage_, manufacturerData), .flags = GPBFieldMapKeyInt32, .dataType = GPBDataTypeBytes, }, { .name = "serviceData", .dataTypeSpecific.clazz = Nil, .number = ProtosAdvertisementData_FieldNumber_ServiceData, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosAdvertisementData__storage_, serviceData), .flags = GPBFieldMapKeyString, .dataType = GPBDataTypeBytes, }, { .name = "serviceUuidsArray", .dataTypeSpecific.clazz = Nil, .number = ProtosAdvertisementData_FieldNumber_ServiceUuidsArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosAdvertisementData__storage_, serviceUuidsArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeString, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosAdvertisementData class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosAdvertisementData__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosScanSettings @implementation ProtosScanSettings @dynamic androidScanMode; @dynamic serviceUuidsArray, serviceUuidsArray_Count; @dynamic allowDuplicates; typedef struct ProtosScanSettings__storage_ { uint32_t _has_storage_[1]; int32_t androidScanMode; NSMutableArray *serviceUuidsArray; } ProtosScanSettings__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "androidScanMode", .dataTypeSpecific.clazz = Nil, .number = ProtosScanSettings_FieldNumber_AndroidScanMode, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosScanSettings__storage_, androidScanMode), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeInt32, }, { .name = "serviceUuidsArray", .dataTypeSpecific.clazz = Nil, .number = ProtosScanSettings_FieldNumber_ServiceUuidsArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosScanSettings__storage_, serviceUuidsArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeString, }, { .name = "allowDuplicates", .dataTypeSpecific.clazz = Nil, .number = ProtosScanSettings_FieldNumber_AllowDuplicates, .hasIndex = 1, .offset = 2, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosScanSettings class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosScanSettings__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosScanResult @implementation ProtosScanResult @dynamic hasDevice, device; @dynamic hasAdvertisementData, advertisementData; @dynamic rssi; typedef struct ProtosScanResult__storage_ { uint32_t _has_storage_[1]; int32_t rssi; ProtosBluetoothDevice *device; ProtosAdvertisementData *advertisementData; } ProtosScanResult__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "device", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothDevice), .number = ProtosScanResult_FieldNumber_Device, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosScanResult__storage_, device), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "advertisementData", .dataTypeSpecific.clazz = GPBObjCClass(ProtosAdvertisementData), .number = ProtosScanResult_FieldNumber_AdvertisementData, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosScanResult__storage_, advertisementData), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "rssi", .dataTypeSpecific.clazz = Nil, .number = ProtosScanResult_FieldNumber_Rssi, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosScanResult__storage_, rssi), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeInt32, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosScanResult class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosScanResult__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosConnectRequest @implementation ProtosConnectRequest @dynamic remoteId; @dynamic androidAutoConnect; typedef struct ProtosConnectRequest__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; } ProtosConnectRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosConnectRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosConnectRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "androidAutoConnect", .dataTypeSpecific.clazz = Nil, .number = ProtosConnectRequest_FieldNumber_AndroidAutoConnect, .hasIndex = 1, .offset = 2, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosConnectRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosConnectRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosBluetoothDevice @implementation ProtosBluetoothDevice @dynamic remoteId; @dynamic name; @dynamic type; typedef struct ProtosBluetoothDevice__storage_ { uint32_t _has_storage_[1]; ProtosBluetoothDevice_Type type; NSString *remoteId; NSString *name; } ProtosBluetoothDevice__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDevice_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosBluetoothDevice__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "name", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDevice_FieldNumber_Name, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosBluetoothDevice__storage_, name), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "type", .dataTypeSpecific.enumDescFunc = ProtosBluetoothDevice_Type_EnumDescriptor, .number = ProtosBluetoothDevice_FieldNumber_Type, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosBluetoothDevice__storage_, type), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeEnum, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosBluetoothDevice class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosBluetoothDevice__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end int32_t ProtosBluetoothDevice_Type_RawValue(ProtosBluetoothDevice *message) { GPBDescriptor *descriptor = [ProtosBluetoothDevice descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosBluetoothDevice_FieldNumber_Type]; return GPBGetMessageRawEnumField(message, field); } void SetProtosBluetoothDevice_Type_RawValue(ProtosBluetoothDevice *message, int32_t value) { GPBDescriptor *descriptor = [ProtosBluetoothDevice descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosBluetoothDevice_FieldNumber_Type]; GPBSetMessageRawEnumField(message, field, value); } #pragma mark - Enum ProtosBluetoothDevice_Type GPBEnumDescriptor *ProtosBluetoothDevice_Type_EnumDescriptor(void) { static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "Unknown\000Classic\000Le\000Dual\000"; static const int32_t values[] = { ProtosBluetoothDevice_Type_Unknown, ProtosBluetoothDevice_Type_Classic, ProtosBluetoothDevice_Type_Le, ProtosBluetoothDevice_Type_Dual, }; GPBEnumDescriptor *worker = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(ProtosBluetoothDevice_Type) valueNames:valueNames values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:ProtosBluetoothDevice_Type_IsValidValue]; GPBEnumDescriptor *expected = nil; if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } return descriptor; } BOOL ProtosBluetoothDevice_Type_IsValidValue(int32_t value__) { switch (value__) { case ProtosBluetoothDevice_Type_Unknown: case ProtosBluetoothDevice_Type_Classic: case ProtosBluetoothDevice_Type_Le: case ProtosBluetoothDevice_Type_Dual: return YES; default: return NO; } } #pragma mark - ProtosBluetoothService @implementation ProtosBluetoothService @dynamic uuid; @dynamic remoteId; @dynamic isPrimary; @dynamic characteristicsArray, characteristicsArray_Count; @dynamic includedServicesArray, includedServicesArray_Count; typedef struct ProtosBluetoothService__storage_ { uint32_t _has_storage_[1]; NSString *uuid; NSString *remoteId; NSMutableArray *characteristicsArray; NSMutableArray *includedServicesArray; } ProtosBluetoothService__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "uuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothService_FieldNumber_Uuid, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosBluetoothService__storage_, uuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothService_FieldNumber_RemoteId, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosBluetoothService__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "isPrimary", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothService_FieldNumber_IsPrimary, .hasIndex = 2, .offset = 3, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "characteristicsArray", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothCharacteristic), .number = ProtosBluetoothService_FieldNumber_CharacteristicsArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosBluetoothService__storage_, characteristicsArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, { .name = "includedServicesArray", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothService), .number = ProtosBluetoothService_FieldNumber_IncludedServicesArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosBluetoothService__storage_, includedServicesArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosBluetoothService class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosBluetoothService__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosBluetoothCharacteristic @implementation ProtosBluetoothCharacteristic @dynamic uuid; @dynamic remoteId; @dynamic serviceUuid; @dynamic secondaryServiceUuid; @dynamic descriptorsArray, descriptorsArray_Count; @dynamic hasProperties, properties; @dynamic value; typedef struct ProtosBluetoothCharacteristic__storage_ { uint32_t _has_storage_[1]; NSString *uuid; NSString *remoteId; NSString *serviceUuid; NSString *secondaryServiceUuid; NSMutableArray *descriptorsArray; ProtosCharacteristicProperties *properties; NSData *value; } ProtosBluetoothCharacteristic__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "uuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothCharacteristic_FieldNumber_Uuid, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, uuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothCharacteristic_FieldNumber_RemoteId, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothCharacteristic_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothCharacteristic_FieldNumber_SecondaryServiceUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "descriptorsArray", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothDescriptor), .number = ProtosBluetoothCharacteristic_FieldNumber_DescriptorsArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, descriptorsArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, { .name = "properties", .dataTypeSpecific.clazz = GPBObjCClass(ProtosCharacteristicProperties), .number = ProtosBluetoothCharacteristic_FieldNumber_Properties, .hasIndex = 4, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, properties), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothCharacteristic_FieldNumber_Value, .hasIndex = 5, .offset = (uint32_t)offsetof(ProtosBluetoothCharacteristic__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosBluetoothCharacteristic class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosBluetoothCharacteristic__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS static const char *extraTextFormatInfo = "\002\003\013\000\004\024\000"; [localDescriptor setupExtraTextInfo:extraTextFormatInfo]; #endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosBluetoothDescriptor @implementation ProtosBluetoothDescriptor @dynamic uuid; @dynamic remoteId; @dynamic serviceUuid; @dynamic characteristicUuid; @dynamic value; typedef struct ProtosBluetoothDescriptor__storage_ { uint32_t _has_storage_[1]; NSString *uuid; NSString *remoteId; NSString *serviceUuid; NSString *characteristicUuid; NSData *value; } ProtosBluetoothDescriptor__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "uuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDescriptor_FieldNumber_Uuid, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosBluetoothDescriptor__storage_, uuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDescriptor_FieldNumber_RemoteId, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosBluetoothDescriptor__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDescriptor_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosBluetoothDescriptor__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDescriptor_FieldNumber_CharacteristicUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosBluetoothDescriptor__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosBluetoothDescriptor_FieldNumber_Value, .hasIndex = 4, .offset = (uint32_t)offsetof(ProtosBluetoothDescriptor__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosBluetoothDescriptor class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosBluetoothDescriptor__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS static const char *extraTextFormatInfo = "\002\003\013\000\004\022\000"; [localDescriptor setupExtraTextInfo:extraTextFormatInfo]; #endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosCharacteristicProperties @implementation ProtosCharacteristicProperties @dynamic broadcast; @dynamic read; @dynamic writeWithoutResponse; @dynamic write; @dynamic notify; @dynamic indicate; @dynamic authenticatedSignedWrites; @dynamic extendedProperties; @dynamic notifyEncryptionRequired; @dynamic indicateEncryptionRequired; typedef struct ProtosCharacteristicProperties__storage_ { uint32_t _has_storage_[1]; } ProtosCharacteristicProperties__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "broadcast", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_Broadcast, .hasIndex = 0, .offset = 1, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "read", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_Read, .hasIndex = 2, .offset = 3, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "writeWithoutResponse", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_WriteWithoutResponse, .hasIndex = 4, .offset = 5, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "write", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_Write, .hasIndex = 6, .offset = 7, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "notify", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_Notify, .hasIndex = 8, .offset = 9, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "indicate", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_Indicate, .hasIndex = 10, .offset = 11, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "authenticatedSignedWrites", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_AuthenticatedSignedWrites, .hasIndex = 12, .offset = 13, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "extendedProperties", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_ExtendedProperties, .hasIndex = 14, .offset = 15, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "notifyEncryptionRequired", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_NotifyEncryptionRequired, .hasIndex = 16, .offset = 17, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, { .name = "indicateEncryptionRequired", .dataTypeSpecific.clazz = Nil, .number = ProtosCharacteristicProperties_FieldNumber_IndicateEncryptionRequired, .hasIndex = 18, .offset = 19, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosCharacteristicProperties class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosCharacteristicProperties__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosDiscoverServicesResult @implementation ProtosDiscoverServicesResult @dynamic remoteId; @dynamic servicesArray, servicesArray_Count; typedef struct ProtosDiscoverServicesResult__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; NSMutableArray *servicesArray; } ProtosDiscoverServicesResult__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosDiscoverServicesResult_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosDiscoverServicesResult__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "servicesArray", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothService), .number = ProtosDiscoverServicesResult_FieldNumber_ServicesArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosDiscoverServicesResult__storage_, servicesArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosDiscoverServicesResult class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosDiscoverServicesResult__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosReadCharacteristicRequest @implementation ProtosReadCharacteristicRequest @dynamic remoteId; @dynamic characteristicUuid; @dynamic serviceUuid; @dynamic secondaryServiceUuid; typedef struct ProtosReadCharacteristicRequest__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; NSString *characteristicUuid; NSString *serviceUuid; NSString *secondaryServiceUuid; } ProtosReadCharacteristicRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosReadCharacteristicRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosReadCharacteristicRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadCharacteristicRequest_FieldNumber_CharacteristicUuid, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosReadCharacteristicRequest__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadCharacteristicRequest_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosReadCharacteristicRequest__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadCharacteristicRequest_FieldNumber_SecondaryServiceUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosReadCharacteristicRequest__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosReadCharacteristicRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosReadCharacteristicRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosReadCharacteristicResponse @implementation ProtosReadCharacteristicResponse @dynamic remoteId; @dynamic hasCharacteristic, characteristic; typedef struct ProtosReadCharacteristicResponse__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; ProtosBluetoothCharacteristic *characteristic; } ProtosReadCharacteristicResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosReadCharacteristicResponse_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosReadCharacteristicResponse__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristic", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothCharacteristic), .number = ProtosReadCharacteristicResponse_FieldNumber_Characteristic, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosReadCharacteristicResponse__storage_, characteristic), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosReadCharacteristicResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosReadCharacteristicResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosReadDescriptorRequest @implementation ProtosReadDescriptorRequest @dynamic remoteId; @dynamic descriptorUuid; @dynamic serviceUuid; @dynamic secondaryServiceUuid; @dynamic characteristicUuid; typedef struct ProtosReadDescriptorRequest__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; NSString *descriptorUuid; NSString *serviceUuid; NSString *secondaryServiceUuid; NSString *characteristicUuid; } ProtosReadDescriptorRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosReadDescriptorRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "descriptorUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorRequest_FieldNumber_DescriptorUuid, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosReadDescriptorRequest__storage_, descriptorUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorRequest_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosReadDescriptorRequest__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorRequest_FieldNumber_SecondaryServiceUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosReadDescriptorRequest__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorRequest_FieldNumber_CharacteristicUuid, .hasIndex = 4, .offset = (uint32_t)offsetof(ProtosReadDescriptorRequest__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosReadDescriptorRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosReadDescriptorRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosReadDescriptorResponse @implementation ProtosReadDescriptorResponse @dynamic hasRequest, request; @dynamic value; typedef struct ProtosReadDescriptorResponse__storage_ { uint32_t _has_storage_[1]; ProtosReadDescriptorRequest *request; NSData *value; } ProtosReadDescriptorResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "request", .dataTypeSpecific.clazz = GPBObjCClass(ProtosReadDescriptorRequest), .number = ProtosReadDescriptorResponse_FieldNumber_Request, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosReadDescriptorResponse__storage_, request), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosReadDescriptorResponse_FieldNumber_Value, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosReadDescriptorResponse__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosReadDescriptorResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosReadDescriptorResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosWriteCharacteristicRequest @implementation ProtosWriteCharacteristicRequest @dynamic remoteId; @dynamic characteristicUuid; @dynamic serviceUuid; @dynamic secondaryServiceUuid; @dynamic writeType; @dynamic value; typedef struct ProtosWriteCharacteristicRequest__storage_ { uint32_t _has_storage_[1]; ProtosWriteCharacteristicRequest_WriteType writeType; NSString *remoteId; NSString *characteristicUuid; NSString *serviceUuid; NSString *secondaryServiceUuid; NSData *value; } ProtosWriteCharacteristicRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicRequest_FieldNumber_CharacteristicUuid, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicRequest_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicRequest_FieldNumber_SecondaryServiceUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "writeType", .dataTypeSpecific.enumDescFunc = ProtosWriteCharacteristicRequest_WriteType_EnumDescriptor, .number = ProtosWriteCharacteristicRequest_FieldNumber_WriteType, .hasIndex = 4, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, writeType), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeEnum, }, { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicRequest_FieldNumber_Value, .hasIndex = 5, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicRequest__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosWriteCharacteristicRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosWriteCharacteristicRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end int32_t ProtosWriteCharacteristicRequest_WriteType_RawValue(ProtosWriteCharacteristicRequest *message) { GPBDescriptor *descriptor = [ProtosWriteCharacteristicRequest descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosWriteCharacteristicRequest_FieldNumber_WriteType]; return GPBGetMessageRawEnumField(message, field); } void SetProtosWriteCharacteristicRequest_WriteType_RawValue(ProtosWriteCharacteristicRequest *message, int32_t value) { GPBDescriptor *descriptor = [ProtosWriteCharacteristicRequest descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosWriteCharacteristicRequest_FieldNumber_WriteType]; GPBSetMessageRawEnumField(message, field, value); } #pragma mark - Enum ProtosWriteCharacteristicRequest_WriteType GPBEnumDescriptor *ProtosWriteCharacteristicRequest_WriteType_EnumDescriptor(void) { static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "WithResponse\000WithoutResponse\000"; static const int32_t values[] = { ProtosWriteCharacteristicRequest_WriteType_WithResponse, ProtosWriteCharacteristicRequest_WriteType_WithoutResponse, }; GPBEnumDescriptor *worker = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(ProtosWriteCharacteristicRequest_WriteType) valueNames:valueNames values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:ProtosWriteCharacteristicRequest_WriteType_IsValidValue]; GPBEnumDescriptor *expected = nil; if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } return descriptor; } BOOL ProtosWriteCharacteristicRequest_WriteType_IsValidValue(int32_t value__) { switch (value__) { case ProtosWriteCharacteristicRequest_WriteType_WithResponse: case ProtosWriteCharacteristicRequest_WriteType_WithoutResponse: return YES; default: return NO; } } #pragma mark - ProtosWriteCharacteristicResponse @implementation ProtosWriteCharacteristicResponse @dynamic hasRequest, request; @dynamic success; typedef struct ProtosWriteCharacteristicResponse__storage_ { uint32_t _has_storage_[1]; ProtosWriteCharacteristicRequest *request; } ProtosWriteCharacteristicResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "request", .dataTypeSpecific.clazz = GPBObjCClass(ProtosWriteCharacteristicRequest), .number = ProtosWriteCharacteristicResponse_FieldNumber_Request, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosWriteCharacteristicResponse__storage_, request), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "success", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteCharacteristicResponse_FieldNumber_Success, .hasIndex = 1, .offset = 2, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosWriteCharacteristicResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosWriteCharacteristicResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosWriteDescriptorRequest @implementation ProtosWriteDescriptorRequest @dynamic remoteId; @dynamic descriptorUuid; @dynamic serviceUuid; @dynamic secondaryServiceUuid; @dynamic characteristicUuid; @dynamic value; typedef struct ProtosWriteDescriptorRequest__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; NSString *descriptorUuid; NSString *serviceUuid; NSString *secondaryServiceUuid; NSString *characteristicUuid; NSData *value; } ProtosWriteDescriptorRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "descriptorUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_DescriptorUuid, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, descriptorUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_ServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_SecondaryServiceUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_CharacteristicUuid, .hasIndex = 4, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "value", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorRequest_FieldNumber_Value, .hasIndex = 5, .offset = (uint32_t)offsetof(ProtosWriteDescriptorRequest__storage_, value), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosWriteDescriptorRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosWriteDescriptorRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosWriteDescriptorResponse @implementation ProtosWriteDescriptorResponse @dynamic hasRequest, request; @dynamic success; typedef struct ProtosWriteDescriptorResponse__storage_ { uint32_t _has_storage_[1]; ProtosWriteDescriptorRequest *request; } ProtosWriteDescriptorResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "request", .dataTypeSpecific.clazz = GPBObjCClass(ProtosWriteDescriptorRequest), .number = ProtosWriteDescriptorResponse_FieldNumber_Request, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosWriteDescriptorResponse__storage_, request), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "success", .dataTypeSpecific.clazz = Nil, .number = ProtosWriteDescriptorResponse_FieldNumber_Success, .hasIndex = 1, .offset = 2, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosWriteDescriptorResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosWriteDescriptorResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosSetNotificationRequest @implementation ProtosSetNotificationRequest @dynamic remoteId; @dynamic serviceUuid; @dynamic secondaryServiceUuid; @dynamic characteristicUuid; @dynamic enable; typedef struct ProtosSetNotificationRequest__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; NSString *serviceUuid; NSString *secondaryServiceUuid; NSString *characteristicUuid; } ProtosSetNotificationRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosSetNotificationRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "serviceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationRequest_FieldNumber_ServiceUuid, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosSetNotificationRequest__storage_, serviceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "secondaryServiceUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationRequest_FieldNumber_SecondaryServiceUuid, .hasIndex = 2, .offset = (uint32_t)offsetof(ProtosSetNotificationRequest__storage_, secondaryServiceUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristicUuid", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationRequest_FieldNumber_CharacteristicUuid, .hasIndex = 3, .offset = (uint32_t)offsetof(ProtosSetNotificationRequest__storage_, characteristicUuid), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "enable", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationRequest_FieldNumber_Enable, .hasIndex = 4, .offset = 5, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosSetNotificationRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosSetNotificationRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosSetNotificationResponse @implementation ProtosSetNotificationResponse @dynamic remoteId; @dynamic hasCharacteristic, characteristic; @dynamic success; typedef struct ProtosSetNotificationResponse__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; ProtosBluetoothCharacteristic *characteristic; } ProtosSetNotificationResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationResponse_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosSetNotificationResponse__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristic", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothCharacteristic), .number = ProtosSetNotificationResponse_FieldNumber_Characteristic, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosSetNotificationResponse__storage_, characteristic), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "success", .dataTypeSpecific.clazz = Nil, .number = ProtosSetNotificationResponse_FieldNumber_Success, .hasIndex = 2, .offset = 3, // Stored in _has_storage_ to save space. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosSetNotificationResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosSetNotificationResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosOnCharacteristicChanged @implementation ProtosOnCharacteristicChanged @dynamic remoteId; @dynamic hasCharacteristic, characteristic; typedef struct ProtosOnCharacteristicChanged__storage_ { uint32_t _has_storage_[1]; NSString *remoteId; ProtosBluetoothCharacteristic *characteristic; } ProtosOnCharacteristicChanged__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosOnCharacteristicChanged_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosOnCharacteristicChanged__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "characteristic", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothCharacteristic), .number = ProtosOnCharacteristicChanged_FieldNumber_Characteristic, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosOnCharacteristicChanged__storage_, characteristic), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosOnCharacteristicChanged class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosOnCharacteristicChanged__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosDeviceStateResponse @implementation ProtosDeviceStateResponse @dynamic remoteId; @dynamic state; typedef struct ProtosDeviceStateResponse__storage_ { uint32_t _has_storage_[1]; ProtosDeviceStateResponse_BluetoothDeviceState state; NSString *remoteId; } ProtosDeviceStateResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosDeviceStateResponse_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosDeviceStateResponse__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "state", .dataTypeSpecific.enumDescFunc = ProtosDeviceStateResponse_BluetoothDeviceState_EnumDescriptor, .number = ProtosDeviceStateResponse_FieldNumber_State, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosDeviceStateResponse__storage_, state), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeEnum, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosDeviceStateResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosDeviceStateResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end int32_t ProtosDeviceStateResponse_State_RawValue(ProtosDeviceStateResponse *message) { GPBDescriptor *descriptor = [ProtosDeviceStateResponse descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosDeviceStateResponse_FieldNumber_State]; return GPBGetMessageRawEnumField(message, field); } void SetProtosDeviceStateResponse_State_RawValue(ProtosDeviceStateResponse *message, int32_t value) { GPBDescriptor *descriptor = [ProtosDeviceStateResponse descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:ProtosDeviceStateResponse_FieldNumber_State]; GPBSetMessageRawEnumField(message, field, value); } #pragma mark - Enum ProtosDeviceStateResponse_BluetoothDeviceState GPBEnumDescriptor *ProtosDeviceStateResponse_BluetoothDeviceState_EnumDescriptor(void) { static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "Disconnected\000Connecting\000Connected\000Discon" "necting\000"; static const int32_t values[] = { ProtosDeviceStateResponse_BluetoothDeviceState_Disconnected, ProtosDeviceStateResponse_BluetoothDeviceState_Connecting, ProtosDeviceStateResponse_BluetoothDeviceState_Connected, ProtosDeviceStateResponse_BluetoothDeviceState_Disconnecting, }; GPBEnumDescriptor *worker = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(ProtosDeviceStateResponse_BluetoothDeviceState) valueNames:valueNames values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:ProtosDeviceStateResponse_BluetoothDeviceState_IsValidValue]; GPBEnumDescriptor *expected = nil; if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } return descriptor; } BOOL ProtosDeviceStateResponse_BluetoothDeviceState_IsValidValue(int32_t value__) { switch (value__) { case ProtosDeviceStateResponse_BluetoothDeviceState_Disconnected: case ProtosDeviceStateResponse_BluetoothDeviceState_Connecting: case ProtosDeviceStateResponse_BluetoothDeviceState_Connected: case ProtosDeviceStateResponse_BluetoothDeviceState_Disconnecting: return YES; default: return NO; } } #pragma mark - ProtosConnectedDevicesResponse @implementation ProtosConnectedDevicesResponse @dynamic devicesArray, devicesArray_Count; typedef struct ProtosConnectedDevicesResponse__storage_ { uint32_t _has_storage_[1]; NSMutableArray *devicesArray; } ProtosConnectedDevicesResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "devicesArray", .dataTypeSpecific.clazz = GPBObjCClass(ProtosBluetoothDevice), .number = ProtosConnectedDevicesResponse_FieldNumber_DevicesArray, .hasIndex = GPBNoHasBit, .offset = (uint32_t)offsetof(ProtosConnectedDevicesResponse__storage_, devicesArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosConnectedDevicesResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosConnectedDevicesResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosMtuSizeRequest @implementation ProtosMtuSizeRequest @dynamic remoteId; @dynamic mtu; typedef struct ProtosMtuSizeRequest__storage_ { uint32_t _has_storage_[1]; uint32_t mtu; NSString *remoteId; } ProtosMtuSizeRequest__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosMtuSizeRequest_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosMtuSizeRequest__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "mtu", .dataTypeSpecific.clazz = Nil, .number = ProtosMtuSizeRequest_FieldNumber_Mtu, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosMtuSizeRequest__storage_, mtu), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeUInt32, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosMtuSizeRequest class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosMtuSizeRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosMtuSizeResponse @implementation ProtosMtuSizeResponse @dynamic remoteId; @dynamic mtu; typedef struct ProtosMtuSizeResponse__storage_ { uint32_t _has_storage_[1]; uint32_t mtu; NSString *remoteId; } ProtosMtuSizeResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosMtuSizeResponse_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosMtuSizeResponse__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "mtu", .dataTypeSpecific.clazz = Nil, .number = ProtosMtuSizeResponse_FieldNumber_Mtu, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosMtuSizeResponse__storage_, mtu), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeUInt32, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosMtuSizeResponse class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosMtuSizeResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma mark - ProtosReadRssiResult @implementation ProtosReadRssiResult @dynamic remoteId; @dynamic rssi; typedef struct ProtosReadRssiResult__storage_ { uint32_t _has_storage_[1]; int32_t rssi; NSString *remoteId; } ProtosReadRssiResult__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { .name = "remoteId", .dataTypeSpecific.clazz = Nil, .number = ProtosReadRssiResult_FieldNumber_RemoteId, .hasIndex = 0, .offset = (uint32_t)offsetof(ProtosReadRssiResult__storage_, remoteId), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeString, }, { .name = "rssi", .dataTypeSpecific.clazz = Nil, .number = ProtosReadRssiResult_FieldNumber_Rssi, .hasIndex = 1, .offset = (uint32_t)offsetof(ProtosReadRssiResult__storage_, rssi), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeInt32, }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[ProtosReadRssiResult class] rootClass:[ProtosFlutterblueplusRoot class] file:ProtosFlutterblueplusRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(ProtosReadRssiResult__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG descriptor = localDescriptor; } return descriptor; } @end #pragma clang diagnostic pop // @@protoc_insertion_point(global_scope) ================================================ FILE: plugins/flutter_blue_plus/lib/flutter_blue_plus.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library flutter_blue_plus; import 'dart:async'; import 'dart:io'; import 'package:collection/collection.dart'; import 'package:convert/convert.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:rxdart/rxdart.dart'; import 'gen/flutterblueplus.pb.dart' as protos; part 'src/bluetooth_characteristic.dart'; part 'src/bluetooth_descriptor.dart'; part 'src/bluetooth_device.dart'; part 'src/bluetooth_service.dart'; part 'src/flutter_blue_plus.dart'; part 'src/guid.dart'; ================================================ FILE: plugins/flutter_blue_plus/lib/gen/flutterblueplus.pb.dart ================================================ /// // Generated code. Do not modify. // source: flutterblueplus.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; import 'flutterblueplus.pbenum.dart'; export 'flutterblueplus.pbenum.dart'; class Int32Value extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Int32Value', createEmptyInstance: create) ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.O3) ..hasRequiredFields = false ; Int32Value._() : super(); factory Int32Value({ $core.int? value, }) { final _result = create(); if (value != null) { _result.value = value; } return _result; } factory Int32Value.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory Int32Value.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') Int32Value clone() => Int32Value()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') Int32Value copyWith(void Function(Int32Value) updates) => super.copyWith((message) => updates(message as Int32Value)) as Int32Value; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static Int32Value create() => Int32Value._(); Int32Value createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static Int32Value getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Int32Value? _defaultInstance; @$pb.TagNumber(1) $core.int get value => $_getIZ(0); @$pb.TagNumber(1) set value($core.int v) { $_setSignedInt32(0, v); } @$pb.TagNumber(1) $core.bool hasValue() => $_has(0); @$pb.TagNumber(1) void clearValue() => clearField(1); } class BluetoothState extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BluetoothState', createEmptyInstance: create) ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE, defaultOrMaker: BluetoothState_State.UNKNOWN, valueOf: BluetoothState_State.valueOf, enumValues: BluetoothState_State.values) ..hasRequiredFields = false ; BluetoothState._() : super(); factory BluetoothState({ BluetoothState_State? state, }) { final _result = create(); if (state != null) { _result.state = state; } return _result; } factory BluetoothState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory BluetoothState.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') BluetoothState clone() => BluetoothState()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') BluetoothState copyWith(void Function(BluetoothState) updates) => super.copyWith((message) => updates(message as BluetoothState)) as BluetoothState; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BluetoothState create() => BluetoothState._(); BluetoothState createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static BluetoothState getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BluetoothState? _defaultInstance; @$pb.TagNumber(1) BluetoothState_State get state => $_getN(0); @$pb.TagNumber(1) set state(BluetoothState_State v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasState() => $_has(0); @$pb.TagNumber(1) void clearState() => clearField(1); } class AdvertisementData extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AdvertisementData', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'localName') ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txPowerLevel', subBuilder: Int32Value.create) ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectable') ..m<$core.int, $core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'manufacturerData', entryClassName: 'AdvertisementData.ManufacturerDataEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.OY) ..m<$core.String, $core.List<$core.int>>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceData', entryClassName: 'AdvertisementData.ServiceDataEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OY) ..pPS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuids') ..hasRequiredFields = false ; AdvertisementData._() : super(); factory AdvertisementData({ $core.String? localName, Int32Value? txPowerLevel, $core.bool? connectable, $core.Map<$core.int, $core.List<$core.int>>? manufacturerData, $core.Map<$core.String, $core.List<$core.int>>? serviceData, $core.Iterable<$core.String>? serviceUuids, }) { final _result = create(); if (localName != null) { _result.localName = localName; } if (txPowerLevel != null) { _result.txPowerLevel = txPowerLevel; } if (connectable != null) { _result.connectable = connectable; } if (manufacturerData != null) { _result.manufacturerData.addAll(manufacturerData); } if (serviceData != null) { _result.serviceData.addAll(serviceData); } if (serviceUuids != null) { _result.serviceUuids.addAll(serviceUuids); } return _result; } factory AdvertisementData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory AdvertisementData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') AdvertisementData clone() => AdvertisementData()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') AdvertisementData copyWith(void Function(AdvertisementData) updates) => super.copyWith((message) => updates(message as AdvertisementData)) as AdvertisementData; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static AdvertisementData create() => AdvertisementData._(); AdvertisementData createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static AdvertisementData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AdvertisementData? _defaultInstance; @$pb.TagNumber(1) $core.String get localName => $_getSZ(0); @$pb.TagNumber(1) set localName($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasLocalName() => $_has(0); @$pb.TagNumber(1) void clearLocalName() => clearField(1); @$pb.TagNumber(2) Int32Value get txPowerLevel => $_getN(1); @$pb.TagNumber(2) set txPowerLevel(Int32Value v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasTxPowerLevel() => $_has(1); @$pb.TagNumber(2) void clearTxPowerLevel() => clearField(2); @$pb.TagNumber(2) Int32Value ensureTxPowerLevel() => $_ensure(1); @$pb.TagNumber(3) $core.bool get connectable => $_getBF(2); @$pb.TagNumber(3) set connectable($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasConnectable() => $_has(2); @$pb.TagNumber(3) void clearConnectable() => clearField(3); @$pb.TagNumber(4) $core.Map<$core.int, $core.List<$core.int>> get manufacturerData => $_getMap(3); @$pb.TagNumber(5) $core.Map<$core.String, $core.List<$core.int>> get serviceData => $_getMap(4); @$pb.TagNumber(6) $core.List<$core.String> get serviceUuids => $_getList(5); } class ScanSettings extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ScanSettings', createEmptyInstance: create) ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'androidScanMode', $pb.PbFieldType.O3) ..pPS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuids') ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allowDuplicates') ..pPS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'macAddresses') ..hasRequiredFields = false ; ScanSettings._() : super(); factory ScanSettings({ $core.int? androidScanMode, $core.Iterable<$core.String>? serviceUuids, $core.bool? allowDuplicates, $core.Iterable<$core.String>? macAddresses, }) { final _result = create(); if (androidScanMode != null) { _result.androidScanMode = androidScanMode; } if (serviceUuids != null) { _result.serviceUuids.addAll(serviceUuids); } if (allowDuplicates != null) { _result.allowDuplicates = allowDuplicates; } if (macAddresses != null) { _result.macAddresses.addAll(macAddresses); } return _result; } factory ScanSettings.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ScanSettings.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ScanSettings clone() => ScanSettings()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ScanSettings copyWith(void Function(ScanSettings) updates) => super.copyWith((message) => updates(message as ScanSettings)) as ScanSettings; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ScanSettings create() => ScanSettings._(); ScanSettings createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ScanSettings getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ScanSettings? _defaultInstance; @$pb.TagNumber(1) $core.int get androidScanMode => $_getIZ(0); @$pb.TagNumber(1) set androidScanMode($core.int v) { $_setSignedInt32(0, v); } @$pb.TagNumber(1) $core.bool hasAndroidScanMode() => $_has(0); @$pb.TagNumber(1) void clearAndroidScanMode() => clearField(1); @$pb.TagNumber(2) $core.List<$core.String> get serviceUuids => $_getList(1); @$pb.TagNumber(3) $core.bool get allowDuplicates => $_getBF(2); @$pb.TagNumber(3) set allowDuplicates($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasAllowDuplicates() => $_has(2); @$pb.TagNumber(3) void clearAllowDuplicates() => clearField(3); @$pb.TagNumber(4) $core.List<$core.String> get macAddresses => $_getList(3); } class ScanResult extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ScanResult', createEmptyInstance: create) ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'device', subBuilder: BluetoothDevice.create) ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'advertisementData', subBuilder: AdvertisementData.create) ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rssi', $pb.PbFieldType.O3) ..hasRequiredFields = false ; ScanResult._() : super(); factory ScanResult({ BluetoothDevice? device, AdvertisementData? advertisementData, $core.int? rssi, }) { final _result = create(); if (device != null) { _result.device = device; } if (advertisementData != null) { _result.advertisementData = advertisementData; } if (rssi != null) { _result.rssi = rssi; } return _result; } factory ScanResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ScanResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ScanResult clone() => ScanResult()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ScanResult copyWith(void Function(ScanResult) updates) => super.copyWith((message) => updates(message as ScanResult)) as ScanResult; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ScanResult create() => ScanResult._(); ScanResult createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ScanResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ScanResult? _defaultInstance; @$pb.TagNumber(1) BluetoothDevice get device => $_getN(0); @$pb.TagNumber(1) set device(BluetoothDevice v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasDevice() => $_has(0); @$pb.TagNumber(1) void clearDevice() => clearField(1); @$pb.TagNumber(1) BluetoothDevice ensureDevice() => $_ensure(0); @$pb.TagNumber(2) AdvertisementData get advertisementData => $_getN(1); @$pb.TagNumber(2) set advertisementData(AdvertisementData v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasAdvertisementData() => $_has(1); @$pb.TagNumber(2) void clearAdvertisementData() => clearField(2); @$pb.TagNumber(2) AdvertisementData ensureAdvertisementData() => $_ensure(1); @$pb.TagNumber(3) $core.int get rssi => $_getIZ(2); @$pb.TagNumber(3) set rssi($core.int v) { $_setSignedInt32(2, v); } @$pb.TagNumber(3) $core.bool hasRssi() => $_has(2); @$pb.TagNumber(3) void clearRssi() => clearField(3); } class ConnectRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ConnectRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'androidAutoConnect') ..hasRequiredFields = false ; ConnectRequest._() : super(); factory ConnectRequest({ $core.String? remoteId, $core.bool? androidAutoConnect, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (androidAutoConnect != null) { _result.androidAutoConnect = androidAutoConnect; } return _result; } factory ConnectRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ConnectRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ConnectRequest clone() => ConnectRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ConnectRequest copyWith(void Function(ConnectRequest) updates) => super.copyWith((message) => updates(message as ConnectRequest)) as ConnectRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ConnectRequest create() => ConnectRequest._(); ConnectRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ConnectRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ConnectRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.bool get androidAutoConnect => $_getBF(1); @$pb.TagNumber(2) set androidAutoConnect($core.bool v) { $_setBool(1, v); } @$pb.TagNumber(2) $core.bool hasAndroidAutoConnect() => $_has(1); @$pb.TagNumber(2) void clearAndroidAutoConnect() => clearField(2); } class BluetoothDevice extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BluetoothDevice', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') ..e(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: BluetoothDevice_Type.UNKNOWN, valueOf: BluetoothDevice_Type.valueOf, enumValues: BluetoothDevice_Type.values) ..hasRequiredFields = false ; BluetoothDevice._() : super(); factory BluetoothDevice({ $core.String? remoteId, $core.String? name, BluetoothDevice_Type? type, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (name != null) { _result.name = name; } if (type != null) { _result.type = type; } return _result; } factory BluetoothDevice.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory BluetoothDevice.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') BluetoothDevice clone() => BluetoothDevice()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') BluetoothDevice copyWith(void Function(BluetoothDevice) updates) => super.copyWith((message) => updates(message as BluetoothDevice)) as BluetoothDevice; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BluetoothDevice create() => BluetoothDevice._(); BluetoothDevice createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static BluetoothDevice getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BluetoothDevice? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get name => $_getSZ(1); @$pb.TagNumber(2) set name($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasName() => $_has(1); @$pb.TagNumber(2) void clearName() => clearField(2); @$pb.TagNumber(3) BluetoothDevice_Type get type => $_getN(2); @$pb.TagNumber(3) set type(BluetoothDevice_Type v) { setField(3, v); } @$pb.TagNumber(3) $core.bool hasType() => $_has(2); @$pb.TagNumber(3) void clearType() => clearField(3); } class BluetoothService extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BluetoothService', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uuid') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isPrimary') ..pc(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristics', $pb.PbFieldType.PM, subBuilder: BluetoothCharacteristic.create) ..pc(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'includedServices', $pb.PbFieldType.PM, subBuilder: BluetoothService.create) ..hasRequiredFields = false ; BluetoothService._() : super(); factory BluetoothService({ $core.String? uuid, $core.String? remoteId, $core.bool? isPrimary, $core.Iterable? characteristics, $core.Iterable? includedServices, }) { final _result = create(); if (uuid != null) { _result.uuid = uuid; } if (remoteId != null) { _result.remoteId = remoteId; } if (isPrimary != null) { _result.isPrimary = isPrimary; } if (characteristics != null) { _result.characteristics.addAll(characteristics); } if (includedServices != null) { _result.includedServices.addAll(includedServices); } return _result; } factory BluetoothService.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory BluetoothService.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') BluetoothService clone() => BluetoothService()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') BluetoothService copyWith(void Function(BluetoothService) updates) => super.copyWith((message) => updates(message as BluetoothService)) as BluetoothService; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BluetoothService create() => BluetoothService._(); BluetoothService createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static BluetoothService getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BluetoothService? _defaultInstance; @$pb.TagNumber(1) $core.String get uuid => $_getSZ(0); @$pb.TagNumber(1) set uuid($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasUuid() => $_has(0); @$pb.TagNumber(1) void clearUuid() => clearField(1); @$pb.TagNumber(2) $core.String get remoteId => $_getSZ(1); @$pb.TagNumber(2) set remoteId($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasRemoteId() => $_has(1); @$pb.TagNumber(2) void clearRemoteId() => clearField(2); @$pb.TagNumber(3) $core.bool get isPrimary => $_getBF(2); @$pb.TagNumber(3) set isPrimary($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasIsPrimary() => $_has(2); @$pb.TagNumber(3) void clearIsPrimary() => clearField(3); @$pb.TagNumber(4) $core.List get characteristics => $_getList(3); @$pb.TagNumber(5) $core.List get includedServices => $_getList(4); } class BluetoothCharacteristic extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BluetoothCharacteristic', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uuid') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid', protoName: 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid', protoName: 'secondaryServiceUuid') ..pc(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'descriptors', $pb.PbFieldType.PM, subBuilder: BluetoothDescriptor.create) ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'properties', subBuilder: CharacteristicProperties.create) ..a<$core.List<$core.int>>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) ..hasRequiredFields = false ; BluetoothCharacteristic._() : super(); factory BluetoothCharacteristic({ $core.String? uuid, $core.String? remoteId, $core.String? serviceUuid, $core.String? secondaryServiceUuid, $core.Iterable? descriptors, CharacteristicProperties? properties, $core.List<$core.int>? value, }) { final _result = create(); if (uuid != null) { _result.uuid = uuid; } if (remoteId != null) { _result.remoteId = remoteId; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } if (descriptors != null) { _result.descriptors.addAll(descriptors); } if (properties != null) { _result.properties = properties; } if (value != null) { _result.value = value; } return _result; } factory BluetoothCharacteristic.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory BluetoothCharacteristic.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') BluetoothCharacteristic clone() => BluetoothCharacteristic()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') BluetoothCharacteristic copyWith(void Function(BluetoothCharacteristic) updates) => super.copyWith((message) => updates(message as BluetoothCharacteristic)) as BluetoothCharacteristic; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BluetoothCharacteristic create() => BluetoothCharacteristic._(); BluetoothCharacteristic createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static BluetoothCharacteristic getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BluetoothCharacteristic? _defaultInstance; @$pb.TagNumber(1) $core.String get uuid => $_getSZ(0); @$pb.TagNumber(1) set uuid($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasUuid() => $_has(0); @$pb.TagNumber(1) void clearUuid() => clearField(1); @$pb.TagNumber(2) $core.String get remoteId => $_getSZ(1); @$pb.TagNumber(2) set remoteId($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasRemoteId() => $_has(1); @$pb.TagNumber(2) void clearRemoteId() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get secondaryServiceUuid => $_getSZ(3); @$pb.TagNumber(4) set secondaryServiceUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasSecondaryServiceUuid() => $_has(3); @$pb.TagNumber(4) void clearSecondaryServiceUuid() => clearField(4); @$pb.TagNumber(5) $core.List get descriptors => $_getList(4); @$pb.TagNumber(6) CharacteristicProperties get properties => $_getN(5); @$pb.TagNumber(6) set properties(CharacteristicProperties v) { setField(6, v); } @$pb.TagNumber(6) $core.bool hasProperties() => $_has(5); @$pb.TagNumber(6) void clearProperties() => clearField(6); @$pb.TagNumber(6) CharacteristicProperties ensureProperties() => $_ensure(5); @$pb.TagNumber(7) $core.List<$core.int> get value => $_getN(6); @$pb.TagNumber(7) set value($core.List<$core.int> v) { $_setBytes(6, v); } @$pb.TagNumber(7) $core.bool hasValue() => $_has(6); @$pb.TagNumber(7) void clearValue() => clearField(7); } class BluetoothDescriptor extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BluetoothDescriptor', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uuid') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid', protoName: 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid', protoName: 'characteristicUuid') ..a<$core.List<$core.int>>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) ..hasRequiredFields = false ; BluetoothDescriptor._() : super(); factory BluetoothDescriptor({ $core.String? uuid, $core.String? remoteId, $core.String? serviceUuid, $core.String? characteristicUuid, $core.List<$core.int>? value, }) { final _result = create(); if (uuid != null) { _result.uuid = uuid; } if (remoteId != null) { _result.remoteId = remoteId; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } if (value != null) { _result.value = value; } return _result; } factory BluetoothDescriptor.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory BluetoothDescriptor.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') BluetoothDescriptor clone() => BluetoothDescriptor()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') BluetoothDescriptor copyWith(void Function(BluetoothDescriptor) updates) => super.copyWith((message) => updates(message as BluetoothDescriptor)) as BluetoothDescriptor; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BluetoothDescriptor create() => BluetoothDescriptor._(); BluetoothDescriptor createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static BluetoothDescriptor getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BluetoothDescriptor? _defaultInstance; @$pb.TagNumber(1) $core.String get uuid => $_getSZ(0); @$pb.TagNumber(1) set uuid($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasUuid() => $_has(0); @$pb.TagNumber(1) void clearUuid() => clearField(1); @$pb.TagNumber(2) $core.String get remoteId => $_getSZ(1); @$pb.TagNumber(2) set remoteId($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasRemoteId() => $_has(1); @$pb.TagNumber(2) void clearRemoteId() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get characteristicUuid => $_getSZ(3); @$pb.TagNumber(4) set characteristicUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasCharacteristicUuid() => $_has(3); @$pb.TagNumber(4) void clearCharacteristicUuid() => clearField(4); @$pb.TagNumber(5) $core.List<$core.int> get value => $_getN(4); @$pb.TagNumber(5) set value($core.List<$core.int> v) { $_setBytes(4, v); } @$pb.TagNumber(5) $core.bool hasValue() => $_has(4); @$pb.TagNumber(5) void clearValue() => clearField(5); } class CharacteristicProperties extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CharacteristicProperties', createEmptyInstance: create) ..aOB(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'broadcast') ..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'read') ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'writeWithoutResponse') ..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'write') ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'notify') ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'indicate') ..aOB(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'authenticatedSignedWrites') ..aOB(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extendedProperties') ..aOB(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'notifyEncryptionRequired') ..aOB(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'indicateEncryptionRequired') ..hasRequiredFields = false ; CharacteristicProperties._() : super(); factory CharacteristicProperties({ $core.bool? broadcast, $core.bool? read, $core.bool? writeWithoutResponse, $core.bool? write, $core.bool? notify, $core.bool? indicate, $core.bool? authenticatedSignedWrites, $core.bool? extendedProperties, $core.bool? notifyEncryptionRequired, $core.bool? indicateEncryptionRequired, }) { final _result = create(); if (broadcast != null) { _result.broadcast = broadcast; } if (read != null) { _result.read = read; } if (writeWithoutResponse != null) { _result.writeWithoutResponse = writeWithoutResponse; } if (write != null) { _result.write = write; } if (notify != null) { _result.notify = notify; } if (indicate != null) { _result.indicate = indicate; } if (authenticatedSignedWrites != null) { _result.authenticatedSignedWrites = authenticatedSignedWrites; } if (extendedProperties != null) { _result.extendedProperties = extendedProperties; } if (notifyEncryptionRequired != null) { _result.notifyEncryptionRequired = notifyEncryptionRequired; } if (indicateEncryptionRequired != null) { _result.indicateEncryptionRequired = indicateEncryptionRequired; } return _result; } factory CharacteristicProperties.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CharacteristicProperties.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') CharacteristicProperties clone() => CharacteristicProperties()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') CharacteristicProperties copyWith(void Function(CharacteristicProperties) updates) => super.copyWith((message) => updates(message as CharacteristicProperties)) as CharacteristicProperties; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static CharacteristicProperties create() => CharacteristicProperties._(); CharacteristicProperties createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static CharacteristicProperties getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CharacteristicProperties? _defaultInstance; @$pb.TagNumber(1) $core.bool get broadcast => $_getBF(0); @$pb.TagNumber(1) set broadcast($core.bool v) { $_setBool(0, v); } @$pb.TagNumber(1) $core.bool hasBroadcast() => $_has(0); @$pb.TagNumber(1) void clearBroadcast() => clearField(1); @$pb.TagNumber(2) $core.bool get read => $_getBF(1); @$pb.TagNumber(2) set read($core.bool v) { $_setBool(1, v); } @$pb.TagNumber(2) $core.bool hasRead() => $_has(1); @$pb.TagNumber(2) void clearRead() => clearField(2); @$pb.TagNumber(3) $core.bool get writeWithoutResponse => $_getBF(2); @$pb.TagNumber(3) set writeWithoutResponse($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasWriteWithoutResponse() => $_has(2); @$pb.TagNumber(3) void clearWriteWithoutResponse() => clearField(3); @$pb.TagNumber(4) $core.bool get write => $_getBF(3); @$pb.TagNumber(4) set write($core.bool v) { $_setBool(3, v); } @$pb.TagNumber(4) $core.bool hasWrite() => $_has(3); @$pb.TagNumber(4) void clearWrite() => clearField(4); @$pb.TagNumber(5) $core.bool get notify => $_getBF(4); @$pb.TagNumber(5) set notify($core.bool v) { $_setBool(4, v); } @$pb.TagNumber(5) $core.bool hasNotify() => $_has(4); @$pb.TagNumber(5) void clearNotify() => clearField(5); @$pb.TagNumber(6) $core.bool get indicate => $_getBF(5); @$pb.TagNumber(6) set indicate($core.bool v) { $_setBool(5, v); } @$pb.TagNumber(6) $core.bool hasIndicate() => $_has(5); @$pb.TagNumber(6) void clearIndicate() => clearField(6); @$pb.TagNumber(7) $core.bool get authenticatedSignedWrites => $_getBF(6); @$pb.TagNumber(7) set authenticatedSignedWrites($core.bool v) { $_setBool(6, v); } @$pb.TagNumber(7) $core.bool hasAuthenticatedSignedWrites() => $_has(6); @$pb.TagNumber(7) void clearAuthenticatedSignedWrites() => clearField(7); @$pb.TagNumber(8) $core.bool get extendedProperties => $_getBF(7); @$pb.TagNumber(8) set extendedProperties($core.bool v) { $_setBool(7, v); } @$pb.TagNumber(8) $core.bool hasExtendedProperties() => $_has(7); @$pb.TagNumber(8) void clearExtendedProperties() => clearField(8); @$pb.TagNumber(9) $core.bool get notifyEncryptionRequired => $_getBF(8); @$pb.TagNumber(9) set notifyEncryptionRequired($core.bool v) { $_setBool(8, v); } @$pb.TagNumber(9) $core.bool hasNotifyEncryptionRequired() => $_has(8); @$pb.TagNumber(9) void clearNotifyEncryptionRequired() => clearField(9); @$pb.TagNumber(10) $core.bool get indicateEncryptionRequired => $_getBF(9); @$pb.TagNumber(10) set indicateEncryptionRequired($core.bool v) { $_setBool(9, v); } @$pb.TagNumber(10) $core.bool hasIndicateEncryptionRequired() => $_has(9); @$pb.TagNumber(10) void clearIndicateEncryptionRequired() => clearField(10); } class DiscoverServicesResult extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DiscoverServicesResult', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'services', $pb.PbFieldType.PM, subBuilder: BluetoothService.create) ..hasRequiredFields = false ; DiscoverServicesResult._() : super(); factory DiscoverServicesResult({ $core.String? remoteId, $core.Iterable? services, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (services != null) { _result.services.addAll(services); } return _result; } factory DiscoverServicesResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory DiscoverServicesResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') DiscoverServicesResult clone() => DiscoverServicesResult()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') DiscoverServicesResult copyWith(void Function(DiscoverServicesResult) updates) => super.copyWith((message) => updates(message as DiscoverServicesResult)) as DiscoverServicesResult; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static DiscoverServicesResult create() => DiscoverServicesResult._(); DiscoverServicesResult createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static DiscoverServicesResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static DiscoverServicesResult? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.List get services => $_getList(1); } class ReadCharacteristicRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ReadCharacteristicRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid') ..hasRequiredFields = false ; ReadCharacteristicRequest._() : super(); factory ReadCharacteristicRequest({ $core.String? remoteId, $core.String? characteristicUuid, $core.String? serviceUuid, $core.String? secondaryServiceUuid, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } return _result; } factory ReadCharacteristicRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ReadCharacteristicRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ReadCharacteristicRequest clone() => ReadCharacteristicRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ReadCharacteristicRequest copyWith(void Function(ReadCharacteristicRequest) updates) => super.copyWith((message) => updates(message as ReadCharacteristicRequest)) as ReadCharacteristicRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ReadCharacteristicRequest create() => ReadCharacteristicRequest._(); ReadCharacteristicRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ReadCharacteristicRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ReadCharacteristicRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get characteristicUuid => $_getSZ(1); @$pb.TagNumber(2) set characteristicUuid($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasCharacteristicUuid() => $_has(1); @$pb.TagNumber(2) void clearCharacteristicUuid() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get secondaryServiceUuid => $_getSZ(3); @$pb.TagNumber(4) set secondaryServiceUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasSecondaryServiceUuid() => $_has(3); @$pb.TagNumber(4) void clearSecondaryServiceUuid() => clearField(4); } class ReadCharacteristicResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ReadCharacteristicResponse', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristic', subBuilder: BluetoothCharacteristic.create) ..hasRequiredFields = false ; ReadCharacteristicResponse._() : super(); factory ReadCharacteristicResponse({ $core.String? remoteId, BluetoothCharacteristic? characteristic, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (characteristic != null) { _result.characteristic = characteristic; } return _result; } factory ReadCharacteristicResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ReadCharacteristicResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ReadCharacteristicResponse clone() => ReadCharacteristicResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ReadCharacteristicResponse copyWith(void Function(ReadCharacteristicResponse) updates) => super.copyWith((message) => updates(message as ReadCharacteristicResponse)) as ReadCharacteristicResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ReadCharacteristicResponse create() => ReadCharacteristicResponse._(); ReadCharacteristicResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ReadCharacteristicResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ReadCharacteristicResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) BluetoothCharacteristic get characteristic => $_getN(1); @$pb.TagNumber(2) set characteristic(BluetoothCharacteristic v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasCharacteristic() => $_has(1); @$pb.TagNumber(2) void clearCharacteristic() => clearField(2); @$pb.TagNumber(2) BluetoothCharacteristic ensureCharacteristic() => $_ensure(1); } class ReadDescriptorRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ReadDescriptorRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'descriptorUuid') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid') ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid') ..hasRequiredFields = false ; ReadDescriptorRequest._() : super(); factory ReadDescriptorRequest({ $core.String? remoteId, $core.String? descriptorUuid, $core.String? serviceUuid, $core.String? secondaryServiceUuid, $core.String? characteristicUuid, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (descriptorUuid != null) { _result.descriptorUuid = descriptorUuid; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } return _result; } factory ReadDescriptorRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ReadDescriptorRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ReadDescriptorRequest clone() => ReadDescriptorRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ReadDescriptorRequest copyWith(void Function(ReadDescriptorRequest) updates) => super.copyWith((message) => updates(message as ReadDescriptorRequest)) as ReadDescriptorRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ReadDescriptorRequest create() => ReadDescriptorRequest._(); ReadDescriptorRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ReadDescriptorRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ReadDescriptorRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get descriptorUuid => $_getSZ(1); @$pb.TagNumber(2) set descriptorUuid($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasDescriptorUuid() => $_has(1); @$pb.TagNumber(2) void clearDescriptorUuid() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get secondaryServiceUuid => $_getSZ(3); @$pb.TagNumber(4) set secondaryServiceUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasSecondaryServiceUuid() => $_has(3); @$pb.TagNumber(4) void clearSecondaryServiceUuid() => clearField(4); @$pb.TagNumber(5) $core.String get characteristicUuid => $_getSZ(4); @$pb.TagNumber(5) set characteristicUuid($core.String v) { $_setString(4, v); } @$pb.TagNumber(5) $core.bool hasCharacteristicUuid() => $_has(4); @$pb.TagNumber(5) void clearCharacteristicUuid() => clearField(5); } class ReadDescriptorResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ReadDescriptorResponse', createEmptyInstance: create) ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'request', subBuilder: ReadDescriptorRequest.create) ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) ..hasRequiredFields = false ; ReadDescriptorResponse._() : super(); factory ReadDescriptorResponse({ ReadDescriptorRequest? request, $core.List<$core.int>? value, }) { final _result = create(); if (request != null) { _result.request = request; } if (value != null) { _result.value = value; } return _result; } factory ReadDescriptorResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ReadDescriptorResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ReadDescriptorResponse clone() => ReadDescriptorResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ReadDescriptorResponse copyWith(void Function(ReadDescriptorResponse) updates) => super.copyWith((message) => updates(message as ReadDescriptorResponse)) as ReadDescriptorResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ReadDescriptorResponse create() => ReadDescriptorResponse._(); ReadDescriptorResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ReadDescriptorResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ReadDescriptorResponse? _defaultInstance; @$pb.TagNumber(1) ReadDescriptorRequest get request => $_getN(0); @$pb.TagNumber(1) set request(ReadDescriptorRequest v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasRequest() => $_has(0); @$pb.TagNumber(1) void clearRequest() => clearField(1); @$pb.TagNumber(1) ReadDescriptorRequest ensureRequest() => $_ensure(0); @$pb.TagNumber(2) $core.List<$core.int> get value => $_getN(1); @$pb.TagNumber(2) set value($core.List<$core.int> v) { $_setBytes(1, v); } @$pb.TagNumber(2) $core.bool hasValue() => $_has(1); @$pb.TagNumber(2) void clearValue() => clearField(2); } class WriteCharacteristicRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'WriteCharacteristicRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid') ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'writeType', $pb.PbFieldType.OE, defaultOrMaker: WriteCharacteristicRequest_WriteType.WITH_RESPONSE, valueOf: WriteCharacteristicRequest_WriteType.valueOf, enumValues: WriteCharacteristicRequest_WriteType.values) ..a<$core.List<$core.int>>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) ..hasRequiredFields = false ; WriteCharacteristicRequest._() : super(); factory WriteCharacteristicRequest({ $core.String? remoteId, $core.String? characteristicUuid, $core.String? serviceUuid, $core.String? secondaryServiceUuid, WriteCharacteristicRequest_WriteType? writeType, $core.List<$core.int>? value, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } if (writeType != null) { _result.writeType = writeType; } if (value != null) { _result.value = value; } return _result; } factory WriteCharacteristicRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory WriteCharacteristicRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') WriteCharacteristicRequest clone() => WriteCharacteristicRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') WriteCharacteristicRequest copyWith(void Function(WriteCharacteristicRequest) updates) => super.copyWith((message) => updates(message as WriteCharacteristicRequest)) as WriteCharacteristicRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static WriteCharacteristicRequest create() => WriteCharacteristicRequest._(); WriteCharacteristicRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static WriteCharacteristicRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static WriteCharacteristicRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get characteristicUuid => $_getSZ(1); @$pb.TagNumber(2) set characteristicUuid($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasCharacteristicUuid() => $_has(1); @$pb.TagNumber(2) void clearCharacteristicUuid() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get secondaryServiceUuid => $_getSZ(3); @$pb.TagNumber(4) set secondaryServiceUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasSecondaryServiceUuid() => $_has(3); @$pb.TagNumber(4) void clearSecondaryServiceUuid() => clearField(4); @$pb.TagNumber(5) WriteCharacteristicRequest_WriteType get writeType => $_getN(4); @$pb.TagNumber(5) set writeType(WriteCharacteristicRequest_WriteType v) { setField(5, v); } @$pb.TagNumber(5) $core.bool hasWriteType() => $_has(4); @$pb.TagNumber(5) void clearWriteType() => clearField(5); @$pb.TagNumber(6) $core.List<$core.int> get value => $_getN(5); @$pb.TagNumber(6) set value($core.List<$core.int> v) { $_setBytes(5, v); } @$pb.TagNumber(6) $core.bool hasValue() => $_has(5); @$pb.TagNumber(6) void clearValue() => clearField(6); } class WriteCharacteristicResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'WriteCharacteristicResponse', createEmptyInstance: create) ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'request', subBuilder: WriteCharacteristicRequest.create) ..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'success') ..hasRequiredFields = false ; WriteCharacteristicResponse._() : super(); factory WriteCharacteristicResponse({ WriteCharacteristicRequest? request, $core.bool? success, }) { final _result = create(); if (request != null) { _result.request = request; } if (success != null) { _result.success = success; } return _result; } factory WriteCharacteristicResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory WriteCharacteristicResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') WriteCharacteristicResponse clone() => WriteCharacteristicResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') WriteCharacteristicResponse copyWith(void Function(WriteCharacteristicResponse) updates) => super.copyWith((message) => updates(message as WriteCharacteristicResponse)) as WriteCharacteristicResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static WriteCharacteristicResponse create() => WriteCharacteristicResponse._(); WriteCharacteristicResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static WriteCharacteristicResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static WriteCharacteristicResponse? _defaultInstance; @$pb.TagNumber(1) WriteCharacteristicRequest get request => $_getN(0); @$pb.TagNumber(1) set request(WriteCharacteristicRequest v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasRequest() => $_has(0); @$pb.TagNumber(1) void clearRequest() => clearField(1); @$pb.TagNumber(1) WriteCharacteristicRequest ensureRequest() => $_ensure(0); @$pb.TagNumber(2) $core.bool get success => $_getBF(1); @$pb.TagNumber(2) set success($core.bool v) { $_setBool(1, v); } @$pb.TagNumber(2) $core.bool hasSuccess() => $_has(1); @$pb.TagNumber(2) void clearSuccess() => clearField(2); } class WriteDescriptorRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'WriteDescriptorRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'descriptorUuid') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid') ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid') ..a<$core.List<$core.int>>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) ..hasRequiredFields = false ; WriteDescriptorRequest._() : super(); factory WriteDescriptorRequest({ $core.String? remoteId, $core.String? descriptorUuid, $core.String? serviceUuid, $core.String? secondaryServiceUuid, $core.String? characteristicUuid, $core.List<$core.int>? value, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (descriptorUuid != null) { _result.descriptorUuid = descriptorUuid; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } if (value != null) { _result.value = value; } return _result; } factory WriteDescriptorRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory WriteDescriptorRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') WriteDescriptorRequest clone() => WriteDescriptorRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') WriteDescriptorRequest copyWith(void Function(WriteDescriptorRequest) updates) => super.copyWith((message) => updates(message as WriteDescriptorRequest)) as WriteDescriptorRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static WriteDescriptorRequest create() => WriteDescriptorRequest._(); WriteDescriptorRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static WriteDescriptorRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static WriteDescriptorRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get descriptorUuid => $_getSZ(1); @$pb.TagNumber(2) set descriptorUuid($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasDescriptorUuid() => $_has(1); @$pb.TagNumber(2) void clearDescriptorUuid() => clearField(2); @$pb.TagNumber(3) $core.String get serviceUuid => $_getSZ(2); @$pb.TagNumber(3) set serviceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get secondaryServiceUuid => $_getSZ(3); @$pb.TagNumber(4) set secondaryServiceUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasSecondaryServiceUuid() => $_has(3); @$pb.TagNumber(4) void clearSecondaryServiceUuid() => clearField(4); @$pb.TagNumber(5) $core.String get characteristicUuid => $_getSZ(4); @$pb.TagNumber(5) set characteristicUuid($core.String v) { $_setString(4, v); } @$pb.TagNumber(5) $core.bool hasCharacteristicUuid() => $_has(4); @$pb.TagNumber(5) void clearCharacteristicUuid() => clearField(5); @$pb.TagNumber(6) $core.List<$core.int> get value => $_getN(5); @$pb.TagNumber(6) set value($core.List<$core.int> v) { $_setBytes(5, v); } @$pb.TagNumber(6) $core.bool hasValue() => $_has(5); @$pb.TagNumber(6) void clearValue() => clearField(6); } class WriteDescriptorResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'WriteDescriptorResponse', createEmptyInstance: create) ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'request', subBuilder: WriteDescriptorRequest.create) ..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'success') ..hasRequiredFields = false ; WriteDescriptorResponse._() : super(); factory WriteDescriptorResponse({ WriteDescriptorRequest? request, $core.bool? success, }) { final _result = create(); if (request != null) { _result.request = request; } if (success != null) { _result.success = success; } return _result; } factory WriteDescriptorResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory WriteDescriptorResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') WriteDescriptorResponse clone() => WriteDescriptorResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') WriteDescriptorResponse copyWith(void Function(WriteDescriptorResponse) updates) => super.copyWith((message) => updates(message as WriteDescriptorResponse)) as WriteDescriptorResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static WriteDescriptorResponse create() => WriteDescriptorResponse._(); WriteDescriptorResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static WriteDescriptorResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static WriteDescriptorResponse? _defaultInstance; @$pb.TagNumber(1) WriteDescriptorRequest get request => $_getN(0); @$pb.TagNumber(1) set request(WriteDescriptorRequest v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasRequest() => $_has(0); @$pb.TagNumber(1) void clearRequest() => clearField(1); @$pb.TagNumber(1) WriteDescriptorRequest ensureRequest() => $_ensure(0); @$pb.TagNumber(2) $core.bool get success => $_getBF(1); @$pb.TagNumber(2) set success($core.bool v) { $_setBool(1, v); } @$pb.TagNumber(2) $core.bool hasSuccess() => $_has(1); @$pb.TagNumber(2) void clearSuccess() => clearField(2); } class SetNotificationRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetNotificationRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serviceUuid') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secondaryServiceUuid') ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristicUuid') ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'enable') ..hasRequiredFields = false ; SetNotificationRequest._() : super(); factory SetNotificationRequest({ $core.String? remoteId, $core.String? serviceUuid, $core.String? secondaryServiceUuid, $core.String? characteristicUuid, $core.bool? enable, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (serviceUuid != null) { _result.serviceUuid = serviceUuid; } if (secondaryServiceUuid != null) { _result.secondaryServiceUuid = secondaryServiceUuid; } if (characteristicUuid != null) { _result.characteristicUuid = characteristicUuid; } if (enable != null) { _result.enable = enable; } return _result; } factory SetNotificationRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory SetNotificationRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') SetNotificationRequest clone() => SetNotificationRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') SetNotificationRequest copyWith(void Function(SetNotificationRequest) updates) => super.copyWith((message) => updates(message as SetNotificationRequest)) as SetNotificationRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static SetNotificationRequest create() => SetNotificationRequest._(); SetNotificationRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static SetNotificationRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static SetNotificationRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.String get serviceUuid => $_getSZ(1); @$pb.TagNumber(2) set serviceUuid($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasServiceUuid() => $_has(1); @$pb.TagNumber(2) void clearServiceUuid() => clearField(2); @$pb.TagNumber(3) $core.String get secondaryServiceUuid => $_getSZ(2); @$pb.TagNumber(3) set secondaryServiceUuid($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) $core.bool hasSecondaryServiceUuid() => $_has(2); @$pb.TagNumber(3) void clearSecondaryServiceUuid() => clearField(3); @$pb.TagNumber(4) $core.String get characteristicUuid => $_getSZ(3); @$pb.TagNumber(4) set characteristicUuid($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) $core.bool hasCharacteristicUuid() => $_has(3); @$pb.TagNumber(4) void clearCharacteristicUuid() => clearField(4); @$pb.TagNumber(5) $core.bool get enable => $_getBF(4); @$pb.TagNumber(5) set enable($core.bool v) { $_setBool(4, v); } @$pb.TagNumber(5) $core.bool hasEnable() => $_has(4); @$pb.TagNumber(5) void clearEnable() => clearField(5); } class SetNotificationResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetNotificationResponse', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristic', subBuilder: BluetoothCharacteristic.create) ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'success') ..hasRequiredFields = false ; SetNotificationResponse._() : super(); factory SetNotificationResponse({ $core.String? remoteId, BluetoothCharacteristic? characteristic, $core.bool? success, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (characteristic != null) { _result.characteristic = characteristic; } if (success != null) { _result.success = success; } return _result; } factory SetNotificationResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory SetNotificationResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') SetNotificationResponse clone() => SetNotificationResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') SetNotificationResponse copyWith(void Function(SetNotificationResponse) updates) => super.copyWith((message) => updates(message as SetNotificationResponse)) as SetNotificationResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static SetNotificationResponse create() => SetNotificationResponse._(); SetNotificationResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static SetNotificationResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static SetNotificationResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) BluetoothCharacteristic get characteristic => $_getN(1); @$pb.TagNumber(2) set characteristic(BluetoothCharacteristic v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasCharacteristic() => $_has(1); @$pb.TagNumber(2) void clearCharacteristic() => clearField(2); @$pb.TagNumber(2) BluetoothCharacteristic ensureCharacteristic() => $_ensure(1); @$pb.TagNumber(3) $core.bool get success => $_getBF(2); @$pb.TagNumber(3) set success($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasSuccess() => $_has(2); @$pb.TagNumber(3) void clearSuccess() => clearField(3); } class OnCharacteristicChanged extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OnCharacteristicChanged', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'characteristic', subBuilder: BluetoothCharacteristic.create) ..hasRequiredFields = false ; OnCharacteristicChanged._() : super(); factory OnCharacteristicChanged({ $core.String? remoteId, BluetoothCharacteristic? characteristic, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (characteristic != null) { _result.characteristic = characteristic; } return _result; } factory OnCharacteristicChanged.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory OnCharacteristicChanged.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') OnCharacteristicChanged clone() => OnCharacteristicChanged()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') OnCharacteristicChanged copyWith(void Function(OnCharacteristicChanged) updates) => super.copyWith((message) => updates(message as OnCharacteristicChanged)) as OnCharacteristicChanged; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static OnCharacteristicChanged create() => OnCharacteristicChanged._(); OnCharacteristicChanged createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static OnCharacteristicChanged getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static OnCharacteristicChanged? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) BluetoothCharacteristic get characteristic => $_getN(1); @$pb.TagNumber(2) set characteristic(BluetoothCharacteristic v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasCharacteristic() => $_has(1); @$pb.TagNumber(2) void clearCharacteristic() => clearField(2); @$pb.TagNumber(2) BluetoothCharacteristic ensureCharacteristic() => $_ensure(1); } class DeviceStateResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DeviceStateResponse', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE, defaultOrMaker: DeviceStateResponse_BluetoothDeviceState.DISCONNECTED, valueOf: DeviceStateResponse_BluetoothDeviceState.valueOf, enumValues: DeviceStateResponse_BluetoothDeviceState.values) ..hasRequiredFields = false ; DeviceStateResponse._() : super(); factory DeviceStateResponse({ $core.String? remoteId, DeviceStateResponse_BluetoothDeviceState? state, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (state != null) { _result.state = state; } return _result; } factory DeviceStateResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory DeviceStateResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') DeviceStateResponse clone() => DeviceStateResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') DeviceStateResponse copyWith(void Function(DeviceStateResponse) updates) => super.copyWith((message) => updates(message as DeviceStateResponse)) as DeviceStateResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static DeviceStateResponse create() => DeviceStateResponse._(); DeviceStateResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static DeviceStateResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static DeviceStateResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) DeviceStateResponse_BluetoothDeviceState get state => $_getN(1); @$pb.TagNumber(2) set state(DeviceStateResponse_BluetoothDeviceState v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasState() => $_has(1); @$pb.TagNumber(2) void clearState() => clearField(2); } class ConnectedDevicesResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ConnectedDevicesResponse', createEmptyInstance: create) ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'devices', $pb.PbFieldType.PM, subBuilder: BluetoothDevice.create) ..hasRequiredFields = false ; ConnectedDevicesResponse._() : super(); factory ConnectedDevicesResponse({ $core.Iterable? devices, }) { final _result = create(); if (devices != null) { _result.devices.addAll(devices); } return _result; } factory ConnectedDevicesResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ConnectedDevicesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ConnectedDevicesResponse clone() => ConnectedDevicesResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ConnectedDevicesResponse copyWith(void Function(ConnectedDevicesResponse) updates) => super.copyWith((message) => updates(message as ConnectedDevicesResponse)) as ConnectedDevicesResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ConnectedDevicesResponse create() => ConnectedDevicesResponse._(); ConnectedDevicesResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ConnectedDevicesResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ConnectedDevicesResponse? _defaultInstance; @$pb.TagNumber(1) $core.List get devices => $_getList(0); } class MtuSizeRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MtuSizeRequest', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mtu', $pb.PbFieldType.OU3) ..hasRequiredFields = false ; MtuSizeRequest._() : super(); factory MtuSizeRequest({ $core.String? remoteId, $core.int? mtu, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (mtu != null) { _result.mtu = mtu; } return _result; } factory MtuSizeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory MtuSizeRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') MtuSizeRequest clone() => MtuSizeRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') MtuSizeRequest copyWith(void Function(MtuSizeRequest) updates) => super.copyWith((message) => updates(message as MtuSizeRequest)) as MtuSizeRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static MtuSizeRequest create() => MtuSizeRequest._(); MtuSizeRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static MtuSizeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static MtuSizeRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.int get mtu => $_getIZ(1); @$pb.TagNumber(2) set mtu($core.int v) { $_setUnsignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasMtu() => $_has(1); @$pb.TagNumber(2) void clearMtu() => clearField(2); } class MtuSizeResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MtuSizeResponse', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mtu', $pb.PbFieldType.OU3) ..hasRequiredFields = false ; MtuSizeResponse._() : super(); factory MtuSizeResponse({ $core.String? remoteId, $core.int? mtu, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (mtu != null) { _result.mtu = mtu; } return _result; } factory MtuSizeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory MtuSizeResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') MtuSizeResponse clone() => MtuSizeResponse()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') MtuSizeResponse copyWith(void Function(MtuSizeResponse) updates) => super.copyWith((message) => updates(message as MtuSizeResponse)) as MtuSizeResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static MtuSizeResponse create() => MtuSizeResponse._(); MtuSizeResponse createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static MtuSizeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static MtuSizeResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.int get mtu => $_getIZ(1); @$pb.TagNumber(2) set mtu($core.int v) { $_setUnsignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasMtu() => $_has(1); @$pb.TagNumber(2) void clearMtu() => clearField(2); } class ReadRssiResult extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ReadRssiResult', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'remoteId') ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rssi', $pb.PbFieldType.O3) ..hasRequiredFields = false ; ReadRssiResult._() : super(); factory ReadRssiResult({ $core.String? remoteId, $core.int? rssi, }) { final _result = create(); if (remoteId != null) { _result.remoteId = remoteId; } if (rssi != null) { _result.rssi = rssi; } return _result; } factory ReadRssiResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory ReadRssiResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') ReadRssiResult clone() => ReadRssiResult()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ReadRssiResult copyWith(void Function(ReadRssiResult) updates) => super.copyWith((message) => updates(message as ReadRssiResult)) as ReadRssiResult; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ReadRssiResult create() => ReadRssiResult._(); ReadRssiResult createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') static ReadRssiResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ReadRssiResult? _defaultInstance; @$pb.TagNumber(1) $core.String get remoteId => $_getSZ(0); @$pb.TagNumber(1) set remoteId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasRemoteId() => $_has(0); @$pb.TagNumber(1) void clearRemoteId() => clearField(1); @$pb.TagNumber(2) $core.int get rssi => $_getIZ(1); @$pb.TagNumber(2) set rssi($core.int v) { $_setSignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasRssi() => $_has(1); @$pb.TagNumber(2) void clearRssi() => clearField(2); } ================================================ FILE: plugins/flutter_blue_plus/lib/gen/flutterblueplus.pbenum.dart ================================================ /// // Generated code. Do not modify. // source: flutterblueplus.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields // ignore_for_file: UNDEFINED_SHOWN_NAME import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; class BluetoothState_State extends $pb.ProtobufEnum { static const BluetoothState_State UNKNOWN = BluetoothState_State._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNKNOWN'); static const BluetoothState_State UNAVAILABLE = BluetoothState_State._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNAVAILABLE'); static const BluetoothState_State UNAUTHORIZED = BluetoothState_State._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNAUTHORIZED'); static const BluetoothState_State TURNING_ON = BluetoothState_State._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TURNING_ON'); static const BluetoothState_State ON = BluetoothState_State._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ON'); static const BluetoothState_State TURNING_OFF = BluetoothState_State._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TURNING_OFF'); static const BluetoothState_State OFF = BluetoothState_State._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OFF'); static const $core.List values = [ UNKNOWN, UNAVAILABLE, UNAUTHORIZED, TURNING_ON, ON, TURNING_OFF, OFF, ]; static final $core.Map<$core.int, BluetoothState_State> _byValue = $pb.ProtobufEnum.initByValue(values); static BluetoothState_State? valueOf($core.int value) => _byValue[value]; const BluetoothState_State._($core.int v, $core.String n) : super(v, n); } class BluetoothDevice_Type extends $pb.ProtobufEnum { static const BluetoothDevice_Type UNKNOWN = BluetoothDevice_Type._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNKNOWN'); static const BluetoothDevice_Type CLASSIC = BluetoothDevice_Type._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CLASSIC'); static const BluetoothDevice_Type LE = BluetoothDevice_Type._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'LE'); static const BluetoothDevice_Type DUAL = BluetoothDevice_Type._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DUAL'); static const $core.List values = [ UNKNOWN, CLASSIC, LE, DUAL, ]; static final $core.Map<$core.int, BluetoothDevice_Type> _byValue = $pb.ProtobufEnum.initByValue(values); static BluetoothDevice_Type? valueOf($core.int value) => _byValue[value]; const BluetoothDevice_Type._($core.int v, $core.String n) : super(v, n); } class WriteCharacteristicRequest_WriteType extends $pb.ProtobufEnum { static const WriteCharacteristicRequest_WriteType WITH_RESPONSE = WriteCharacteristicRequest_WriteType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WITH_RESPONSE'); static const WriteCharacteristicRequest_WriteType WITHOUT_RESPONSE = WriteCharacteristicRequest_WriteType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WITHOUT_RESPONSE'); static const $core.List values = [ WITH_RESPONSE, WITHOUT_RESPONSE, ]; static final $core.Map<$core.int, WriteCharacteristicRequest_WriteType> _byValue = $pb.ProtobufEnum.initByValue(values); static WriteCharacteristicRequest_WriteType? valueOf($core.int value) => _byValue[value]; const WriteCharacteristicRequest_WriteType._($core.int v, $core.String n) : super(v, n); } class DeviceStateResponse_BluetoothDeviceState extends $pb.ProtobufEnum { static const DeviceStateResponse_BluetoothDeviceState DISCONNECTED = DeviceStateResponse_BluetoothDeviceState._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DISCONNECTED'); static const DeviceStateResponse_BluetoothDeviceState CONNECTING = DeviceStateResponse_BluetoothDeviceState._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CONNECTING'); static const DeviceStateResponse_BluetoothDeviceState CONNECTED = DeviceStateResponse_BluetoothDeviceState._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CONNECTED'); static const DeviceStateResponse_BluetoothDeviceState DISCONNECTING = DeviceStateResponse_BluetoothDeviceState._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DISCONNECTING'); static const $core.List values = [ DISCONNECTED, CONNECTING, CONNECTED, DISCONNECTING, ]; static final $core.Map<$core.int, DeviceStateResponse_BluetoothDeviceState> _byValue = $pb.ProtobufEnum.initByValue(values); static DeviceStateResponse_BluetoothDeviceState? valueOf($core.int value) => _byValue[value]; const DeviceStateResponse_BluetoothDeviceState._($core.int v, $core.String n) : super(v, n); } ================================================ FILE: plugins/flutter_blue_plus/lib/gen/flutterblueplus.pbjson.dart ================================================ /// // Generated code. Do not modify. // source: flutterblueplus.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package import 'dart:core' as $core; import 'dart:convert' as $convert; import 'dart:typed_data' as $typed_data; @$core.Deprecated('Use int32ValueDescriptor instead') const Int32Value$json = const { '1': 'Int32Value', '2': const [ const {'1': 'value', '3': 1, '4': 1, '5': 5, '10': 'value'}, ], }; /// Descriptor for `Int32Value`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List int32ValueDescriptor = $convert.base64Decode('CgpJbnQzMlZhbHVlEhQKBXZhbHVlGAEgASgFUgV2YWx1ZQ=='); @$core.Deprecated('Use bluetoothStateDescriptor instead') const BluetoothState$json = const { '1': 'BluetoothState', '2': const [ const {'1': 'state', '3': 1, '4': 1, '5': 14, '6': '.BluetoothState.State', '10': 'state'}, ], '4': const [BluetoothState_State$json], }; @$core.Deprecated('Use bluetoothStateDescriptor instead') const BluetoothState_State$json = const { '1': 'State', '2': const [ const {'1': 'UNKNOWN', '2': 0}, const {'1': 'UNAVAILABLE', '2': 1}, const {'1': 'UNAUTHORIZED', '2': 2}, const {'1': 'TURNING_ON', '2': 3}, const {'1': 'ON', '2': 4}, const {'1': 'TURNING_OFF', '2': 5}, const {'1': 'OFF', '2': 6}, ], }; /// Descriptor for `BluetoothState`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List bluetoothStateDescriptor = $convert.base64Decode('Cg5CbHVldG9vdGhTdGF0ZRIrCgVzdGF0ZRgBIAEoDjIVLkJsdWV0b290aFN0YXRlLlN0YXRlUgVzdGF0ZSJpCgVTdGF0ZRILCgdVTktOT1dOEAASDwoLVU5BVkFJTEFCTEUQARIQCgxVTkFVVEhPUklaRUQQAhIOCgpUVVJOSU5HX09OEAMSBgoCT04QBBIPCgtUVVJOSU5HX09GRhAFEgcKA09GRhAG'); @$core.Deprecated('Use advertisementDataDescriptor instead') const AdvertisementData$json = const { '1': 'AdvertisementData', '2': const [ const {'1': 'local_name', '3': 1, '4': 1, '5': 9, '10': 'localName'}, const {'1': 'tx_power_level', '3': 2, '4': 1, '5': 11, '6': '.Int32Value', '10': 'txPowerLevel'}, const {'1': 'connectable', '3': 3, '4': 1, '5': 8, '10': 'connectable'}, const {'1': 'manufacturer_data', '3': 4, '4': 3, '5': 11, '6': '.AdvertisementData.ManufacturerDataEntry', '10': 'manufacturerData'}, const {'1': 'service_data', '3': 5, '4': 3, '5': 11, '6': '.AdvertisementData.ServiceDataEntry', '10': 'serviceData'}, const {'1': 'service_uuids', '3': 6, '4': 3, '5': 9, '10': 'serviceUuids'}, ], '3': const [AdvertisementData_ManufacturerDataEntry$json, AdvertisementData_ServiceDataEntry$json], }; @$core.Deprecated('Use advertisementDataDescriptor instead') const AdvertisementData_ManufacturerDataEntry$json = const { '1': 'ManufacturerDataEntry', '2': const [ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'}, const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, ], '7': const {'7': true}, }; @$core.Deprecated('Use advertisementDataDescriptor instead') const AdvertisementData_ServiceDataEntry$json = const { '1': 'ServiceDataEntry', '2': const [ const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, ], '7': const {'7': true}, }; /// Descriptor for `AdvertisementData`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List advertisementDataDescriptor = $convert.base64Decode('ChFBZHZlcnRpc2VtZW50RGF0YRIdCgpsb2NhbF9uYW1lGAEgASgJUglsb2NhbE5hbWUSMQoOdHhfcG93ZXJfbGV2ZWwYAiABKAsyCy5JbnQzMlZhbHVlUgx0eFBvd2VyTGV2ZWwSIAoLY29ubmVjdGFibGUYAyABKAhSC2Nvbm5lY3RhYmxlElUKEW1hbnVmYWN0dXJlcl9kYXRhGAQgAygLMiguQWR2ZXJ0aXNlbWVudERhdGEuTWFudWZhY3R1cmVyRGF0YUVudHJ5UhBtYW51ZmFjdHVyZXJEYXRhEkYKDHNlcnZpY2VfZGF0YRgFIAMoCzIjLkFkdmVydGlzZW1lbnREYXRhLlNlcnZpY2VEYXRhRW50cnlSC3NlcnZpY2VEYXRhEiMKDXNlcnZpY2VfdXVpZHMYBiADKAlSDHNlcnZpY2VVdWlkcxpDChVNYW51ZmFjdHVyZXJEYXRhRW50cnkSEAoDa2V5GAEgASgFUgNrZXkSFAoFdmFsdWUYAiABKAxSBXZhbHVlOgI4ARo+ChBTZXJ2aWNlRGF0YUVudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgMUgV2YWx1ZToCOAE='); @$core.Deprecated('Use scanSettingsDescriptor instead') const ScanSettings$json = const { '1': 'ScanSettings', '2': const [ const {'1': 'android_scan_mode', '3': 1, '4': 1, '5': 5, '10': 'androidScanMode'}, const {'1': 'service_uuids', '3': 2, '4': 3, '5': 9, '10': 'serviceUuids'}, const {'1': 'allow_duplicates', '3': 3, '4': 1, '5': 8, '10': 'allowDuplicates'}, const {'1': 'mac_addresses', '3': 4, '4': 3, '5': 9, '10': 'macAddresses'}, ], }; /// Descriptor for `ScanSettings`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List scanSettingsDescriptor = $convert.base64Decode('CgxTY2FuU2V0dGluZ3MSKgoRYW5kcm9pZF9zY2FuX21vZGUYASABKAVSD2FuZHJvaWRTY2FuTW9kZRIjCg1zZXJ2aWNlX3V1aWRzGAIgAygJUgxzZXJ2aWNlVXVpZHMSKQoQYWxsb3dfZHVwbGljYXRlcxgDIAEoCFIPYWxsb3dEdXBsaWNhdGVzEiMKDW1hY19hZGRyZXNzZXMYBCADKAlSDG1hY0FkZHJlc3Nlcw=='); @$core.Deprecated('Use scanResultDescriptor instead') const ScanResult$json = const { '1': 'ScanResult', '2': const [ const {'1': 'device', '3': 1, '4': 1, '5': 11, '6': '.BluetoothDevice', '10': 'device'}, const {'1': 'advertisement_data', '3': 2, '4': 1, '5': 11, '6': '.AdvertisementData', '10': 'advertisementData'}, const {'1': 'rssi', '3': 3, '4': 1, '5': 5, '10': 'rssi'}, ], }; /// Descriptor for `ScanResult`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List scanResultDescriptor = $convert.base64Decode('CgpTY2FuUmVzdWx0EigKBmRldmljZRgBIAEoCzIQLkJsdWV0b290aERldmljZVIGZGV2aWNlEkEKEmFkdmVydGlzZW1lbnRfZGF0YRgCIAEoCzISLkFkdmVydGlzZW1lbnREYXRhUhFhZHZlcnRpc2VtZW50RGF0YRISCgRyc3NpGAMgASgFUgRyc3Np'); @$core.Deprecated('Use connectRequestDescriptor instead') const ConnectRequest$json = const { '1': 'ConnectRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'android_auto_connect', '3': 2, '4': 1, '5': 8, '10': 'androidAutoConnect'}, ], }; /// Descriptor for `ConnectRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List connectRequestDescriptor = $convert.base64Decode('Cg5Db25uZWN0UmVxdWVzdBIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEjAKFGFuZHJvaWRfYXV0b19jb25uZWN0GAIgASgIUhJhbmRyb2lkQXV0b0Nvbm5lY3Q='); @$core.Deprecated('Use bluetoothDeviceDescriptor instead') const BluetoothDevice$json = const { '1': 'BluetoothDevice', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, const {'1': 'type', '3': 3, '4': 1, '5': 14, '6': '.BluetoothDevice.Type', '10': 'type'}, ], '4': const [BluetoothDevice_Type$json], }; @$core.Deprecated('Use bluetoothDeviceDescriptor instead') const BluetoothDevice_Type$json = const { '1': 'Type', '2': const [ const {'1': 'UNKNOWN', '2': 0}, const {'1': 'CLASSIC', '2': 1}, const {'1': 'LE', '2': 2}, const {'1': 'DUAL', '2': 3}, ], }; /// Descriptor for `BluetoothDevice`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List bluetoothDeviceDescriptor = $convert.base64Decode('Cg9CbHVldG9vdGhEZXZpY2USGwoJcmVtb3RlX2lkGAEgASgJUghyZW1vdGVJZBISCgRuYW1lGAIgASgJUgRuYW1lEikKBHR5cGUYAyABKA4yFS5CbHVldG9vdGhEZXZpY2UuVHlwZVIEdHlwZSIyCgRUeXBlEgsKB1VOS05PV04QABILCgdDTEFTU0lDEAESBgoCTEUQAhIICgREVUFMEAM='); @$core.Deprecated('Use bluetoothServiceDescriptor instead') const BluetoothService$json = const { '1': 'BluetoothService', '2': const [ const {'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'}, const {'1': 'remote_id', '3': 2, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'is_primary', '3': 3, '4': 1, '5': 8, '10': 'isPrimary'}, const {'1': 'characteristics', '3': 4, '4': 3, '5': 11, '6': '.BluetoothCharacteristic', '10': 'characteristics'}, const {'1': 'included_services', '3': 5, '4': 3, '5': 11, '6': '.BluetoothService', '10': 'includedServices'}, ], }; /// Descriptor for `BluetoothService`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List bluetoothServiceDescriptor = $convert.base64Decode('ChBCbHVldG9vdGhTZXJ2aWNlEhIKBHV1aWQYASABKAlSBHV1aWQSGwoJcmVtb3RlX2lkGAIgASgJUghyZW1vdGVJZBIdCgppc19wcmltYXJ5GAMgASgIUglpc1ByaW1hcnkSQgoPY2hhcmFjdGVyaXN0aWNzGAQgAygLMhguQmx1ZXRvb3RoQ2hhcmFjdGVyaXN0aWNSD2NoYXJhY3RlcmlzdGljcxI+ChFpbmNsdWRlZF9zZXJ2aWNlcxgFIAMoCzIRLkJsdWV0b290aFNlcnZpY2VSEGluY2x1ZGVkU2VydmljZXM='); @$core.Deprecated('Use bluetoothCharacteristicDescriptor instead') const BluetoothCharacteristic$json = const { '1': 'BluetoothCharacteristic', '2': const [ const {'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'}, const {'1': 'remote_id', '3': 2, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'serviceUuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondaryServiceUuid', '3': 4, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, const {'1': 'descriptors', '3': 5, '4': 3, '5': 11, '6': '.BluetoothDescriptor', '10': 'descriptors'}, const {'1': 'properties', '3': 6, '4': 1, '5': 11, '6': '.CharacteristicProperties', '10': 'properties'}, const {'1': 'value', '3': 7, '4': 1, '5': 12, '10': 'value'}, ], }; /// Descriptor for `BluetoothCharacteristic`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List bluetoothCharacteristicDescriptor = $convert.base64Decode('ChdCbHVldG9vdGhDaGFyYWN0ZXJpc3RpYxISCgR1dWlkGAEgASgJUgR1dWlkEhsKCXJlbW90ZV9pZBgCIAEoCVIIcmVtb3RlSWQSIAoLc2VydmljZVV1aWQYAyABKAlSC3NlcnZpY2VVdWlkEjIKFHNlY29uZGFyeVNlcnZpY2VVdWlkGAQgASgJUhRzZWNvbmRhcnlTZXJ2aWNlVXVpZBI2CgtkZXNjcmlwdG9ycxgFIAMoCzIULkJsdWV0b290aERlc2NyaXB0b3JSC2Rlc2NyaXB0b3JzEjkKCnByb3BlcnRpZXMYBiABKAsyGS5DaGFyYWN0ZXJpc3RpY1Byb3BlcnRpZXNSCnByb3BlcnRpZXMSFAoFdmFsdWUYByABKAxSBXZhbHVl'); @$core.Deprecated('Use bluetoothDescriptorDescriptor instead') const BluetoothDescriptor$json = const { '1': 'BluetoothDescriptor', '2': const [ const {'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'}, const {'1': 'remote_id', '3': 2, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'serviceUuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'characteristicUuid', '3': 4, '4': 1, '5': 9, '10': 'characteristicUuid'}, const {'1': 'value', '3': 5, '4': 1, '5': 12, '10': 'value'}, ], }; /// Descriptor for `BluetoothDescriptor`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List bluetoothDescriptorDescriptor = $convert.base64Decode('ChNCbHVldG9vdGhEZXNjcmlwdG9yEhIKBHV1aWQYASABKAlSBHV1aWQSGwoJcmVtb3RlX2lkGAIgASgJUghyZW1vdGVJZBIgCgtzZXJ2aWNlVXVpZBgDIAEoCVILc2VydmljZVV1aWQSLgoSY2hhcmFjdGVyaXN0aWNVdWlkGAQgASgJUhJjaGFyYWN0ZXJpc3RpY1V1aWQSFAoFdmFsdWUYBSABKAxSBXZhbHVl'); @$core.Deprecated('Use characteristicPropertiesDescriptor instead') const CharacteristicProperties$json = const { '1': 'CharacteristicProperties', '2': const [ const {'1': 'broadcast', '3': 1, '4': 1, '5': 8, '10': 'broadcast'}, const {'1': 'read', '3': 2, '4': 1, '5': 8, '10': 'read'}, const {'1': 'write_without_response', '3': 3, '4': 1, '5': 8, '10': 'writeWithoutResponse'}, const {'1': 'write', '3': 4, '4': 1, '5': 8, '10': 'write'}, const {'1': 'notify', '3': 5, '4': 1, '5': 8, '10': 'notify'}, const {'1': 'indicate', '3': 6, '4': 1, '5': 8, '10': 'indicate'}, const {'1': 'authenticated_signed_writes', '3': 7, '4': 1, '5': 8, '10': 'authenticatedSignedWrites'}, const {'1': 'extended_properties', '3': 8, '4': 1, '5': 8, '10': 'extendedProperties'}, const {'1': 'notify_encryption_required', '3': 9, '4': 1, '5': 8, '10': 'notifyEncryptionRequired'}, const {'1': 'indicate_encryption_required', '3': 10, '4': 1, '5': 8, '10': 'indicateEncryptionRequired'}, ], }; /// Descriptor for `CharacteristicProperties`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List characteristicPropertiesDescriptor = $convert.base64Decode('ChhDaGFyYWN0ZXJpc3RpY1Byb3BlcnRpZXMSHAoJYnJvYWRjYXN0GAEgASgIUglicm9hZGNhc3QSEgoEcmVhZBgCIAEoCFIEcmVhZBI0ChZ3cml0ZV93aXRob3V0X3Jlc3BvbnNlGAMgASgIUhR3cml0ZVdpdGhvdXRSZXNwb25zZRIUCgV3cml0ZRgEIAEoCFIFd3JpdGUSFgoGbm90aWZ5GAUgASgIUgZub3RpZnkSGgoIaW5kaWNhdGUYBiABKAhSCGluZGljYXRlEj4KG2F1dGhlbnRpY2F0ZWRfc2lnbmVkX3dyaXRlcxgHIAEoCFIZYXV0aGVudGljYXRlZFNpZ25lZFdyaXRlcxIvChNleHRlbmRlZF9wcm9wZXJ0aWVzGAggASgIUhJleHRlbmRlZFByb3BlcnRpZXMSPAoabm90aWZ5X2VuY3J5cHRpb25fcmVxdWlyZWQYCSABKAhSGG5vdGlmeUVuY3J5cHRpb25SZXF1aXJlZBJAChxpbmRpY2F0ZV9lbmNyeXB0aW9uX3JlcXVpcmVkGAogASgIUhppbmRpY2F0ZUVuY3J5cHRpb25SZXF1aXJlZA=='); @$core.Deprecated('Use discoverServicesResultDescriptor instead') const DiscoverServicesResult$json = const { '1': 'DiscoverServicesResult', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'services', '3': 2, '4': 3, '5': 11, '6': '.BluetoothService', '10': 'services'}, ], }; /// Descriptor for `DiscoverServicesResult`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List discoverServicesResultDescriptor = $convert.base64Decode('ChZEaXNjb3ZlclNlcnZpY2VzUmVzdWx0EhsKCXJlbW90ZV9pZBgBIAEoCVIIcmVtb3RlSWQSLQoIc2VydmljZXMYAiADKAsyES5CbHVldG9vdGhTZXJ2aWNlUghzZXJ2aWNlcw=='); @$core.Deprecated('Use readCharacteristicRequestDescriptor instead') const ReadCharacteristicRequest$json = const { '1': 'ReadCharacteristicRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'characteristic_uuid', '3': 2, '4': 1, '5': 9, '10': 'characteristicUuid'}, const {'1': 'service_uuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondary_service_uuid', '3': 4, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, ], }; /// Descriptor for `ReadCharacteristicRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List readCharacteristicRequestDescriptor = $convert.base64Decode('ChlSZWFkQ2hhcmFjdGVyaXN0aWNSZXF1ZXN0EhsKCXJlbW90ZV9pZBgBIAEoCVIIcmVtb3RlSWQSLwoTY2hhcmFjdGVyaXN0aWNfdXVpZBgCIAEoCVISY2hhcmFjdGVyaXN0aWNVdWlkEiEKDHNlcnZpY2VfdXVpZBgDIAEoCVILc2VydmljZVV1aWQSNAoWc2Vjb25kYXJ5X3NlcnZpY2VfdXVpZBgEIAEoCVIUc2Vjb25kYXJ5U2VydmljZVV1aWQ='); @$core.Deprecated('Use readCharacteristicResponseDescriptor instead') const ReadCharacteristicResponse$json = const { '1': 'ReadCharacteristicResponse', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'characteristic', '3': 2, '4': 1, '5': 11, '6': '.BluetoothCharacteristic', '10': 'characteristic'}, ], }; /// Descriptor for `ReadCharacteristicResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List readCharacteristicResponseDescriptor = $convert.base64Decode('ChpSZWFkQ2hhcmFjdGVyaXN0aWNSZXNwb25zZRIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEkAKDmNoYXJhY3RlcmlzdGljGAIgASgLMhguQmx1ZXRvb3RoQ2hhcmFjdGVyaXN0aWNSDmNoYXJhY3RlcmlzdGlj'); @$core.Deprecated('Use readDescriptorRequestDescriptor instead') const ReadDescriptorRequest$json = const { '1': 'ReadDescriptorRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'descriptor_uuid', '3': 2, '4': 1, '5': 9, '10': 'descriptorUuid'}, const {'1': 'service_uuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondary_service_uuid', '3': 4, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, const {'1': 'characteristic_uuid', '3': 5, '4': 1, '5': 9, '10': 'characteristicUuid'}, ], }; /// Descriptor for `ReadDescriptorRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List readDescriptorRequestDescriptor = $convert.base64Decode('ChVSZWFkRGVzY3JpcHRvclJlcXVlc3QSGwoJcmVtb3RlX2lkGAEgASgJUghyZW1vdGVJZBInCg9kZXNjcmlwdG9yX3V1aWQYAiABKAlSDmRlc2NyaXB0b3JVdWlkEiEKDHNlcnZpY2VfdXVpZBgDIAEoCVILc2VydmljZVV1aWQSNAoWc2Vjb25kYXJ5X3NlcnZpY2VfdXVpZBgEIAEoCVIUc2Vjb25kYXJ5U2VydmljZVV1aWQSLwoTY2hhcmFjdGVyaXN0aWNfdXVpZBgFIAEoCVISY2hhcmFjdGVyaXN0aWNVdWlk'); @$core.Deprecated('Use readDescriptorResponseDescriptor instead') const ReadDescriptorResponse$json = const { '1': 'ReadDescriptorResponse', '2': const [ const {'1': 'request', '3': 1, '4': 1, '5': 11, '6': '.ReadDescriptorRequest', '10': 'request'}, const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, ], }; /// Descriptor for `ReadDescriptorResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List readDescriptorResponseDescriptor = $convert.base64Decode('ChZSZWFkRGVzY3JpcHRvclJlc3BvbnNlEjAKB3JlcXVlc3QYASABKAsyFi5SZWFkRGVzY3JpcHRvclJlcXVlc3RSB3JlcXVlc3QSFAoFdmFsdWUYAiABKAxSBXZhbHVl'); @$core.Deprecated('Use writeCharacteristicRequestDescriptor instead') const WriteCharacteristicRequest$json = const { '1': 'WriteCharacteristicRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'characteristic_uuid', '3': 2, '4': 1, '5': 9, '10': 'characteristicUuid'}, const {'1': 'service_uuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondary_service_uuid', '3': 4, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, const {'1': 'write_type', '3': 5, '4': 1, '5': 14, '6': '.WriteCharacteristicRequest.WriteType', '10': 'writeType'}, const {'1': 'value', '3': 6, '4': 1, '5': 12, '10': 'value'}, ], '4': const [WriteCharacteristicRequest_WriteType$json], }; @$core.Deprecated('Use writeCharacteristicRequestDescriptor instead') const WriteCharacteristicRequest_WriteType$json = const { '1': 'WriteType', '2': const [ const {'1': 'WITH_RESPONSE', '2': 0}, const {'1': 'WITHOUT_RESPONSE', '2': 1}, ], }; /// Descriptor for `WriteCharacteristicRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List writeCharacteristicRequestDescriptor = $convert.base64Decode('ChpXcml0ZUNoYXJhY3RlcmlzdGljUmVxdWVzdBIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEi8KE2NoYXJhY3RlcmlzdGljX3V1aWQYAiABKAlSEmNoYXJhY3RlcmlzdGljVXVpZBIhCgxzZXJ2aWNlX3V1aWQYAyABKAlSC3NlcnZpY2VVdWlkEjQKFnNlY29uZGFyeV9zZXJ2aWNlX3V1aWQYBCABKAlSFHNlY29uZGFyeVNlcnZpY2VVdWlkEkQKCndyaXRlX3R5cGUYBSABKA4yJS5Xcml0ZUNoYXJhY3RlcmlzdGljUmVxdWVzdC5Xcml0ZVR5cGVSCXdyaXRlVHlwZRIUCgV2YWx1ZRgGIAEoDFIFdmFsdWUiNAoJV3JpdGVUeXBlEhEKDVdJVEhfUkVTUE9OU0UQABIUChBXSVRIT1VUX1JFU1BPTlNFEAE='); @$core.Deprecated('Use writeCharacteristicResponseDescriptor instead') const WriteCharacteristicResponse$json = const { '1': 'WriteCharacteristicResponse', '2': const [ const {'1': 'request', '3': 1, '4': 1, '5': 11, '6': '.WriteCharacteristicRequest', '10': 'request'}, const {'1': 'success', '3': 2, '4': 1, '5': 8, '10': 'success'}, ], }; /// Descriptor for `WriteCharacteristicResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List writeCharacteristicResponseDescriptor = $convert.base64Decode('ChtXcml0ZUNoYXJhY3RlcmlzdGljUmVzcG9uc2USNQoHcmVxdWVzdBgBIAEoCzIbLldyaXRlQ2hhcmFjdGVyaXN0aWNSZXF1ZXN0UgdyZXF1ZXN0EhgKB3N1Y2Nlc3MYAiABKAhSB3N1Y2Nlc3M='); @$core.Deprecated('Use writeDescriptorRequestDescriptor instead') const WriteDescriptorRequest$json = const { '1': 'WriteDescriptorRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'descriptor_uuid', '3': 2, '4': 1, '5': 9, '10': 'descriptorUuid'}, const {'1': 'service_uuid', '3': 3, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondary_service_uuid', '3': 4, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, const {'1': 'characteristic_uuid', '3': 5, '4': 1, '5': 9, '10': 'characteristicUuid'}, const {'1': 'value', '3': 6, '4': 1, '5': 12, '10': 'value'}, ], }; /// Descriptor for `WriteDescriptorRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List writeDescriptorRequestDescriptor = $convert.base64Decode('ChZXcml0ZURlc2NyaXB0b3JSZXF1ZXN0EhsKCXJlbW90ZV9pZBgBIAEoCVIIcmVtb3RlSWQSJwoPZGVzY3JpcHRvcl91dWlkGAIgASgJUg5kZXNjcmlwdG9yVXVpZBIhCgxzZXJ2aWNlX3V1aWQYAyABKAlSC3NlcnZpY2VVdWlkEjQKFnNlY29uZGFyeV9zZXJ2aWNlX3V1aWQYBCABKAlSFHNlY29uZGFyeVNlcnZpY2VVdWlkEi8KE2NoYXJhY3RlcmlzdGljX3V1aWQYBSABKAlSEmNoYXJhY3RlcmlzdGljVXVpZBIUCgV2YWx1ZRgGIAEoDFIFdmFsdWU='); @$core.Deprecated('Use writeDescriptorResponseDescriptor instead') const WriteDescriptorResponse$json = const { '1': 'WriteDescriptorResponse', '2': const [ const {'1': 'request', '3': 1, '4': 1, '5': 11, '6': '.WriteDescriptorRequest', '10': 'request'}, const {'1': 'success', '3': 2, '4': 1, '5': 8, '10': 'success'}, ], }; /// Descriptor for `WriteDescriptorResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List writeDescriptorResponseDescriptor = $convert.base64Decode('ChdXcml0ZURlc2NyaXB0b3JSZXNwb25zZRIxCgdyZXF1ZXN0GAEgASgLMhcuV3JpdGVEZXNjcmlwdG9yUmVxdWVzdFIHcmVxdWVzdBIYCgdzdWNjZXNzGAIgASgIUgdzdWNjZXNz'); @$core.Deprecated('Use setNotificationRequestDescriptor instead') const SetNotificationRequest$json = const { '1': 'SetNotificationRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'service_uuid', '3': 2, '4': 1, '5': 9, '10': 'serviceUuid'}, const {'1': 'secondary_service_uuid', '3': 3, '4': 1, '5': 9, '10': 'secondaryServiceUuid'}, const {'1': 'characteristic_uuid', '3': 4, '4': 1, '5': 9, '10': 'characteristicUuid'}, const {'1': 'enable', '3': 5, '4': 1, '5': 8, '10': 'enable'}, ], }; /// Descriptor for `SetNotificationRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List setNotificationRequestDescriptor = $convert.base64Decode('ChZTZXROb3RpZmljYXRpb25SZXF1ZXN0EhsKCXJlbW90ZV9pZBgBIAEoCVIIcmVtb3RlSWQSIQoMc2VydmljZV91dWlkGAIgASgJUgtzZXJ2aWNlVXVpZBI0ChZzZWNvbmRhcnlfc2VydmljZV91dWlkGAMgASgJUhRzZWNvbmRhcnlTZXJ2aWNlVXVpZBIvChNjaGFyYWN0ZXJpc3RpY191dWlkGAQgASgJUhJjaGFyYWN0ZXJpc3RpY1V1aWQSFgoGZW5hYmxlGAUgASgIUgZlbmFibGU='); @$core.Deprecated('Use setNotificationResponseDescriptor instead') const SetNotificationResponse$json = const { '1': 'SetNotificationResponse', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'characteristic', '3': 2, '4': 1, '5': 11, '6': '.BluetoothCharacteristic', '10': 'characteristic'}, const {'1': 'success', '3': 3, '4': 1, '5': 8, '10': 'success'}, ], }; /// Descriptor for `SetNotificationResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List setNotificationResponseDescriptor = $convert.base64Decode('ChdTZXROb3RpZmljYXRpb25SZXNwb25zZRIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEkAKDmNoYXJhY3RlcmlzdGljGAIgASgLMhguQmx1ZXRvb3RoQ2hhcmFjdGVyaXN0aWNSDmNoYXJhY3RlcmlzdGljEhgKB3N1Y2Nlc3MYAyABKAhSB3N1Y2Nlc3M='); @$core.Deprecated('Use onCharacteristicChangedDescriptor instead') const OnCharacteristicChanged$json = const { '1': 'OnCharacteristicChanged', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'characteristic', '3': 2, '4': 1, '5': 11, '6': '.BluetoothCharacteristic', '10': 'characteristic'}, ], }; /// Descriptor for `OnCharacteristicChanged`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List onCharacteristicChangedDescriptor = $convert.base64Decode('ChdPbkNoYXJhY3RlcmlzdGljQ2hhbmdlZBIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEkAKDmNoYXJhY3RlcmlzdGljGAIgASgLMhguQmx1ZXRvb3RoQ2hhcmFjdGVyaXN0aWNSDmNoYXJhY3RlcmlzdGlj'); @$core.Deprecated('Use deviceStateResponseDescriptor instead') const DeviceStateResponse$json = const { '1': 'DeviceStateResponse', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'state', '3': 2, '4': 1, '5': 14, '6': '.DeviceStateResponse.BluetoothDeviceState', '10': 'state'}, ], '4': const [DeviceStateResponse_BluetoothDeviceState$json], }; @$core.Deprecated('Use deviceStateResponseDescriptor instead') const DeviceStateResponse_BluetoothDeviceState$json = const { '1': 'BluetoothDeviceState', '2': const [ const {'1': 'DISCONNECTED', '2': 0}, const {'1': 'CONNECTING', '2': 1}, const {'1': 'CONNECTED', '2': 2}, const {'1': 'DISCONNECTING', '2': 3}, ], }; /// Descriptor for `DeviceStateResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List deviceStateResponseDescriptor = $convert.base64Decode('ChNEZXZpY2VTdGF0ZVJlc3BvbnNlEhsKCXJlbW90ZV9pZBgBIAEoCVIIcmVtb3RlSWQSPwoFc3RhdGUYAiABKA4yKS5EZXZpY2VTdGF0ZVJlc3BvbnNlLkJsdWV0b290aERldmljZVN0YXRlUgVzdGF0ZSJaChRCbHVldG9vdGhEZXZpY2VTdGF0ZRIQCgxESVNDT05ORUNURUQQABIOCgpDT05ORUNUSU5HEAESDQoJQ09OTkVDVEVEEAISEQoNRElTQ09OTkVDVElORxAD'); @$core.Deprecated('Use connectedDevicesResponseDescriptor instead') const ConnectedDevicesResponse$json = const { '1': 'ConnectedDevicesResponse', '2': const [ const {'1': 'devices', '3': 1, '4': 3, '5': 11, '6': '.BluetoothDevice', '10': 'devices'}, ], }; /// Descriptor for `ConnectedDevicesResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List connectedDevicesResponseDescriptor = $convert.base64Decode('ChhDb25uZWN0ZWREZXZpY2VzUmVzcG9uc2USKgoHZGV2aWNlcxgBIAMoCzIQLkJsdWV0b290aERldmljZVIHZGV2aWNlcw=='); @$core.Deprecated('Use mtuSizeRequestDescriptor instead') const MtuSizeRequest$json = const { '1': 'MtuSizeRequest', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'mtu', '3': 2, '4': 1, '5': 13, '10': 'mtu'}, ], }; /// Descriptor for `MtuSizeRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List mtuSizeRequestDescriptor = $convert.base64Decode('Cg5NdHVTaXplUmVxdWVzdBIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEhAKA210dRgCIAEoDVIDbXR1'); @$core.Deprecated('Use mtuSizeResponseDescriptor instead') const MtuSizeResponse$json = const { '1': 'MtuSizeResponse', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'mtu', '3': 2, '4': 1, '5': 13, '10': 'mtu'}, ], }; /// Descriptor for `MtuSizeResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List mtuSizeResponseDescriptor = $convert.base64Decode('Cg9NdHVTaXplUmVzcG9uc2USGwoJcmVtb3RlX2lkGAEgASgJUghyZW1vdGVJZBIQCgNtdHUYAiABKA1SA210dQ=='); @$core.Deprecated('Use readRssiResultDescriptor instead') const ReadRssiResult$json = const { '1': 'ReadRssiResult', '2': const [ const {'1': 'remote_id', '3': 1, '4': 1, '5': 9, '10': 'remoteId'}, const {'1': 'rssi', '3': 2, '4': 1, '5': 5, '10': 'rssi'}, ], }; /// Descriptor for `ReadRssiResult`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List readRssiResultDescriptor = $convert.base64Decode('Cg5SZWFkUnNzaVJlc3VsdBIbCglyZW1vdGVfaWQYASABKAlSCHJlbW90ZUlkEhIKBHJzc2kYAiABKAVSBHJzc2k='); ================================================ FILE: plugins/flutter_blue_plus/lib/gen/flutterblueplus.pbserver.dart ================================================ /// // Generated code. Do not modify. // source: flutterblueplus.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package export 'flutterblueplus.pb.dart'; ================================================ FILE: plugins/flutter_blue_plus/lib/src/bluetooth_characteristic.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class BluetoothCharacteristic { final Guid uuid; final DeviceIdentifier deviceId; final Guid serviceUuid; final Guid? secondaryServiceUuid; final CharacteristicProperties properties; final List descriptors; bool get isNotifying { try { var cccd = descriptors.singleWhere((d) => d.uuid == BluetoothDescriptor.cccd); return ((cccd.lastValue[0] & 0x01) > 0 || (cccd.lastValue[0] & 0x02) > 0); } catch (e) { return false; } } final BehaviorSubject> _value; Stream> get value => Rx.merge([ _value.stream, onValueChangedStream, ]); List get lastValue => _value.value; BluetoothCharacteristic.fromProto(protos.BluetoothCharacteristic p) : uuid = Guid(p.uuid), deviceId = DeviceIdentifier(p.remoteId), serviceUuid = Guid(p.serviceUuid), secondaryServiceUuid = (p.secondaryServiceUuid.isNotEmpty) ? Guid(p.secondaryServiceUuid) : null, descriptors = p.descriptors.map((d) => BluetoothDescriptor.fromProto(d)).toList(), properties = CharacteristicProperties.fromProto(p.properties), _value = BehaviorSubject.seeded(p.value); Stream get _onCharacteristicChangedStream => FlutterBluePlus.instance._methodStream .where((m) => m.method == "OnCharacteristicChanged") .map((m) => m.arguments) .map((buffer) => protos.OnCharacteristicChanged.fromBuffer(buffer)) .where((p) => p.remoteId == deviceId.toString()) .map((p) => BluetoothCharacteristic.fromProto(p.characteristic)) .where((c) => c.uuid == uuid) .map((c) { // Update the characteristic with the new values _updateDescriptors(c.descriptors); return c; }); Stream> get onValueChangedStream => _onCharacteristicChangedStream.map((c) => c.lastValue); void _updateDescriptors(List newDescriptors) { for (var d in descriptors) { for (var newD in newDescriptors) { if (d.uuid == newD.uuid) { d._value.add(newD.lastValue); } } } } /// Retrieves the value of the characteristic Future> read() async { var request = protos.ReadCharacteristicRequest.create() ..remoteId = deviceId.toString() ..characteristicUuid = uuid.toString() ..serviceUuid = serviceUuid.toString(); FlutterBluePlus.instance._log(LogLevel.info, 'remoteId: ${deviceId.toString()} characteristicUuid: ${uuid.toString()} serviceUuid: ${serviceUuid.toString()}'); await FlutterBluePlus.instance._channel .invokeMethod('readCharacteristic', request.writeToBuffer()); return FlutterBluePlus.instance._methodStream .where((m) => m.method == "ReadCharacteristicResponse") .map((m) => m.arguments) .map((buffer) => protos.ReadCharacteristicResponse.fromBuffer(buffer)) .where((p) => (p.remoteId == request.remoteId) && (p.characteristic.uuid == request.characteristicUuid) && (p.characteristic.serviceUuid == request.serviceUuid)) .map((p) => p.characteristic.value) .first .then((d) { _value.add(d); return d; }); } /// Writes the value of a characteristic. /// [CharacteristicWriteType.withoutResponse]: the write is not /// guaranteed and will return immediately with success. /// [CharacteristicWriteType.withResponse]: the method will return after the /// write operation has either passed or failed. Future write(List value, {bool withoutResponse = false}) async { final type = withoutResponse ? CharacteristicWriteType.withoutResponse : CharacteristicWriteType.withResponse; var request = protos.WriteCharacteristicRequest.create() ..remoteId = deviceId.toString() ..characteristicUuid = uuid.toString() ..serviceUuid = serviceUuid.toString() ..writeType = protos.WriteCharacteristicRequest_WriteType.valueOf(type.index)! ..value = value; var result = await FlutterBluePlus.instance._channel .invokeMethod('writeCharacteristic', request.writeToBuffer()); if (type == CharacteristicWriteType.withoutResponse) { return result; } return FlutterBluePlus.instance._methodStream .where((m) => m.method == "WriteCharacteristicResponse") .map((m) => m.arguments) .map((buffer) => protos.WriteCharacteristicResponse.fromBuffer(buffer)) .where((p) => (p.request.remoteId == request.remoteId) && (p.request.characteristicUuid == request.characteristicUuid) && (p.request.serviceUuid == request.serviceUuid)) .first .then((w) => w.success) .then((success) => (!success) ? throw Exception('Failed to write the characteristic') : null) .then((_) => null); } /// Sets notifications or indications for the value of a specified characteristic Future setNotifyValue(bool notify) async { var request = protos.SetNotificationRequest.create() ..remoteId = deviceId.toString() ..serviceUuid = serviceUuid.toString() ..characteristicUuid = uuid.toString() ..enable = notify; await FlutterBluePlus.instance._channel .invokeMethod('setNotification', request.writeToBuffer()); return FlutterBluePlus.instance._methodStream .where((m) => m.method == "SetNotificationResponse") .map((m) => m.arguments) .map((buffer) => protos.SetNotificationResponse.fromBuffer(buffer)) .where((p) => (p.remoteId == request.remoteId) && (p.characteristic.uuid == request.characteristicUuid) && (p.characteristic.serviceUuid == request.serviceUuid)) .first .then((p) => BluetoothCharacteristic.fromProto(p.characteristic)) .then((c) { _updateDescriptors(c.descriptors); return (c.isNotifying == notify); }); } @override String toString() { return 'BluetoothCharacteristic{uuid: $uuid, deviceId: $deviceId, serviceUuid: $serviceUuid, secondaryServiceUuid: $secondaryServiceUuid, properties: $properties, descriptors: $descriptors, value: ${_value.value}'; } } enum CharacteristicWriteType { withResponse, withoutResponse } @immutable class CharacteristicProperties { final bool broadcast; final bool read; final bool writeWithoutResponse; final bool write; final bool notify; final bool indicate; final bool authenticatedSignedWrites; final bool extendedProperties; final bool notifyEncryptionRequired; final bool indicateEncryptionRequired; const CharacteristicProperties( {this.broadcast = false, this.read = false, this.writeWithoutResponse = false, this.write = false, this.notify = false, this.indicate = false, this.authenticatedSignedWrites = false, this.extendedProperties = false, this.notifyEncryptionRequired = false, this.indicateEncryptionRequired = false}); CharacteristicProperties.fromProto(protos.CharacteristicProperties p) : broadcast = p.broadcast, read = p.read, writeWithoutResponse = p.writeWithoutResponse, write = p.write, notify = p.notify, indicate = p.indicate, authenticatedSignedWrites = p.authenticatedSignedWrites, extendedProperties = p.extendedProperties, notifyEncryptionRequired = p.notifyEncryptionRequired, indicateEncryptionRequired = p.indicateEncryptionRequired; @override String toString() { return 'CharacteristicProperties{broadcast: $broadcast, read: $read, writeWithoutResponse: $writeWithoutResponse, write: $write, notify: $notify, indicate: $indicate, authenticatedSignedWrites: $authenticatedSignedWrites, extendedProperties: $extendedProperties, notifyEncryptionRequired: $notifyEncryptionRequired, indicateEncryptionRequired: $indicateEncryptionRequired}'; } } ================================================ FILE: plugins/flutter_blue_plus/lib/src/bluetooth_descriptor.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class BluetoothDescriptor { static final Guid cccd = Guid("00002902-0000-1000-8000-00805f9b34fb"); final Guid uuid; final DeviceIdentifier deviceId; final Guid serviceUuid; final Guid characteristicUuid; final BehaviorSubject> _value; Stream> get value => _value.stream; List get lastValue => _value.value; BluetoothDescriptor.fromProto(protos.BluetoothDescriptor p) : uuid = Guid(p.uuid), deviceId = DeviceIdentifier(p.remoteId), serviceUuid = Guid(p.serviceUuid), characteristicUuid = Guid(p.characteristicUuid), _value = BehaviorSubject.seeded(p.value); /// Retrieves the value of a specified descriptor Future> read() async { var request = protos.ReadDescriptorRequest.create() ..remoteId = deviceId.toString() ..descriptorUuid = uuid.toString() ..characteristicUuid = characteristicUuid.toString() ..serviceUuid = serviceUuid.toString(); await FlutterBluePlus.instance._channel .invokeMethod('readDescriptor', request.writeToBuffer()); return FlutterBluePlus.instance._methodStream .where((m) => m.method == "ReadDescriptorResponse") .map((m) => m.arguments) .map((buffer) => protos.ReadDescriptorResponse.fromBuffer(buffer)) .where((p) => (p.request.remoteId == request.remoteId) && (p.request.descriptorUuid == request.descriptorUuid) && (p.request.characteristicUuid == request.characteristicUuid) && (p.request.serviceUuid == request.serviceUuid)) .map((d) => d.value) .first .then((d) { _value.add(d); return d; }); } /// Writes the value of a descriptor Future write(List value) async { var request = protos.WriteDescriptorRequest.create() ..remoteId = deviceId.toString() ..descriptorUuid = uuid.toString() ..characteristicUuid = characteristicUuid.toString() ..serviceUuid = serviceUuid.toString() ..value = value; await FlutterBluePlus.instance._channel .invokeMethod('writeDescriptor', request.writeToBuffer()); return FlutterBluePlus.instance._methodStream .where((m) => m.method == "WriteDescriptorResponse") .map((m) => m.arguments) .map((buffer) => protos.WriteDescriptorResponse.fromBuffer(buffer)) .where((p) => (p.request.remoteId == request.remoteId) && (p.request.descriptorUuid == request.descriptorUuid) && (p.request.characteristicUuid == request.characteristicUuid) && (p.request.serviceUuid == request.serviceUuid)) .first .then((w) => w.success) .then((success) => (!success) ? throw Exception('Failed to write the descriptor') : null) .then((_) => _value.add(value)) .then((_) => null); } @override String toString() { return 'BluetoothDescriptor{uuid: $uuid, deviceId: $deviceId, serviceUuid: $serviceUuid, characteristicUuid: $characteristicUuid, value: ${_value.value}}'; } } ================================================ FILE: plugins/flutter_blue_plus/lib/src/bluetooth_device.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class BluetoothDevice { final DeviceIdentifier id; final String name; final BluetoothDeviceType type; BluetoothDevice.fromProto(protos.BluetoothDevice p) : id = DeviceIdentifier(p.remoteId), name = p.name, type = BluetoothDeviceType.values[p.type.value]; /// Use on Android when the MAC address is known. /// /// This constructor enables the Android to connect to a specific device /// as soon as it becomes available on the bluetooth "network". BluetoothDevice.fromId(String id, {String? name, BluetoothDeviceType? type}) : id = DeviceIdentifier(id), name = name ?? "Unknown name", type = type ?? BluetoothDeviceType.unknown; final BehaviorSubject _isDiscoveringServices = BehaviorSubject.seeded(false); Stream get isDiscoveringServices => _isDiscoveringServices.stream; /// Establishes a connection to the Bluetooth Device. Future connect({ Duration? timeout, bool autoConnect = true, }) async { var request = protos.ConnectRequest.create() ..remoteId = id.toString() ..androidAutoConnect = autoConnect; await FlutterBluePlus.instance._channel .invokeMethod('connect', request.writeToBuffer()); if (timeout == null) { await state.firstWhere((s) => s == BluetoothDeviceState.connected); } else { await state .firstWhere((s) => s == BluetoothDeviceState.connected) .timeout( timeout, onTimeout: () { disconnect(); throw TimeoutException('Failed to connect in time.', timeout); }, ); } } /// Send a pairing request to the device. /// Currently only implemented on Android. Future pair() async { return FlutterBluePlus.instance._channel .invokeMethod('pair', id.toString()); } /// Refresh Gatt Device Cache /// Emergency method to reload ble services & characteristics /// Currently only implemented on Android. Future clearGattCache() async { if (Platform.isAndroid) { return FlutterBluePlus.instance._channel .invokeMethod('clearGattCache', id.toString()); } } /// Cancels connection to the Bluetooth Device Future disconnect() => FlutterBluePlus.instance._channel .invokeMethod('disconnect', id.toString()); final BehaviorSubject> _services = BehaviorSubject.seeded([]); /// Discovers services offered by the remote device as well as their characteristics and descriptors Future> discoverServices() async { final s = await state.first; if (s != BluetoothDeviceState.connected) { return Future.error(Exception( 'Cannot discoverServices while device is not connected. State == $s')); } var response = FlutterBluePlus.instance._methodStream .where((m) => m.method == "DiscoverServicesResult") .map((m) => m.arguments) .map((buffer) => protos.DiscoverServicesResult.fromBuffer(buffer)) .where((p) => p.remoteId == id.toString()) .map((p) => p.services) .map((s) => s.map((p) => BluetoothService.fromProto(p)).toList()) .first .then((list) { _services.add(list); _isDiscoveringServices.add(false); return list; }); await FlutterBluePlus.instance._channel .invokeMethod('discoverServices', id.toString()); _isDiscoveringServices.add(true); return response; } /// Returns a list of Bluetooth GATT services offered by the remote device /// This function requires that discoverServices has been completed for this device Stream> get services async* { yield await FlutterBluePlus.instance._channel .invokeMethod('services', id.toString()) .then((buffer) => protos.DiscoverServicesResult.fromBuffer(buffer).services) .then((i) => i.map((s) => BluetoothService.fromProto(s)).toList()); yield* _services.stream; } /// The current connection state of the device Stream get state async* { yield await FlutterBluePlus.instance._channel .invokeMethod('deviceState', id.toString()) .then((buffer) => protos.DeviceStateResponse.fromBuffer(buffer)) .then((p) => BluetoothDeviceState.values[p.state.value]); yield* FlutterBluePlus.instance._methodStream .where((m) => m.method == "DeviceState") .map((m) => m.arguments) .map((buffer) => protos.DeviceStateResponse.fromBuffer(buffer)) .where((p) => p.remoteId == id.toString()) .map((p) => BluetoothDeviceState.values[p.state.value]); } /// The MTU size in bytes Stream get mtu async* { yield await FlutterBluePlus.instance._channel .invokeMethod('mtu', id.toString()) .then((buffer) => protos.MtuSizeResponse.fromBuffer(buffer)) .then((p) => p.mtu); yield* FlutterBluePlus.instance._methodStream .where((m) => m.method == "MtuSize") .map((m) => m.arguments) .map((buffer) => protos.MtuSizeResponse.fromBuffer(buffer)) .where((p) => p.remoteId == id.toString()) .map((p) => p.mtu); } /// Request to change the MTU Size /// Throws error if request did not complete successfully /// Request to change the MTU Size and returns the response back /// Throws error if request did not complete successfully Future requestMtu(int desiredMtu) async { var request = protos.MtuSizeRequest.create() ..remoteId = id.toString() ..mtu = desiredMtu; var response = FlutterBluePlus.instance._methodStream .where((m) => m.method == "MtuSize") .map((m) => m.arguments) .map((buffer) => protos.MtuSizeResponse.fromBuffer(buffer)) .where((p) => p.remoteId == id.toString()) .map((p) => p.mtu) .first; await FlutterBluePlus.instance._channel .invokeMethod('requestMtu', request.writeToBuffer()); return response; } /// Indicates whether the Bluetooth Device can send a write without response Future get canSendWriteWithoutResponse => Future.error(UnimplementedError()); /// Read the RSSI for a connected remote device Future readRssi() async { final remoteId = id.toString(); await FlutterBluePlus.instance._channel.invokeMethod('readRssi', remoteId); return FlutterBluePlus.instance._methodStream .where((m) => m.method == "ReadRssiResult") .map((m) => m.arguments) .map((buffer) => protos.ReadRssiResult.fromBuffer(buffer)) .where((p) => (p.remoteId == remoteId)) .first .then((c) { return (c.rssi); }); } @override bool operator ==(Object other) => identical(this, other) || other is BluetoothDevice && runtimeType == other.runtimeType && id == other.id; @override int get hashCode => id.hashCode; @override String toString() { return 'BluetoothDevice{id: $id, name: $name, type: $type, isDiscoveringServices: ${_isDiscoveringServices.value}, _services: ${_services.value}'; } } enum BluetoothDeviceType { unknown, classic, le, dual } enum BluetoothDeviceState { disconnected, connecting, connected, disconnecting } ================================================ FILE: plugins/flutter_blue_plus/lib/src/bluetooth_service.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class BluetoothService { final Guid uuid; final DeviceIdentifier deviceId; final bool isPrimary; final List characteristics; final List includedServices; BluetoothService.fromProto(protos.BluetoothService p) : uuid = Guid(p.uuid), deviceId = DeviceIdentifier(p.remoteId), isPrimary = p.isPrimary, characteristics = p.characteristics .map((c) => BluetoothCharacteristic.fromProto(c)) .toList(), includedServices = p.includedServices .map((s) => BluetoothService.fromProto(s)) .toList(); @override String toString() { return 'BluetoothService{uuid: $uuid, deviceId: $deviceId, isPrimary: $isPrimary, characteristics: $characteristics, includedServices: $includedServices}'; } } ================================================ FILE: plugins/flutter_blue_plus/lib/src/flutter_blue_plus.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class FlutterBluePlus { final MethodChannel _channel = const MethodChannel('flutter_blue_plus/methods'); final EventChannel _stateChannel = const EventChannel('flutter_blue_plus/state'); final StreamController _methodStreamController = StreamController.broadcast(); // ignore: close_sinks Stream get _methodStream => _methodStreamController .stream; // Used internally to dispatch methods from platform. /// Cached broadcast stream for FlutterBlue.state events /// Caching this stream allows for more than one listener to subscribe /// and unsubscribe apart from each other, /// while allowing events to still be sent to others that are subscribed Stream? _stateStream; /// Singleton boilerplate FlutterBluePlus._() { _channel.setMethodCallHandler((MethodCall call) async { _methodStreamController.add(call); }); setLogLevel(logLevel); } static final FlutterBluePlus _instance = FlutterBluePlus._(); static FlutterBluePlus get instance => _instance; /// Log level of the instance, default is all messages (debug). LogLevel _logLevel = LogLevel.debug; LogLevel get logLevel => _logLevel; /// Checks whether the device supports Bluetooth Future get isAvailable => _channel.invokeMethod('isAvailable').then((d) => d); /// Return the friendly Bluetooth name of the local Bluetooth adapter Future get name => _channel.invokeMethod('name').then((d) => d); /// Checks if Bluetooth functionality is turned on Future get isOn => _channel.invokeMethod('isOn').then((d) => d); /// Tries to turn on Bluetooth (Android only), /// /// Returns true if bluetooth is being turned on. /// You have to listen for a stateChange to ON to ensure bluetooth is already running /// /// Returns false if an error occured or bluetooth is already running /// Future turnOn() { return _channel.invokeMethod('turnOn').then((d) => d); } /// Tries to turn off Bluetooth (Android only), /// /// Returns true if bluetooth is being turned off. /// You have to listen for a stateChange to OFF to ensure bluetooth is turned off /// /// Returns false if an error occured /// Future turnOff() { return _channel.invokeMethod('turnOff').then((d) => d); } final BehaviorSubject _isScanning = BehaviorSubject.seeded(false); Stream get isScanning => _isScanning.stream; final BehaviorSubject> _scanResults = BehaviorSubject.seeded([]); /// Returns a stream that is a list of [ScanResult] results while a scan is in progress. /// /// The list emitted is all the scanned results as of the last initiated scan. When a scan is /// first started, an empty list is emitted. The returned stream is never closed. /// /// One use for [scanResults] is as the stream in a StreamBuilder to display the /// results of a scan in real time while the scan is in progress. Stream> get scanResults => _scanResults.stream; final PublishSubject _stopScanPill = PublishSubject(); /// Gets the current state of the Bluetooth module Stream get state async* { yield await _channel .invokeMethod('state') .then((buffer) => protos.BluetoothState.fromBuffer(buffer)) .then((s) => BluetoothState.values[s.state.value]); _stateStream ??= _stateChannel .receiveBroadcastStream() .map((buffer) => protos.BluetoothState.fromBuffer(buffer)) .map((s) => BluetoothState.values[s.state.value]) .doOnCancel(() => _stateStream = null); yield* _stateStream!; } /// Retrieve a list of connected devices Future> get connectedDevices { return _channel .invokeMethod('getConnectedDevices') .then((buffer) => protos.ConnectedDevicesResponse.fromBuffer(buffer)) .then((p) => p.devices) .then((p) => p.map((d) => BluetoothDevice.fromProto(d)).toList()); } /// Retrieve a list of bonded devices (Android only) Future> get bondedDevices { return _channel .invokeMethod('getBondedDevices') .then((buffer) => protos.ConnectedDevicesResponse.fromBuffer(buffer)) .then((p) => p.devices) .then((p) => p.map((d) => BluetoothDevice.fromProto(d)).toList()); } /// Starts a scan for Bluetooth Low Energy devices and returns a stream /// of the [ScanResult] results as they are received. /// /// timeout calls stopStream after a specified [Duration]. /// You can also get a list of ongoing results in the [scanResults] stream. /// If scanning is already in progress, this will throw an [Exception]. Stream scan({ ScanMode scanMode = ScanMode.lowLatency, List withServices = const [], List withDevices = const [], List macAddresses = const [], Duration? timeout, bool allowDuplicates = false, }) async* { var settings = protos.ScanSettings.create() ..androidScanMode = scanMode.value ..allowDuplicates = allowDuplicates ..macAddresses.addAll(macAddresses) ..serviceUuids.addAll(withServices.map((g) => g.toString()).toList()); if (_isScanning.value == true) { throw Exception('Another scan is already in progress.'); } // Emit to isScanning _isScanning.add(true); final killStreams = []; killStreams.add(_stopScanPill); if (timeout != null) { killStreams.add(Rx.timer(null, timeout)); } // Clear scan results list _scanResults.add([]); try { await _channel.invokeMethod('startScan', settings.writeToBuffer()); } catch (e) { if (kDebugMode) { print('Error starting scan.'); } _stopScanPill.add(null); _isScanning.add(false); rethrow; } yield* FlutterBluePlus.instance._methodStream .where((m) => m.method == "ScanResult") .map((m) => m.arguments) .takeUntil(Rx.merge(killStreams)) .doOnDone(stopScan) .map((buffer) => protos.ScanResult.fromBuffer(buffer)) .map((p) { final result = ScanResult.fromProto(p); final list = _scanResults.value; int index = list.indexOf(result); if (index != -1) { list[index] = result; } else { list.add(result); } _scanResults.add(list); return result; }); } /// Starts a scan and returns a future that will complete once the scan has finished. /// /// Once a scan is started, call [stopScan] to stop the scan and complete the returned future. /// /// timeout automatically stops the scan after a specified [Duration]. /// /// To observe the results while the scan is in progress, listen to the [scanResults] stream, /// or call [scan] instead. Future startScan({ ScanMode scanMode = ScanMode.lowLatency, List withServices = const [], List withDevices = const [], List macAddresses = const [], Duration? timeout, bool allowDuplicates = false, }) async { await scan( scanMode: scanMode, withServices: withServices, withDevices: withDevices, macAddresses: macAddresses, timeout: timeout, allowDuplicates: allowDuplicates) .drain(); return _scanResults.value; } /// Stops a scan for Bluetooth Low Energy devices Future stopScan() async { await _channel.invokeMethod('stopScan'); _stopScanPill.add(null); _isScanning.add(false); } /// The list of connected peripherals can include those that are connected /// by other apps and that will need to be connected locally using the /// device.connect() method before they can be used. // Stream> connectedDevices({ // List withServices = const [], // }) => // throw UnimplementedError(); /// Sets the log level of the FlutterBlue instance /// Messages equal or below the log level specified are stored/forwarded, /// messages above are dropped. void setLogLevel(LogLevel level) async { await _channel.invokeMethod('setLogLevel', level.index); _logLevel = level; } void _log(LogLevel level, String message) { if (level.index <= _logLevel.index) { if (kDebugMode) { print(message); } } } } /// Log levels for FlutterBlue enum LogLevel { emergency, alert, critical, error, warning, notice, info, debug, } /// State of the bluetooth adapter. enum BluetoothState { unknown, unavailable, unauthorized, turningOn, on, turningOff, off } class ScanMode { const ScanMode(this.value); static const lowPower = ScanMode(0); static const balanced = ScanMode(1); static const lowLatency = ScanMode(2); static const opportunistic = ScanMode(-1); final int value; } class DeviceIdentifier { final String id; const DeviceIdentifier(this.id); @override String toString() => id; @override int get hashCode => id.hashCode; @override bool operator ==(other) => other is DeviceIdentifier && compareAsciiLowerCase(id, other.id) == 0; } class ScanResult { ScanResult.fromProto(protos.ScanResult p) : device = BluetoothDevice.fromProto(p.device), advertisementData = AdvertisementData.fromProto(p.advertisementData), rssi = p.rssi, timeStamp = DateTime.now(); final BluetoothDevice device; final AdvertisementData advertisementData; final int rssi; final DateTime timeStamp; @override bool operator ==(Object other) => identical(this, other) || other is ScanResult && runtimeType == other.runtimeType && device == other.device; @override int get hashCode => device.hashCode; @override String toString() { return 'ScanResult{device: $device, advertisementData: $advertisementData, rssi: $rssi, timeStamp: $timeStamp}'; } } class AdvertisementData { final String localName; final int? txPowerLevel; final bool connectable; final Map> manufacturerData; final Map> serviceData; final List serviceUuids; AdvertisementData.fromProto(protos.AdvertisementData p) : localName = p.localName, txPowerLevel = (p.txPowerLevel.hasValue()) ? p.txPowerLevel.value : null, connectable = p.connectable, manufacturerData = p.manufacturerData, serviceData = p.serviceData, serviceUuids = p.serviceUuids; @override String toString() { return 'AdvertisementData{localName: $localName, txPowerLevel: $txPowerLevel, connectable: $connectable, manufacturerData: $manufacturerData, serviceData: $serviceData, serviceUuids: $serviceUuids}'; } } ================================================ FILE: plugins/flutter_blue_plus/lib/src/guid.dart ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of flutter_blue_plus; class Guid { final List _bytes; final int _hashCode; Guid._internal(List bytes) : _bytes = bytes, _hashCode = _calcHashCode(bytes); Guid(String input) : this._internal(_fromString(input)); Guid.fromMac(String input) : this._internal(_fromMacString(input)); Guid.empty() : this._internal(List.filled(16, 0)); static List _fromMacString(String input) { input = _removeNonHexCharacters(input); final bytes = hex.decode(input); if (bytes.length != 6) { throw FormatException("The format is invalid: $input"); } return bytes + List.filled(10, 0); } static List _fromString(String input) { input = _removeNonHexCharacters(input); final bytes = hex.decode(input); if (bytes.length != 16) { throw const FormatException("The format is invalid"); } return bytes; } static String _removeNonHexCharacters(String sourceString) { return String.fromCharCodes(sourceString.runes.where((r) => (r >= 48 && r <= 57) // characters 0 to 9 || (r >= 65 && r <= 70) // characters A to F || (r >= 97 && r <= 102) // characters a to f )); } static int _calcHashCode(List bytes) { const equality = ListEquality(); return equality.hash(bytes); } @override String toString() { String one = hex.encode(_bytes.sublist(0, 4)); String two = hex.encode(_bytes.sublist(4, 6)); String three = hex.encode(_bytes.sublist(6, 8)); String four = hex.encode(_bytes.sublist(8, 10)); String five = hex.encode(_bytes.sublist(10, 16)); return "$one-$two-$three-$four-$five"; } String toMac() { String one = hex.encode(_bytes.sublist(0, 1)); String two = hex.encode(_bytes.sublist(1, 2)); String three = hex.encode(_bytes.sublist(2, 3)); String four = hex.encode(_bytes.sublist(3, 4)); String five = hex.encode(_bytes.sublist(4, 5)); String six = hex.encode(_bytes.sublist(5, 6)); return "$one:$two:$three:$four:$five:$six".toUpperCase(); } List toByteArray() { return _bytes; } @override operator ==(other) => other is Guid && hashCode == other.hashCode; @override int get hashCode => _hashCode; } ================================================ FILE: plugins/flutter_blue_plus/protos/flutterblueplus.proto ================================================ // Copyright 2017, Paul DeMarco. // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. syntax = "proto3"; option java_package = "com.boskokg.flutter_blue_plus"; option java_outer_classname = "Protos"; option objc_class_prefix = "Protos"; // Wrapper message for `int32`. // // Allows for nullability of fields in messages message Int32Value { // The int32 value. int32 value = 1; } message BluetoothState { enum State { UNKNOWN = 0; UNAVAILABLE = 1; UNAUTHORIZED = 2; TURNING_ON = 3; ON = 4; TURNING_OFF = 5; OFF = 6; }; State state = 1; } message AdvertisementData { string local_name = 1; Int32Value tx_power_level = 2; bool connectable = 3; map manufacturer_data = 4; // Map of manufacturers to their data map service_data = 5; // Map of service UUIDs to their data. repeated string service_uuids = 6; } message ScanSettings { int32 android_scan_mode = 1; repeated string service_uuids = 2; bool allow_duplicates = 3; repeated string mac_addresses = 4; } message ScanResult { BluetoothDevice device = 1; // The received peer's ID. AdvertisementData advertisement_data = 2; int32 rssi = 3; } message ConnectRequest { string remote_id = 1; bool android_auto_connect = 2; } message BluetoothDevice { enum Type { UNKNOWN = 0; CLASSIC = 1; LE = 2; DUAL = 3; }; string remote_id = 1; string name = 2; Type type = 3; } message BluetoothService { string uuid = 1; string remote_id = 2; bool is_primary = 3; // Indicates whether the type of service is primary or secondary. repeated BluetoothCharacteristic characteristics = 4; // A list of characteristics that have been discovered in this service. repeated BluetoothService included_services = 5; // A list of included services that have been discovered in this service. } message BluetoothCharacteristic { string uuid = 1; string remote_id = 2; string serviceUuid = 3; // The service that this characteristic belongs to. string secondaryServiceUuid = 4; // The secondary service if nested repeated BluetoothDescriptor descriptors = 5; // A list of descriptors that have been discovered in this characteristic. CharacteristicProperties properties = 6; // The properties of the characteristic. bytes value = 7; } message BluetoothDescriptor { string uuid = 1; string remote_id = 2; string serviceUuid = 3; // The service that this descriptor belongs to. string characteristicUuid = 4; // The characteristic that this descriptor belongs to. bytes value = 5; } message CharacteristicProperties { bool broadcast = 1; bool read = 2; bool write_without_response = 3; bool write = 4; bool notify = 5; bool indicate = 6; bool authenticated_signed_writes = 7; bool extended_properties = 8; bool notify_encryption_required = 9; bool indicate_encryption_required = 10; } message DiscoverServicesResult { string remote_id = 1; repeated BluetoothService services = 2; } message ReadCharacteristicRequest { string remote_id = 1; string characteristic_uuid = 2; string service_uuid = 3; string secondary_service_uuid = 4; } message ReadCharacteristicResponse { string remote_id = 1; BluetoothCharacteristic characteristic = 2; } message ReadDescriptorRequest { string remote_id = 1; string descriptor_uuid = 2; string service_uuid = 3; string secondary_service_uuid = 4; string characteristic_uuid = 5; } message ReadDescriptorResponse { ReadDescriptorRequest request = 1; bytes value = 2; } message WriteCharacteristicRequest { enum WriteType { WITH_RESPONSE = 0; WITHOUT_RESPONSE = 1; } string remote_id = 1; string characteristic_uuid = 2; string service_uuid = 3; string secondary_service_uuid = 4; WriteType write_type = 5; bytes value = 6; } message WriteCharacteristicResponse { WriteCharacteristicRequest request = 1; bool success = 2; } message WriteDescriptorRequest { string remote_id = 1; string descriptor_uuid = 2; string service_uuid = 3; string secondary_service_uuid = 4; string characteristic_uuid = 5; bytes value = 6; } message WriteDescriptorResponse { WriteDescriptorRequest request = 1; bool success = 2; } message SetNotificationRequest { string remote_id = 1; string service_uuid = 2; string secondary_service_uuid = 3; string characteristic_uuid = 4; bool enable = 5; } message SetNotificationResponse { string remote_id = 1; BluetoothCharacteristic characteristic = 2; bool success = 3; } message OnCharacteristicChanged { string remote_id = 1; BluetoothCharacteristic characteristic = 2; } message DeviceStateResponse { enum BluetoothDeviceState { DISCONNECTED = 0; CONNECTING = 1; CONNECTED = 2; DISCONNECTING = 3; } string remote_id = 1; BluetoothDeviceState state = 2; } message ConnectedDevicesResponse { repeated BluetoothDevice devices = 1; } message MtuSizeRequest { string remote_id = 1; uint32 mtu = 2; } message MtuSizeResponse { string remote_id = 1; uint32 mtu = 2; } message ReadRssiResult { string remote_id = 1; int32 rssi = 2; } ================================================ FILE: plugins/flutter_blue_plus/protos/regenerate.md ================================================ // Copyright 2017, Paul DeMarco.\ // All rights reserved. Use of this source code is governed by a\ // BSD-style license that can be found in the LICENSE file. # Generate protobuf files in Dart 1. If upgrading, delete all proto files from /home/.pub-cache/bin 1. Clone the latest dart-protoc-plugin from https://github.com/dart-lang/protobuf 1. Run `dart pub install` inside protobuf/protoc_plugin 1. Run `dart pub global activate protoc_plugin` to get .dart files into /home/.pub-cache/bin/ 1. Get the latest linux protoc compiler from https://github.com/google/protobuf/releases/ (protoc-X.X.X-linux-x86_64.zip) 1. Copy /bin/protoc into /home/.pub-cache/bin/ 1. Run the following commands from this project's protos folder ```protoc --dart_out=../lib/gen ./flutterblueplus.proto``` ```protoc --objc_out=../ios/gen ./flutterblueplus.proto``` ================================================ FILE: plugins/flutter_blue_plus/pubspec.yaml ================================================ name: flutter_blue_plus description: Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS version: 1.4.0 homepage: https://github.com/boskokg/flutter_blue_plus environment: sdk: ">=2.15.1 <3.0.0" flutter: ">=2.5.0" dependencies: flutter: sdk: flutter convert: ^3.0.1 protobuf: ^2.0.1 rxdart: ^0.27.5 collection: ^1.15.0 meta: ^1.7.0 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.1 flutter: plugin: platforms: android: package: com.boskokg.flutter_blue_plus pluginClass: FlutterBluePlusPlugin ios: pluginClass: FlutterBluePlusPlugin ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/.gitignore ================================================ .DS_Store .dart_tool/ .packages .pub/ pubspec.lock build/ .last_build_id Podfile.lock local.properties ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled and should not be manually edited. version: revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f channel: stable project_type: plugin ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/CHANGELOG.md ================================================ ## 0.3.7 Better workaround for an issue with receiving sysex messages on Android via BLE ## 0.3.6 Workaround for an issue with receiving long sysex messages on Android via BLE ## 0.3.5 Fixed an issue with BLE device IDs on Android Fixed an issue where BLE devices would appear in device list as native devices as well as bluetooth devices after being connected ## 0.3.4 Changed permissions to fine location for BLE on Android, required when targeting sdk 29+ ## 0.3.3 Fixed nullable error in kotlin ## 0.3.2 Fixed BLE timestamp on iOS ## 0.3.1 Fixed device disconnect on iOS ## 0.3.0 Added linux support ## 0.2.6 Fix example app on macos ## 0.2.5 Fix MIDI Session Support on iOS Simulator ## 0.2.4 iOS Pod fix ## 0.2.3 Android compile fix ## 0.2.2 Cleanup and docs ## 0.2.1 Added macOS implementation. Cleaned iOS code (shared with macOS). ## 0.2.0 Migrated to federated plugin using platform interface. ## 0.1.7 Bugfix - sending cabled MIDI on iOS ## 0.1.6 Bugfix, android setup/plugin init ## 0.1.5 Updated Android plugin structure Fixed iOS compilation error, with latest Dart Fixed BLE Midi parsing on iOS ## 0.1.4 Updated Gradle version Merge PR #8 ## 0.1.3 Better handling of broadcast receiver on Android. ## 0.1.2 Fixed message splitting on iOS Bluetooth MIDI Thanks to https://github.com/TheKashe for the contribution. ## 0.1.2 Better handling of disabled Bluetooth ## 0.1.1 Added missing entitlement in iOS plist for bluetooth access ## 0.1.0 Moved Message Types into separate file: flutter_midi_command_messages.dart. Fixed threading issue. https://github.com/InvisibleWrench/FlutterMidiCommand/issues/4 Added teardown function to disconnect and close all ports and devices. Gradle dependency raised to 3.4.2 minSDKversion raised to 24 Version bumped to 0.1.0 ## 0.0.8 Gradle and Kotlin update. AndroidX ## 0.0.7 Updated readme ## 0.0.6 Added missing stopScanForDevices function on iOS ## 0.0.5 Updated kotlin version. Specific MidiMessage type now exist as separate subtypes of MidiMessage. Added StopScanning function. Updated example. ## 0.0.4 Fixed stream broadcast bug ## 0.0.3 Added Support for BLE MIDI devices on iOS ## 0.0.2 Readme and formatting ## 0.0.1 Initial Release. Functioning discovery and connection to MIDI devices on Android and iOS, as well as BLE MIDI devices on Android. Functioning sending and receiving of MIDI data ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/LICENSE ================================================ Copyright 2020 InvisibleWrench. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Invisible Wrench ApS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/README.md ================================================ # flutter_midi_command A Flutter plugin for sending and receiving MIDI messages between Flutter and physical and virtual MIDI devices. Wraps CoreMIDI/android.media.midi/ALSA in a thin dart/flutter layer. Supports - USB and BLE MIDI connections on Android - USB, network(session) and BLE MIDI connections on iOS and macOS. - ALSA Midi on Linux ## To install - Make sure your project is created with Kotlin and Swift support. - Add flutter_midi_command: ^0.3.0 to your pubspec.yaml file. - In ios/Podfile uncomment and change the platform to 10.0 `platform :ios, '10.0'` - After building, Add a NSBluetoothAlwaysUsageDescription to info.plist in the generated Xcode project. - On Linux, make sure ALSA is installed. ## Getting Started This plugin is build using Swift and Kotlin on the native side, so make sure your project supports this. Import flutter_midi_command `import 'package:flutter_midi_command/flutter_midi_command.dart';` - Get a list of available MIDI devices by calling `MidiCommand().devices` which returns a list of `MidiDevice` - Start scanning for BLE MIDI devices by calling `MidiCommand().startScanningForBluetoothDevices()` - Connect to a specific `MidiDevice` by calling `MidiCommand.connectToDevice(selectedDevice)` - Stop scanning for BLE MIDI devices by calling `MidiCommand().stopScanningForBluetoothDevices()` - Disconnect from the current device by calling `MidiCommand.disconnectDevice()` - Listen for updates in the MIDI setup by subscribing to `MidiCommand().onMidiSetupChanged` - Listen for incoming MIDI messages on from the current device by subscribing to `MidiCommand().onMidiDataReceived`, after which the listener will recieve inbound MIDI messages as an UInt8List of variable length. - Send a MIDI message by calling `MidiCommand.sendData(data)`, where data is an UInt8List of bytes following the MIDI spec. - Or use the various `MidiCommand` subtypes to send PC, CC, NoteOn and NoteOff messages. See example folder for how to use. For help getting started with Flutter, view our online [documentation](https://flutter.io/). For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package). ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/build.gradle ================================================ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 31 namespace 'com.invisiblewrench.flutter_midi_command' sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.invisiblewrench.flutter_midi_command" minSdkVersion 16 targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/debug/AndroidManifest.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java ================================================ package io.flutter.plugins; import androidx.annotation.Keep; import androidx.annotation.NonNull; import io.flutter.embedding.engine.FlutterEngine; /** * Generated file. Do not edit. * This file is generated by the Flutter tool based on the * plugins that support the Android platform. */ @Keep public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) { flutterEngine.getPlugins().add(new com.invisiblewrench.fluttermidicommand.FlutterMidiCommandPlugin()); } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/main/kotlin/com/invisiblewrench/flutter_midi_command/MainActivity.kt ================================================ package com.invisiblewrench.flutter_midi_command import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/main/res/drawable/launch_background.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/main/res/values/styles.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/app/src/profile/AndroidManifest.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/build.gradle ================================================ group 'com.invisiblewrench.fluttermidicommand' version '1.0-SNAPSHOT' buildscript { ext.kotlin_version = '1.6.10' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } rootProject.allprojects { repositories { google() jcenter() } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { compileSdkVersion 31 namespace 'com.invisiblewrench.fluttermidicommand' kotlinOptions { jvmTarget = "17" } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 19 } lintOptions { disable 'InvalidPackage' } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=C:/AndroidSDK/jdk-17.0.9 ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/gradlew ================================================ #!/usr/bin/env bash ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn ( ) { echo "$*" } die ( ) { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; esac # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { JVM_OPTS=("$@") } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/gradlew.bat ================================================ @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windowz variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/settings.gradle ================================================ rootProject.name = 'flutter_midi_command' ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/android/src/main/kotlin/com/invisiblewrench/fluttermidicommand/FlutterMidiCommandPlugin.kt ================================================ package com.invisiblewrench.fluttermidicommand import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding import io.flutter.embedding.engine.plugins.activity.ActivityAware import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result import io.flutter.plugin.common.PluginRegistry.Registrar import io.flutter.plugin.common.EventChannel import android.app.Activity import android.os.Handler import android.media.midi.* import android.content.Context.MIDI_SERVICE import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothManager import android.bluetooth.le.* import android.content.pm.PackageManager import android.os.ParcelUuid import android.Manifest import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter import io.flutter.plugin.common.BinaryMessenger import android.util.Log /** FlutterMidiCommandPlugin */ public class FlutterMidiCommandPlugin : FlutterPlugin, ActivityAware, MethodCallHandler { lateinit var context: Context private var activity:Activity? = null lateinit var messenger:BinaryMessenger private lateinit var midiManager:MidiManager private lateinit var handler: Handler private var connectedDevices = mutableMapOf() lateinit var rxChannel:EventChannel lateinit var rxStreamHandler:FlutterStreamHandler lateinit var setupChannel:EventChannel lateinit var setupStreamHandler:FlutterStreamHandler lateinit var bluetoothAdapter:BluetoothAdapter var bluetoothScanner:BluetoothLeScanner? = null private val PERMISSIONS_REQUEST_ACCESS_LOCATION = 95453 // arbitrary var discoveredDevices = mutableSetOf() lateinit var blManager:BluetoothManager override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { messenger = flutterPluginBinding.binaryMessenger context = flutterPluginBinding.applicationContext } override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { print("detached from engine") } override fun onAttachedToActivity(p0: ActivityPluginBinding) { print("onAttachedToActivity") // TODO: your plugin is now attached to an Activity activity = p0?.activity setup() } override fun onDetachedFromActivityForConfigChanges() { print("onDetachedFromActivityForConfigChanges") // TODO: the Activity your plugin was attached to was // destroyed to change configuration. // This call will be followed by onReattachedToActivityForConfigChanges(). } override fun onReattachedToActivityForConfigChanges(p0: ActivityPluginBinding) { // TODO: your plugin is now attached to a new Activity // after a configuration change. print("onReattachedToActivityForConfigChanges") } override fun onDetachedFromActivity() { // TODO: your plugin is no longer associated with an Activity. // Clean up references. print("onDetachedFromActivity") activity = null } // This static function is optional and equivalent to onAttachedToEngine. It supports the old // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting // plugin registration via this function while apps migrate to use the new Android APIs // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. // // It is encouraged to share logic between onAttachedToEngine and registerWith to keep // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called // depending on the user's project. onAttachedToEngine or registerWith must both be defined // in the same class. companion object { @JvmStatic fun registerWith(registrar: Registrar) { // val channel = MethodChannel(registrar.messenger(), "fluttermidicommand") var instance = FlutterMidiCommandPlugin() instance.messenger = registrar.messenger() instance.context = registrar.activeContext() instance.activity = registrar.activity() instance.setup() } } private inner class MidiDeviceOpenedListener : MidiManager.OnDeviceOpenedListener { override fun onDeviceOpened(it: MidiDevice?) { Log.d("FlutterMIDICommand", "onDeviceOpened") it?.also { val id = it.info.id.toString() Log.d("FlutterMIDICommand", "Opened\n${it.info}") val device = ConnectedDevice(it) device.connectWithReceiver(RXReceiver(rxStreamHandler, it)) connectedDevices[id] = device this@FlutterMidiCommandPlugin.setupStreamHandler.send("deviceOpened") } } } private lateinit var deviceOpenedListener: MidiDeviceOpenedListener private inner class MidiDeviceCallback : MidiManager.DeviceCallback() { override fun onDeviceAdded(device: MidiDeviceInfo?) { super.onDeviceAdded(device) device?.also { Log.d("FlutterMIDICommand", "device added $it") this@FlutterMidiCommandPlugin.setupStreamHandler.send("deviceFound") } } override fun onDeviceRemoved(device: MidiDeviceInfo?) { super.onDeviceRemoved(device) device?.also { Log.d("FlutterMIDICommand","device removed $it") connectedDevices[it.id.toString()]?.also { Log.d("FlutterMIDICommand","remove removed device $it") connectedDevices.remove(it.id) } this@FlutterMidiCommandPlugin.setupStreamHandler.send("deviceLost") } } override fun onDeviceStatusChanged(status: MidiDeviceStatus?) { super.onDeviceStatusChanged(status) Log.d("FlutterMIDICommand","device status changed ${status.toString()}") status?.also { connectedDevices[status.deviceInfo.id.toString()]?.also { Log.d("FlutterMIDICommand", "update device status") it.status = status } } this@FlutterMidiCommandPlugin.setupStreamHandler.send("onDeviceStatusChanged") } } private lateinit var deviceConnectionCallback: MidiDeviceCallback fun setup() { //TODO: Better? if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_MIDI)) return; deviceOpenedListener = MidiDeviceOpenedListener() deviceConnectionCallback = MidiDeviceCallback() print("setup") val channel = MethodChannel(messenger, "plugins.invisiblewrench.com/flutter_midi_command") channel.setMethodCallHandler(this) handler = Handler(context.mainLooper) midiManager = context.getSystemService(Context.MIDI_SERVICE) as MidiManager midiManager.registerDeviceCallback(deviceConnectionCallback, handler) rxStreamHandler = FlutterStreamHandler(handler) rxChannel = EventChannel(messenger, "plugins.invisiblewrench.com/flutter_midi_command/rx_channel") rxChannel.setStreamHandler( rxStreamHandler ) setupStreamHandler = FlutterStreamHandler(handler) setupChannel = EventChannel(messenger, "plugins.invisiblewrench.com/flutter_midi_command/setup_channel") setupChannel.setStreamHandler( setupStreamHandler ) } override fun onMethodCall(call: MethodCall, result: Result): Unit { // Log.d("FlutterMIDICommand","call method ${call.method}") if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M) { result.error("ERROR", "Needs at least Android M", null); return; } when (call.method) { "sendData" -> { var args : Map? = call.arguments() sendData(args?.get("data") as ByteArray, args["timestamp"] as? Long, args["deviceId"]?.toString()) result.success(null) } "getDevices" -> { result.success(listOfDevices()) } "scanForDevices" -> { val errorMsg = startScanningLeDevices() if (errorMsg != null) { result.error("ERROR", errorMsg, null) } else { result.success(null) } } "stopScanForDevices" -> { stopScanningLeDevices() result.success(null) } "connectToDevice" -> { var args : Map? = call.arguments() var device = (args?.get("device") as Map) // var portList = (args["ports"] as List>).map{ // Port(if (it["id"].toString() is String) it["id"].toString().toInt() else 0 , it["type"].toString()) // } connectToDevice(device["id"].toString(), device["type"].toString()) result.success(null) } "disconnectDevice" -> { var args = call.arguments>() args?.get("id")?.let { disconnectDevice(it.toString()) } result.success(null) } "teardown" -> { teardown() result.success(null) } else -> { result.notImplemented() } } } private fun tryToInitBT() : String? { Log.d("FlutterMIDICommand", "tryToInitBT") if (context.checkSelfPermission(Manifest.permission.BLUETOOTH_ADMIN) != PackageManager.PERMISSION_GRANTED || context.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { if (activity != null) { var activity = activity!! if (activity.shouldShowRequestPermissionRationale(Manifest.permission.BLUETOOTH_ADMIN) || activity.shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) { Log.d("FlutterMIDICommand", "Show rationale for Location") return "showRationaleForPermission" } else { activity.requestPermissions(arrayOf(Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.ACCESS_FINE_LOCATION), PERMISSIONS_REQUEST_ACCESS_LOCATION) } } } else { Log.d("FlutterMIDICommand", "Already permitted") blManager = context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager bluetoothAdapter = blManager.adapter if (bluetoothAdapter != null) { bluetoothScanner = bluetoothAdapter.bluetoothLeScanner if (bluetoothScanner != null) { // Listen for changes in Bluetooth state context.registerReceiver(broadcastReceiver, IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)) startScanningLeDevices() } else { Log.d("FlutterMIDICommand", "bluetoothScanner is null") return "bluetoothNotAvailable" } } else { Log.d("FlutterMIDICommand", "bluetoothAdapter is null") } } return null } private val broadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val action = intent.action if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { val state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) when (state) { BluetoothAdapter.STATE_OFF -> { Log.d("FlutterMIDICommand", "BT is now off") bluetoothScanner = null } BluetoothAdapter.STATE_TURNING_OFF -> { Log.d("FlutterMIDICommand", "BT is now turning off") } BluetoothAdapter.STATE_ON -> { Log.d("FlutterMIDICommand", "BT is now on") } } } } } private fun startScanningLeDevices() : String? { //Removed to enable support for Kitkat return null } private fun stopScanningLeDevices() { //Removed to enable support for Kitkat } fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { Log.d("FlutterMIDICommand", "Permissions code: $requestCode grantResults: $grantResults") if (requestCode == PERMISSIONS_REQUEST_ACCESS_LOCATION && grantResults[0] == PackageManager.PERMISSION_GRANTED) { startScanningLeDevices() } else { Log.d("FlutterMIDICommand", "Perms failed") } } private fun connectToDevice(deviceId:String, type:String) { Log.d("FlutterMIDICommand", "connect to $type device: $deviceId") if (type == "BLE") { val bleDevices = discoveredDevices.filter { it.address == deviceId } if (bleDevices.count() == 0) { Log.d("FlutterMIDICommand", "Device not found ${deviceId}") } else { Log.d("FlutterMIDICommand", "Stop BLE Scan - Open device") midiManager.openBluetoothDevice(bleDevices.first(), deviceOpenedListener, handler) } } else if (type == "native") { val devices = midiManager.devices.filter { d -> d.id.toString() == deviceId } if (devices.count() == 0) { Log.d("FlutterMIDICommand", "not found device $devices") } else { Log.d("FlutterMIDICommand", "open device ${devices[0]}") midiManager.openDevice(devices[0], deviceOpenedListener, handler) } } } fun teardown() { if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M) return; Log.d("FlutterMIDICommand", "teardown") connectedDevices.forEach { s, connectedDevice -> connectedDevice.close() } connectedDevices.clear() Log.d("FlutterMIDICommand", "unregisterDeviceCallback") midiManager.unregisterDeviceCallback(deviceConnectionCallback) Log.d("FlutterMIDICommand", "unregister broadcastReceiver") try { context.unregisterReceiver(broadcastReceiver) } catch (e: Exception) { // The receiver was not registered. // There is nothing to do in that case. // Everything is fine. } } fun disconnectDevice(deviceId: String) { connectedDevices[deviceId]?.also { it.close() connectedDevices.remove(deviceId) } } fun sendData(data: ByteArray, timestamp: Long?, deviceId: String?) { if (deviceId != null && connectedDevices.containsKey(deviceId)) { connectedDevices[deviceId]?.let { it.send(data, timestamp) } } else { connectedDevices.values.forEach { it.send(data, timestamp) } } } fun listOfPorts(count: Int) : List> { Log.d("FlutterMIDICommand", "number of ports $count") return (0 until count).map { mapOf("id" to it, "connected" to false) } } fun listOfDevices() : List> { var list = mutableListOf>() val devs:Array = midiManager.devices Log.d("FlutterMIDICommand", "devices $devs") var connectedBleDeviceIds = mutableListOf() devs.forEach { if (it.type == MidiDeviceInfo.TYPE_BLUETOOTH) { connectedBleDeviceIds.add(it.properties.get(MidiDeviceInfo.PROPERTY_BLUETOOTH_DEVICE).toString()) } list.add(mapOf( "name" to (it.properties.getString(MidiDeviceInfo.PROPERTY_NAME) ?: "-"), "id" to it.id.toString(), "type" to "native", "connected" to if (connectedDevices.contains(it.id.toString())) "true" else "false", "inputs" to listOfPorts(it.inputPortCount), "outputs" to listOfPorts(it.outputPortCount) ) )} discoveredDevices.forEach { if (!connectedBleDeviceIds.contains(it.address)) { list.add(mapOf( "name" to it.name, "id" to it.address, "type" to "BLE", "connected" to if (connectedDevices.contains(it.address)) "true" else "false", "inputs" to listOf(mapOf("id" to 0, "connected" to false)), "outputs" to listOf(mapOf("id" to 0, "connected" to false)) )) } } Log.d("FlutterMIDICommand", "list $list") return list.toList() } class RXReceiver(stream: FlutterStreamHandler, device: MidiDevice) : MidiReceiver() { val stream = stream var isBluetoothDevice = device.info.type == MidiDeviceInfo.TYPE_BLUETOOTH val deviceInfo = mapOf("id" to if(isBluetoothDevice) device.info.properties.get(MidiDeviceInfo.PROPERTY_BLUETOOTH_DEVICE).toString() else device.info.id.toString(), "name" to device.info.properties.getString(MidiDeviceInfo.PROPERTY_NAME), "type" to if(isBluetoothDevice) "BLE" else "native") var sysexPart:MutableList = mutableListOf() override fun onSend(msg: ByteArray?, offset: Int, count: Int, timestamp: Long) { msg?.also { var data = it.slice(IntRange(offset, offset+count-1)) // Log.d("FlutterMIDICommand", "data sliced $data offset $offset count $count first ${data.first()} last ${data.last()}") if (sysexPart.isNotEmpty()) { // does data contain a start byte? var startIndex = data.indexOf(0xF0.toByte()) if (startIndex > -1) { // new sysex incoming, cap old one // Log.d("FlutterMIDICommand", "new sysex message starting, ending last one from startindex $startIndex") var tailEnd = data.subList(0, startIndex) sysexPart.addAll(tailEnd) if (sysexPart.indexOf(0xF7.toByte()) == -1) { sysexPart.add(0xF7.toByte()) // Sometimes android drops the last byte of a BLE Midi message, so this workaround tries to save that situation } stream.send( mapOf("data" to sysexPart.toList(), "timestamp" to timestamp, "device" to deviceInfo)) // insert start of new message sysexPart.clear() sysexPart.addAll(data.subList(startIndex, data.size)) } else { // add more data to part sysexPart.addAll(data) } // Log.d("FlutterMIDICommand", "data $sysexPart") // is the message complete var endIndex = sysexPart.indexOf(0xF7.toByte()) if (endIndex > -1) { var sysexData = sysexPart.subList(0, endIndex+1) // Log.d("FlutterMIDICommand", "complete sysex message, send to app") stream.send(mapOf("data" to sysexData, "timestamp" to timestamp, "device" to deviceInfo)) sysexPart = sysexPart.subList(endIndex+1, sysexPart.size) // Log.d("FlutterMIDICommand", "remainng sysex part, $sysexPart") } } else { // Start of new sysex message if (data.first() == 0xF0.toByte()) { var endIndex = data.indexOf(0xF7.toByte()) // Log.d("FlutterMIDICommand", "sysex end index $endIndex") if (endIndex > -1) { // Has end byte var sysexData = data.subList(0, endIndex+1); // Log.d("FlutterMIDICommand", "complete sysex message $sysexData, send to app") stream.send(mapOf("data" to sysexData, "timestamp" to timestamp, "device" to deviceInfo)) if (endIndex < data.size-1) { // Log.d("FlutterMIDICommand", "start of new sysex message in tail, save...") sysexPart.clear() sysexPart.addAll(data.subList(endIndex+1, data.size)) } } else { // no end byte, save for later sysexPart.clear() sysexPart.addAll(data) } } else { // regular midi message stream.send(mapOf("data" to data, "timestamp" to timestamp, "device" to deviceInfo)) } } } } } class FlutterStreamHandler(handler: Handler) : EventChannel.StreamHandler { val handler = handler private var eventSink: EventChannel.EventSink? = null // EventChannel.StreamHandler methods override fun onListen(arguments: Any?, eventSink: EventChannel.EventSink?) { Log.d("FlutterMIDICommand","FlutterStreamHandler onListen") this.eventSink = eventSink } override fun onCancel(arguments: Any?) { Log.d("FlutterMIDICommand","FlutterStreamHandler onCancel") eventSink = null } fun send(data: Any) { // Log.d("FlutterMIDICommand","FlutterStreamHandler send ${data}") handler.post { eventSink?.success(data) } } } class Port { var id:Int var type:String constructor(id:Int, type:String) { this.id = id this.type = type } } class ConnectedDevice { var id:String var type:String lateinit var midiDevice:MidiDevice var inputPort:MidiInputPort? = null var outputPort:MidiOutputPort? = null var status:MidiDeviceStatus? = null private var receiver:MidiReceiver? = null constructor(device:MidiDevice) { this.midiDevice = device this.id = device.info.id.toString() this.type = device.info.type.toString() device.info.ports.forEach { Log.d("FlutterMIDICommand", "port on device: ${it.name} ${it.type} ${it.portNumber}") } } fun connectWithReceiver(receiver: MidiReceiver) { Log.d("FlutterMIDICommand","connectWithHandler") this.midiDevice?.info?.let { // Log.d("FlutterMIDICommand","inputPorts ${it.inputPortCount} outputPorts ${it.outputPortCount}") // it.ports.forEach { // Log.d("FlutterMIDICommand", "${it.name} ${it.type} ${it.portNumber}") // } // Log.d("FlutterMIDICommand", "is binder alive? ${this.midiDevice?.info?.properties?.getBinder(null)?.isBinderAlive}") if(it.inputPortCount > 0) { Log.d("FlutterMIDICommand", "Open input port") this.inputPort = this.midiDevice?.openInputPort(0) } if (it.outputPortCount > 0) { Log.d("FlutterMIDICommand", "Open output port") this.outputPort = this.midiDevice?.openOutputPort(0) this.outputPort?.connect(receiver) } } this.receiver = receiver } // fun openPorts(ports: List) { // this.midiDevice.info?.let { deviceInfo -> // Log.d("FlutterMIDICommand","inputPorts ${deviceInfo.inputPortCount} outputPorts ${deviceInfo.outputPortCount}") // // ports.forEach { port -> // Log.d("FlutterMIDICommand", "Open port ${port.type} ${port.id}") // when (port.type) { // "MidiPortType.IN" -> { // if (deviceInfo.inputPortCount > port.id) { // Log.d("FlutterMIDICommand", "Open input port ${port.id}") // this.inputPort = this.midiDevice.openInputPort(port.id) // } // } // "MidiPortType.OUT" -> { // if (deviceInfo.outputPortCount > port.id) { // Log.d("FlutterMIDICommand", "Open output port ${port.id}") // this.outputPort = this.midiDevice.openOutputPort(port.id) // this.outputPort?.connect(receiver) // } // } // else -> { // Log.d("FlutterMIDICommand", "Unknown MIDI port type ${port.type}. Not opening.") // } // } // } // } // } fun send(data: ByteArray, timestamp: Long?) { this.inputPort?.send(data, 0, data.count(), if (timestamp is Long) timestamp else 0); } fun close() { Log.d("FlutterMIDICommand", "Flush input port ${this.inputPort}") this.inputPort?.flush() Log.d("FlutterMIDICommand", "Close input port ${this.inputPort}") this.inputPort?.close() Log.d("FlutterMIDICommand", "Close output port ${this.outputPort}") this.outputPort?.close() Log.d("FlutterMIDICommand", "Disconnect receiver ${this.receiver}") this.outputPort?.disconnect(this.receiver) this.receiver = null Log.d("FlutterMIDICommand", "Close device ${this.midiDevice}") this.midiDevice?.close() } } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig /Flutter/flutter_export_environment.sh ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Classes/FlutterMidiCommandPlugin.h ================================================ #if TARGET_OS_OSX #import #else #import #endif @interface FlutterMidiCommandPlugin : NSObject @end ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Classes/FlutterMidiCommandPlugin.m ================================================ #import "FlutterMidiCommandPlugin.h" #if __has_include() #import #else // Support project import fallback if the generated compatibility header // is not copied when this plugin is created as a library. // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 #import "flutter_midi_command-Swift.h" #endif @implementation FlutterMidiCommandPlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftFlutterMidiCommandPlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Classes/SwiftFlutterMidiCommandPlugin.swift ================================================ #if os(macOS) import FlutterMacOS #else import Flutter #endif import CoreMIDI import os.log import CoreBluetooth import Foundation /// /// Credit to /// http://mattg411.com/coremidi-swift-programming/ /// https://github.com/genedelisa/Swift3MIDI /// http://www.gneuron.com/?p=96 /// https://learn.sparkfun.com/tutorials/midi-ble-tutorial/all public class SwiftFlutterMidiCommandPlugin: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate, FlutterPlugin { // MIDI var midiClient = MIDIClientRef() var connectedDevices = Dictionary() // Flutter var midiRXChannel:FlutterEventChannel? var rxStreamHandler = StreamHandler() var midiSetupChannel:FlutterEventChannel? var setupStreamHandler = StreamHandler() #if os(iOS) // Network Session var session:MIDINetworkSession? #endif // BLE var manager:CBCentralManager! var discoveredDevices:Set = [] let midiLog = OSLog(subsystem: "com.invisiblewrench.FlutterMidiCommand", category: "MIDI") public static func register(with registrar: FlutterPluginRegistrar) { #if os(macOS) let channel = FlutterMethodChannel(name: "plugins.invisiblewrench.com/flutter_midi_command", binaryMessenger: registrar.messenger) #else let channel = FlutterMethodChannel(name: "plugins.invisiblewrench.com/flutter_midi_command", binaryMessenger: registrar.messenger()) #endif let instance = SwiftFlutterMidiCommandPlugin() registrar.addMethodCallDelegate(instance, channel: channel) instance.setup(registrar) } deinit { NotificationCenter.default.removeObserver(self) MIDIClientDispose(midiClient) } func setup(_ registrar: FlutterPluginRegistrar) { // Stream setup #if os(macOS) midiRXChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/rx_channel", binaryMessenger: registrar.messenger) #else midiRXChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/rx_channel", binaryMessenger: registrar.messenger()) #endif midiRXChannel?.setStreamHandler(rxStreamHandler) #if os(macOS) midiSetupChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/setup_channel", binaryMessenger: registrar.messenger) #else midiSetupChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/setup_channel", binaryMessenger: registrar.messenger()) #endif midiSetupChannel?.setStreamHandler(setupStreamHandler) // MIDI client with notification handler MIDIClientCreateWithBlock("plugins.invisiblewrench.com.FlutterMidiCommand" as CFString, &midiClient) { (notification) in self.handleMIDINotification(notification) } manager = CBCentralManager.init(delegate: self, queue: DispatchQueue.global(qos: .userInteractive)) #if os(iOS) session = MIDINetworkSession.default() session?.isEnabled = true session?.connectionPolicy = MIDINetworkConnectionPolicy.anyone #endif } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { // print("call method \(call.method)") switch call.method { case "scanForDevices": print("\(manager.state.rawValue)") if manager.state == CBManagerState.poweredOn { print("Start discovery") discoveredDevices.removeAll() manager.scanForPeripherals(withServices: [CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")], options: nil) result(nil) } else { print("BT not ready") result(FlutterError(code: "MESSAGEERROR", message: "bluetoothNotAvailable", details: call.arguments)) } break case "stopScanForDevices": manager.stopScan() break case "getDevices": let devices = getDevices() print("--- devices ---\n\(devices)") result(devices) break case "connectToDevice": if let args = call.arguments as? Dictionary { if let deviceInfo = args["device"] as? Dictionary { if let deviceId = deviceInfo["id"] as? String { if connectedDevices[deviceId] != nil { result(FlutterError.init(code: "MESSAGEERROR", message: "Device already connected", details: call.arguments)) } else { connectToDevice(deviceId: deviceInfo["id"] as! String, type: deviceInfo["type"] as! String, ports: nil) } result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "No device Id", details: deviceInfo)) } } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse deviceInfo", details: call.arguments)) } } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse args", details: call.arguments)) } break case "disconnectDevice": if let deviceInfo = call.arguments as? Dictionary { if let deviceId = deviceInfo["id"] as? String { disconnectDevice(deviceId: deviceId) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "No device Id", details: call.arguments)) } result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse device id", details: call.arguments)) } result(nil) break case "sendData": if let packet = call.arguments as? Dictionary { sendData(packet["data"] as! FlutterStandardTypedData, deviceId: packet["deviceId"] as? String, timestamp: packet["timestamp"] as? UInt64) result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not form midi packet", details: call.arguments)) } break case "teardown": teardown() break default: result(FlutterMethodNotImplemented) } } func teardown() { for device in connectedDevices { disconnectDevice(deviceId: device.value.id) } #if os(iOS) session?.isEnabled = false #endif } func connectToDevice(deviceId:String, type:String, ports:[Port]?) { print("connect \(deviceId) \(type)") if type == "BLE" { if let periph = discoveredDevices.filter({ (p) -> Bool in p.identifier.uuidString == deviceId }).first { let device = ConnectedBLEDevice(id: deviceId, type: type, streamHandler: rxStreamHandler, peripheral: periph, ports:ports) connectedDevices[deviceId] = device manager.stopScan() manager.connect(periph, options: nil) } else { print("error connecting to device \(deviceId) [\(type)]") } } else if type == "native" { let device = ConnectedNativeDevice(id: deviceId, type: type, streamHandler: rxStreamHandler, client: midiClient, ports:ports) connectedDevices[deviceId] = device setupStreamHandler.send(data: "deviceConnected") } } func disconnectDevice(deviceId:String) { let device = connectedDevices[deviceId] print("disconnect \(String(describing: device)) for id \(deviceId)") if let device = device { if device.deviceType == "BLE" { //let p = (device as! ConnectedBLEDevice).peripheral //manager.cancelPeripheralConnection(p) device.close() } else { print("disconmmected MIDI") device.close() setupStreamHandler.send(data: "deviceDisconnected") } connectedDevices.removeValue(forKey: deviceId) } } func sendData(_ data:FlutterStandardTypedData, deviceId: String?, timestamp: UInt64?) { let bytes = [UInt8](data.data) if let deviceId = deviceId { if let device = connectedDevices[deviceId] { device.send(bytes: bytes, timestamp: timestamp) // _sendDataToDevice(device: device, data: data, timestamp: timestamp) } } else { connectedDevices.values.forEach({ (device) in device.send(bytes: bytes, timestamp: timestamp) // _sendDataToDevice(device: device, data: data, timestamp: timestamp) }) } } static func getMIDIProperty(_ prop:CFString, fromObject obj:MIDIObjectRef) -> String { var param: Unmanaged? var result: String = "Error" let err: OSStatus = MIDIObjectGetStringProperty(obj, prop, ¶m) if err == OSStatus(noErr) { result = param!.takeRetainedValue() as String } return result } func createPortDict(count:Int) -> Array> { return (0.. Dictionary in return ["id": id, "connected" : false] } } func getDevices() -> [Dictionary] { var devices:[Dictionary] = [] // Native var nativeDevices = Dictionary>() let destinationCount = MIDIGetNumberOfDestinations() for d in 0..) { print("\ngot a MIDINotification!") let notification = midiNotification.pointee print("MIDI Notify, messageId= \(notification.messageID)") print("MIDI Notify, messageSize= \(notification.messageSize)") setupStreamHandler.send(data: "\(notification.messageID)") switch notification.messageID { // Some aspect of the current MIDISetup has changed. No data. Should ignore this message if messages 2-6 are handled. case .msgSetupChanged: print("MIDI setup changed") let ptr = UnsafeMutablePointer(mutating: midiNotification) // let ptr = UnsafeMutablePointer(midiNotification) let m = ptr.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") break // A device, entity or endpoint was added. Structure is MIDIObjectAddRemoveNotification. case .msgObjectAdded: print("added") // let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIObjectAddRemoveNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("child \(m.child)") print("child type \(m.childType)") showMIDIObjectType(m.childType) print("parent \(m.parent)") print("parentType \(m.parentType)") showMIDIObjectType(m.parentType) // print("childName \(String(describing: getDisplayName(m.child)))") } break // A device, entity or endpoint was removed. Structure is MIDIObjectAddRemoveNotification. case .msgObjectRemoved: print("kMIDIMsgObjectRemoved") // let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIObjectAddRemoveNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("child \(m.child)") print("child type \(m.childType)") print("parent \(m.parent)") print("parentType \(m.parentType)") // print("childName \(String(describing: getDisplayName(m.child)))") } break // An object's property was changed. Structure is MIDIObjectPropertyChangeNotification. case .msgPropertyChanged: print("kMIDIMsgPropertyChanged") midiNotification.withMemoryRebound(to: MIDIObjectPropertyChangeNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("object \(m.object)") print("objectType \(m.objectType)") print("propertyName \(m.propertyName)") print("propertyName \(m.propertyName.takeUnretainedValue())") if m.propertyName.takeUnretainedValue() as String == "apple.midirtp.session" { print("connected") } } break // A persistent MIDI Thru connection wasor destroyed. No data. case .msgThruConnectionsChanged: print("MIDI thru connections changed.") break //A persistent MIDI Thru connection was created or destroyed. No data. case .msgSerialPortOwnerChanged: print("MIDI serial port owner changed.") break case .msgIOError: print("MIDI I/O error.") //let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIIOErrorNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("driverDevice \(m.driverDevice)") print("errorCode \(m.errorCode)") } break @unknown default: break } } func showMIDIObjectType(_ ot: MIDIObjectType) { switch ot { case .other: os_log("midiObjectType: Other", log: midiLog, type: .debug) break case .device: os_log("midiObjectType: Device", log: midiLog, type: .debug) break case .entity: os_log("midiObjectType: Entity", log: midiLog, type: .debug) break case .source: os_log("midiObjectType: Source", log: midiLog, type: .debug) break case .destination: os_log("midiObjectType: Destination", log: midiLog, type: .debug) break case .externalDevice: os_log("midiObjectType: ExternalDevice", log: midiLog, type: .debug) break case .externalEntity: print("midiObjectType: ExternalEntity") os_log("midiObjectType: ExternalEntity", log: midiLog, type: .debug) break case .externalSource: os_log("midiObjectType: ExternalSource", log: midiLog, type: .debug) break case .externalDestination: os_log("midiObjectType: ExternalDestination", log: midiLog, type: .debug) break @unknown default: break } } #if os(iOS) /// MIDI Network Session @objc func midiNetworkChanged(notification:NSNotification) { print("\(#function)") print("\(notification)") if let session = notification.object as? MIDINetworkSession { print("session \(session)") for con in session.connections() { print("con \(con)") } print("isEnabled \(session.isEnabled)") print("sourceEndpoint \(session.sourceEndpoint())") print("destinationEndpoint \(session.destinationEndpoint())") print("networkName \(session.networkName)") print("localName \(session.localName)") // if let name = getDeviceName(session.sourceEndpoint()) { // print("source name \(name)") // } // // if let name = getDeviceName(session.destinationEndpoint()) { // print("destination name \(name)") // } } setupStreamHandler.send(data: "\(#function) \(notification)") } @objc func midiNetworkContactsChanged(notification:NSNotification) { print("\(#function)") print("\(notification)") if let session = notification.object as? MIDINetworkSession { print("session \(session)") for con in session.contacts() { print("contact \(con)") } } setupStreamHandler.send(data: "\(#function) \(notification)") } #endif /// BLE handling // Central public func centralManagerDidUpdateState(_ central: CBCentralManager) { print("central did update state \(central.state.rawValue)") } public func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { print("central didDiscover \(peripheral)") if !discoveredDevices.contains(peripheral) { discoveredDevices.insert(peripheral) setupStreamHandler.send(data: "deviceFound") } } public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { print("central did connect \(peripheral)") // connectedPeripheral = peripheral // peripheral.delegate = self // peripheral.discoverServices([CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")]) setupStreamHandler.send(data: "deviceConnected") (connectedDevices[peripheral.identifier.uuidString] as! ConnectedBLEDevice).setupBLE() } public func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { print("central did fail to connect state \(peripheral)") // connectingDevice = nil setupStreamHandler.send(data: "connectionFailed") connectedDevices.removeValue(forKey: peripheral.identifier.uuidString) } public func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) { print("central didDisconnectPeripheral \(peripheral)") // connectedPeripheral = nil // connectedCharacteristic = nil setupStreamHandler.send(data: "deviceDisconnected") } } class StreamHandler : NSObject, FlutterStreamHandler { var sink:FlutterEventSink? func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? { sink = events return nil } func onCancel(withArguments arguments: Any?) -> FlutterError? { sink = nil return nil } func send(data: Any) { if let sink = sink { sink(data) // } else { // print("no sink") } } } class Port { var id:Int var type:String init(id:Int, type:String) { self.id = id; self.type = type } } class ConnectedDevice : NSObject { var id:String var deviceType:String var streamHandler : StreamHandler init(id:String, type:String, streamHandler:StreamHandler) { self.id = id self.deviceType = type self.streamHandler = streamHandler } func openPorts() {} func send(bytes:[UInt8], timestamp: UInt64?) {} func close() {} } class ConnectedNativeDevice : ConnectedDevice { var outputPort = MIDIPortRef() var inputPort = MIDIPortRef() var client : MIDIClientRef var name : String? var outEndpoint : MIDIEndpointRef? var inSource : MIDIEndpointRef? var entity : MIDIEntityRef? var ports:[Port]? init(id:String, type:String, streamHandler:StreamHandler, client: MIDIClientRef, ports:[Port]?) { self.client = client self.ports = ports let idParts = id.split(separator: ":") // Store entity and get device/entity name if let deviceId = MIDIDeviceRef(idParts[0]) { if let entityId = Int(idParts[1]) { entity = MIDIDeviceGetEntity(deviceId, entityId) if let e = entity { let entityName = SwiftFlutterMidiCommandPlugin.getMIDIProperty(kMIDIPropertyName, fromObject: e) var device:MIDIDeviceRef = 0 MIDIEntityGetDevice(e, &device) let deviceName = SwiftFlutterMidiCommandPlugin.getMIDIProperty(kMIDIPropertyName, fromObject: device) name = "\(deviceName) \(entityName)" } else { print("no entity") } } else { print("no entityId") } } else { print("no deviceId") } super.init(id: id, type: type, streamHandler: streamHandler) // MIDI Input with handler MIDIInputPortCreateWithBlock(client, "FlutterMidiCommand_InPort" as CFString, &inputPort) { (packetList, srcConnRefCon) in self.handlePacketList(packetList, srcConnRefCon: srcConnRefCon) } // MIDI output MIDIOutputPortCreate(client, "FlutterMidiCommand_OutPort" as CFString, &outputPort); openPorts() } override func send(bytes: [UInt8], timestamp: UInt64?) { if let ep = outEndpoint { let packetList = UnsafeMutablePointer.allocate(capacity: 1) var packet = MIDIPacketListInit(packetList) let time = timestamp ?? mach_absolute_time() packet = MIDIPacketListAdd(packetList, 1024, packet, time, bytes.count, bytes) let status = MIDISend(outputPort, ep, packetList) //print("send bytes \(bytes) on port \(outputPort) \(ep) status \(status)") packetList.deallocate() } else { print("No MIDI destination for id \(name!)") } } override func openPorts() { print("open native ports") if let e = entity { if let ps = ports { for port in ps { inSource = MIDIEntityGetSource(e, port.id) switch port.type { case "MidiPortType.IN": let status = MIDIPortConnectSource(inputPort, inSource!, &name) print("port open status \(status)") case "MidiPortType.OUT": outEndpoint = MIDIEntityGetDestination(e, port.id) // print("port endpoint \(endpoint)") break default: print("unknown port type \(port.type)") } } } else { print("open default ports") inSource = MIDIEntityGetSource(e, 0) let status = MIDIPortConnectSource(inputPort, inSource!, &name) outEndpoint = MIDIEntityGetDestination(e, 0) } } } override func close() { if let oEP = outEndpoint { MIDIEndpointDispose(oEP) } if let iS = inSource { MIDIPortDisconnectSource(inputPort, iS) } MIDIPortDispose(inputPort) MIDIPortDispose(outputPort) } func handlePacketList(_ packetList:UnsafePointer, srcConnRefCon:UnsafeMutableRawPointer?) { let packets = packetList.pointee let packet:MIDIPacket = packets.packet var ap = UnsafeMutablePointer.allocate(capacity: 1) ap.initialize(to:packet) let deviceInfo = ["name" : name, "id": String(id), "type":"native"] for _ in 0 ..< packets.numPackets { let p = ap.pointee var tmp = p.data let data = Data(bytes: &tmp, count: Int(p.length)) let timestamp = p.timeStamp // print("data \(data) timestamp \(timestamp)") streamHandler.send(data: ["data": data, "timestamp":timestamp, "device":deviceInfo]) ap = MIDIPacketNext(ap) } // ap.deallocate() } } class ConnectedBLEDevice : ConnectedDevice, CBPeripheralDelegate { var peripheral:CBPeripheral var characteristic:CBCharacteristic? // BLE MIDI parsing enum BLE_HANDLER_STATE { case HEADER case TIMESTAMP case STATUS case STATUS_RUNNING case PARAMS case SYSTEM_RT case SYSEX case SYSEX_END case SYSEX_INT } var bleHandlerState = BLE_HANDLER_STATE.HEADER var sysExBuffer: [UInt8] = [] var timestamp: UInt64 = 0 var bleMidiBuffer:[UInt8] = [] var bleMidiPacketLength:UInt8 = 0 var bleSysExHasFinished = true init(id:String, type:String, streamHandler:StreamHandler, peripheral:CBPeripheral, ports:[Port]?) { self.peripheral = peripheral super.init(id: id, type: type, streamHandler: streamHandler) } func setupBLE() { peripheral.delegate = self peripheral.discoverServices([CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")]) } override func close() { CBCentralManager().cancelPeripheralConnection(peripheral) characteristic = nil } override func send(bytes:[UInt8], timestamp: UInt64?) { // print("ble send \(id) \(bytes)") if (characteristic != nil) { let packetSize = 20 var dataBytes = Data(bytes) if bytes.first == 0xF0 && bytes.last == 0xF7 { // this is a sysex message, handle carefully if bytes.count > 17 { // Split into multiple messages of 20 bytes total // First packet var packet = dataBytes.subdata(in: 0.. 0 { print("count \(dataBytes.count)") let pickCount = min(dataBytes.count, packetSize-1) // print("pickCount \(pickCount)") packet = dataBytes.subdata(in: 0.. packetSize-2) { dataBytes = dataBytes.advanced(by: pickCount) // Advance buffer } else { print("done") return } } } else { // Insert timestamp low in front of Sysex End-byte dataBytes.insert(0x80, at: bytes.count-1) // Insert header(and empty timstamp high) and timestamp low in front of BLE Midi message dataBytes.insert(0x80, at: 0) dataBytes.insert(0x80, at: 0) peripheral.writeValue(dataBytes, for: characteristic!, type: CBCharacteristicWriteType.withoutResponse) } return } // Insert header(and empty timstamp high) and timestamp low in front of BLE Midi message dataBytes.insert(0x80, at: 0) dataBytes.insert(0x80, at: 0) peripheral.writeValue(dataBytes, for: characteristic!, type: CBCharacteristicWriteType.withoutResponse) } else { print("No peripheral/characteristic in device") } } public func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { print("perif didDiscoverServices \(String(describing: peripheral.services))") for service:CBService in peripheral.services! { peripheral.discoverCharacteristics(nil, for: service) } } public func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { print("perif didDiscoverCharacteristicsFor \(String(describing: service.characteristics))") for characteristic:CBCharacteristic in service.characteristics! { if characteristic.uuid.uuidString == "7772E5DB-3868-4112-A1A9-F2669D106BF3" { self.characteristic = characteristic peripheral.setNotifyValue(true, for: characteristic) print("set up characteristic for device") } } } func createMessageEvent(_ bytes:[UInt8], timestamp:UInt64, peripheral:CBPeripheral) { // print("send rx event \(bytes)") let data = Data(bytes: bytes, count: Int(bytes.count)) streamHandler.send(data: ["data": data, "timestamp":timestamp, "device":[ "name" : peripheral.name ?? "-", "id":peripheral.identifier.uuidString, "type":"BLE"]]) } public func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { // print("perif didUpdateValueFor \(String(describing: characteristic))") if let value = characteristic.value { parseBLEPacket(value, peripheral:peripheral) } } func parseBLEPacket(_ packet:Data, peripheral:CBPeripheral) -> Void { // print("parse \(packet)") if (packet.count > 1) { // parse BLE message bleHandlerState = BLE_HANDLER_STATE.HEADER let header = packet[0] var statusByte:UInt8 = 0 for i in 1...packet.count-1 { let midiByte:UInt8 = packet[i] // print ("bleHandlerState \(bleHandlerState) byte \(midiByte)") if ((midiByte & 0x80) == 0x80 && bleHandlerState != BLE_HANDLER_STATE.TIMESTAMP && bleHandlerState != BLE_HANDLER_STATE.SYSEX_INT) { if (!bleSysExHasFinished) { bleHandlerState = BLE_HANDLER_STATE.SYSEX_INT } else { bleHandlerState = BLE_HANDLER_STATE.TIMESTAMP } } else { // State handling switch (bleHandlerState) { case BLE_HANDLER_STATE.HEADER: if (!bleSysExHasFinished) { if ((midiByte & 0x80) == 0x80) { // System messages can interrupt ongoing sysex bleHandlerState = BLE_HANDLER_STATE.SYSEX_INT } else { // Sysex continue //print("sysex continue") bleHandlerState = BLE_HANDLER_STATE.SYSEX } } break case BLE_HANDLER_STATE.TIMESTAMP: if ((midiByte & 0xFF) == 0xF0) { // Sysex start bleSysExHasFinished = false sysExBuffer.removeAll() bleHandlerState = BLE_HANDLER_STATE.SYSEX } else if ((midiByte & 0x80) == 0x80) { // Status/System start bleHandlerState = BLE_HANDLER_STATE.STATUS } else { bleHandlerState = BLE_HANDLER_STATE.STATUS_RUNNING } break case BLE_HANDLER_STATE.STATUS: bleHandlerState = BLE_HANDLER_STATE.PARAMS break case BLE_HANDLER_STATE.STATUS_RUNNING: bleHandlerState = BLE_HANDLER_STATE.PARAMS break; case BLE_HANDLER_STATE.PARAMS: // After params can come TSlow or more params break case BLE_HANDLER_STATE.SYSEX: break case BLE_HANDLER_STATE.SYSEX_INT: if ((midiByte & 0xF7) == 0xF7) { // Sysex end // print("sysex end") bleSysExHasFinished = true bleHandlerState = BLE_HANDLER_STATE.SYSEX_END } else { bleHandlerState = BLE_HANDLER_STATE.SYSTEM_RT } break; case BLE_HANDLER_STATE.SYSTEM_RT: if (!bleSysExHasFinished) { // Continue incomplete Sysex bleHandlerState = BLE_HANDLER_STATE.SYSEX } break default: print ("Unhandled state \(bleHandlerState)") break } } // print ("\(bleHandlerState) - \(midiByte) [\(String(format:"%02X", midiByte))]") // Data handling switch (bleHandlerState) { case BLE_HANDLER_STATE.TIMESTAMP: // print ("set timestamp") let tsHigh = header & 0x3f let tsLow = midiByte & 0x7f timestamp = UInt64(tsHigh) << 7 | UInt64(tsLow) // print ("timestamp is \(timestamp)") break case BLE_HANDLER_STATE.STATUS: bleMidiPacketLength = lengthOfMessageType(midiByte) // print("message length \(bleMidiPacketLength)") bleMidiBuffer.removeAll() bleMidiBuffer.append(midiByte) if bleMidiPacketLength == 1 { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) // TODO Add timestamp } else { // print ("set status") statusByte = midiByte } break case BLE_HANDLER_STATE.STATUS_RUNNING: // print("set running status") bleMidiPacketLength = lengthOfMessageType(statusByte) bleMidiBuffer.removeAll() bleMidiBuffer.append(statusByte) bleMidiBuffer.append(midiByte) if bleMidiPacketLength == 2 { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) } break case BLE_HANDLER_STATE.PARAMS: // print ("add param \(midiByte)") bleMidiBuffer.append(midiByte) if bleMidiPacketLength == bleMidiBuffer.count { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) bleMidiBuffer.removeLast(Int(bleMidiPacketLength)-1) // Remove all but status, which might be used for running msgs } break case BLE_HANDLER_STATE.SYSTEM_RT: // print("handle RT") createMessageEvent([midiByte], timestamp: timestamp, peripheral:peripheral) break case BLE_HANDLER_STATE.SYSEX: // print("add sysex") sysExBuffer.append(midiByte) break case BLE_HANDLER_STATE.SYSEX_INT: // print("sysex int") break case BLE_HANDLER_STATE.SYSEX_END: // print("finalize sysex") sysExBuffer.append(midiByte) createMessageEvent(sysExBuffer, timestamp: 0, peripheral:peripheral) break default: print ("Unhandled state (data) \(bleHandlerState)") break } } } } func lengthOfMessageType(_ type:UInt8) -> UInt8 { let midiType:UInt8 = type & 0xF0 switch (type) { case 0xF6, 0xF8, 0xFA, 0xFB, 0xFC, 0xFF, 0xFE: return 1 case 0xF1, 0xF3: return 2 default: break } switch (midiType) { case 0xC0, 0xD0: return 2 case 0xF2, 0x80, 0x90, 0xA0, 0xB0, 0xE0: return 3 default: break } return 0 } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Flutter/AppFrameworkInfo.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable App CFBundleIdentifier io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName App CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 MinimumOSVersion 9.0 ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Flutter/Debug.xcconfig ================================================ #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Flutter/Release.xcconfig ================================================ #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Podfile ================================================ # Uncomment this line to define a global platform for your project platform :ios, '10.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/AppDelegate.swift ================================================ import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@3x.png", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@3x.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@3x.png", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@2x.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@3x.png", "scale" : "3x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@1x.png", "scale" : "1x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@1x.png", "scale" : "1x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@1x.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@2x.png", "scale" : "2x" }, { "size" : "83.5x83.5", "idiom" : "ipad", "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", "filename" : "Icon-App-1024x1024@1x.png", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md ================================================ # Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Base.lproj/Main.storyboard ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName flutter_midi_command CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner/Runner-Bridging-Header.h ================================================ #import "GeneratedPluginRegistrant.h" ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, ); name = Flutter; sourceTree = ""; }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, ); sourceTree = ""; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, ); name = Products; sourceTree = ""; }; 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, ); buildRules = ( ); dependencies = ( ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1020; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 97C146FB1CF9000F007C117D /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 97C147001CF9000F007C117D /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Profile; }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.invisiblewrench.flutterMidiCommand; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.invisiblewrench.flutterMidiCommand; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.invisiblewrench.flutterMidiCommand; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/ios/flutter_midi_command.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint flutter_midi_command.podspec' to validate before publishing. # Pod::Spec.new do |s| s.name = 'flutter_midi_command' s.version = '0.3.6' s.summary = 'A Flutter plugin for sending and receiving MIDI messages' s.description = <<-DESC 'A Flutter plugin for sending and receiving MIDI messages' DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' s.platform = :ios, '10.0' # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } s.swift_version = '5.0' end ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/lib/flutter_midi_command.dart ================================================ import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; import 'flutter_midi_command_linux_stub.dart' if (dart.library.ffi) 'package:flutter_midi_command_linux/flutter_midi_command_linux.dart'; import 'package:flutter_midi_command_platform_interface/flutter_midi_command_platform_interface.dart'; export 'package:flutter_midi_command_platform_interface/flutter_midi_command_platform_interface.dart' show MidiDevice, MidiPacket, MidiPort; class MidiCommand { factory MidiCommand() { if (_instance == null) { _instance = MidiCommand._(); } return _instance!; } MidiCommand._(); static MidiCommand? _instance; static MidiCommandPlatform? __platform; StreamController _txStreamCtrl = StreamController.broadcast(); /// Get the platform specific implementation static MidiCommandPlatform get _platform { if (__platform != null) return __platform!; try { if (Platform.isLinux) { __platform = FlutterMidiCommandLinux(); } else { __platform = MidiCommandPlatform.instance; } } finally { __platform = MidiCommandPlatform.instance; } return __platform!; } /// Gets a list of available MIDI devices and returns it Future?> get devices async { return _platform.devices; } /// Starts scanning for BLE MIDI devices /// /// Found devices will be included in the list returned by [devices] Future startScanningForBluetoothDevices() async { return _platform.startScanningForBluetoothDevices(); } /// Stop scanning for BLE MIDI devices void stopScanningForBluetoothDevices() { _platform.stopScanningForBluetoothDevices(); } /// Connects to the device void connectToDevice(MidiDevice device) { _platform.connectToDevice(device); } /// Disconnects from the device void disconnectDevice(MidiDevice device) { _platform.disconnectDevice(device); } /// Disconnects from all devices void teardown() { _platform.teardown(); } /// Sends data to the currently connected device /// /// Data is an UInt8List of individual MIDI command bytes void sendData(Uint8List data, {String? deviceId, int? timestamp}) { _platform.sendData(data, deviceId: deviceId, timestamp: timestamp); _txStreamCtrl.add(data); } /// Stream firing events whenever a midi package is received /// /// The event contains the raw bytes contained in the MIDI package Stream? get onMidiDataReceived { return _platform.onMidiDataReceived; } /// Stream firing events whenever a change in the MIDI setup occurs /// /// For example, when a new BLE devices is discovered Stream? get onMidiSetupChanged { return _platform.onMidiSetupChanged; } /// Stream firing events whenever a midi package is sent /// /// The event contains the raw bytes contained in the MIDI package Stream get onMidiDataSent { return _txStreamCtrl.stream; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/lib/flutter_midi_command_linux_stub.dart ================================================ import 'package:flutter_midi_command_platform_interface/flutter_midi_command_platform_interface.dart'; class FlutterMidiCommandLinux extends MidiCommandPlatform {} ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/lib/flutter_midi_command_messages.dart ================================================ import 'dart:typed_data'; import 'flutter_midi_command.dart'; enum MessageType { CC, PC, NoteOn, NoteOff, NRPN, SYSEX, Beat } /// Base class for MIDI message types class MidiMessage { /// Byte data of the message Uint8List data = Uint8List(0); MidiMessage(); /// Send the message bytes to all connected devices void send() { MidiCommand().sendData(data); } } /// Continuous Control Message class CCMessage extends MidiMessage { int channel = 0; int controller = 0; int value = 0; CCMessage({this.channel = 0, this.controller = 0, this.value = 0}); @override void send() { data = Uint8List(3); data[0] = 0xB0 + channel; data[1] = controller; data[2] = value; super.send(); } } /// Program Change Message class PCMessage extends MidiMessage { int channel = 0; int program = 0; PCMessage({this.channel = 0, this.program = 0}); @override void send() { data = Uint8List(2); data[0] = 0xC0 + channel; data[1] = program; super.send(); } } /// Note On Message class NoteOnMessage extends MidiMessage { int channel = 0; int note = 0; int velocity = 0; NoteOnMessage({this.channel = 0, this.note = 0, this.velocity = 0}); @override void send() { data = Uint8List(3); data[0] = 0x90 + channel; data[1] = note; data[2] = velocity; super.send(); } } /// Note Off Message class NoteOffMessage extends MidiMessage { int channel = 0; int note = 0; int velocity = 0; NoteOffMessage({this.channel = 0, this.note = 0, this.velocity = 0}); @override void send() { data = Uint8List(3); data[0] = 0x80 + channel; data[1] = note; data[2] = velocity; super.send(); } } /// System Exclusive Message class SysExMessage extends MidiMessage { List headerData = []; int value = 0; SysExMessage({this.headerData = const [], this.value = 0}); @override void send() { data = Uint8List.fromList(headerData); data.insert(0, 0xF0); // Start byte data.addAll(_bytesForValue(value)); data.add(0xF7); // End byte super.send(); } Int8List _bytesForValue(int value) { print("bytes for value $value"); var bytes = Int8List(5); int absValue = value.abs(); int base256 = (absValue ~/ 256); int left = absValue - (base256 * 256); int base1 = left % 128; left -= base1; int base2 = left ~/ 2; if (value < 0) { bytes[0] = 0x7F; bytes[1] = 0x7F; bytes[2] = 0x7F - base256; bytes[3] = 0x7F - base2; bytes[4] = 0x7F - base1; } else { bytes[2] = base256; bytes[3] = base2; bytes[4] = base1; } return bytes; } } /// NRPN Message class NRPNMessage extends MidiMessage { int channel = 0; int parameter = 0; int value = 0; NRPNMessage({this.channel = 0, this.parameter = 0, this.value = 0}); @override void send() { data = Uint8List(12); // Data Entry MSB data[0] = 0xB0 + channel; data[1] = 0x63; data[2] = parameter ~/ 128; // Data Entry LSB data[3] = 0xB0 + channel; data[4] = 0x62; data[5] = parameter - (data[2] * 128); // Data Value MSB data[6] = 0xB0 + channel; data[7] = 0x06; data[8] = value & 0x7F; // Data Value LSB data[9] = 0xB0 + channel; data[10] = 0x38; data[11] = value & 0x3F80; super.send(); } } /// NRPN Message with data separated in MSB, LSB class NRPNHexMessage extends MidiMessage { int channel = 0; int parameterMSB = 0; int parameterLSB = 0; int valueMSB = 0; int valueLSB = -1; NRPNHexMessage({ this.channel = 0, this.parameterMSB = 0, this.parameterLSB = 0, this.valueMSB = 0, this.valueLSB = 0, }); @override void send() { var length = valueLSB > -1 ? 12 : 9; data = Uint8List(length); // Data Entry MSB data[0] = 0xB0 + channel; data[1] = 0x63; data[2] = parameterMSB; // Data Entry LSB data[3] = 0xB0 + channel; data[4] = 0x62; data[5] = parameterLSB; // Data Value MSB data[6] = 0xB0 + channel; data[7] = 0x06; data[8] = valueMSB; // Data Value LSB if (valueLSB > -1) { data[9] = 0xB0 + channel; data[10] = 0x38; data[11] = valueLSB; } super.send(); } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/macos/Classes/SwiftFlutterMidiCommandPlugin.swift ================================================ #if os(macOS) import FlutterMacOS #else import Flutter #endif import CoreMIDI import os.log import CoreBluetooth import Foundation /// /// Credit to /// http://mattg411.com/coremidi-swift-programming/ /// https://github.com/genedelisa/Swift3MIDI /// http://www.gneuron.com/?p=96 /// https://learn.sparkfun.com/tutorials/midi-ble-tutorial/all public class SwiftFlutterMidiCommandPlugin: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate, FlutterPlugin { // MIDI var midiClient = MIDIClientRef() var connectedDevices = Dictionary() // Flutter var midiRXChannel:FlutterEventChannel? var rxStreamHandler = StreamHandler() var midiSetupChannel:FlutterEventChannel? var setupStreamHandler = StreamHandler() #if os(iOS) // Network Session var session:MIDINetworkSession? #endif // BLE var manager:CBCentralManager! var discoveredDevices:Set = [] let midiLog = OSLog(subsystem: "com.invisiblewrench.FlutterMidiCommand", category: "MIDI") public static func register(with registrar: FlutterPluginRegistrar) { #if os(macOS) let channel = FlutterMethodChannel(name: "plugins.invisiblewrench.com/flutter_midi_command", binaryMessenger: registrar.messenger) #else let channel = FlutterMethodChannel(name: "plugins.invisiblewrench.com/flutter_midi_command", binaryMessenger: registrar.messenger()) #endif let instance = SwiftFlutterMidiCommandPlugin() registrar.addMethodCallDelegate(instance, channel: channel) instance.setup(registrar) } deinit { NotificationCenter.default.removeObserver(self) MIDIClientDispose(midiClient) } func setup(_ registrar: FlutterPluginRegistrar) { // Stream setup #if os(macOS) midiRXChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/rx_channel", binaryMessenger: registrar.messenger) #else midiRXChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/rx_channel", binaryMessenger: registrar.messenger()) #endif midiRXChannel?.setStreamHandler(rxStreamHandler) #if os(macOS) midiSetupChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/setup_channel", binaryMessenger: registrar.messenger) #else midiSetupChannel = FlutterEventChannel(name: "plugins.invisiblewrench.com/flutter_midi_command/setup_channel", binaryMessenger: registrar.messenger()) #endif midiSetupChannel?.setStreamHandler(setupStreamHandler) // MIDI client with notification handler MIDIClientCreateWithBlock("plugins.invisiblewrench.com.FlutterMidiCommand" as CFString, &midiClient) { (notification) in self.handleMIDINotification(notification) } manager = CBCentralManager.init(delegate: self, queue: DispatchQueue.global(qos: .userInteractive)) #if os(iOS) session = MIDINetworkSession.default() session?.isEnabled = true session?.connectionPolicy = MIDINetworkConnectionPolicy.anyone #endif } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { // print("call method \(call.method)") switch call.method { case "scanForDevices": print("\(manager.state.rawValue)") if manager.state == CBManagerState.poweredOn { print("Start discovery") discoveredDevices.removeAll() manager.scanForPeripherals(withServices: [CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")], options: nil) result(nil) } else { print("BT not ready") result(FlutterError(code: "MESSAGEERROR", message: "bluetoothNotAvailable", details: call.arguments)) } break case "stopScanForDevices": manager.stopScan() break case "getDevices": let devices = getDevices() print("--- devices ---\n\(devices)") result(devices) break case "connectToDevice": if let args = call.arguments as? Dictionary { if let deviceInfo = args["device"] as? Dictionary { if let deviceId = deviceInfo["id"] as? String { if connectedDevices[deviceId] != nil { result(FlutterError.init(code: "MESSAGEERROR", message: "Device already connected", details: call.arguments)) } else { connectToDevice(deviceId: deviceInfo["id"] as! String, type: deviceInfo["type"] as! String, ports: nil) } result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "No device Id", details: deviceInfo)) } } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse deviceInfo", details: call.arguments)) } } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse args", details: call.arguments)) } break case "disconnectDevice": if let deviceInfo = call.arguments as? Dictionary { if let deviceId = deviceInfo["id"] as? String { disconnectDevice(deviceId: deviceId) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "No device Id", details: call.arguments)) } result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not parse device id", details: call.arguments)) } result(nil) break case "sendData": if let packet = call.arguments as? Dictionary { sendData(packet["data"] as! FlutterStandardTypedData, deviceId: packet["deviceId"] as? String, timestamp: packet["timestamp"] as? UInt64) result(nil) } else { result(FlutterError.init(code: "MESSAGEERROR", message: "Could not form midi packet", details: call.arguments)) } break case "teardown": teardown() break default: result(FlutterMethodNotImplemented) } } func teardown() { for device in connectedDevices { disconnectDevice(deviceId: device.value.id) } #if os(iOS) session?.isEnabled = false #endif } func connectToDevice(deviceId:String, type:String, ports:[Port]?) { print("connect \(deviceId) \(type)") if type == "BLE" { if let periph = discoveredDevices.filter({ (p) -> Bool in p.identifier.uuidString == deviceId }).first { let device = ConnectedBLEDevice(id: deviceId, type: type, streamHandler: rxStreamHandler, peripheral: periph, ports:ports) connectedDevices[deviceId] = device manager.stopScan() manager.connect(periph, options: nil) } else { print("error connecting to device \(deviceId) [\(type)]") } } else if type == "native" { let device = ConnectedNativeDevice(id: deviceId, type: type, streamHandler: rxStreamHandler, client: midiClient, ports:ports) connectedDevices[deviceId] = device setupStreamHandler.send(data: "deviceConnected") } } func disconnectDevice(deviceId:String) { let device = connectedDevices[deviceId] print("disconnect \(String(describing: device)) for id \(deviceId)") if let device = device { if device.deviceType == "BLE" { //let p = (device as! ConnectedBLEDevice).peripheral //manager.cancelPeripheralConnection(p) device.close() } else { print("disconmmected MIDI") device.close() setupStreamHandler.send(data: "deviceDisconnected") } connectedDevices.removeValue(forKey: deviceId) } } func sendData(_ data:FlutterStandardTypedData, deviceId: String?, timestamp: UInt64?) { let bytes = [UInt8](data.data) if let deviceId = deviceId { if let device = connectedDevices[deviceId] { device.send(bytes: bytes, timestamp: timestamp) // _sendDataToDevice(device: device, data: data, timestamp: timestamp) } } else { connectedDevices.values.forEach({ (device) in device.send(bytes: bytes, timestamp: timestamp) // _sendDataToDevice(device: device, data: data, timestamp: timestamp) }) } } static func getMIDIProperty(_ prop:CFString, fromObject obj:MIDIObjectRef) -> String { var param: Unmanaged? var result: String = "Error" let err: OSStatus = MIDIObjectGetStringProperty(obj, prop, ¶m) if err == OSStatus(noErr) { result = param!.takeRetainedValue() as String } return result } func createPortDict(count:Int) -> Array> { return (0.. Dictionary in return ["id": id, "connected" : false] } } func getDevices() -> [Dictionary] { var devices:[Dictionary] = [] // Native var nativeDevices = Dictionary>() let destinationCount = MIDIGetNumberOfDestinations() for d in 0..) { print("\ngot a MIDINotification!") let notification = midiNotification.pointee print("MIDI Notify, messageId= \(notification.messageID)") print("MIDI Notify, messageSize= \(notification.messageSize)") setupStreamHandler.send(data: "\(notification.messageID)") switch notification.messageID { // Some aspect of the current MIDISetup has changed. No data. Should ignore this message if messages 2-6 are handled. case .msgSetupChanged: print("MIDI setup changed") let ptr = UnsafeMutablePointer(mutating: midiNotification) // let ptr = UnsafeMutablePointer(midiNotification) let m = ptr.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") break // A device, entity or endpoint was added. Structure is MIDIObjectAddRemoveNotification. case .msgObjectAdded: print("added") // let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIObjectAddRemoveNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("child \(m.child)") print("child type \(m.childType)") showMIDIObjectType(m.childType) print("parent \(m.parent)") print("parentType \(m.parentType)") showMIDIObjectType(m.parentType) // print("childName \(String(describing: getDisplayName(m.child)))") } break // A device, entity or endpoint was removed. Structure is MIDIObjectAddRemoveNotification. case .msgObjectRemoved: print("kMIDIMsgObjectRemoved") // let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIObjectAddRemoveNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("child \(m.child)") print("child type \(m.childType)") print("parent \(m.parent)") print("parentType \(m.parentType)") // print("childName \(String(describing: getDisplayName(m.child)))") } break // An object's property was changed. Structure is MIDIObjectPropertyChangeNotification. case .msgPropertyChanged: print("kMIDIMsgPropertyChanged") midiNotification.withMemoryRebound(to: MIDIObjectPropertyChangeNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("object \(m.object)") print("objectType \(m.objectType)") print("propertyName \(m.propertyName)") print("propertyName \(m.propertyName.takeUnretainedValue())") if m.propertyName.takeUnretainedValue() as String == "apple.midirtp.session" { print("connected") } } break // A persistent MIDI Thru connection wasor destroyed. No data. case .msgThruConnectionsChanged: print("MIDI thru connections changed.") break //A persistent MIDI Thru connection was created or destroyed. No data. case .msgSerialPortOwnerChanged: print("MIDI serial port owner changed.") break case .msgIOError: print("MIDI I/O error.") //let ptr = UnsafeMutablePointer(midiNotification) midiNotification.withMemoryRebound(to: MIDIIOErrorNotification.self, capacity: 1) { let m = $0.pointee print(m) print("id \(m.messageID)") print("size \(m.messageSize)") print("driverDevice \(m.driverDevice)") print("errorCode \(m.errorCode)") } break @unknown default: break } } func showMIDIObjectType(_ ot: MIDIObjectType) { switch ot { case .other: os_log("midiObjectType: Other", log: midiLog, type: .debug) break case .device: os_log("midiObjectType: Device", log: midiLog, type: .debug) break case .entity: os_log("midiObjectType: Entity", log: midiLog, type: .debug) break case .source: os_log("midiObjectType: Source", log: midiLog, type: .debug) break case .destination: os_log("midiObjectType: Destination", log: midiLog, type: .debug) break case .externalDevice: os_log("midiObjectType: ExternalDevice", log: midiLog, type: .debug) break case .externalEntity: print("midiObjectType: ExternalEntity") os_log("midiObjectType: ExternalEntity", log: midiLog, type: .debug) break case .externalSource: os_log("midiObjectType: ExternalSource", log: midiLog, type: .debug) break case .externalDestination: os_log("midiObjectType: ExternalDestination", log: midiLog, type: .debug) break @unknown default: break } } #if os(iOS) /// MIDI Network Session @objc func midiNetworkChanged(notification:NSNotification) { print("\(#function)") print("\(notification)") if let session = notification.object as? MIDINetworkSession { print("session \(session)") for con in session.connections() { print("con \(con)") } print("isEnabled \(session.isEnabled)") print("sourceEndpoint \(session.sourceEndpoint())") print("destinationEndpoint \(session.destinationEndpoint())") print("networkName \(session.networkName)") print("localName \(session.localName)") // if let name = getDeviceName(session.sourceEndpoint()) { // print("source name \(name)") // } // // if let name = getDeviceName(session.destinationEndpoint()) { // print("destination name \(name)") // } } setupStreamHandler.send(data: "\(#function) \(notification)") } @objc func midiNetworkContactsChanged(notification:NSNotification) { print("\(#function)") print("\(notification)") if let session = notification.object as? MIDINetworkSession { print("session \(session)") for con in session.contacts() { print("contact \(con)") } } setupStreamHandler.send(data: "\(#function) \(notification)") } #endif /// BLE handling // Central public func centralManagerDidUpdateState(_ central: CBCentralManager) { print("central did update state \(central.state.rawValue)") } public func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { print("central didDiscover \(peripheral)") if !discoveredDevices.contains(peripheral) { discoveredDevices.insert(peripheral) setupStreamHandler.send(data: "deviceFound") } } public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { print("central did connect \(peripheral)") // connectedPeripheral = peripheral // peripheral.delegate = self // peripheral.discoverServices([CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")]) setupStreamHandler.send(data: "deviceConnected") (connectedDevices[peripheral.identifier.uuidString] as! ConnectedBLEDevice).setupBLE() } public func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { print("central did fail to connect state \(peripheral)") // connectingDevice = nil setupStreamHandler.send(data: "connectionFailed") connectedDevices.removeValue(forKey: peripheral.identifier.uuidString) } public func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) { print("central didDisconnectPeripheral \(peripheral)") // connectedPeripheral = nil // connectedCharacteristic = nil setupStreamHandler.send(data: "deviceDisconnected") } } class StreamHandler : NSObject, FlutterStreamHandler { var sink:FlutterEventSink? func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? { sink = events return nil } func onCancel(withArguments arguments: Any?) -> FlutterError? { sink = nil return nil } func send(data: Any) { if let sink = sink { sink(data) // } else { // print("no sink") } } } class Port { var id:Int var type:String init(id:Int, type:String) { self.id = id; self.type = type } } class ConnectedDevice : NSObject { var id:String var deviceType:String var streamHandler : StreamHandler init(id:String, type:String, streamHandler:StreamHandler) { self.id = id self.deviceType = type self.streamHandler = streamHandler } func openPorts() {} func send(bytes:[UInt8], timestamp: UInt64?) {} func close() {} } class ConnectedNativeDevice : ConnectedDevice { var outputPort = MIDIPortRef() var inputPort = MIDIPortRef() var client : MIDIClientRef var name : String? var outEndpoint : MIDIEndpointRef? var inSource : MIDIEndpointRef? var entity : MIDIEntityRef? var ports:[Port]? init(id:String, type:String, streamHandler:StreamHandler, client: MIDIClientRef, ports:[Port]?) { self.client = client self.ports = ports let idParts = id.split(separator: ":") // Store entity and get device/entity name if let deviceId = MIDIDeviceRef(idParts[0]) { if let entityId = Int(idParts[1]) { entity = MIDIDeviceGetEntity(deviceId, entityId) if let e = entity { let entityName = SwiftFlutterMidiCommandPlugin.getMIDIProperty(kMIDIPropertyName, fromObject: e) var device:MIDIDeviceRef = 0 MIDIEntityGetDevice(e, &device) let deviceName = SwiftFlutterMidiCommandPlugin.getMIDIProperty(kMIDIPropertyName, fromObject: device) name = "\(deviceName) \(entityName)" } else { print("no entity") } } else { print("no entityId") } } else { print("no deviceId") } super.init(id: id, type: type, streamHandler: streamHandler) // MIDI Input with handler MIDIInputPortCreateWithBlock(client, "FlutterMidiCommand_InPort" as CFString, &inputPort) { (packetList, srcConnRefCon) in self.handlePacketList(packetList, srcConnRefCon: srcConnRefCon) } // MIDI output MIDIOutputPortCreate(client, "FlutterMidiCommand_OutPort" as CFString, &outputPort); openPorts() } override func send(bytes: [UInt8], timestamp: UInt64?) { if let ep = outEndpoint { let packetList = UnsafeMutablePointer.allocate(capacity: 1) var packet = MIDIPacketListInit(packetList) let time = timestamp ?? mach_absolute_time() packet = MIDIPacketListAdd(packetList, 1024, packet, time, bytes.count, bytes) let status = MIDISend(outputPort, ep, packetList) //print("send bytes \(bytes) on port \(outputPort) \(ep) status \(status)") packetList.deallocate() } else { print("No MIDI destination for id \(name!)") } } override func openPorts() { print("open native ports") if let e = entity { if let ps = ports { for port in ps { inSource = MIDIEntityGetSource(e, port.id) switch port.type { case "MidiPortType.IN": let status = MIDIPortConnectSource(inputPort, inSource!, &name) print("port open status \(status)") case "MidiPortType.OUT": outEndpoint = MIDIEntityGetDestination(e, port.id) // print("port endpoint \(endpoint)") break default: print("unknown port type \(port.type)") } } } else { print("open default ports") inSource = MIDIEntityGetSource(e, 0) let status = MIDIPortConnectSource(inputPort, inSource!, &name) outEndpoint = MIDIEntityGetDestination(e, 0) } } } override func close() { if let oEP = outEndpoint { MIDIEndpointDispose(oEP) } if let iS = inSource { MIDIPortDisconnectSource(inputPort, iS) } MIDIPortDispose(inputPort) MIDIPortDispose(outputPort) } func handlePacketList(_ packetList:UnsafePointer, srcConnRefCon:UnsafeMutableRawPointer?) { let packets = packetList.pointee let packet:MIDIPacket = packets.packet var ap = UnsafeMutablePointer.allocate(capacity: 1) ap.initialize(to:packet) let deviceInfo = ["name" : name, "id": String(id), "type":"native"] for _ in 0 ..< packets.numPackets { let p = ap.pointee var tmp = p.data let data = Data(bytes: &tmp, count: Int(p.length)) let timestamp = p.timeStamp // print("data \(data) timestamp \(timestamp)") streamHandler.send(data: ["data": data, "timestamp":timestamp, "device":deviceInfo]) ap = MIDIPacketNext(ap) } // ap.deallocate() } } class ConnectedBLEDevice : ConnectedDevice, CBPeripheralDelegate { var peripheral:CBPeripheral var characteristic:CBCharacteristic? // BLE MIDI parsing enum BLE_HANDLER_STATE { case HEADER case TIMESTAMP case STATUS case STATUS_RUNNING case PARAMS case SYSTEM_RT case SYSEX case SYSEX_END case SYSEX_INT } var bleHandlerState = BLE_HANDLER_STATE.HEADER var sysExBuffer: [UInt8] = [] var timestamp: UInt64 = 0 var bleMidiBuffer:[UInt8] = [] var bleMidiPacketLength:UInt8 = 0 var bleSysExHasFinished = true init(id:String, type:String, streamHandler:StreamHandler, peripheral:CBPeripheral, ports:[Port]?) { self.peripheral = peripheral super.init(id: id, type: type, streamHandler: streamHandler) } func setupBLE() { peripheral.delegate = self peripheral.discoverServices([CBUUID(string: "03B80E5A-EDE8-4B33-A751-6CE34EC4C700")]) } override func close() { CBCentralManager().cancelPeripheralConnection(peripheral) characteristic = nil } override func send(bytes:[UInt8], timestamp: UInt64?) { // print("ble send \(id) \(bytes)") if (characteristic != nil) { let packetSize = 20 var dataBytes = Data(bytes) if bytes.first == 0xF0 && bytes.last == 0xF7 { // this is a sysex message, handle carefully if bytes.count > 17 { // Split into multiple messages of 20 bytes total // First packet var packet = dataBytes.subdata(in: 0.. 0 { print("count \(dataBytes.count)") let pickCount = min(dataBytes.count, packetSize-1) // print("pickCount \(pickCount)") packet = dataBytes.subdata(in: 0.. packetSize-2) { dataBytes = dataBytes.advanced(by: pickCount) // Advance buffer } else { print("done") return } } } else { // Insert timestamp low in front of Sysex End-byte dataBytes.insert(0x80, at: bytes.count-1) // Insert header(and empty timstamp high) and timestamp low in front of BLE Midi message dataBytes.insert(0x80, at: 0) dataBytes.insert(0x80, at: 0) peripheral.writeValue(dataBytes, for: characteristic!, type: CBCharacteristicWriteType.withoutResponse) } return } // Insert header(and empty timstamp high) and timestamp low in front of BLE Midi message dataBytes.insert(0x80, at: 0) dataBytes.insert(0x80, at: 0) peripheral.writeValue(dataBytes, for: characteristic!, type: CBCharacteristicWriteType.withoutResponse) } else { print("No peripheral/characteristic in device") } } public func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { print("perif didDiscoverServices \(String(describing: peripheral.services))") for service:CBService in peripheral.services! { peripheral.discoverCharacteristics(nil, for: service) } } public func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { print("perif didDiscoverCharacteristicsFor \(String(describing: service.characteristics))") for characteristic:CBCharacteristic in service.characteristics! { if characteristic.uuid.uuidString == "7772E5DB-3868-4112-A1A9-F2669D106BF3" { self.characteristic = characteristic peripheral.setNotifyValue(true, for: characteristic) print("set up characteristic for device") } } } func createMessageEvent(_ bytes:[UInt8], timestamp:UInt64, peripheral:CBPeripheral) { // print("send rx event \(bytes)") let data = Data(bytes: bytes, count: Int(bytes.count)) streamHandler.send(data: ["data": data, "timestamp":timestamp, "device":[ "name" : peripheral.name ?? "-", "id":peripheral.identifier.uuidString, "type":"BLE"]]) } public func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { // print("perif didUpdateValueFor \(String(describing: characteristic))") if let value = characteristic.value { parseBLEPacket(value, peripheral:peripheral) } } func parseBLEPacket(_ packet:Data, peripheral:CBPeripheral) -> Void { // print("parse \(packet)") if (packet.count > 1) { // parse BLE message bleHandlerState = BLE_HANDLER_STATE.HEADER let header = packet[0] var statusByte:UInt8 = 0 for i in 1...packet.count-1 { let midiByte:UInt8 = packet[i] // print ("bleHandlerState \(bleHandlerState) byte \(midiByte)") if ((midiByte & 0x80) == 0x80 && bleHandlerState != BLE_HANDLER_STATE.TIMESTAMP && bleHandlerState != BLE_HANDLER_STATE.SYSEX_INT) { if (!bleSysExHasFinished) { bleHandlerState = BLE_HANDLER_STATE.SYSEX_INT } else { bleHandlerState = BLE_HANDLER_STATE.TIMESTAMP } } else { // State handling switch (bleHandlerState) { case BLE_HANDLER_STATE.HEADER: if (!bleSysExHasFinished) { if ((midiByte & 0x80) == 0x80) { // System messages can interrupt ongoing sysex bleHandlerState = BLE_HANDLER_STATE.SYSEX_INT } else { // Sysex continue //print("sysex continue") bleHandlerState = BLE_HANDLER_STATE.SYSEX } } break case BLE_HANDLER_STATE.TIMESTAMP: if ((midiByte & 0xFF) == 0xF0) { // Sysex start bleSysExHasFinished = false sysExBuffer.removeAll() bleHandlerState = BLE_HANDLER_STATE.SYSEX } else if ((midiByte & 0x80) == 0x80) { // Status/System start bleHandlerState = BLE_HANDLER_STATE.STATUS } else { bleHandlerState = BLE_HANDLER_STATE.STATUS_RUNNING } break case BLE_HANDLER_STATE.STATUS: bleHandlerState = BLE_HANDLER_STATE.PARAMS break case BLE_HANDLER_STATE.STATUS_RUNNING: bleHandlerState = BLE_HANDLER_STATE.PARAMS break; case BLE_HANDLER_STATE.PARAMS: // After params can come TSlow or more params break case BLE_HANDLER_STATE.SYSEX: break case BLE_HANDLER_STATE.SYSEX_INT: if ((midiByte & 0xF7) == 0xF7) { // Sysex end // print("sysex end") bleSysExHasFinished = true bleHandlerState = BLE_HANDLER_STATE.SYSEX_END } else { bleHandlerState = BLE_HANDLER_STATE.SYSTEM_RT } break; case BLE_HANDLER_STATE.SYSTEM_RT: if (!bleSysExHasFinished) { // Continue incomplete Sysex bleHandlerState = BLE_HANDLER_STATE.SYSEX } break default: print ("Unhandled state \(bleHandlerState)") break } } // print ("\(bleHandlerState) - \(midiByte) [\(String(format:"%02X", midiByte))]") // Data handling switch (bleHandlerState) { case BLE_HANDLER_STATE.TIMESTAMP: // print ("set timestamp") let tsHigh = header & 0x3f let tsLow = midiByte & 0x7f timestamp = UInt64(tsHigh) << 7 | UInt64(tsLow) // print ("timestamp is \(timestamp)") break case BLE_HANDLER_STATE.STATUS: bleMidiPacketLength = lengthOfMessageType(midiByte) // print("message length \(bleMidiPacketLength)") bleMidiBuffer.removeAll() bleMidiBuffer.append(midiByte) if bleMidiPacketLength == 1 { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) // TODO Add timestamp } else { // print ("set status") statusByte = midiByte } break case BLE_HANDLER_STATE.STATUS_RUNNING: // print("set running status") bleMidiPacketLength = lengthOfMessageType(statusByte) bleMidiBuffer.removeAll() bleMidiBuffer.append(statusByte) bleMidiBuffer.append(midiByte) if bleMidiPacketLength == 2 { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) } break case BLE_HANDLER_STATE.PARAMS: // print ("add param \(midiByte)") bleMidiBuffer.append(midiByte) if bleMidiPacketLength == bleMidiBuffer.count { createMessageEvent(bleMidiBuffer, timestamp: timestamp, peripheral:peripheral) bleMidiBuffer.removeLast(Int(bleMidiPacketLength)-1) // Remove all but status, which might be used for running msgs } break case BLE_HANDLER_STATE.SYSTEM_RT: // print("handle RT") createMessageEvent([midiByte], timestamp: timestamp, peripheral:peripheral) break case BLE_HANDLER_STATE.SYSEX: // print("add sysex") sysExBuffer.append(midiByte) break case BLE_HANDLER_STATE.SYSEX_INT: // print("sysex int") break case BLE_HANDLER_STATE.SYSEX_END: // print("finalize sysex") sysExBuffer.append(midiByte) createMessageEvent(sysExBuffer, timestamp: 0, peripheral:peripheral) break default: print ("Unhandled state (data) \(bleHandlerState)") break } } } } func lengthOfMessageType(_ type:UInt8) -> UInt8 { let midiType:UInt8 = type & 0xF0 switch (type) { case 0xF6, 0xF8, 0xFA, 0xFB, 0xFC, 0xFF, 0xFE: return 1 case 0xF1, 0xF3: return 2 default: break } switch (midiType) { case 0xC0, 0xD0: return 2 case 0xF2, 0x80, 0x90, 0xA0, 0xB0, 0xE0: return 3 default: break } return 0 } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/macos/flutter_midi_command.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint flutter_midi_command.podspec' to validate before publishing. # Pod::Spec.new do |s| s.name = 'flutter_midi_command' s.version = '0.0.1' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A new flutter plugin project. DESC s.homepage = 'https://github.com/InvisibleWrench/FlutterMidiCommand' s.license = { :file => '../LICENSE' } s.author = { 'Invisible Wrench' => 'hello@invisiblewrench.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' s.platform = :osx, '10.13' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' end ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/pubspec.yaml ================================================ name: flutter_midi_command description: A Flutter plugin for sending and receiving MIDI messages between Flutter and physical and virtual MIDI devices. Wraps CoreMIDI and android.media.midi in a thin dart/flutter layer. version: 0.3.7 homepage: https://github.com/InvisibleWrench/FlutterMidiCommand publish_to: none environment: sdk: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # This section identifies this Flutter project as a plugin project. # The 'pluginClass' and Android 'package' identifiers should not ordinarily # be modified. They are used by the tooling to maintain consistency when # adding or updating assets for this project. plugin: platforms: android: package: com.invisiblewrench.fluttermidicommand pluginClass: FlutterMidiCommandPlugin ios: pluginClass: FlutterMidiCommandPlugin macos: pluginClass: SwiftFlutterMidiCommandPlugin linux: default_package: flutter_midi_command_linux dependencies: flutter: sdk: flutter flutter_midi_command_platform_interface: path: ../flutter_midi_command_platform_interface-0.3.3 flutter_midi_command_linux: path: ../flutter_midi_command_linux-0.1.3 dev_dependencies: flutter_test: sdk: flutter # To add assets to your plugin package, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # # For details regarding assets in packages, see # https://flutter.dev/assets-and-images/#from-packages # # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # To add custom fonts to your plugin package, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts in packages, see # https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command-0.3.7/test/flutter_midi_command_test.dart ================================================ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { const MethodChannel channel = MethodChannel('fluttermidicommand'); TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { channel.setMockMethodCallHandler((MethodCall methodCall) async { return '42'; }); }); tearDown(() { channel.setMockMethodCallHandler(null); }); test('getPlatformVersion', () async { // expect(await MidiCommand.platformVersion, '42'); }); } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/.gitignore ================================================ .DS_Store .dart_tool/ .packages .pub/ pubspec.lock build/ pubspec.lock ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled and should not be manually edited. version: revision: 8b3760638a189741cd9ca881aa2dd237c1df1be5 channel: beta project_type: plugin ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/.vscode/c_cpp_properties.json ================================================ { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "gnu18", "cppStandard": "gnu++14", "intelliSenseMode": "gcc-x64" } ], "version": 4 } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/.vscode/launch.json ================================================ { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "flutter_midi_command_linux", "request": "launch", "type": "dart" } ] } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/.vscode/settings.json ================================================ { "cmake.configureOnOpen": true } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/CHANGELOG.md ================================================ ## 0.1.3 Fixed buffer allocation ## 0.1.2 Isolate port close ## 0.1.1 Fixed notification on device disconnect ## 0.1.0 First release with linux support ## 0.0.1 Initial Linux support ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/LICENSE ================================================ Copyright 2020 InvisibleWrench. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/README.md ================================================ # flutter_midi_command_linux A new Flutter plugin. ## Getting Started This project is a starting point for a Flutter [plug-in package](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS. For help getting started with Flutter, view our [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/lib/alsa_generated_bindings.dart ================================================ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; class ALSA { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) _lookup; /// The symbols are looked up in [dynamicLibrary]. ALSA(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. ALSA.fromLookup( ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; int access( ffi.Pointer __name, int __type, ) { return _access( __name, __type, ); } late final _access_ptr = _lookup>('access'); late final _dart_access _access = _access_ptr.asFunction<_dart_access>(); int faccessat( int __fd, ffi.Pointer __file, int __type, int __flag, ) { return _faccessat( __fd, __file, __type, __flag, ); } late final _faccessat_ptr = _lookup>('faccessat'); late final _dart_faccessat _faccessat = _faccessat_ptr.asFunction<_dart_faccessat>(); int lseek( int __fd, int __offset, int __whence, ) { return _lseek( __fd, __offset, __whence, ); } late final _lseek_ptr = _lookup>('lseek'); late final _dart_lseek _lseek = _lseek_ptr.asFunction<_dart_lseek>(); int close( int __fd, ) { return _close( __fd, ); } late final _close_ptr = _lookup>('close'); late final _dart_close _close = _close_ptr.asFunction<_dart_close>(); int read( int __fd, ffi.Pointer __buf, int __nbytes, ) { return _read( __fd, __buf, __nbytes, ); } late final _read_ptr = _lookup>('read'); late final _dart_read _read = _read_ptr.asFunction<_dart_read>(); int write( int __fd, ffi.Pointer __buf, int __n, ) { return _write( __fd, __buf, __n, ); } late final _write_ptr = _lookup>('write'); late final _dart_write _write = _write_ptr.asFunction<_dart_write>(); int pread( int __fd, ffi.Pointer __buf, int __nbytes, int __offset, ) { return _pread( __fd, __buf, __nbytes, __offset, ); } late final _pread_ptr = _lookup>('pread'); late final _dart_pread _pread = _pread_ptr.asFunction<_dart_pread>(); int pwrite( int __fd, ffi.Pointer __buf, int __n, int __offset, ) { return _pwrite( __fd, __buf, __n, __offset, ); } late final _pwrite_ptr = _lookup>('pwrite'); late final _dart_pwrite _pwrite = _pwrite_ptr.asFunction<_dart_pwrite>(); int pipe( ffi.Pointer __pipedes, ) { return _pipe( __pipedes, ); } late final _pipe_ptr = _lookup>('pipe'); late final _dart_pipe _pipe = _pipe_ptr.asFunction<_dart_pipe>(); int alarm( int __seconds, ) { return _alarm( __seconds, ); } late final _alarm_ptr = _lookup>('alarm'); late final _dart_alarm _alarm = _alarm_ptr.asFunction<_dart_alarm>(); int sleep( int __seconds, ) { return _sleep( __seconds, ); } late final _sleep_ptr = _lookup>('sleep'); late final _dart_sleep _sleep = _sleep_ptr.asFunction<_dart_sleep>(); int ualarm( int __value, int __interval, ) { return _ualarm( __value, __interval, ); } late final _ualarm_ptr = _lookup>('ualarm'); late final _dart_ualarm _ualarm = _ualarm_ptr.asFunction<_dart_ualarm>(); int usleep( int __useconds, ) { return _usleep( __useconds, ); } late final _usleep_ptr = _lookup>('usleep'); late final _dart_usleep _usleep = _usleep_ptr.asFunction<_dart_usleep>(); int pause() { return _pause(); } late final _pause_ptr = _lookup>('pause'); late final _dart_pause _pause = _pause_ptr.asFunction<_dart_pause>(); int chown( ffi.Pointer __file, int __owner, int __group, ) { return _chown( __file, __owner, __group, ); } late final _chown_ptr = _lookup>('chown'); late final _dart_chown _chown = _chown_ptr.asFunction<_dart_chown>(); int fchown( int __fd, int __owner, int __group, ) { return _fchown( __fd, __owner, __group, ); } late final _fchown_ptr = _lookup>('fchown'); late final _dart_fchown _fchown = _fchown_ptr.asFunction<_dart_fchown>(); int lchown( ffi.Pointer __file, int __owner, int __group, ) { return _lchown( __file, __owner, __group, ); } late final _lchown_ptr = _lookup>('lchown'); late final _dart_lchown _lchown = _lchown_ptr.asFunction<_dart_lchown>(); int fchownat( int __fd, ffi.Pointer __file, int __owner, int __group, int __flag, ) { return _fchownat( __fd, __file, __owner, __group, __flag, ); } late final _fchownat_ptr = _lookup>('fchownat'); late final _dart_fchownat _fchownat = _fchownat_ptr.asFunction<_dart_fchownat>(); int chdir( ffi.Pointer __path, ) { return _chdir( __path, ); } late final _chdir_ptr = _lookup>('chdir'); late final _dart_chdir _chdir = _chdir_ptr.asFunction<_dart_chdir>(); int fchdir( int __fd, ) { return _fchdir( __fd, ); } late final _fchdir_ptr = _lookup>('fchdir'); late final _dart_fchdir _fchdir = _fchdir_ptr.asFunction<_dart_fchdir>(); ffi.Pointer getcwd( ffi.Pointer __buf, int __size, ) { return _getcwd( __buf, __size, ); } late final _getcwd_ptr = _lookup>('getcwd'); late final _dart_getcwd _getcwd = _getcwd_ptr.asFunction<_dart_getcwd>(); ffi.Pointer getwd( ffi.Pointer __buf, ) { return _getwd( __buf, ); } late final _getwd_ptr = _lookup>('getwd'); late final _dart_getwd _getwd = _getwd_ptr.asFunction<_dart_getwd>(); int dup( int __fd, ) { return _dup( __fd, ); } late final _dup_ptr = _lookup>('dup'); late final _dart_dup _dup = _dup_ptr.asFunction<_dart_dup>(); int dup2( int __fd, int __fd2, ) { return _dup2( __fd, __fd2, ); } late final _dup2_ptr = _lookup>('dup2'); late final _dart_dup2 _dup2 = _dup2_ptr.asFunction<_dart_dup2>(); late final ffi.Pointer>> ___environ = _lookup>>('__environ'); ffi.Pointer> get __environ => ___environ.value; set __environ(ffi.Pointer> value) => ___environ.value = value; int execve( ffi.Pointer __path, ffi.Pointer> __argv, ffi.Pointer> __envp, ) { return _execve( __path, __argv, __envp, ); } late final _execve_ptr = _lookup>('execve'); late final _dart_execve _execve = _execve_ptr.asFunction<_dart_execve>(); int fexecve( int __fd, ffi.Pointer> __argv, ffi.Pointer> __envp, ) { return _fexecve( __fd, __argv, __envp, ); } late final _fexecve_ptr = _lookup>('fexecve'); late final _dart_fexecve _fexecve = _fexecve_ptr.asFunction<_dart_fexecve>(); int execv( ffi.Pointer __path, ffi.Pointer> __argv, ) { return _execv( __path, __argv, ); } late final _execv_ptr = _lookup>('execv'); late final _dart_execv _execv = _execv_ptr.asFunction<_dart_execv>(); int execle( ffi.Pointer __path, ffi.Pointer __arg, ) { return _execle( __path, __arg, ); } late final _execle_ptr = _lookup>('execle'); late final _dart_execle _execle = _execle_ptr.asFunction<_dart_execle>(); int execl( ffi.Pointer __path, ffi.Pointer __arg, ) { return _execl( __path, __arg, ); } late final _execl_ptr = _lookup>('execl'); late final _dart_execl _execl = _execl_ptr.asFunction<_dart_execl>(); int execvp( ffi.Pointer __file, ffi.Pointer> __argv, ) { return _execvp( __file, __argv, ); } late final _execvp_ptr = _lookup>('execvp'); late final _dart_execvp _execvp = _execvp_ptr.asFunction<_dart_execvp>(); int execlp( ffi.Pointer __file, ffi.Pointer __arg, ) { return _execlp( __file, __arg, ); } late final _execlp_ptr = _lookup>('execlp'); late final _dart_execlp _execlp = _execlp_ptr.asFunction<_dart_execlp>(); int nice( int __inc, ) { return _nice( __inc, ); } late final _nice_ptr = _lookup>('nice'); late final _dart_nice _nice = _nice_ptr.asFunction<_dart_nice>(); void _exit( int __status, ) { return __exit( __status, ); } late final __exit_ptr = _lookup>('_exit'); late final _dart__exit __exit = __exit_ptr.asFunction<_dart__exit>(); int pathconf( ffi.Pointer __path, int __name, ) { return _pathconf( __path, __name, ); } late final _pathconf_ptr = _lookup>('pathconf'); late final _dart_pathconf _pathconf = _pathconf_ptr.asFunction<_dart_pathconf>(); int fpathconf( int __fd, int __name, ) { return _fpathconf( __fd, __name, ); } late final _fpathconf_ptr = _lookup>('fpathconf'); late final _dart_fpathconf _fpathconf = _fpathconf_ptr.asFunction<_dart_fpathconf>(); int sysconf( int __name, ) { return _sysconf( __name, ); } late final _sysconf_ptr = _lookup>('sysconf'); late final _dart_sysconf _sysconf = _sysconf_ptr.asFunction<_dart_sysconf>(); int confstr( int __name, ffi.Pointer __buf, int __len, ) { return _confstr( __name, __buf, __len, ); } late final _confstr_ptr = _lookup>('confstr'); late final _dart_confstr _confstr = _confstr_ptr.asFunction<_dart_confstr>(); int getpid() { return _getpid(); } late final _getpid_ptr = _lookup>('getpid'); late final _dart_getpid _getpid = _getpid_ptr.asFunction<_dart_getpid>(); int getppid() { return _getppid(); } late final _getppid_ptr = _lookup>('getppid'); late final _dart_getppid _getppid = _getppid_ptr.asFunction<_dart_getppid>(); int getpgrp() { return _getpgrp(); } late final _getpgrp_ptr = _lookup>('getpgrp'); late final _dart_getpgrp _getpgrp = _getpgrp_ptr.asFunction<_dart_getpgrp>(); int __getpgid( int __pid, ) { return ___getpgid( __pid, ); } late final ___getpgid_ptr = _lookup>('__getpgid'); late final _dart___getpgid ___getpgid = ___getpgid_ptr.asFunction<_dart___getpgid>(); int getpgid( int __pid, ) { return _getpgid( __pid, ); } late final _getpgid_ptr = _lookup>('getpgid'); late final _dart_getpgid _getpgid = _getpgid_ptr.asFunction<_dart_getpgid>(); int setpgid( int __pid, int __pgid, ) { return _setpgid( __pid, __pgid, ); } late final _setpgid_ptr = _lookup>('setpgid'); late final _dart_setpgid _setpgid = _setpgid_ptr.asFunction<_dart_setpgid>(); int setpgrp() { return _setpgrp(); } late final _setpgrp_ptr = _lookup>('setpgrp'); late final _dart_setpgrp _setpgrp = _setpgrp_ptr.asFunction<_dart_setpgrp>(); int setsid() { return _setsid(); } late final _setsid_ptr = _lookup>('setsid'); late final _dart_setsid _setsid = _setsid_ptr.asFunction<_dart_setsid>(); int getsid( int __pid, ) { return _getsid( __pid, ); } late final _getsid_ptr = _lookup>('getsid'); late final _dart_getsid _getsid = _getsid_ptr.asFunction<_dart_getsid>(); int getuid() { return _getuid(); } late final _getuid_ptr = _lookup>('getuid'); late final _dart_getuid _getuid = _getuid_ptr.asFunction<_dart_getuid>(); int geteuid() { return _geteuid(); } late final _geteuid_ptr = _lookup>('geteuid'); late final _dart_geteuid _geteuid = _geteuid_ptr.asFunction<_dart_geteuid>(); int getgid() { return _getgid(); } late final _getgid_ptr = _lookup>('getgid'); late final _dart_getgid _getgid = _getgid_ptr.asFunction<_dart_getgid>(); int getegid() { return _getegid(); } late final _getegid_ptr = _lookup>('getegid'); late final _dart_getegid _getegid = _getegid_ptr.asFunction<_dart_getegid>(); int getgroups( int __size, ffi.Pointer __list, ) { return _getgroups( __size, __list, ); } late final _getgroups_ptr = _lookup>('getgroups'); late final _dart_getgroups _getgroups = _getgroups_ptr.asFunction<_dart_getgroups>(); int setuid( int __uid, ) { return _setuid( __uid, ); } late final _setuid_ptr = _lookup>('setuid'); late final _dart_setuid _setuid = _setuid_ptr.asFunction<_dart_setuid>(); int setreuid( int __ruid, int __euid, ) { return _setreuid( __ruid, __euid, ); } late final _setreuid_ptr = _lookup>('setreuid'); late final _dart_setreuid _setreuid = _setreuid_ptr.asFunction<_dart_setreuid>(); int seteuid( int __uid, ) { return _seteuid( __uid, ); } late final _seteuid_ptr = _lookup>('seteuid'); late final _dart_seteuid _seteuid = _seteuid_ptr.asFunction<_dart_seteuid>(); int setgid( int __gid, ) { return _setgid( __gid, ); } late final _setgid_ptr = _lookup>('setgid'); late final _dart_setgid _setgid = _setgid_ptr.asFunction<_dart_setgid>(); int setregid( int __rgid, int __egid, ) { return _setregid( __rgid, __egid, ); } late final _setregid_ptr = _lookup>('setregid'); late final _dart_setregid _setregid = _setregid_ptr.asFunction<_dart_setregid>(); int setegid( int __gid, ) { return _setegid( __gid, ); } late final _setegid_ptr = _lookup>('setegid'); late final _dart_setegid _setegid = _setegid_ptr.asFunction<_dart_setegid>(); int fork() { return _fork(); } late final _fork_ptr = _lookup>('fork'); late final _dart_fork _fork = _fork_ptr.asFunction<_dart_fork>(); int vfork() { return _vfork(); } late final _vfork_ptr = _lookup>('vfork'); late final _dart_vfork _vfork = _vfork_ptr.asFunction<_dart_vfork>(); ffi.Pointer ttyname( int __fd, ) { return _ttyname( __fd, ); } late final _ttyname_ptr = _lookup>('ttyname'); late final _dart_ttyname _ttyname = _ttyname_ptr.asFunction<_dart_ttyname>(); int ttyname_r( int __fd, ffi.Pointer __buf, int __buflen, ) { return _ttyname_r( __fd, __buf, __buflen, ); } late final _ttyname_r_ptr = _lookup>('ttyname_r'); late final _dart_ttyname_r _ttyname_r = _ttyname_r_ptr.asFunction<_dart_ttyname_r>(); int isatty( int __fd, ) { return _isatty( __fd, ); } late final _isatty_ptr = _lookup>('isatty'); late final _dart_isatty _isatty = _isatty_ptr.asFunction<_dart_isatty>(); int ttyslot() { return _ttyslot(); } late final _ttyslot_ptr = _lookup>('ttyslot'); late final _dart_ttyslot _ttyslot = _ttyslot_ptr.asFunction<_dart_ttyslot>(); int link( ffi.Pointer __from, ffi.Pointer __to, ) { return _link( __from, __to, ); } late final _link_ptr = _lookup>('link'); late final _dart_link _link = _link_ptr.asFunction<_dart_link>(); int linkat( int __fromfd, ffi.Pointer __from, int __tofd, ffi.Pointer __to, int __flags, ) { return _linkat( __fromfd, __from, __tofd, __to, __flags, ); } late final _linkat_ptr = _lookup>('linkat'); late final _dart_linkat _linkat = _linkat_ptr.asFunction<_dart_linkat>(); int symlink( ffi.Pointer __from, ffi.Pointer __to, ) { return _symlink( __from, __to, ); } late final _symlink_ptr = _lookup>('symlink'); late final _dart_symlink _symlink = _symlink_ptr.asFunction<_dart_symlink>(); int readlink( ffi.Pointer __path, ffi.Pointer __buf, int __len, ) { return _readlink( __path, __buf, __len, ); } late final _readlink_ptr = _lookup>('readlink'); late final _dart_readlink _readlink = _readlink_ptr.asFunction<_dart_readlink>(); int symlinkat( ffi.Pointer __from, int __tofd, ffi.Pointer __to, ) { return _symlinkat( __from, __tofd, __to, ); } late final _symlinkat_ptr = _lookup>('symlinkat'); late final _dart_symlinkat _symlinkat = _symlinkat_ptr.asFunction<_dart_symlinkat>(); int readlinkat( int __fd, ffi.Pointer __path, ffi.Pointer __buf, int __len, ) { return _readlinkat( __fd, __path, __buf, __len, ); } late final _readlinkat_ptr = _lookup>('readlinkat'); late final _dart_readlinkat _readlinkat = _readlinkat_ptr.asFunction<_dart_readlinkat>(); int unlink( ffi.Pointer __name, ) { return _unlink( __name, ); } late final _unlink_ptr = _lookup>('unlink'); late final _dart_unlink _unlink = _unlink_ptr.asFunction<_dart_unlink>(); int unlinkat( int __fd, ffi.Pointer __name, int __flag, ) { return _unlinkat( __fd, __name, __flag, ); } late final _unlinkat_ptr = _lookup>('unlinkat'); late final _dart_unlinkat _unlinkat = _unlinkat_ptr.asFunction<_dart_unlinkat>(); int rmdir( ffi.Pointer __path, ) { return _rmdir( __path, ); } late final _rmdir_ptr = _lookup>('rmdir'); late final _dart_rmdir _rmdir = _rmdir_ptr.asFunction<_dart_rmdir>(); int tcgetpgrp( int __fd, ) { return _tcgetpgrp( __fd, ); } late final _tcgetpgrp_ptr = _lookup>('tcgetpgrp'); late final _dart_tcgetpgrp _tcgetpgrp = _tcgetpgrp_ptr.asFunction<_dart_tcgetpgrp>(); int tcsetpgrp( int __fd, int __pgrp_id, ) { return _tcsetpgrp( __fd, __pgrp_id, ); } late final _tcsetpgrp_ptr = _lookup>('tcsetpgrp'); late final _dart_tcsetpgrp _tcsetpgrp = _tcsetpgrp_ptr.asFunction<_dart_tcsetpgrp>(); ffi.Pointer getlogin() { return _getlogin(); } late final _getlogin_ptr = _lookup>('getlogin'); late final _dart_getlogin _getlogin = _getlogin_ptr.asFunction<_dart_getlogin>(); int getlogin_r( ffi.Pointer __name, int __name_len, ) { return _getlogin_r( __name, __name_len, ); } late final _getlogin_r_ptr = _lookup>('getlogin_r'); late final _dart_getlogin_r _getlogin_r = _getlogin_r_ptr.asFunction<_dart_getlogin_r>(); int setlogin( ffi.Pointer __name, ) { return _setlogin( __name, ); } late final _setlogin_ptr = _lookup>('setlogin'); late final _dart_setlogin _setlogin = _setlogin_ptr.asFunction<_dart_setlogin>(); late final ffi.Pointer> _optarg = _lookup>('optarg'); ffi.Pointer get optarg => _optarg.value; set optarg(ffi.Pointer value) => _optarg.value = value; late final ffi.Pointer _optind = _lookup('optind'); int get optind => _optind.value; set optind(int value) => _optind.value = value; late final ffi.Pointer _opterr = _lookup('opterr'); int get opterr => _opterr.value; set opterr(int value) => _opterr.value = value; late final ffi.Pointer _optopt = _lookup('optopt'); int get optopt => _optopt.value; set optopt(int value) => _optopt.value = value; int getopt( int ___argc, ffi.Pointer> ___argv, ffi.Pointer __shortopts, ) { return _getopt( ___argc, ___argv, __shortopts, ); } late final _getopt_ptr = _lookup>('getopt'); late final _dart_getopt _getopt = _getopt_ptr.asFunction<_dart_getopt>(); int gethostname( ffi.Pointer __name, int __len, ) { return _gethostname( __name, __len, ); } late final _gethostname_ptr = _lookup>('gethostname'); late final _dart_gethostname _gethostname = _gethostname_ptr.asFunction<_dart_gethostname>(); int sethostname( ffi.Pointer __name, int __len, ) { return _sethostname( __name, __len, ); } late final _sethostname_ptr = _lookup>('sethostname'); late final _dart_sethostname _sethostname = _sethostname_ptr.asFunction<_dart_sethostname>(); int sethostid( int __id, ) { return _sethostid( __id, ); } late final _sethostid_ptr = _lookup>('sethostid'); late final _dart_sethostid _sethostid = _sethostid_ptr.asFunction<_dart_sethostid>(); int getdomainname( ffi.Pointer __name, int __len, ) { return _getdomainname( __name, __len, ); } late final _getdomainname_ptr = _lookup>('getdomainname'); late final _dart_getdomainname _getdomainname = _getdomainname_ptr.asFunction<_dart_getdomainname>(); int setdomainname( ffi.Pointer __name, int __len, ) { return _setdomainname( __name, __len, ); } late final _setdomainname_ptr = _lookup>('setdomainname'); late final _dart_setdomainname _setdomainname = _setdomainname_ptr.asFunction<_dart_setdomainname>(); int vhangup() { return _vhangup(); } late final _vhangup_ptr = _lookup>('vhangup'); late final _dart_vhangup _vhangup = _vhangup_ptr.asFunction<_dart_vhangup>(); int revoke( ffi.Pointer __file, ) { return _revoke( __file, ); } late final _revoke_ptr = _lookup>('revoke'); late final _dart_revoke _revoke = _revoke_ptr.asFunction<_dart_revoke>(); int profil( ffi.Pointer __sample_buffer, int __size, int __offset, int __scale, ) { return _profil( __sample_buffer, __size, __offset, __scale, ); } late final _profil_ptr = _lookup>('profil'); late final _dart_profil _profil = _profil_ptr.asFunction<_dart_profil>(); int acct( ffi.Pointer __name, ) { return _acct( __name, ); } late final _acct_ptr = _lookup>('acct'); late final _dart_acct _acct = _acct_ptr.asFunction<_dart_acct>(); ffi.Pointer getusershell() { return _getusershell(); } late final _getusershell_ptr = _lookup>('getusershell'); late final _dart_getusershell _getusershell = _getusershell_ptr.asFunction<_dart_getusershell>(); void endusershell() { return _endusershell(); } late final _endusershell_ptr = _lookup>('endusershell'); late final _dart_endusershell _endusershell = _endusershell_ptr.asFunction<_dart_endusershell>(); void setusershell() { return _setusershell(); } late final _setusershell_ptr = _lookup>('setusershell'); late final _dart_setusershell _setusershell = _setusershell_ptr.asFunction<_dart_setusershell>(); int daemon( int __nochdir, int __noclose, ) { return _daemon( __nochdir, __noclose, ); } late final _daemon_ptr = _lookup>('daemon'); late final _dart_daemon _daemon = _daemon_ptr.asFunction<_dart_daemon>(); int chroot( ffi.Pointer __path, ) { return _chroot( __path, ); } late final _chroot_ptr = _lookup>('chroot'); late final _dart_chroot _chroot = _chroot_ptr.asFunction<_dart_chroot>(); ffi.Pointer getpass( ffi.Pointer __prompt, ) { return _getpass( __prompt, ); } late final _getpass_ptr = _lookup>('getpass'); late final _dart_getpass _getpass = _getpass_ptr.asFunction<_dart_getpass>(); int fsync( int __fd, ) { return _fsync( __fd, ); } late final _fsync_ptr = _lookup>('fsync'); late final _dart_fsync _fsync = _fsync_ptr.asFunction<_dart_fsync>(); int gethostid() { return _gethostid(); } late final _gethostid_ptr = _lookup>('gethostid'); late final _dart_gethostid _gethostid = _gethostid_ptr.asFunction<_dart_gethostid>(); void sync_1() { return _sync_1(); } late final _sync_1_ptr = _lookup>('sync'); late final _dart_sync_1 _sync_1 = _sync_1_ptr.asFunction<_dart_sync_1>(); int getpagesize() { return _getpagesize(); } late final _getpagesize_ptr = _lookup>('getpagesize'); late final _dart_getpagesize _getpagesize = _getpagesize_ptr.asFunction<_dart_getpagesize>(); int getdtablesize() { return _getdtablesize(); } late final _getdtablesize_ptr = _lookup>('getdtablesize'); late final _dart_getdtablesize _getdtablesize = _getdtablesize_ptr.asFunction<_dart_getdtablesize>(); int truncate( ffi.Pointer __file, int __length, ) { return _truncate( __file, __length, ); } late final _truncate_ptr = _lookup>('truncate'); late final _dart_truncate _truncate = _truncate_ptr.asFunction<_dart_truncate>(); int ftruncate( int __fd, int __length, ) { return _ftruncate( __fd, __length, ); } late final _ftruncate_ptr = _lookup>('ftruncate'); late final _dart_ftruncate _ftruncate = _ftruncate_ptr.asFunction<_dart_ftruncate>(); int brk( ffi.Pointer __addr, ) { return _brk( __addr, ); } late final _brk_ptr = _lookup>('brk'); late final _dart_brk _brk = _brk_ptr.asFunction<_dart_brk>(); ffi.Pointer sbrk( int __delta, ) { return _sbrk( __delta, ); } late final _sbrk_ptr = _lookup>('sbrk'); late final _dart_sbrk _sbrk = _sbrk_ptr.asFunction<_dart_sbrk>(); int syscall( int __sysno, ) { return _syscall( __sysno, ); } late final _syscall_ptr = _lookup>('syscall'); late final _dart_syscall _syscall = _syscall_ptr.asFunction<_dart_syscall>(); int lockf( int __fd, int __cmd, int __len, ) { return _lockf( __fd, __cmd, __len, ); } late final _lockf_ptr = _lookup>('lockf'); late final _dart_lockf _lockf = _lockf_ptr.asFunction<_dart_lockf>(); int fdatasync( int __fildes, ) { return _fdatasync( __fildes, ); } late final _fdatasync_ptr = _lookup>('fdatasync'); late final _dart_fdatasync _fdatasync = _fdatasync_ptr.asFunction<_dart_fdatasync>(); ffi.Pointer crypt( ffi.Pointer __key, ffi.Pointer __salt, ) { return _crypt( __key, __salt, ); } late final _crypt_ptr = _lookup>('crypt'); late final _dart_crypt _crypt = _crypt_ptr.asFunction<_dart_crypt>(); int getentropy( ffi.Pointer __buffer, int __length, ) { return _getentropy( __buffer, __length, ); } late final _getentropy_ptr = _lookup>('getentropy'); late final _dart_getentropy _getentropy = _getentropy_ptr.asFunction<_dart_getentropy>(); late final ffi.Pointer> _stdin = _lookup>('stdin'); ffi.Pointer get stdin => _stdin.value; set stdin(ffi.Pointer value) => _stdin.value = value; late final ffi.Pointer> _stdout = _lookup>('stdout'); ffi.Pointer get stdout => _stdout.value; set stdout(ffi.Pointer value) => _stdout.value = value; late final ffi.Pointer> _stderr = _lookup>('stderr'); ffi.Pointer get stderr => _stderr.value; set stderr(ffi.Pointer value) => _stderr.value = value; int remove( ffi.Pointer __filename, ) { return _remove( __filename, ); } late final _remove_ptr = _lookup>('remove'); late final _dart_remove _remove = _remove_ptr.asFunction<_dart_remove>(); int rename( ffi.Pointer __old, ffi.Pointer __new, ) { return _rename( __old, __new, ); } late final _rename_ptr = _lookup>('rename'); late final _dart_rename _rename = _rename_ptr.asFunction<_dart_rename>(); int renameat( int __oldfd, ffi.Pointer __old, int __newfd, ffi.Pointer __new, ) { return _renameat( __oldfd, __old, __newfd, __new, ); } late final _renameat_ptr = _lookup>('renameat'); late final _dart_renameat _renameat = _renameat_ptr.asFunction<_dart_renameat>(); ffi.Pointer tmpfile() { return _tmpfile(); } late final _tmpfile_ptr = _lookup>('tmpfile'); late final _dart_tmpfile _tmpfile = _tmpfile_ptr.asFunction<_dart_tmpfile>(); ffi.Pointer tmpnam( ffi.Pointer __s, ) { return _tmpnam( __s, ); } late final _tmpnam_ptr = _lookup>('tmpnam'); late final _dart_tmpnam _tmpnam = _tmpnam_ptr.asFunction<_dart_tmpnam>(); ffi.Pointer tmpnam_r( ffi.Pointer __s, ) { return _tmpnam_r( __s, ); } late final _tmpnam_r_ptr = _lookup>('tmpnam_r'); late final _dart_tmpnam_r _tmpnam_r = _tmpnam_r_ptr.asFunction<_dart_tmpnam_r>(); ffi.Pointer tempnam( ffi.Pointer __dir, ffi.Pointer __pfx, ) { return _tempnam( __dir, __pfx, ); } late final _tempnam_ptr = _lookup>('tempnam'); late final _dart_tempnam _tempnam = _tempnam_ptr.asFunction<_dart_tempnam>(); int fclose( ffi.Pointer __stream, ) { return _fclose( __stream, ); } late final _fclose_ptr = _lookup>('fclose'); late final _dart_fclose _fclose = _fclose_ptr.asFunction<_dart_fclose>(); int fflush( ffi.Pointer __stream, ) { return _fflush( __stream, ); } late final _fflush_ptr = _lookup>('fflush'); late final _dart_fflush _fflush = _fflush_ptr.asFunction<_dart_fflush>(); int fflush_unlocked( ffi.Pointer __stream, ) { return _fflush_unlocked( __stream, ); } late final _fflush_unlocked_ptr = _lookup>('fflush_unlocked'); late final _dart_fflush_unlocked _fflush_unlocked = _fflush_unlocked_ptr.asFunction<_dart_fflush_unlocked>(); ffi.Pointer fopen( ffi.Pointer __filename, ffi.Pointer __modes, ) { return _fopen( __filename, __modes, ); } late final _fopen_ptr = _lookup>('fopen'); late final _dart_fopen _fopen = _fopen_ptr.asFunction<_dart_fopen>(); ffi.Pointer freopen( ffi.Pointer __filename, ffi.Pointer __modes, ffi.Pointer __stream, ) { return _freopen( __filename, __modes, __stream, ); } late final _freopen_ptr = _lookup>('freopen'); late final _dart_freopen _freopen = _freopen_ptr.asFunction<_dart_freopen>(); ffi.Pointer fdopen( int __fd, ffi.Pointer __modes, ) { return _fdopen( __fd, __modes, ); } late final _fdopen_ptr = _lookup>('fdopen'); late final _dart_fdopen _fdopen = _fdopen_ptr.asFunction<_dart_fdopen>(); ffi.Pointer fmemopen( ffi.Pointer __s, int __len, ffi.Pointer __modes, ) { return _fmemopen( __s, __len, __modes, ); } late final _fmemopen_ptr = _lookup>('fmemopen'); late final _dart_fmemopen _fmemopen = _fmemopen_ptr.asFunction<_dart_fmemopen>(); ffi.Pointer open_memstream( ffi.Pointer> __bufloc, ffi.Pointer __sizeloc, ) { return _open_memstream( __bufloc, __sizeloc, ); } late final _open_memstream_ptr = _lookup>('open_memstream'); late final _dart_open_memstream _open_memstream = _open_memstream_ptr.asFunction<_dart_open_memstream>(); void setbuf( ffi.Pointer __stream, ffi.Pointer __buf, ) { return _setbuf( __stream, __buf, ); } late final _setbuf_ptr = _lookup>('setbuf'); late final _dart_setbuf _setbuf = _setbuf_ptr.asFunction<_dart_setbuf>(); int setvbuf( ffi.Pointer __stream, ffi.Pointer __buf, int __modes, int __n, ) { return _setvbuf( __stream, __buf, __modes, __n, ); } late final _setvbuf_ptr = _lookup>('setvbuf'); late final _dart_setvbuf _setvbuf = _setvbuf_ptr.asFunction<_dart_setvbuf>(); void setbuffer( ffi.Pointer __stream, ffi.Pointer __buf, int __size, ) { return _setbuffer( __stream, __buf, __size, ); } late final _setbuffer_ptr = _lookup>('setbuffer'); late final _dart_setbuffer _setbuffer = _setbuffer_ptr.asFunction<_dart_setbuffer>(); void setlinebuf( ffi.Pointer __stream, ) { return _setlinebuf( __stream, ); } late final _setlinebuf_ptr = _lookup>('setlinebuf'); late final _dart_setlinebuf _setlinebuf = _setlinebuf_ptr.asFunction<_dart_setlinebuf>(); int fprintf( ffi.Pointer __stream, ffi.Pointer __format, ) { return _fprintf( __stream, __format, ); } late final _fprintf_ptr = _lookup>('fprintf'); late final _dart_fprintf _fprintf = _fprintf_ptr.asFunction<_dart_fprintf>(); int printf( ffi.Pointer __format, ) { return _printf( __format, ); } late final _printf_ptr = _lookup>('printf'); late final _dart_printf _printf = _printf_ptr.asFunction<_dart_printf>(); int sprintf( ffi.Pointer __s, ffi.Pointer __format, ) { return _sprintf( __s, __format, ); } late final _sprintf_ptr = _lookup>('sprintf'); late final _dart_sprintf _sprintf = _sprintf_ptr.asFunction<_dart_sprintf>(); int vfprintf( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vfprintf( __s, __format, __arg, ); } late final _vfprintf_ptr = _lookup>('vfprintf'); late final _dart_vfprintf _vfprintf = _vfprintf_ptr.asFunction<_dart_vfprintf>(); int vprintf( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vprintf( __format, __arg, ); } late final _vprintf_ptr = _lookup>('vprintf'); late final _dart_vprintf _vprintf = _vprintf_ptr.asFunction<_dart_vprintf>(); int vsprintf( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vsprintf( __s, __format, __arg, ); } late final _vsprintf_ptr = _lookup>('vsprintf'); late final _dart_vsprintf _vsprintf = _vsprintf_ptr.asFunction<_dart_vsprintf>(); int snprintf( ffi.Pointer __s, int __maxlen, ffi.Pointer __format, ) { return _snprintf( __s, __maxlen, __format, ); } late final _snprintf_ptr = _lookup>('snprintf'); late final _dart_snprintf _snprintf = _snprintf_ptr.asFunction<_dart_snprintf>(); int vsnprintf( ffi.Pointer __s, int __maxlen, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vsnprintf( __s, __maxlen, __format, __arg, ); } late final _vsnprintf_ptr = _lookup>('vsnprintf'); late final _dart_vsnprintf _vsnprintf = _vsnprintf_ptr.asFunction<_dart_vsnprintf>(); int vdprintf( int __fd, ffi.Pointer __fmt, ffi.Pointer<_va_list_tag_> __arg, ) { return _vdprintf( __fd, __fmt, __arg, ); } late final _vdprintf_ptr = _lookup>('vdprintf'); late final _dart_vdprintf _vdprintf = _vdprintf_ptr.asFunction<_dart_vdprintf>(); int dprintf( int __fd, ffi.Pointer __fmt, ) { return _dprintf( __fd, __fmt, ); } late final _dprintf_ptr = _lookup>('dprintf'); late final _dart_dprintf _dprintf = _dprintf_ptr.asFunction<_dart_dprintf>(); int fscanf( ffi.Pointer __stream, ffi.Pointer __format, ) { return _fscanf( __stream, __format, ); } late final _fscanf_ptr = _lookup>('fscanf'); late final _dart_fscanf _fscanf = _fscanf_ptr.asFunction<_dart_fscanf>(); int scanf( ffi.Pointer __format, ) { return _scanf( __format, ); } late final _scanf_ptr = _lookup>('scanf'); late final _dart_scanf _scanf = _scanf_ptr.asFunction<_dart_scanf>(); int sscanf( ffi.Pointer __s, ffi.Pointer __format, ) { return _sscanf( __s, __format, ); } late final _sscanf_ptr = _lookup>('sscanf'); late final _dart_sscanf _sscanf = _sscanf_ptr.asFunction<_dart_sscanf>(); int vfscanf( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vfscanf( __s, __format, __arg, ); } late final _vfscanf_ptr = _lookup>('vfscanf'); late final _dart_vfscanf _vfscanf = _vfscanf_ptr.asFunction<_dart_vfscanf>(); int vscanf( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vscanf( __format, __arg, ); } late final _vscanf_ptr = _lookup>('vscanf'); late final _dart_vscanf _vscanf = _vscanf_ptr.asFunction<_dart_vscanf>(); int vsscanf( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ) { return _vsscanf( __s, __format, __arg, ); } late final _vsscanf_ptr = _lookup>('vsscanf'); late final _dart_vsscanf _vsscanf = _vsscanf_ptr.asFunction<_dart_vsscanf>(); int fgetc( ffi.Pointer __stream, ) { return _fgetc( __stream, ); } late final _fgetc_ptr = _lookup>('fgetc'); late final _dart_fgetc _fgetc = _fgetc_ptr.asFunction<_dart_fgetc>(); int getc( ffi.Pointer __stream, ) { return _getc( __stream, ); } late final _getc_ptr = _lookup>('getc'); late final _dart_getc _getc = _getc_ptr.asFunction<_dart_getc>(); int getchar() { return _getchar(); } late final _getchar_ptr = _lookup>('getchar'); late final _dart_getchar _getchar = _getchar_ptr.asFunction<_dart_getchar>(); int getc_unlocked( ffi.Pointer __stream, ) { return _getc_unlocked( __stream, ); } late final _getc_unlocked_ptr = _lookup>('getc_unlocked'); late final _dart_getc_unlocked _getc_unlocked = _getc_unlocked_ptr.asFunction<_dart_getc_unlocked>(); int getchar_unlocked() { return _getchar_unlocked(); } late final _getchar_unlocked_ptr = _lookup>('getchar_unlocked'); late final _dart_getchar_unlocked _getchar_unlocked = _getchar_unlocked_ptr.asFunction<_dart_getchar_unlocked>(); int fgetc_unlocked( ffi.Pointer __stream, ) { return _fgetc_unlocked( __stream, ); } late final _fgetc_unlocked_ptr = _lookup>('fgetc_unlocked'); late final _dart_fgetc_unlocked _fgetc_unlocked = _fgetc_unlocked_ptr.asFunction<_dart_fgetc_unlocked>(); int fputc( int __c, ffi.Pointer __stream, ) { return _fputc( __c, __stream, ); } late final _fputc_ptr = _lookup>('fputc'); late final _dart_fputc _fputc = _fputc_ptr.asFunction<_dart_fputc>(); int putc( int __c, ffi.Pointer __stream, ) { return _putc( __c, __stream, ); } late final _putc_ptr = _lookup>('putc'); late final _dart_putc _putc = _putc_ptr.asFunction<_dart_putc>(); int putchar( int __c, ) { return _putchar( __c, ); } late final _putchar_ptr = _lookup>('putchar'); late final _dart_putchar _putchar = _putchar_ptr.asFunction<_dart_putchar>(); int fputc_unlocked( int __c, ffi.Pointer __stream, ) { return _fputc_unlocked( __c, __stream, ); } late final _fputc_unlocked_ptr = _lookup>('fputc_unlocked'); late final _dart_fputc_unlocked _fputc_unlocked = _fputc_unlocked_ptr.asFunction<_dart_fputc_unlocked>(); int putc_unlocked( int __c, ffi.Pointer __stream, ) { return _putc_unlocked( __c, __stream, ); } late final _putc_unlocked_ptr = _lookup>('putc_unlocked'); late final _dart_putc_unlocked _putc_unlocked = _putc_unlocked_ptr.asFunction<_dart_putc_unlocked>(); int putchar_unlocked( int __c, ) { return _putchar_unlocked( __c, ); } late final _putchar_unlocked_ptr = _lookup>('putchar_unlocked'); late final _dart_putchar_unlocked _putchar_unlocked = _putchar_unlocked_ptr.asFunction<_dart_putchar_unlocked>(); int getw( ffi.Pointer __stream, ) { return _getw( __stream, ); } late final _getw_ptr = _lookup>('getw'); late final _dart_getw _getw = _getw_ptr.asFunction<_dart_getw>(); int putw( int __w, ffi.Pointer __stream, ) { return _putw( __w, __stream, ); } late final _putw_ptr = _lookup>('putw'); late final _dart_putw _putw = _putw_ptr.asFunction<_dart_putw>(); ffi.Pointer fgets( ffi.Pointer __s, int __n, ffi.Pointer __stream, ) { return _fgets( __s, __n, __stream, ); } late final _fgets_ptr = _lookup>('fgets'); late final _dart_fgets _fgets = _fgets_ptr.asFunction<_dart_fgets>(); int __getdelim( ffi.Pointer> __lineptr, ffi.Pointer __n, int __delimiter, ffi.Pointer __stream, ) { return ___getdelim( __lineptr, __n, __delimiter, __stream, ); } late final ___getdelim_ptr = _lookup>('__getdelim'); late final _dart___getdelim ___getdelim = ___getdelim_ptr.asFunction<_dart___getdelim>(); int getdelim( ffi.Pointer> __lineptr, ffi.Pointer __n, int __delimiter, ffi.Pointer __stream, ) { return _getdelim( __lineptr, __n, __delimiter, __stream, ); } late final _getdelim_ptr = _lookup>('getdelim'); late final _dart_getdelim _getdelim = _getdelim_ptr.asFunction<_dart_getdelim>(); int getline( ffi.Pointer> __lineptr, ffi.Pointer __n, ffi.Pointer __stream, ) { return _getline( __lineptr, __n, __stream, ); } late final _getline_ptr = _lookup>('getline'); late final _dart_getline _getline = _getline_ptr.asFunction<_dart_getline>(); int fputs( ffi.Pointer __s, ffi.Pointer __stream, ) { return _fputs( __s, __stream, ); } late final _fputs_ptr = _lookup>('fputs'); late final _dart_fputs _fputs = _fputs_ptr.asFunction<_dart_fputs>(); int puts( ffi.Pointer __s, ) { return _puts( __s, ); } late final _puts_ptr = _lookup>('puts'); late final _dart_puts _puts = _puts_ptr.asFunction<_dart_puts>(); int ungetc( int __c, ffi.Pointer __stream, ) { return _ungetc( __c, __stream, ); } late final _ungetc_ptr = _lookup>('ungetc'); late final _dart_ungetc _ungetc = _ungetc_ptr.asFunction<_dart_ungetc>(); int fread( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ) { return _fread( __ptr, __size, __n, __stream, ); } late final _fread_ptr = _lookup>('fread'); late final _dart_fread _fread = _fread_ptr.asFunction<_dart_fread>(); int fwrite( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __s, ) { return _fwrite( __ptr, __size, __n, __s, ); } late final _fwrite_ptr = _lookup>('fwrite'); late final _dart_fwrite _fwrite = _fwrite_ptr.asFunction<_dart_fwrite>(); int fread_unlocked( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ) { return _fread_unlocked( __ptr, __size, __n, __stream, ); } late final _fread_unlocked_ptr = _lookup>('fread_unlocked'); late final _dart_fread_unlocked _fread_unlocked = _fread_unlocked_ptr.asFunction<_dart_fread_unlocked>(); int fwrite_unlocked( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ) { return _fwrite_unlocked( __ptr, __size, __n, __stream, ); } late final _fwrite_unlocked_ptr = _lookup>('fwrite_unlocked'); late final _dart_fwrite_unlocked _fwrite_unlocked = _fwrite_unlocked_ptr.asFunction<_dart_fwrite_unlocked>(); int fseek( ffi.Pointer __stream, int __off, int __whence, ) { return _fseek( __stream, __off, __whence, ); } late final _fseek_ptr = _lookup>('fseek'); late final _dart_fseek _fseek = _fseek_ptr.asFunction<_dart_fseek>(); int ftell( ffi.Pointer __stream, ) { return _ftell( __stream, ); } late final _ftell_ptr = _lookup>('ftell'); late final _dart_ftell _ftell = _ftell_ptr.asFunction<_dart_ftell>(); void rewind( ffi.Pointer __stream, ) { return _rewind( __stream, ); } late final _rewind_ptr = _lookup>('rewind'); late final _dart_rewind _rewind = _rewind_ptr.asFunction<_dart_rewind>(); int fseeko( ffi.Pointer __stream, int __off, int __whence, ) { return _fseeko( __stream, __off, __whence, ); } late final _fseeko_ptr = _lookup>('fseeko'); late final _dart_fseeko _fseeko = _fseeko_ptr.asFunction<_dart_fseeko>(); int ftello( ffi.Pointer __stream, ) { return _ftello( __stream, ); } late final _ftello_ptr = _lookup>('ftello'); late final _dart_ftello _ftello = _ftello_ptr.asFunction<_dart_ftello>(); int fgetpos( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ) { return _fgetpos( __stream, __pos, ); } late final _fgetpos_ptr = _lookup>('fgetpos'); late final _dart_fgetpos _fgetpos = _fgetpos_ptr.asFunction<_dart_fgetpos>(); int fsetpos( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ) { return _fsetpos( __stream, __pos, ); } late final _fsetpos_ptr = _lookup>('fsetpos'); late final _dart_fsetpos _fsetpos = _fsetpos_ptr.asFunction<_dart_fsetpos>(); void clearerr( ffi.Pointer __stream, ) { return _clearerr( __stream, ); } late final _clearerr_ptr = _lookup>('clearerr'); late final _dart_clearerr _clearerr = _clearerr_ptr.asFunction<_dart_clearerr>(); int feof( ffi.Pointer __stream, ) { return _feof( __stream, ); } late final _feof_ptr = _lookup>('feof'); late final _dart_feof _feof = _feof_ptr.asFunction<_dart_feof>(); int ferror( ffi.Pointer __stream, ) { return _ferror( __stream, ); } late final _ferror_ptr = _lookup>('ferror'); late final _dart_ferror _ferror = _ferror_ptr.asFunction<_dart_ferror>(); void clearerr_unlocked( ffi.Pointer __stream, ) { return _clearerr_unlocked( __stream, ); } late final _clearerr_unlocked_ptr = _lookup>('clearerr_unlocked'); late final _dart_clearerr_unlocked _clearerr_unlocked = _clearerr_unlocked_ptr.asFunction<_dart_clearerr_unlocked>(); int feof_unlocked( ffi.Pointer __stream, ) { return _feof_unlocked( __stream, ); } late final _feof_unlocked_ptr = _lookup>('feof_unlocked'); late final _dart_feof_unlocked _feof_unlocked = _feof_unlocked_ptr.asFunction<_dart_feof_unlocked>(); int ferror_unlocked( ffi.Pointer __stream, ) { return _ferror_unlocked( __stream, ); } late final _ferror_unlocked_ptr = _lookup>('ferror_unlocked'); late final _dart_ferror_unlocked _ferror_unlocked = _ferror_unlocked_ptr.asFunction<_dart_ferror_unlocked>(); void perror( ffi.Pointer __s, ) { return _perror( __s, ); } late final _perror_ptr = _lookup>('perror'); late final _dart_perror _perror = _perror_ptr.asFunction<_dart_perror>(); late final ffi.Pointer _sys_nerr = _lookup('sys_nerr'); int get sys_nerr => _sys_nerr.value; set sys_nerr(int value) => _sys_nerr.value = value; late final ffi.Pointer>> _sys_errlist = _lookup>>('sys_errlist'); ffi.Pointer> get sys_errlist => _sys_errlist.value; set sys_errlist(ffi.Pointer> value) => _sys_errlist.value = value; int fileno( ffi.Pointer __stream, ) { return _fileno( __stream, ); } late final _fileno_ptr = _lookup>('fileno'); late final _dart_fileno _fileno = _fileno_ptr.asFunction<_dart_fileno>(); int fileno_unlocked( ffi.Pointer __stream, ) { return _fileno_unlocked( __stream, ); } late final _fileno_unlocked_ptr = _lookup>('fileno_unlocked'); late final _dart_fileno_unlocked _fileno_unlocked = _fileno_unlocked_ptr.asFunction<_dart_fileno_unlocked>(); ffi.Pointer popen( ffi.Pointer __command, ffi.Pointer __modes, ) { return _popen( __command, __modes, ); } late final _popen_ptr = _lookup>('popen'); late final _dart_popen _popen = _popen_ptr.asFunction<_dart_popen>(); int pclose( ffi.Pointer __stream, ) { return _pclose( __stream, ); } late final _pclose_ptr = _lookup>('pclose'); late final _dart_pclose _pclose = _pclose_ptr.asFunction<_dart_pclose>(); ffi.Pointer ctermid( ffi.Pointer __s, ) { return _ctermid( __s, ); } late final _ctermid_ptr = _lookup>('ctermid'); late final _dart_ctermid _ctermid = _ctermid_ptr.asFunction<_dart_ctermid>(); void flockfile( ffi.Pointer __stream, ) { return _flockfile( __stream, ); } late final _flockfile_ptr = _lookup>('flockfile'); late final _dart_flockfile _flockfile = _flockfile_ptr.asFunction<_dart_flockfile>(); int ftrylockfile( ffi.Pointer __stream, ) { return _ftrylockfile( __stream, ); } late final _ftrylockfile_ptr = _lookup>('ftrylockfile'); late final _dart_ftrylockfile _ftrylockfile = _ftrylockfile_ptr.asFunction<_dart_ftrylockfile>(); void funlockfile( ffi.Pointer __stream, ) { return _funlockfile( __stream, ); } late final _funlockfile_ptr = _lookup>('funlockfile'); late final _dart_funlockfile _funlockfile = _funlockfile_ptr.asFunction<_dart_funlockfile>(); int __uflow( ffi.Pointer arg0, ) { return ___uflow( arg0, ); } late final ___uflow_ptr = _lookup>('__uflow'); late final _dart___uflow ___uflow = ___uflow_ptr.asFunction<_dart___uflow>(); int __overflow( ffi.Pointer arg0, int arg1, ) { return ___overflow( arg0, arg1, ); } late final ___overflow_ptr = _lookup>('__overflow'); late final _dart___overflow ___overflow = ___overflow_ptr.asFunction<_dart___overflow>(); int __ctype_get_mb_cur_max() { return ___ctype_get_mb_cur_max(); } late final ___ctype_get_mb_cur_max_ptr = _lookup>( '__ctype_get_mb_cur_max'); late final _dart___ctype_get_mb_cur_max ___ctype_get_mb_cur_max = ___ctype_get_mb_cur_max_ptr.asFunction<_dart___ctype_get_mb_cur_max>(); double atof( ffi.Pointer __nptr, ) { return _atof( __nptr, ); } late final _atof_ptr = _lookup>('atof'); late final _dart_atof _atof = _atof_ptr.asFunction<_dart_atof>(); int atoi( ffi.Pointer __nptr, ) { return _atoi( __nptr, ); } late final _atoi_ptr = _lookup>('atoi'); late final _dart_atoi _atoi = _atoi_ptr.asFunction<_dart_atoi>(); int atol( ffi.Pointer __nptr, ) { return _atol( __nptr, ); } late final _atol_ptr = _lookup>('atol'); late final _dart_atol _atol = _atol_ptr.asFunction<_dart_atol>(); int atoll( ffi.Pointer __nptr, ) { return _atoll( __nptr, ); } late final _atoll_ptr = _lookup>('atoll'); late final _dart_atoll _atoll = _atoll_ptr.asFunction<_dart_atoll>(); double strtod( ffi.Pointer __nptr, ffi.Pointer> __endptr, ) { return _strtod( __nptr, __endptr, ); } late final _strtod_ptr = _lookup>('strtod'); late final _dart_strtod _strtod = _strtod_ptr.asFunction<_dart_strtod>(); double strtof( ffi.Pointer __nptr, ffi.Pointer> __endptr, ) { return _strtof( __nptr, __endptr, ); } late final _strtof_ptr = _lookup>('strtof'); late final _dart_strtof _strtof = _strtof_ptr.asFunction<_dart_strtof>(); int strtol( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtol( __nptr, __endptr, __base, ); } late final _strtol_ptr = _lookup>('strtol'); late final _dart_strtol _strtol = _strtol_ptr.asFunction<_dart_strtol>(); int strtoul( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtoul( __nptr, __endptr, __base, ); } late final _strtoul_ptr = _lookup>('strtoul'); late final _dart_strtoul _strtoul = _strtoul_ptr.asFunction<_dart_strtoul>(); int strtoq( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtoq( __nptr, __endptr, __base, ); } late final _strtoq_ptr = _lookup>('strtoq'); late final _dart_strtoq _strtoq = _strtoq_ptr.asFunction<_dart_strtoq>(); int strtouq( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtouq( __nptr, __endptr, __base, ); } late final _strtouq_ptr = _lookup>('strtouq'); late final _dart_strtouq _strtouq = _strtouq_ptr.asFunction<_dart_strtouq>(); int strtoll( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtoll( __nptr, __endptr, __base, ); } late final _strtoll_ptr = _lookup>('strtoll'); late final _dart_strtoll _strtoll = _strtoll_ptr.asFunction<_dart_strtoll>(); int strtoull( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ) { return _strtoull( __nptr, __endptr, __base, ); } late final _strtoull_ptr = _lookup>('strtoull'); late final _dart_strtoull _strtoull = _strtoull_ptr.asFunction<_dart_strtoull>(); ffi.Pointer l64a( int __n, ) { return _l64a( __n, ); } late final _l64a_ptr = _lookup>('l64a'); late final _dart_l64a _l64a = _l64a_ptr.asFunction<_dart_l64a>(); int a64l( ffi.Pointer __s, ) { return _a64l( __s, ); } late final _a64l_ptr = _lookup>('a64l'); late final _dart_a64l _a64l = _a64l_ptr.asFunction<_dart_a64l>(); int select( int __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ) { return _select( __nfds, __readfds, __writefds, __exceptfds, __timeout, ); } late final _select_ptr = _lookup>('select'); late final _dart_select _select = _select_ptr.asFunction<_dart_select>(); int pselect( int __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ffi.Pointer<_sigset_t_> __sigmask, ) { return _pselect( __nfds, __readfds, __writefds, __exceptfds, __timeout, __sigmask, ); } late final _pselect_ptr = _lookup>('pselect'); late final _dart_pselect _pselect = _pselect_ptr.asFunction<_dart_pselect>(); int random() { return _random(); } late final _random_ptr = _lookup>('random'); late final _dart_random _random = _random_ptr.asFunction<_dart_random>(); void srandom( int __seed, ) { return _srandom( __seed, ); } late final _srandom_ptr = _lookup>('srandom'); late final _dart_srandom _srandom = _srandom_ptr.asFunction<_dart_srandom>(); ffi.Pointer initstate( int __seed, ffi.Pointer __statebuf, int __statelen, ) { return _initstate( __seed, __statebuf, __statelen, ); } late final _initstate_ptr = _lookup>('initstate'); late final _dart_initstate _initstate = _initstate_ptr.asFunction<_dart_initstate>(); ffi.Pointer setstate( ffi.Pointer __statebuf, ) { return _setstate( __statebuf, ); } late final _setstate_ptr = _lookup>('setstate'); late final _dart_setstate _setstate = _setstate_ptr.asFunction<_dart_setstate>(); int random_r( ffi.Pointer __buf, ffi.Pointer __result, ) { return _random_r( __buf, __result, ); } late final _random_r_ptr = _lookup>('random_r'); late final _dart_random_r _random_r = _random_r_ptr.asFunction<_dart_random_r>(); int srandom_r( int __seed, ffi.Pointer __buf, ) { return _srandom_r( __seed, __buf, ); } late final _srandom_r_ptr = _lookup>('srandom_r'); late final _dart_srandom_r _srandom_r = _srandom_r_ptr.asFunction<_dart_srandom_r>(); int initstate_r( int __seed, ffi.Pointer __statebuf, int __statelen, ffi.Pointer __buf, ) { return _initstate_r( __seed, __statebuf, __statelen, __buf, ); } late final _initstate_r_ptr = _lookup>('initstate_r'); late final _dart_initstate_r _initstate_r = _initstate_r_ptr.asFunction<_dart_initstate_r>(); int setstate_r( ffi.Pointer __statebuf, ffi.Pointer __buf, ) { return _setstate_r( __statebuf, __buf, ); } late final _setstate_r_ptr = _lookup>('setstate_r'); late final _dart_setstate_r _setstate_r = _setstate_r_ptr.asFunction<_dart_setstate_r>(); int rand() { return _rand(); } late final _rand_ptr = _lookup>('rand'); late final _dart_rand _rand = _rand_ptr.asFunction<_dart_rand>(); void srand( int __seed, ) { return _srand( __seed, ); } late final _srand_ptr = _lookup>('srand'); late final _dart_srand _srand = _srand_ptr.asFunction<_dart_srand>(); int rand_r( ffi.Pointer __seed, ) { return _rand_r( __seed, ); } late final _rand_r_ptr = _lookup>('rand_r'); late final _dart_rand_r _rand_r = _rand_r_ptr.asFunction<_dart_rand_r>(); double drand48() { return _drand48(); } late final _drand48_ptr = _lookup>('drand48'); late final _dart_drand48 _drand48 = _drand48_ptr.asFunction<_dart_drand48>(); double erand48( ffi.Pointer __xsubi, ) { return _erand48( __xsubi, ); } late final _erand48_ptr = _lookup>('erand48'); late final _dart_erand48 _erand48 = _erand48_ptr.asFunction<_dart_erand48>(); int lrand48() { return _lrand48(); } late final _lrand48_ptr = _lookup>('lrand48'); late final _dart_lrand48 _lrand48 = _lrand48_ptr.asFunction<_dart_lrand48>(); int nrand48( ffi.Pointer __xsubi, ) { return _nrand48( __xsubi, ); } late final _nrand48_ptr = _lookup>('nrand48'); late final _dart_nrand48 _nrand48 = _nrand48_ptr.asFunction<_dart_nrand48>(); int mrand48() { return _mrand48(); } late final _mrand48_ptr = _lookup>('mrand48'); late final _dart_mrand48 _mrand48 = _mrand48_ptr.asFunction<_dart_mrand48>(); int jrand48( ffi.Pointer __xsubi, ) { return _jrand48( __xsubi, ); } late final _jrand48_ptr = _lookup>('jrand48'); late final _dart_jrand48 _jrand48 = _jrand48_ptr.asFunction<_dart_jrand48>(); void srand48( int __seedval, ) { return _srand48( __seedval, ); } late final _srand48_ptr = _lookup>('srand48'); late final _dart_srand48 _srand48 = _srand48_ptr.asFunction<_dart_srand48>(); ffi.Pointer seed48( ffi.Pointer __seed16v, ) { return _seed48( __seed16v, ); } late final _seed48_ptr = _lookup>('seed48'); late final _dart_seed48 _seed48 = _seed48_ptr.asFunction<_dart_seed48>(); void lcong48( ffi.Pointer __param, ) { return _lcong48( __param, ); } late final _lcong48_ptr = _lookup>('lcong48'); late final _dart_lcong48 _lcong48 = _lcong48_ptr.asFunction<_dart_lcong48>(); int drand48_r( ffi.Pointer __buffer, ffi.Pointer __result, ) { return _drand48_r( __buffer, __result, ); } late final _drand48_r_ptr = _lookup>('drand48_r'); late final _dart_drand48_r _drand48_r = _drand48_r_ptr.asFunction<_dart_drand48_r>(); int erand48_r( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ) { return _erand48_r( __xsubi, __buffer, __result, ); } late final _erand48_r_ptr = _lookup>('erand48_r'); late final _dart_erand48_r _erand48_r = _erand48_r_ptr.asFunction<_dart_erand48_r>(); int lrand48_r( ffi.Pointer __buffer, ffi.Pointer __result, ) { return _lrand48_r( __buffer, __result, ); } late final _lrand48_r_ptr = _lookup>('lrand48_r'); late final _dart_lrand48_r _lrand48_r = _lrand48_r_ptr.asFunction<_dart_lrand48_r>(); int nrand48_r( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ) { return _nrand48_r( __xsubi, __buffer, __result, ); } late final _nrand48_r_ptr = _lookup>('nrand48_r'); late final _dart_nrand48_r _nrand48_r = _nrand48_r_ptr.asFunction<_dart_nrand48_r>(); int mrand48_r( ffi.Pointer __buffer, ffi.Pointer __result, ) { return _mrand48_r( __buffer, __result, ); } late final _mrand48_r_ptr = _lookup>('mrand48_r'); late final _dart_mrand48_r _mrand48_r = _mrand48_r_ptr.asFunction<_dart_mrand48_r>(); int jrand48_r( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ) { return _jrand48_r( __xsubi, __buffer, __result, ); } late final _jrand48_r_ptr = _lookup>('jrand48_r'); late final _dart_jrand48_r _jrand48_r = _jrand48_r_ptr.asFunction<_dart_jrand48_r>(); int srand48_r( int __seedval, ffi.Pointer __buffer, ) { return _srand48_r( __seedval, __buffer, ); } late final _srand48_r_ptr = _lookup>('srand48_r'); late final _dart_srand48_r _srand48_r = _srand48_r_ptr.asFunction<_dart_srand48_r>(); int seed48_r( ffi.Pointer __seed16v, ffi.Pointer __buffer, ) { return _seed48_r( __seed16v, __buffer, ); } late final _seed48_r_ptr = _lookup>('seed48_r'); late final _dart_seed48_r _seed48_r = _seed48_r_ptr.asFunction<_dart_seed48_r>(); int lcong48_r( ffi.Pointer __param, ffi.Pointer __buffer, ) { return _lcong48_r( __param, __buffer, ); } late final _lcong48_r_ptr = _lookup>('lcong48_r'); late final _dart_lcong48_r _lcong48_r = _lcong48_r_ptr.asFunction<_dart_lcong48_r>(); ffi.Pointer malloc( int __size, ) { return _malloc( __size, ); } late final _malloc_ptr = _lookup>('malloc'); late final _dart_malloc _malloc = _malloc_ptr.asFunction<_dart_malloc>(); ffi.Pointer calloc( int __nmemb, int __size, ) { return _calloc( __nmemb, __size, ); } late final _calloc_ptr = _lookup>('calloc'); late final _dart_calloc _calloc = _calloc_ptr.asFunction<_dart_calloc>(); ffi.Pointer realloc( ffi.Pointer __ptr, int __size, ) { return _realloc( __ptr, __size, ); } late final _realloc_ptr = _lookup>('realloc'); late final _dart_realloc _realloc = _realloc_ptr.asFunction<_dart_realloc>(); ffi.Pointer reallocarray( ffi.Pointer __ptr, int __nmemb, int __size, ) { return _reallocarray( __ptr, __nmemb, __size, ); } late final _reallocarray_ptr = _lookup>('reallocarray'); late final _dart_reallocarray _reallocarray = _reallocarray_ptr.asFunction<_dart_reallocarray>(); void free( ffi.Pointer __ptr, ) { return _free( __ptr, ); } late final _free_ptr = _lookup>('free'); late final _dart_free _free = _free_ptr.asFunction<_dart_free>(); ffi.Pointer alloca( int __size, ) { return _alloca( __size, ); } late final _alloca_ptr = _lookup>('alloca'); late final _dart_alloca _alloca = _alloca_ptr.asFunction<_dart_alloca>(); ffi.Pointer valloc( int __size, ) { return _valloc( __size, ); } late final _valloc_ptr = _lookup>('valloc'); late final _dart_valloc _valloc = _valloc_ptr.asFunction<_dart_valloc>(); int posix_memalign( ffi.Pointer> __memptr, int __alignment, int __size, ) { return _posix_memalign( __memptr, __alignment, __size, ); } late final _posix_memalign_ptr = _lookup>('posix_memalign'); late final _dart_posix_memalign _posix_memalign = _posix_memalign_ptr.asFunction<_dart_posix_memalign>(); ffi.Pointer aligned_alloc( int __alignment, int __size, ) { return _aligned_alloc( __alignment, __size, ); } late final _aligned_alloc_ptr = _lookup>('aligned_alloc'); late final _dart_aligned_alloc _aligned_alloc = _aligned_alloc_ptr.asFunction<_dart_aligned_alloc>(); void abort() { return _abort(); } late final _abort_ptr = _lookup>('abort'); late final _dart_abort _abort = _abort_ptr.asFunction<_dart_abort>(); int atexit( ffi.Pointer> __func, ) { return _atexit( __func, ); } late final _atexit_ptr = _lookup>('atexit'); late final _dart_atexit _atexit = _atexit_ptr.asFunction<_dart_atexit>(); int at_quick_exit( ffi.Pointer> __func, ) { return _at_quick_exit( __func, ); } late final _at_quick_exit_ptr = _lookup>('at_quick_exit'); late final _dart_at_quick_exit _at_quick_exit = _at_quick_exit_ptr.asFunction<_dart_at_quick_exit>(); int on_exit( ffi.Pointer> __func, ffi.Pointer __arg, ) { return _on_exit( __func, __arg, ); } late final _on_exit_ptr = _lookup>('on_exit'); late final _dart_on_exit _on_exit = _on_exit_ptr.asFunction<_dart_on_exit>(); void exit( int __status, ) { return _exit_1( __status, ); } late final _exit_ptr = _lookup>('exit'); late final _dart_exit _exit_1 = _exit_ptr.asFunction<_dart_exit>(); void quick_exit( int __status, ) { return _quick_exit( __status, ); } late final _quick_exit_ptr = _lookup>('quick_exit'); late final _dart_quick_exit _quick_exit = _quick_exit_ptr.asFunction<_dart_quick_exit>(); void _Exit( int __status, ) { return __Exit( __status, ); } late final __Exit_ptr = _lookup>('_Exit'); late final _dart__Exit __Exit = __Exit_ptr.asFunction<_dart__Exit>(); ffi.Pointer getenv( ffi.Pointer __name, ) { return _getenv( __name, ); } late final _getenv_ptr = _lookup>('getenv'); late final _dart_getenv _getenv = _getenv_ptr.asFunction<_dart_getenv>(); int putenv( ffi.Pointer __string, ) { return _putenv( __string, ); } late final _putenv_ptr = _lookup>('putenv'); late final _dart_putenv _putenv = _putenv_ptr.asFunction<_dart_putenv>(); int setenv( ffi.Pointer __name, ffi.Pointer __value, int __replace, ) { return _setenv( __name, __value, __replace, ); } late final _setenv_ptr = _lookup>('setenv'); late final _dart_setenv _setenv = _setenv_ptr.asFunction<_dart_setenv>(); int unsetenv( ffi.Pointer __name, ) { return _unsetenv( __name, ); } late final _unsetenv_ptr = _lookup>('unsetenv'); late final _dart_unsetenv _unsetenv = _unsetenv_ptr.asFunction<_dart_unsetenv>(); int clearenv() { return _clearenv(); } late final _clearenv_ptr = _lookup>('clearenv'); late final _dart_clearenv _clearenv = _clearenv_ptr.asFunction<_dart_clearenv>(); ffi.Pointer mktemp( ffi.Pointer __template, ) { return _mktemp( __template, ); } late final _mktemp_ptr = _lookup>('mktemp'); late final _dart_mktemp _mktemp = _mktemp_ptr.asFunction<_dart_mktemp>(); int mkstemp( ffi.Pointer __template, ) { return _mkstemp( __template, ); } late final _mkstemp_ptr = _lookup>('mkstemp'); late final _dart_mkstemp _mkstemp = _mkstemp_ptr.asFunction<_dart_mkstemp>(); int mkstemps( ffi.Pointer __template, int __suffixlen, ) { return _mkstemps( __template, __suffixlen, ); } late final _mkstemps_ptr = _lookup>('mkstemps'); late final _dart_mkstemps _mkstemps = _mkstemps_ptr.asFunction<_dart_mkstemps>(); ffi.Pointer mkdtemp( ffi.Pointer __template, ) { return _mkdtemp( __template, ); } late final _mkdtemp_ptr = _lookup>('mkdtemp'); late final _dart_mkdtemp _mkdtemp = _mkdtemp_ptr.asFunction<_dart_mkdtemp>(); int system( ffi.Pointer __command, ) { return _system( __command, ); } late final _system_ptr = _lookup>('system'); late final _dart_system _system = _system_ptr.asFunction<_dart_system>(); ffi.Pointer realpath( ffi.Pointer __name, ffi.Pointer __resolved, ) { return _realpath( __name, __resolved, ); } late final _realpath_ptr = _lookup>('realpath'); late final _dart_realpath _realpath = _realpath_ptr.asFunction<_dart_realpath>(); ffi.Pointer bsearch( ffi.Pointer __key, ffi.Pointer __base, int __nmemb, int __size, ffi.Pointer> __compar, ) { return _bsearch( __key, __base, __nmemb, __size, __compar, ); } late final _bsearch_ptr = _lookup>('bsearch'); late final _dart_bsearch _bsearch = _bsearch_ptr.asFunction<_dart_bsearch>(); void qsort( ffi.Pointer __base, int __nmemb, int __size, ffi.Pointer> __compar, ) { return _qsort( __base, __nmemb, __size, __compar, ); } late final _qsort_ptr = _lookup>('qsort'); late final _dart_qsort _qsort = _qsort_ptr.asFunction<_dart_qsort>(); int abs( int __x, ) { return _abs( __x, ); } late final _abs_ptr = _lookup>('abs'); late final _dart_abs _abs = _abs_ptr.asFunction<_dart_abs>(); int labs( int __x, ) { return _labs( __x, ); } late final _labs_ptr = _lookup>('labs'); late final _dart_labs _labs = _labs_ptr.asFunction<_dart_labs>(); int llabs( int __x, ) { return _llabs( __x, ); } late final _llabs_ptr = _lookup>('llabs'); late final _dart_llabs _llabs = _llabs_ptr.asFunction<_dart_llabs>(); div_t div( int __numer, int __denom, ) { return _div( __numer, __denom, ); } late final _div_ptr = _lookup>('div'); late final _dart_div _div = _div_ptr.asFunction<_dart_div>(); ldiv_t ldiv( int __numer, int __denom, ) { return _ldiv( __numer, __denom, ); } late final _ldiv_ptr = _lookup>('ldiv'); late final _dart_ldiv _ldiv = _ldiv_ptr.asFunction<_dart_ldiv>(); lldiv_t lldiv( int __numer, int __denom, ) { return _lldiv( __numer, __denom, ); } late final _lldiv_ptr = _lookup>('lldiv'); late final _dart_lldiv _lldiv = _lldiv_ptr.asFunction<_dart_lldiv>(); ffi.Pointer ecvt( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ) { return _ecvt( __value, __ndigit, __decpt, __sign, ); } late final _ecvt_ptr = _lookup>('ecvt'); late final _dart_ecvt _ecvt = _ecvt_ptr.asFunction<_dart_ecvt>(); ffi.Pointer fcvt( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ) { return _fcvt( __value, __ndigit, __decpt, __sign, ); } late final _fcvt_ptr = _lookup>('fcvt'); late final _dart_fcvt _fcvt = _fcvt_ptr.asFunction<_dart_fcvt>(); ffi.Pointer gcvt( double __value, int __ndigit, ffi.Pointer __buf, ) { return _gcvt( __value, __ndigit, __buf, ); } late final _gcvt_ptr = _lookup>('gcvt'); late final _dart_gcvt _gcvt = _gcvt_ptr.asFunction<_dart_gcvt>(); int ecvt_r( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, int __len, ) { return _ecvt_r( __value, __ndigit, __decpt, __sign, __buf, __len, ); } late final _ecvt_r_ptr = _lookup>('ecvt_r'); late final _dart_ecvt_r _ecvt_r = _ecvt_r_ptr.asFunction<_dart_ecvt_r>(); int fcvt_r( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, int __len, ) { return _fcvt_r( __value, __ndigit, __decpt, __sign, __buf, __len, ); } late final _fcvt_r_ptr = _lookup>('fcvt_r'); late final _dart_fcvt_r _fcvt_r = _fcvt_r_ptr.asFunction<_dart_fcvt_r>(); int mblen( ffi.Pointer __s, int __n, ) { return _mblen( __s, __n, ); } late final _mblen_ptr = _lookup>('mblen'); late final _dart_mblen _mblen = _mblen_ptr.asFunction<_dart_mblen>(); int mbtowc( ffi.Pointer __pwc, ffi.Pointer __s, int __n, ) { return _mbtowc( __pwc, __s, __n, ); } late final _mbtowc_ptr = _lookup>('mbtowc'); late final _dart_mbtowc _mbtowc = _mbtowc_ptr.asFunction<_dart_mbtowc>(); int wctomb( ffi.Pointer __s, int __wchar, ) { return _wctomb( __s, __wchar, ); } late final _wctomb_ptr = _lookup>('wctomb'); late final _dart_wctomb _wctomb = _wctomb_ptr.asFunction<_dart_wctomb>(); int mbstowcs( ffi.Pointer __pwcs, ffi.Pointer __s, int __n, ) { return _mbstowcs( __pwcs, __s, __n, ); } late final _mbstowcs_ptr = _lookup>('mbstowcs'); late final _dart_mbstowcs _mbstowcs = _mbstowcs_ptr.asFunction<_dart_mbstowcs>(); int wcstombs( ffi.Pointer __s, ffi.Pointer __pwcs, int __n, ) { return _wcstombs( __s, __pwcs, __n, ); } late final _wcstombs_ptr = _lookup>('wcstombs'); late final _dart_wcstombs _wcstombs = _wcstombs_ptr.asFunction<_dart_wcstombs>(); int rpmatch( ffi.Pointer __response, ) { return _rpmatch( __response, ); } late final _rpmatch_ptr = _lookup>('rpmatch'); late final _dart_rpmatch _rpmatch = _rpmatch_ptr.asFunction<_dart_rpmatch>(); int getsubopt( ffi.Pointer> __optionp, ffi.Pointer> __tokens, ffi.Pointer> __valuep, ) { return _getsubopt( __optionp, __tokens, __valuep, ); } late final _getsubopt_ptr = _lookup>('getsubopt'); late final _dart_getsubopt _getsubopt = _getsubopt_ptr.asFunction<_dart_getsubopt>(); int getloadavg( ffi.Pointer __loadavg, int __nelem, ) { return _getloadavg( __loadavg, __nelem, ); } late final _getloadavg_ptr = _lookup>('getloadavg'); late final _dart_getloadavg _getloadavg = _getloadavg_ptr.asFunction<_dart_getloadavg>(); ffi.Pointer memcpy( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _memcpy( __dest, __src, __n, ); } late final _memcpy_ptr = _lookup>('memcpy'); late final _dart_memcpy _memcpy = _memcpy_ptr.asFunction<_dart_memcpy>(); ffi.Pointer memmove( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _memmove( __dest, __src, __n, ); } late final _memmove_ptr = _lookup>('memmove'); late final _dart_memmove _memmove = _memmove_ptr.asFunction<_dart_memmove>(); ffi.Pointer memccpy( ffi.Pointer __dest, ffi.Pointer __src, int __c, int __n, ) { return _memccpy( __dest, __src, __c, __n, ); } late final _memccpy_ptr = _lookup>('memccpy'); late final _dart_memccpy _memccpy = _memccpy_ptr.asFunction<_dart_memccpy>(); ffi.Pointer memset( ffi.Pointer __s, int __c, int __n, ) { return _memset( __s, __c, __n, ); } late final _memset_ptr = _lookup>('memset'); late final _dart_memset _memset = _memset_ptr.asFunction<_dart_memset>(); int memcmp( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ) { return _memcmp( __s1, __s2, __n, ); } late final _memcmp_ptr = _lookup>('memcmp'); late final _dart_memcmp _memcmp = _memcmp_ptr.asFunction<_dart_memcmp>(); ffi.Pointer memchr( ffi.Pointer __s, int __c, int __n, ) { return _memchr( __s, __c, __n, ); } late final _memchr_ptr = _lookup>('memchr'); late final _dart_memchr _memchr = _memchr_ptr.asFunction<_dart_memchr>(); ffi.Pointer strcpy( ffi.Pointer __dest, ffi.Pointer __src, ) { return _strcpy( __dest, __src, ); } late final _strcpy_ptr = _lookup>('strcpy'); late final _dart_strcpy _strcpy = _strcpy_ptr.asFunction<_dart_strcpy>(); ffi.Pointer strncpy( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _strncpy( __dest, __src, __n, ); } late final _strncpy_ptr = _lookup>('strncpy'); late final _dart_strncpy _strncpy = _strncpy_ptr.asFunction<_dart_strncpy>(); ffi.Pointer strcat( ffi.Pointer __dest, ffi.Pointer __src, ) { return _strcat( __dest, __src, ); } late final _strcat_ptr = _lookup>('strcat'); late final _dart_strcat _strcat = _strcat_ptr.asFunction<_dart_strcat>(); ffi.Pointer strncat( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _strncat( __dest, __src, __n, ); } late final _strncat_ptr = _lookup>('strncat'); late final _dart_strncat _strncat = _strncat_ptr.asFunction<_dart_strncat>(); int strcmp( ffi.Pointer __s1, ffi.Pointer __s2, ) { return _strcmp( __s1, __s2, ); } late final _strcmp_ptr = _lookup>('strcmp'); late final _dart_strcmp _strcmp = _strcmp_ptr.asFunction<_dart_strcmp>(); int strncmp( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ) { return _strncmp( __s1, __s2, __n, ); } late final _strncmp_ptr = _lookup>('strncmp'); late final _dart_strncmp _strncmp = _strncmp_ptr.asFunction<_dart_strncmp>(); int strcoll( ffi.Pointer __s1, ffi.Pointer __s2, ) { return _strcoll( __s1, __s2, ); } late final _strcoll_ptr = _lookup>('strcoll'); late final _dart_strcoll _strcoll = _strcoll_ptr.asFunction<_dart_strcoll>(); int strxfrm( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _strxfrm( __dest, __src, __n, ); } late final _strxfrm_ptr = _lookup>('strxfrm'); late final _dart_strxfrm _strxfrm = _strxfrm_ptr.asFunction<_dart_strxfrm>(); int strcoll_l( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __l, ) { return _strcoll_l( __s1, __s2, __l, ); } late final _strcoll_l_ptr = _lookup>('strcoll_l'); late final _dart_strcoll_l _strcoll_l = _strcoll_l_ptr.asFunction<_dart_strcoll_l>(); int strxfrm_l( ffi.Pointer __dest, ffi.Pointer __src, int __n, ffi.Pointer<_locale_struct_> __l, ) { return _strxfrm_l( __dest, __src, __n, __l, ); } late final _strxfrm_l_ptr = _lookup>('strxfrm_l'); late final _dart_strxfrm_l _strxfrm_l = _strxfrm_l_ptr.asFunction<_dart_strxfrm_l>(); ffi.Pointer strdup( ffi.Pointer __s, ) { return _strdup( __s, ); } late final _strdup_ptr = _lookup>('strdup'); late final _dart_strdup _strdup = _strdup_ptr.asFunction<_dart_strdup>(); ffi.Pointer strndup( ffi.Pointer __string, int __n, ) { return _strndup( __string, __n, ); } late final _strndup_ptr = _lookup>('strndup'); late final _dart_strndup _strndup = _strndup_ptr.asFunction<_dart_strndup>(); ffi.Pointer strchr( ffi.Pointer __s, int __c, ) { return _strchr( __s, __c, ); } late final _strchr_ptr = _lookup>('strchr'); late final _dart_strchr _strchr = _strchr_ptr.asFunction<_dart_strchr>(); ffi.Pointer strrchr( ffi.Pointer __s, int __c, ) { return _strrchr( __s, __c, ); } late final _strrchr_ptr = _lookup>('strrchr'); late final _dart_strrchr _strrchr = _strrchr_ptr.asFunction<_dart_strrchr>(); int strcspn( ffi.Pointer __s, ffi.Pointer __reject, ) { return _strcspn( __s, __reject, ); } late final _strcspn_ptr = _lookup>('strcspn'); late final _dart_strcspn _strcspn = _strcspn_ptr.asFunction<_dart_strcspn>(); int strspn( ffi.Pointer __s, ffi.Pointer __accept, ) { return _strspn( __s, __accept, ); } late final _strspn_ptr = _lookup>('strspn'); late final _dart_strspn _strspn = _strspn_ptr.asFunction<_dart_strspn>(); ffi.Pointer strpbrk( ffi.Pointer __s, ffi.Pointer __accept, ) { return _strpbrk( __s, __accept, ); } late final _strpbrk_ptr = _lookup>('strpbrk'); late final _dart_strpbrk _strpbrk = _strpbrk_ptr.asFunction<_dart_strpbrk>(); ffi.Pointer strstr( ffi.Pointer __haystack, ffi.Pointer __needle, ) { return _strstr( __haystack, __needle, ); } late final _strstr_ptr = _lookup>('strstr'); late final _dart_strstr _strstr = _strstr_ptr.asFunction<_dart_strstr>(); ffi.Pointer strtok( ffi.Pointer __s, ffi.Pointer __delim, ) { return _strtok( __s, __delim, ); } late final _strtok_ptr = _lookup>('strtok'); late final _dart_strtok _strtok = _strtok_ptr.asFunction<_dart_strtok>(); ffi.Pointer __strtok_r( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ) { return ___strtok_r( __s, __delim, __save_ptr, ); } late final ___strtok_r_ptr = _lookup>('__strtok_r'); late final _dart___strtok_r ___strtok_r = ___strtok_r_ptr.asFunction<_dart___strtok_r>(); ffi.Pointer strtok_r( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ) { return _strtok_r( __s, __delim, __save_ptr, ); } late final _strtok_r_ptr = _lookup>('strtok_r'); late final _dart_strtok_r _strtok_r = _strtok_r_ptr.asFunction<_dart_strtok_r>(); int strlen( ffi.Pointer __s, ) { return _strlen( __s, ); } late final _strlen_ptr = _lookup>('strlen'); late final _dart_strlen _strlen = _strlen_ptr.asFunction<_dart_strlen>(); int strnlen( ffi.Pointer __string, int __maxlen, ) { return _strnlen( __string, __maxlen, ); } late final _strnlen_ptr = _lookup>('strnlen'); late final _dart_strnlen _strnlen = _strnlen_ptr.asFunction<_dart_strnlen>(); ffi.Pointer strerror( int __errnum, ) { return _strerror( __errnum, ); } late final _strerror_ptr = _lookup>('strerror'); late final _dart_strerror _strerror = _strerror_ptr.asFunction<_dart_strerror>(); int strerror_r( int __errnum, ffi.Pointer __buf, int __buflen, ) { return _strerror_r( __errnum, __buf, __buflen, ); } late final _strerror_r_ptr = _lookup>('strerror_r'); late final _dart_strerror_r _strerror_r = _strerror_r_ptr.asFunction<_dart_strerror_r>(); ffi.Pointer strerror_l( int __errnum, ffi.Pointer<_locale_struct_> __l, ) { return _strerror_l( __errnum, __l, ); } late final _strerror_l_ptr = _lookup>('strerror_l'); late final _dart_strerror_l _strerror_l = _strerror_l_ptr.asFunction<_dart_strerror_l>(); int bcmp( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ) { return _bcmp( __s1, __s2, __n, ); } late final _bcmp_ptr = _lookup>('bcmp'); late final _dart_bcmp _bcmp = _bcmp_ptr.asFunction<_dart_bcmp>(); void bcopy( ffi.Pointer __src, ffi.Pointer __dest, int __n, ) { return _bcopy( __src, __dest, __n, ); } late final _bcopy_ptr = _lookup>('bcopy'); late final _dart_bcopy _bcopy = _bcopy_ptr.asFunction<_dart_bcopy>(); void bzero( ffi.Pointer __s, int __n, ) { return _bzero( __s, __n, ); } late final _bzero_ptr = _lookup>('bzero'); late final _dart_bzero _bzero = _bzero_ptr.asFunction<_dart_bzero>(); ffi.Pointer index( ffi.Pointer __s, int __c, ) { return _index( __s, __c, ); } late final _index_ptr = _lookup>('index'); late final _dart_index _index = _index_ptr.asFunction<_dart_index>(); ffi.Pointer rindex( ffi.Pointer __s, int __c, ) { return _rindex( __s, __c, ); } late final _rindex_ptr = _lookup>('rindex'); late final _dart_rindex _rindex = _rindex_ptr.asFunction<_dart_rindex>(); int ffs( int __i, ) { return _ffs( __i, ); } late final _ffs_ptr = _lookup>('ffs'); late final _dart_ffs _ffs = _ffs_ptr.asFunction<_dart_ffs>(); int ffsl( int __l, ) { return _ffsl( __l, ); } late final _ffsl_ptr = _lookup>('ffsl'); late final _dart_ffsl _ffsl = _ffsl_ptr.asFunction<_dart_ffsl>(); int ffsll( int __ll, ) { return _ffsll( __ll, ); } late final _ffsll_ptr = _lookup>('ffsll'); late final _dart_ffsll _ffsll = _ffsll_ptr.asFunction<_dart_ffsll>(); int strcasecmp( ffi.Pointer __s1, ffi.Pointer __s2, ) { return _strcasecmp( __s1, __s2, ); } late final _strcasecmp_ptr = _lookup>('strcasecmp'); late final _dart_strcasecmp _strcasecmp = _strcasecmp_ptr.asFunction<_dart_strcasecmp>(); int strncasecmp( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ) { return _strncasecmp( __s1, __s2, __n, ); } late final _strncasecmp_ptr = _lookup>('strncasecmp'); late final _dart_strncasecmp _strncasecmp = _strncasecmp_ptr.asFunction<_dart_strncasecmp>(); int strcasecmp_l( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __loc, ) { return _strcasecmp_l( __s1, __s2, __loc, ); } late final _strcasecmp_l_ptr = _lookup>('strcasecmp_l'); late final _dart_strcasecmp_l _strcasecmp_l = _strcasecmp_l_ptr.asFunction<_dart_strcasecmp_l>(); int strncasecmp_l( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ffi.Pointer<_locale_struct_> __loc, ) { return _strncasecmp_l( __s1, __s2, __n, __loc, ); } late final _strncasecmp_l_ptr = _lookup>('strncasecmp_l'); late final _dart_strncasecmp_l _strncasecmp_l = _strncasecmp_l_ptr.asFunction<_dart_strncasecmp_l>(); void explicit_bzero( ffi.Pointer __s, int __n, ) { return _explicit_bzero( __s, __n, ); } late final _explicit_bzero_ptr = _lookup>('explicit_bzero'); late final _dart_explicit_bzero _explicit_bzero = _explicit_bzero_ptr.asFunction<_dart_explicit_bzero>(); ffi.Pointer strsep( ffi.Pointer> __stringp, ffi.Pointer __delim, ) { return _strsep( __stringp, __delim, ); } late final _strsep_ptr = _lookup>('strsep'); late final _dart_strsep _strsep = _strsep_ptr.asFunction<_dart_strsep>(); ffi.Pointer strsignal( int __sig, ) { return _strsignal( __sig, ); } late final _strsignal_ptr = _lookup>('strsignal'); late final _dart_strsignal _strsignal = _strsignal_ptr.asFunction<_dart_strsignal>(); ffi.Pointer __stpcpy( ffi.Pointer __dest, ffi.Pointer __src, ) { return ___stpcpy( __dest, __src, ); } late final ___stpcpy_ptr = _lookup>('__stpcpy'); late final _dart___stpcpy ___stpcpy = ___stpcpy_ptr.asFunction<_dart___stpcpy>(); ffi.Pointer stpcpy( ffi.Pointer __dest, ffi.Pointer __src, ) { return _stpcpy( __dest, __src, ); } late final _stpcpy_ptr = _lookup>('stpcpy'); late final _dart_stpcpy _stpcpy = _stpcpy_ptr.asFunction<_dart_stpcpy>(); ffi.Pointer __stpncpy( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return ___stpncpy( __dest, __src, __n, ); } late final ___stpncpy_ptr = _lookup>('__stpncpy'); late final _dart___stpncpy ___stpncpy = ___stpncpy_ptr.asFunction<_dart___stpncpy>(); ffi.Pointer stpncpy( ffi.Pointer __dest, ffi.Pointer __src, int __n, ) { return _stpncpy( __dest, __src, __n, ); } late final _stpncpy_ptr = _lookup>('stpncpy'); late final _dart_stpncpy _stpncpy = _stpncpy_ptr.asFunction<_dart_stpncpy>(); int fcntl( int __fd, int __cmd, ) { return _fcntl( __fd, __cmd, ); } late final _fcntl_ptr = _lookup>('fcntl'); late final _dart_fcntl _fcntl = _fcntl_ptr.asFunction<_dart_fcntl>(); int open( ffi.Pointer __file, int __oflag, ) { return _open( __file, __oflag, ); } late final _open_ptr = _lookup>('open'); late final _dart_open _open = _open_ptr.asFunction<_dart_open>(); int openat( int __fd, ffi.Pointer __file, int __oflag, ) { return _openat( __fd, __file, __oflag, ); } late final _openat_ptr = _lookup>('openat'); late final _dart_openat _openat = _openat_ptr.asFunction<_dart_openat>(); int creat( ffi.Pointer __file, int __mode, ) { return _creat( __file, __mode, ); } late final _creat_ptr = _lookup>('creat'); late final _dart_creat _creat = _creat_ptr.asFunction<_dart_creat>(); int posix_fadvise( int __fd, int __offset, int __len, int __advise, ) { return _posix_fadvise( __fd, __offset, __len, __advise, ); } late final _posix_fadvise_ptr = _lookup>('posix_fadvise'); late final _dart_posix_fadvise _posix_fadvise = _posix_fadvise_ptr.asFunction<_dart_posix_fadvise>(); int posix_fallocate( int __fd, int __offset, int __len, ) { return _posix_fallocate( __fd, __offset, __len, ); } late final _posix_fallocate_ptr = _lookup>('posix_fallocate'); late final _dart_posix_fallocate _posix_fallocate = _posix_fallocate_ptr.asFunction<_dart_posix_fallocate>(); void __assert_fail( ffi.Pointer __assertion, ffi.Pointer __file, int __line, ffi.Pointer __function, ) { return ___assert_fail( __assertion, __file, __line, __function, ); } late final ___assert_fail_ptr = _lookup>('__assert_fail'); late final _dart___assert_fail ___assert_fail = ___assert_fail_ptr.asFunction<_dart___assert_fail>(); void __assert_perror_fail( int __errnum, ffi.Pointer __file, int __line, ffi.Pointer __function, ) { return ___assert_perror_fail( __errnum, __file, __line, __function, ); } late final ___assert_perror_fail_ptr = _lookup>( '__assert_perror_fail'); late final _dart___assert_perror_fail ___assert_perror_fail = ___assert_perror_fail_ptr.asFunction<_dart___assert_perror_fail>(); void __assert( ffi.Pointer __assertion, ffi.Pointer __file, int __line, ) { return ___assert( __assertion, __file, __line, ); } late final ___assert_ptr = _lookup>('__assert'); late final _dart___assert ___assert = ___assert_ptr.asFunction<_dart___assert>(); int poll( ffi.Pointer __fds, int __nfds, int __timeout, ) { return _poll( __fds, __nfds, __timeout, ); } late final _poll_ptr = _lookup>('poll'); late final _dart_poll _poll = _poll_ptr.asFunction<_dart_poll>(); ffi.Pointer __errno_location() { return ___errno_location(); } late final ___errno_location_ptr = _lookup>('__errno_location'); late final _dart___errno_location ___errno_location = ___errno_location_ptr.asFunction<_dart___errno_location>(); int clock() { return _clock(); } late final _clock_ptr = _lookup>('clock'); late final _dart_clock _clock = _clock_ptr.asFunction<_dart_clock>(); int time( ffi.Pointer __timer, ) { return _time( __timer, ); } late final _time_ptr = _lookup>('time'); late final _dart_time _time = _time_ptr.asFunction<_dart_time>(); double difftime( int __time1, int __time0, ) { return _difftime( __time1, __time0, ); } late final _difftime_ptr = _lookup>('difftime'); late final _dart_difftime _difftime = _difftime_ptr.asFunction<_dart_difftime>(); int mktime( ffi.Pointer __tp, ) { return _mktime( __tp, ); } late final _mktime_ptr = _lookup>('mktime'); late final _dart_mktime _mktime = _mktime_ptr.asFunction<_dart_mktime>(); int strftime( ffi.Pointer __s, int __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ) { return _strftime( __s, __maxsize, __format, __tp, ); } late final _strftime_ptr = _lookup>('strftime'); late final _dart_strftime _strftime = _strftime_ptr.asFunction<_dart_strftime>(); int strftime_l( ffi.Pointer __s, int __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ffi.Pointer<_locale_struct_> __loc, ) { return _strftime_l( __s, __maxsize, __format, __tp, __loc, ); } late final _strftime_l_ptr = _lookup>('strftime_l'); late final _dart_strftime_l _strftime_l = _strftime_l_ptr.asFunction<_dart_strftime_l>(); ffi.Pointer gmtime( ffi.Pointer __timer, ) { return _gmtime( __timer, ); } late final _gmtime_ptr = _lookup>('gmtime'); late final _dart_gmtime _gmtime = _gmtime_ptr.asFunction<_dart_gmtime>(); ffi.Pointer localtime( ffi.Pointer __timer, ) { return _localtime( __timer, ); } late final _localtime_ptr = _lookup>('localtime'); late final _dart_localtime _localtime = _localtime_ptr.asFunction<_dart_localtime>(); ffi.Pointer gmtime_r( ffi.Pointer __timer, ffi.Pointer __tp, ) { return _gmtime_r( __timer, __tp, ); } late final _gmtime_r_ptr = _lookup>('gmtime_r'); late final _dart_gmtime_r _gmtime_r = _gmtime_r_ptr.asFunction<_dart_gmtime_r>(); ffi.Pointer localtime_r( ffi.Pointer __timer, ffi.Pointer __tp, ) { return _localtime_r( __timer, __tp, ); } late final _localtime_r_ptr = _lookup>('localtime_r'); late final _dart_localtime_r _localtime_r = _localtime_r_ptr.asFunction<_dart_localtime_r>(); ffi.Pointer asctime( ffi.Pointer __tp, ) { return _asctime( __tp, ); } late final _asctime_ptr = _lookup>('asctime'); late final _dart_asctime _asctime = _asctime_ptr.asFunction<_dart_asctime>(); ffi.Pointer ctime( ffi.Pointer __timer, ) { return _ctime( __timer, ); } late final _ctime_ptr = _lookup>('ctime'); late final _dart_ctime _ctime = _ctime_ptr.asFunction<_dart_ctime>(); ffi.Pointer asctime_r( ffi.Pointer __tp, ffi.Pointer __buf, ) { return _asctime_r( __tp, __buf, ); } late final _asctime_r_ptr = _lookup>('asctime_r'); late final _dart_asctime_r _asctime_r = _asctime_r_ptr.asFunction<_dart_asctime_r>(); ffi.Pointer ctime_r( ffi.Pointer __timer, ffi.Pointer __buf, ) { return _ctime_r( __timer, __buf, ); } late final _ctime_r_ptr = _lookup>('ctime_r'); late final _dart_ctime_r _ctime_r = _ctime_r_ptr.asFunction<_dart_ctime_r>(); late final ffi.Pointer>> ___tzname = _lookup>>('__tzname'); ffi.Pointer> get __tzname => ___tzname.value; set __tzname(ffi.Pointer> value) => ___tzname.value = value; late final ffi.Pointer ___daylight = _lookup('__daylight'); int get __daylight => ___daylight.value; set __daylight(int value) => ___daylight.value = value; late final ffi.Pointer ___timezone = _lookup('__timezone'); int get __timezone => ___timezone.value; set __timezone(int value) => ___timezone.value = value; late final ffi.Pointer>> _tzname = _lookup>>('tzname'); ffi.Pointer> get tzname => _tzname.value; set tzname(ffi.Pointer> value) => _tzname.value = value; void tzset() { return _tzset(); } late final _tzset_ptr = _lookup>('tzset'); late final _dart_tzset _tzset = _tzset_ptr.asFunction<_dart_tzset>(); late final ffi.Pointer _daylight = _lookup('daylight'); int get daylight => _daylight.value; set daylight(int value) => _daylight.value = value; late final ffi.Pointer _timezone = _lookup('timezone'); int get timezone => _timezone.value; set timezone(int value) => _timezone.value = value; int timegm( ffi.Pointer __tp, ) { return _timegm( __tp, ); } late final _timegm_ptr = _lookup>('timegm'); late final _dart_timegm _timegm = _timegm_ptr.asFunction<_dart_timegm>(); int timelocal( ffi.Pointer __tp, ) { return _timelocal( __tp, ); } late final _timelocal_ptr = _lookup>('timelocal'); late final _dart_timelocal _timelocal = _timelocal_ptr.asFunction<_dart_timelocal>(); int dysize( int __year, ) { return _dysize( __year, ); } late final _dysize_ptr = _lookup>('dysize'); late final _dart_dysize _dysize = _dysize_ptr.asFunction<_dart_dysize>(); int nanosleep( ffi.Pointer __requested_time, ffi.Pointer __remaining, ) { return _nanosleep( __requested_time, __remaining, ); } late final _nanosleep_ptr = _lookup>('nanosleep'); late final _dart_nanosleep _nanosleep = _nanosleep_ptr.asFunction<_dart_nanosleep>(); int clock_getres( int __clock_id, ffi.Pointer __res, ) { return _clock_getres( __clock_id, __res, ); } late final _clock_getres_ptr = _lookup>('clock_getres'); late final _dart_clock_getres _clock_getres = _clock_getres_ptr.asFunction<_dart_clock_getres>(); int clock_gettime( int __clock_id, ffi.Pointer __tp, ) { return _clock_gettime( __clock_id, __tp, ); } late final _clock_gettime_ptr = _lookup>('clock_gettime'); late final _dart_clock_gettime _clock_gettime = _clock_gettime_ptr.asFunction<_dart_clock_gettime>(); int clock_settime( int __clock_id, ffi.Pointer __tp, ) { return _clock_settime( __clock_id, __tp, ); } late final _clock_settime_ptr = _lookup>('clock_settime'); late final _dart_clock_settime _clock_settime = _clock_settime_ptr.asFunction<_dart_clock_settime>(); int clock_nanosleep( int __clock_id, int __flags, ffi.Pointer __req, ffi.Pointer __rem, ) { return _clock_nanosleep( __clock_id, __flags, __req, __rem, ); } late final _clock_nanosleep_ptr = _lookup>('clock_nanosleep'); late final _dart_clock_nanosleep _clock_nanosleep = _clock_nanosleep_ptr.asFunction<_dart_clock_nanosleep>(); int clock_getcpuclockid( int __pid, ffi.Pointer __clock_id, ) { return _clock_getcpuclockid( __pid, __clock_id, ); } late final _clock_getcpuclockid_ptr = _lookup>( 'clock_getcpuclockid'); late final _dart_clock_getcpuclockid _clock_getcpuclockid = _clock_getcpuclockid_ptr.asFunction<_dart_clock_getcpuclockid>(); int timer_create( int __clock_id, ffi.Pointer __evp, ffi.Pointer> __timerid, ) { return _timer_create( __clock_id, __evp, __timerid, ); } late final _timer_create_ptr = _lookup>('timer_create'); late final _dart_timer_create _timer_create = _timer_create_ptr.asFunction<_dart_timer_create>(); int timer_delete( ffi.Pointer __timerid, ) { return _timer_delete( __timerid, ); } late final _timer_delete_ptr = _lookup>('timer_delete'); late final _dart_timer_delete _timer_delete = _timer_delete_ptr.asFunction<_dart_timer_delete>(); int timer_settime( ffi.Pointer __timerid, int __flags, ffi.Pointer __value, ffi.Pointer __ovalue, ) { return _timer_settime( __timerid, __flags, __value, __ovalue, ); } late final _timer_settime_ptr = _lookup>('timer_settime'); late final _dart_timer_settime _timer_settime = _timer_settime_ptr.asFunction<_dart_timer_settime>(); int timer_gettime( ffi.Pointer __timerid, ffi.Pointer __value, ) { return _timer_gettime( __timerid, __value, ); } late final _timer_gettime_ptr = _lookup>('timer_gettime'); late final _dart_timer_gettime _timer_gettime = _timer_gettime_ptr.asFunction<_dart_timer_gettime>(); int timer_getoverrun( ffi.Pointer __timerid, ) { return _timer_getoverrun( __timerid, ); } late final _timer_getoverrun_ptr = _lookup>('timer_getoverrun'); late final _dart_timer_getoverrun _timer_getoverrun = _timer_getoverrun_ptr.asFunction<_dart_timer_getoverrun>(); int timespec_get( ffi.Pointer __ts, int __base, ) { return _timespec_get( __ts, __base, ); } late final _timespec_get_ptr = _lookup>('timespec_get'); late final _dart_timespec_get _timespec_get = _timespec_get_ptr.asFunction<_dart_timespec_get>(); ffi.Pointer snd_asoundlib_version() { return _snd_asoundlib_version(); } late final _snd_asoundlib_version_ptr = _lookup>( 'snd_asoundlib_version'); late final _dart_snd_asoundlib_version _snd_asoundlib_version = _snd_asoundlib_version_ptr.asFunction<_dart_snd_asoundlib_version>(); late final ffi.Pointer> _snd_dlsym_start = _lookup>('snd_dlsym_start'); ffi.Pointer get snd_dlsym_start => _snd_dlsym_start.value; set snd_dlsym_start(ffi.Pointer value) => _snd_dlsym_start.value = value; ffi.Pointer snd_dlopen( ffi.Pointer file, int mode, ffi.Pointer errbuf, int errbuflen, ) { return _snd_dlopen( file, mode, errbuf, errbuflen, ); } late final _snd_dlopen_ptr = _lookup>('snd_dlopen'); late final _dart_snd_dlopen _snd_dlopen = _snd_dlopen_ptr.asFunction<_dart_snd_dlopen>(); ffi.Pointer snd_dlsym( ffi.Pointer handle, ffi.Pointer name, ffi.Pointer version, ) { return _snd_dlsym( handle, name, version, ); } late final _snd_dlsym_ptr = _lookup>('snd_dlsym'); late final _dart_snd_dlsym _snd_dlsym = _snd_dlsym_ptr.asFunction<_dart_snd_dlsym>(); int snd_dlclose( ffi.Pointer handle, ) { return _snd_dlclose( handle, ); } late final _snd_dlclose_ptr = _lookup>('snd_dlclose'); late final _dart_snd_dlclose _snd_dlclose = _snd_dlclose_ptr.asFunction<_dart_snd_dlclose>(); int snd_async_add_handler( ffi.Pointer> handler, int fd, ffi.Pointer> callback, ffi.Pointer private_data, ) { return _snd_async_add_handler( handler, fd, callback, private_data, ); } late final _snd_async_add_handler_ptr = _lookup>( 'snd_async_add_handler'); late final _dart_snd_async_add_handler _snd_async_add_handler = _snd_async_add_handler_ptr.asFunction<_dart_snd_async_add_handler>(); int snd_async_del_handler( ffi.Pointer handler, ) { return _snd_async_del_handler( handler, ); } late final _snd_async_del_handler_ptr = _lookup>( 'snd_async_del_handler'); late final _dart_snd_async_del_handler _snd_async_del_handler = _snd_async_del_handler_ptr.asFunction<_dart_snd_async_del_handler>(); int snd_async_handler_get_fd( ffi.Pointer handler, ) { return _snd_async_handler_get_fd( handler, ); } late final _snd_async_handler_get_fd_ptr = _lookup>( 'snd_async_handler_get_fd'); late final _dart_snd_async_handler_get_fd _snd_async_handler_get_fd = _snd_async_handler_get_fd_ptr .asFunction<_dart_snd_async_handler_get_fd>(); int snd_async_handler_get_signo( ffi.Pointer handler, ) { return _snd_async_handler_get_signo( handler, ); } late final _snd_async_handler_get_signo_ptr = _lookup>( 'snd_async_handler_get_signo'); late final _dart_snd_async_handler_get_signo _snd_async_handler_get_signo = _snd_async_handler_get_signo_ptr .asFunction<_dart_snd_async_handler_get_signo>(); ffi.Pointer snd_async_handler_get_callback_private( ffi.Pointer handler, ) { return _snd_async_handler_get_callback_private( handler, ); } late final _snd_async_handler_get_callback_private_ptr = _lookup>( 'snd_async_handler_get_callback_private'); late final _dart_snd_async_handler_get_callback_private _snd_async_handler_get_callback_private = _snd_async_handler_get_callback_private_ptr .asFunction<_dart_snd_async_handler_get_callback_private>(); ffi.Pointer snd_shm_area_create( int shmid, ffi.Pointer ptr, ) { return _snd_shm_area_create( shmid, ptr, ); } late final _snd_shm_area_create_ptr = _lookup>( 'snd_shm_area_create'); late final _dart_snd_shm_area_create _snd_shm_area_create = _snd_shm_area_create_ptr.asFunction<_dart_snd_shm_area_create>(); ffi.Pointer snd_shm_area_share( ffi.Pointer area, ) { return _snd_shm_area_share( area, ); } late final _snd_shm_area_share_ptr = _lookup>('snd_shm_area_share'); late final _dart_snd_shm_area_share _snd_shm_area_share = _snd_shm_area_share_ptr.asFunction<_dart_snd_shm_area_share>(); int snd_shm_area_destroy( ffi.Pointer area, ) { return _snd_shm_area_destroy( area, ); } late final _snd_shm_area_destroy_ptr = _lookup>( 'snd_shm_area_destroy'); late final _dart_snd_shm_area_destroy _snd_shm_area_destroy = _snd_shm_area_destroy_ptr.asFunction<_dart_snd_shm_area_destroy>(); int snd_user_file( ffi.Pointer file, ffi.Pointer> result, ) { return _snd_user_file( file, result, ); } late final _snd_user_file_ptr = _lookup>('snd_user_file'); late final _dart_snd_user_file _snd_user_file = _snd_user_file_ptr.asFunction<_dart_snd_user_file>(); int snd_input_stdio_open( ffi.Pointer> inputp, ffi.Pointer file, ffi.Pointer mode, ) { return _snd_input_stdio_open( inputp, file, mode, ); } late final _snd_input_stdio_open_ptr = _lookup>( 'snd_input_stdio_open'); late final _dart_snd_input_stdio_open _snd_input_stdio_open = _snd_input_stdio_open_ptr.asFunction<_dart_snd_input_stdio_open>(); int snd_input_stdio_attach( ffi.Pointer> inputp, ffi.Pointer fp, int _close, ) { return _snd_input_stdio_attach( inputp, fp, _close, ); } late final _snd_input_stdio_attach_ptr = _lookup>( 'snd_input_stdio_attach'); late final _dart_snd_input_stdio_attach _snd_input_stdio_attach = _snd_input_stdio_attach_ptr.asFunction<_dart_snd_input_stdio_attach>(); int snd_input_buffer_open( ffi.Pointer> inputp, ffi.Pointer buffer, int size, ) { return _snd_input_buffer_open( inputp, buffer, size, ); } late final _snd_input_buffer_open_ptr = _lookup>( 'snd_input_buffer_open'); late final _dart_snd_input_buffer_open _snd_input_buffer_open = _snd_input_buffer_open_ptr.asFunction<_dart_snd_input_buffer_open>(); int snd_input_close( ffi.Pointer input, ) { return _snd_input_close( input, ); } late final _snd_input_close_ptr = _lookup>('snd_input_close'); late final _dart_snd_input_close _snd_input_close = _snd_input_close_ptr.asFunction<_dart_snd_input_close>(); int snd_input_scanf( ffi.Pointer input, ffi.Pointer format, ) { return _snd_input_scanf( input, format, ); } late final _snd_input_scanf_ptr = _lookup>('snd_input_scanf'); late final _dart_snd_input_scanf _snd_input_scanf = _snd_input_scanf_ptr.asFunction<_dart_snd_input_scanf>(); ffi.Pointer snd_input_gets( ffi.Pointer input, ffi.Pointer str, int size, ) { return _snd_input_gets( input, str, size, ); } late final _snd_input_gets_ptr = _lookup>('snd_input_gets'); late final _dart_snd_input_gets _snd_input_gets = _snd_input_gets_ptr.asFunction<_dart_snd_input_gets>(); int snd_input_getc( ffi.Pointer input, ) { return _snd_input_getc( input, ); } late final _snd_input_getc_ptr = _lookup>('snd_input_getc'); late final _dart_snd_input_getc _snd_input_getc = _snd_input_getc_ptr.asFunction<_dart_snd_input_getc>(); int snd_input_ungetc( ffi.Pointer input, int c, ) { return _snd_input_ungetc( input, c, ); } late final _snd_input_ungetc_ptr = _lookup>('snd_input_ungetc'); late final _dart_snd_input_ungetc _snd_input_ungetc = _snd_input_ungetc_ptr.asFunction<_dart_snd_input_ungetc>(); int snd_output_stdio_open( ffi.Pointer> outputp, ffi.Pointer file, ffi.Pointer mode, ) { return _snd_output_stdio_open( outputp, file, mode, ); } late final _snd_output_stdio_open_ptr = _lookup>( 'snd_output_stdio_open'); late final _dart_snd_output_stdio_open _snd_output_stdio_open = _snd_output_stdio_open_ptr.asFunction<_dart_snd_output_stdio_open>(); int snd_output_stdio_attach( ffi.Pointer> outputp, ffi.Pointer fp, int _close, ) { return _snd_output_stdio_attach( outputp, fp, _close, ); } late final _snd_output_stdio_attach_ptr = _lookup>( 'snd_output_stdio_attach'); late final _dart_snd_output_stdio_attach _snd_output_stdio_attach = _snd_output_stdio_attach_ptr.asFunction<_dart_snd_output_stdio_attach>(); int snd_output_buffer_open( ffi.Pointer> outputp, ) { return _snd_output_buffer_open( outputp, ); } late final _snd_output_buffer_open_ptr = _lookup>( 'snd_output_buffer_open'); late final _dart_snd_output_buffer_open _snd_output_buffer_open = _snd_output_buffer_open_ptr.asFunction<_dart_snd_output_buffer_open>(); int snd_output_buffer_string( ffi.Pointer output, ffi.Pointer> buf, ) { return _snd_output_buffer_string( output, buf, ); } late final _snd_output_buffer_string_ptr = _lookup>( 'snd_output_buffer_string'); late final _dart_snd_output_buffer_string _snd_output_buffer_string = _snd_output_buffer_string_ptr .asFunction<_dart_snd_output_buffer_string>(); int snd_output_close( ffi.Pointer output, ) { return _snd_output_close( output, ); } late final _snd_output_close_ptr = _lookup>('snd_output_close'); late final _dart_snd_output_close _snd_output_close = _snd_output_close_ptr.asFunction<_dart_snd_output_close>(); int snd_output_printf( ffi.Pointer output, ffi.Pointer format, ) { return _snd_output_printf( output, format, ); } late final _snd_output_printf_ptr = _lookup>('snd_output_printf'); late final _dart_snd_output_printf _snd_output_printf = _snd_output_printf_ptr.asFunction<_dart_snd_output_printf>(); int snd_output_vprintf( ffi.Pointer output, ffi.Pointer format, ffi.Pointer<_va_list_tag_> args, ) { return _snd_output_vprintf( output, format, args, ); } late final _snd_output_vprintf_ptr = _lookup>('snd_output_vprintf'); late final _dart_snd_output_vprintf _snd_output_vprintf = _snd_output_vprintf_ptr.asFunction<_dart_snd_output_vprintf>(); int snd_output_puts( ffi.Pointer output, ffi.Pointer str, ) { return _snd_output_puts( output, str, ); } late final _snd_output_puts_ptr = _lookup>('snd_output_puts'); late final _dart_snd_output_puts _snd_output_puts = _snd_output_puts_ptr.asFunction<_dart_snd_output_puts>(); int snd_output_putc( ffi.Pointer output, int c, ) { return _snd_output_putc( output, c, ); } late final _snd_output_putc_ptr = _lookup>('snd_output_putc'); late final _dart_snd_output_putc _snd_output_putc = _snd_output_putc_ptr.asFunction<_dart_snd_output_putc>(); int snd_output_flush( ffi.Pointer output, ) { return _snd_output_flush( output, ); } late final _snd_output_flush_ptr = _lookup>('snd_output_flush'); late final _dart_snd_output_flush _snd_output_flush = _snd_output_flush_ptr.asFunction<_dart_snd_output_flush>(); ffi.Pointer snd_strerror( int errnum, ) { return _snd_strerror( errnum, ); } late final _snd_strerror_ptr = _lookup>('snd_strerror'); late final _dart_snd_strerror _snd_strerror = _snd_strerror_ptr.asFunction<_dart_snd_strerror>(); late final ffi .Pointer>> _snd_lib_error = _lookup>>( 'snd_lib_error'); ffi.Pointer> get snd_lib_error => _snd_lib_error.value; set snd_lib_error( ffi.Pointer> value) => _snd_lib_error.value = value; int snd_lib_error_set_handler( ffi.Pointer> handler, ) { return _snd_lib_error_set_handler( handler, ); } late final _snd_lib_error_set_handler_ptr = _lookup>( 'snd_lib_error_set_handler'); late final _dart_snd_lib_error_set_handler _snd_lib_error_set_handler = _snd_lib_error_set_handler_ptr .asFunction<_dart_snd_lib_error_set_handler>(); ffi.Pointer> snd_lib_error_set_local( ffi.Pointer> func, ) { return _snd_lib_error_set_local( func, ); } late final _snd_lib_error_set_local_ptr = _lookup>( 'snd_lib_error_set_local'); late final _dart_snd_lib_error_set_local _snd_lib_error_set_local = _snd_lib_error_set_local_ptr.asFunction<_dart_snd_lib_error_set_local>(); late final ffi.Pointer> _snd_config = _lookup>('snd_config'); ffi.Pointer get snd_config => _snd_config.value; set snd_config(ffi.Pointer value) => _snd_config.value = value; ffi.Pointer snd_config_topdir() { return _snd_config_topdir(); } late final _snd_config_topdir_ptr = _lookup>('snd_config_topdir'); late final _dart_snd_config_topdir _snd_config_topdir = _snd_config_topdir_ptr.asFunction<_dart_snd_config_topdir>(); int snd_config_top( ffi.Pointer> config, ) { return _snd_config_top( config, ); } late final _snd_config_top_ptr = _lookup>('snd_config_top'); late final _dart_snd_config_top _snd_config_top = _snd_config_top_ptr.asFunction<_dart_snd_config_top>(); int snd_config_load( ffi.Pointer config, ffi.Pointer in_1, ) { return _snd_config_load( config, in_1, ); } late final _snd_config_load_ptr = _lookup>('snd_config_load'); late final _dart_snd_config_load _snd_config_load = _snd_config_load_ptr.asFunction<_dart_snd_config_load>(); int snd_config_load_override( ffi.Pointer config, ffi.Pointer in_1, ) { return _snd_config_load_override( config, in_1, ); } late final _snd_config_load_override_ptr = _lookup>( 'snd_config_load_override'); late final _dart_snd_config_load_override _snd_config_load_override = _snd_config_load_override_ptr .asFunction<_dart_snd_config_load_override>(); int snd_config_save( ffi.Pointer config, ffi.Pointer out, ) { return _snd_config_save( config, out, ); } late final _snd_config_save_ptr = _lookup>('snd_config_save'); late final _dart_snd_config_save _snd_config_save = _snd_config_save_ptr.asFunction<_dart_snd_config_save>(); int snd_config_update() { return _snd_config_update(); } late final _snd_config_update_ptr = _lookup>('snd_config_update'); late final _dart_snd_config_update _snd_config_update = _snd_config_update_ptr.asFunction<_dart_snd_config_update>(); int snd_config_update_r( ffi.Pointer> top, ffi.Pointer> update, ffi.Pointer path, ) { return _snd_config_update_r( top, update, path, ); } late final _snd_config_update_r_ptr = _lookup>( 'snd_config_update_r'); late final _dart_snd_config_update_r _snd_config_update_r = _snd_config_update_r_ptr.asFunction<_dart_snd_config_update_r>(); int snd_config_update_free( ffi.Pointer update, ) { return _snd_config_update_free( update, ); } late final _snd_config_update_free_ptr = _lookup>( 'snd_config_update_free'); late final _dart_snd_config_update_free _snd_config_update_free = _snd_config_update_free_ptr.asFunction<_dart_snd_config_update_free>(); int snd_config_update_free_global() { return _snd_config_update_free_global(); } late final _snd_config_update_free_global_ptr = _lookup>( 'snd_config_update_free_global'); late final _dart_snd_config_update_free_global _snd_config_update_free_global = _snd_config_update_free_global_ptr .asFunction<_dart_snd_config_update_free_global>(); int snd_config_update_ref( ffi.Pointer> top, ) { return _snd_config_update_ref( top, ); } late final _snd_config_update_ref_ptr = _lookup>( 'snd_config_update_ref'); late final _dart_snd_config_update_ref _snd_config_update_ref = _snd_config_update_ref_ptr.asFunction<_dart_snd_config_update_ref>(); void snd_config_ref( ffi.Pointer top, ) { return _snd_config_ref( top, ); } late final _snd_config_ref_ptr = _lookup>('snd_config_ref'); late final _dart_snd_config_ref _snd_config_ref = _snd_config_ref_ptr.asFunction<_dart_snd_config_ref>(); void snd_config_unref( ffi.Pointer top, ) { return _snd_config_unref( top, ); } late final _snd_config_unref_ptr = _lookup>('snd_config_unref'); late final _dart_snd_config_unref _snd_config_unref = _snd_config_unref_ptr.asFunction<_dart_snd_config_unref>(); int snd_config_search( ffi.Pointer config, ffi.Pointer key, ffi.Pointer> result, ) { return _snd_config_search( config, key, result, ); } late final _snd_config_search_ptr = _lookup>('snd_config_search'); late final _dart_snd_config_search _snd_config_search = _snd_config_search_ptr.asFunction<_dart_snd_config_search>(); int snd_config_searchv( ffi.Pointer config, ffi.Pointer> result, ) { return _snd_config_searchv( config, result, ); } late final _snd_config_searchv_ptr = _lookup>('snd_config_searchv'); late final _dart_snd_config_searchv _snd_config_searchv = _snd_config_searchv_ptr.asFunction<_dart_snd_config_searchv>(); int snd_config_search_definition( ffi.Pointer config, ffi.Pointer base, ffi.Pointer key, ffi.Pointer> result, ) { return _snd_config_search_definition( config, base, key, result, ); } late final _snd_config_search_definition_ptr = _lookup>( 'snd_config_search_definition'); late final _dart_snd_config_search_definition _snd_config_search_definition = _snd_config_search_definition_ptr .asFunction<_dart_snd_config_search_definition>(); int snd_config_expand( ffi.Pointer config, ffi.Pointer root, ffi.Pointer args, ffi.Pointer private_data, ffi.Pointer> result, ) { return _snd_config_expand( config, root, args, private_data, result, ); } late final _snd_config_expand_ptr = _lookup>('snd_config_expand'); late final _dart_snd_config_expand _snd_config_expand = _snd_config_expand_ptr.asFunction<_dart_snd_config_expand>(); int snd_config_evaluate( ffi.Pointer config, ffi.Pointer root, ffi.Pointer private_data, ffi.Pointer> result, ) { return _snd_config_evaluate( config, root, private_data, result, ); } late final _snd_config_evaluate_ptr = _lookup>( 'snd_config_evaluate'); late final _dart_snd_config_evaluate _snd_config_evaluate = _snd_config_evaluate_ptr.asFunction<_dart_snd_config_evaluate>(); int snd_config_add( ffi.Pointer config, ffi.Pointer child, ) { return _snd_config_add( config, child, ); } late final _snd_config_add_ptr = _lookup>('snd_config_add'); late final _dart_snd_config_add _snd_config_add = _snd_config_add_ptr.asFunction<_dart_snd_config_add>(); int snd_config_add_before( ffi.Pointer before, ffi.Pointer child, ) { return _snd_config_add_before( before, child, ); } late final _snd_config_add_before_ptr = _lookup>( 'snd_config_add_before'); late final _dart_snd_config_add_before _snd_config_add_before = _snd_config_add_before_ptr.asFunction<_dart_snd_config_add_before>(); int snd_config_add_after( ffi.Pointer after, ffi.Pointer child, ) { return _snd_config_add_after( after, child, ); } late final _snd_config_add_after_ptr = _lookup>( 'snd_config_add_after'); late final _dart_snd_config_add_after _snd_config_add_after = _snd_config_add_after_ptr.asFunction<_dart_snd_config_add_after>(); int snd_config_remove( ffi.Pointer config, ) { return _snd_config_remove( config, ); } late final _snd_config_remove_ptr = _lookup>('snd_config_remove'); late final _dart_snd_config_remove _snd_config_remove = _snd_config_remove_ptr.asFunction<_dart_snd_config_remove>(); int snd_config_delete( ffi.Pointer config, ) { return _snd_config_delete( config, ); } late final _snd_config_delete_ptr = _lookup>('snd_config_delete'); late final _dart_snd_config_delete _snd_config_delete = _snd_config_delete_ptr.asFunction<_dart_snd_config_delete>(); int snd_config_delete_compound_members( ffi.Pointer config, ) { return _snd_config_delete_compound_members( config, ); } late final _snd_config_delete_compound_members_ptr = _lookup>( 'snd_config_delete_compound_members'); late final _dart_snd_config_delete_compound_members _snd_config_delete_compound_members = _snd_config_delete_compound_members_ptr .asFunction<_dart_snd_config_delete_compound_members>(); int snd_config_copy( ffi.Pointer> dst, ffi.Pointer src, ) { return _snd_config_copy( dst, src, ); } late final _snd_config_copy_ptr = _lookup>('snd_config_copy'); late final _dart_snd_config_copy _snd_config_copy = _snd_config_copy_ptr.asFunction<_dart_snd_config_copy>(); int snd_config_make( ffi.Pointer> config, ffi.Pointer key, int type, ) { return _snd_config_make( config, key, type, ); } late final _snd_config_make_ptr = _lookup>('snd_config_make'); late final _dart_snd_config_make _snd_config_make = _snd_config_make_ptr.asFunction<_dart_snd_config_make>(); int snd_config_make_integer( ffi.Pointer> config, ffi.Pointer key, ) { return _snd_config_make_integer( config, key, ); } late final _snd_config_make_integer_ptr = _lookup>( 'snd_config_make_integer'); late final _dart_snd_config_make_integer _snd_config_make_integer = _snd_config_make_integer_ptr.asFunction<_dart_snd_config_make_integer>(); int snd_config_make_integer64( ffi.Pointer> config, ffi.Pointer key, ) { return _snd_config_make_integer64( config, key, ); } late final _snd_config_make_integer64_ptr = _lookup>( 'snd_config_make_integer64'); late final _dart_snd_config_make_integer64 _snd_config_make_integer64 = _snd_config_make_integer64_ptr .asFunction<_dart_snd_config_make_integer64>(); int snd_config_make_real( ffi.Pointer> config, ffi.Pointer key, ) { return _snd_config_make_real( config, key, ); } late final _snd_config_make_real_ptr = _lookup>( 'snd_config_make_real'); late final _dart_snd_config_make_real _snd_config_make_real = _snd_config_make_real_ptr.asFunction<_dart_snd_config_make_real>(); int snd_config_make_string( ffi.Pointer> config, ffi.Pointer key, ) { return _snd_config_make_string( config, key, ); } late final _snd_config_make_string_ptr = _lookup>( 'snd_config_make_string'); late final _dart_snd_config_make_string _snd_config_make_string = _snd_config_make_string_ptr.asFunction<_dart_snd_config_make_string>(); int snd_config_make_pointer( ffi.Pointer> config, ffi.Pointer key, ) { return _snd_config_make_pointer( config, key, ); } late final _snd_config_make_pointer_ptr = _lookup>( 'snd_config_make_pointer'); late final _dart_snd_config_make_pointer _snd_config_make_pointer = _snd_config_make_pointer_ptr.asFunction<_dart_snd_config_make_pointer>(); int snd_config_make_compound( ffi.Pointer> config, ffi.Pointer key, int join, ) { return _snd_config_make_compound( config, key, join, ); } late final _snd_config_make_compound_ptr = _lookup>( 'snd_config_make_compound'); late final _dart_snd_config_make_compound _snd_config_make_compound = _snd_config_make_compound_ptr .asFunction<_dart_snd_config_make_compound>(); int snd_config_imake_integer( ffi.Pointer> config, ffi.Pointer key, int value, ) { return _snd_config_imake_integer( config, key, value, ); } late final _snd_config_imake_integer_ptr = _lookup>( 'snd_config_imake_integer'); late final _dart_snd_config_imake_integer _snd_config_imake_integer = _snd_config_imake_integer_ptr .asFunction<_dart_snd_config_imake_integer>(); int snd_config_imake_integer64( ffi.Pointer> config, ffi.Pointer key, int value, ) { return _snd_config_imake_integer64( config, key, value, ); } late final _snd_config_imake_integer64_ptr = _lookup>( 'snd_config_imake_integer64'); late final _dart_snd_config_imake_integer64 _snd_config_imake_integer64 = _snd_config_imake_integer64_ptr .asFunction<_dart_snd_config_imake_integer64>(); int snd_config_imake_real( ffi.Pointer> config, ffi.Pointer key, double value, ) { return _snd_config_imake_real( config, key, value, ); } late final _snd_config_imake_real_ptr = _lookup>( 'snd_config_imake_real'); late final _dart_snd_config_imake_real _snd_config_imake_real = _snd_config_imake_real_ptr.asFunction<_dart_snd_config_imake_real>(); int snd_config_imake_string( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ) { return _snd_config_imake_string( config, key, ascii, ); } late final _snd_config_imake_string_ptr = _lookup>( 'snd_config_imake_string'); late final _dart_snd_config_imake_string _snd_config_imake_string = _snd_config_imake_string_ptr.asFunction<_dart_snd_config_imake_string>(); int snd_config_imake_safe_string( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ) { return _snd_config_imake_safe_string( config, key, ascii, ); } late final _snd_config_imake_safe_string_ptr = _lookup>( 'snd_config_imake_safe_string'); late final _dart_snd_config_imake_safe_string _snd_config_imake_safe_string = _snd_config_imake_safe_string_ptr .asFunction<_dart_snd_config_imake_safe_string>(); int snd_config_imake_pointer( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ptr, ) { return _snd_config_imake_pointer( config, key, ptr, ); } late final _snd_config_imake_pointer_ptr = _lookup>( 'snd_config_imake_pointer'); late final _dart_snd_config_imake_pointer _snd_config_imake_pointer = _snd_config_imake_pointer_ptr .asFunction<_dart_snd_config_imake_pointer>(); int snd_config_get_type( ffi.Pointer config, ) { return _snd_config_get_type( config, ); } late final _snd_config_get_type_ptr = _lookup>( 'snd_config_get_type'); late final _dart_snd_config_get_type _snd_config_get_type = _snd_config_get_type_ptr.asFunction<_dart_snd_config_get_type>(); int snd_config_is_array( ffi.Pointer config, ) { return _snd_config_is_array( config, ); } late final _snd_config_is_array_ptr = _lookup>( 'snd_config_is_array'); late final _dart_snd_config_is_array _snd_config_is_array = _snd_config_is_array_ptr.asFunction<_dart_snd_config_is_array>(); int snd_config_set_id( ffi.Pointer config, ffi.Pointer id, ) { return _snd_config_set_id( config, id, ); } late final _snd_config_set_id_ptr = _lookup>('snd_config_set_id'); late final _dart_snd_config_set_id _snd_config_set_id = _snd_config_set_id_ptr.asFunction<_dart_snd_config_set_id>(); int snd_config_set_integer( ffi.Pointer config, int value, ) { return _snd_config_set_integer( config, value, ); } late final _snd_config_set_integer_ptr = _lookup>( 'snd_config_set_integer'); late final _dart_snd_config_set_integer _snd_config_set_integer = _snd_config_set_integer_ptr.asFunction<_dart_snd_config_set_integer>(); int snd_config_set_integer64( ffi.Pointer config, int value, ) { return _snd_config_set_integer64( config, value, ); } late final _snd_config_set_integer64_ptr = _lookup>( 'snd_config_set_integer64'); late final _dart_snd_config_set_integer64 _snd_config_set_integer64 = _snd_config_set_integer64_ptr .asFunction<_dart_snd_config_set_integer64>(); int snd_config_set_real( ffi.Pointer config, double value, ) { return _snd_config_set_real( config, value, ); } late final _snd_config_set_real_ptr = _lookup>( 'snd_config_set_real'); late final _dart_snd_config_set_real _snd_config_set_real = _snd_config_set_real_ptr.asFunction<_dart_snd_config_set_real>(); int snd_config_set_string( ffi.Pointer config, ffi.Pointer value, ) { return _snd_config_set_string( config, value, ); } late final _snd_config_set_string_ptr = _lookup>( 'snd_config_set_string'); late final _dart_snd_config_set_string _snd_config_set_string = _snd_config_set_string_ptr.asFunction<_dart_snd_config_set_string>(); int snd_config_set_ascii( ffi.Pointer config, ffi.Pointer ascii, ) { return _snd_config_set_ascii( config, ascii, ); } late final _snd_config_set_ascii_ptr = _lookup>( 'snd_config_set_ascii'); late final _dart_snd_config_set_ascii _snd_config_set_ascii = _snd_config_set_ascii_ptr.asFunction<_dart_snd_config_set_ascii>(); int snd_config_set_pointer( ffi.Pointer config, ffi.Pointer ptr, ) { return _snd_config_set_pointer( config, ptr, ); } late final _snd_config_set_pointer_ptr = _lookup>( 'snd_config_set_pointer'); late final _dart_snd_config_set_pointer _snd_config_set_pointer = _snd_config_set_pointer_ptr.asFunction<_dart_snd_config_set_pointer>(); int snd_config_get_id( ffi.Pointer config, ffi.Pointer> value, ) { return _snd_config_get_id( config, value, ); } late final _snd_config_get_id_ptr = _lookup>('snd_config_get_id'); late final _dart_snd_config_get_id _snd_config_get_id = _snd_config_get_id_ptr.asFunction<_dart_snd_config_get_id>(); int snd_config_get_integer( ffi.Pointer config, ffi.Pointer value, ) { return _snd_config_get_integer( config, value, ); } late final _snd_config_get_integer_ptr = _lookup>( 'snd_config_get_integer'); late final _dart_snd_config_get_integer _snd_config_get_integer = _snd_config_get_integer_ptr.asFunction<_dart_snd_config_get_integer>(); int snd_config_get_integer64( ffi.Pointer config, ffi.Pointer value, ) { return _snd_config_get_integer64( config, value, ); } late final _snd_config_get_integer64_ptr = _lookup>( 'snd_config_get_integer64'); late final _dart_snd_config_get_integer64 _snd_config_get_integer64 = _snd_config_get_integer64_ptr .asFunction<_dart_snd_config_get_integer64>(); int snd_config_get_real( ffi.Pointer config, ffi.Pointer value, ) { return _snd_config_get_real( config, value, ); } late final _snd_config_get_real_ptr = _lookup>( 'snd_config_get_real'); late final _dart_snd_config_get_real _snd_config_get_real = _snd_config_get_real_ptr.asFunction<_dart_snd_config_get_real>(); int snd_config_get_ireal( ffi.Pointer config, ffi.Pointer value, ) { return _snd_config_get_ireal( config, value, ); } late final _snd_config_get_ireal_ptr = _lookup>( 'snd_config_get_ireal'); late final _dart_snd_config_get_ireal _snd_config_get_ireal = _snd_config_get_ireal_ptr.asFunction<_dart_snd_config_get_ireal>(); int snd_config_get_string( ffi.Pointer config, ffi.Pointer> value, ) { return _snd_config_get_string( config, value, ); } late final _snd_config_get_string_ptr = _lookup>( 'snd_config_get_string'); late final _dart_snd_config_get_string _snd_config_get_string = _snd_config_get_string_ptr.asFunction<_dart_snd_config_get_string>(); int snd_config_get_ascii( ffi.Pointer config, ffi.Pointer> value, ) { return _snd_config_get_ascii( config, value, ); } late final _snd_config_get_ascii_ptr = _lookup>( 'snd_config_get_ascii'); late final _dart_snd_config_get_ascii _snd_config_get_ascii = _snd_config_get_ascii_ptr.asFunction<_dart_snd_config_get_ascii>(); int snd_config_get_pointer( ffi.Pointer config, ffi.Pointer> value, ) { return _snd_config_get_pointer( config, value, ); } late final _snd_config_get_pointer_ptr = _lookup>( 'snd_config_get_pointer'); late final _dart_snd_config_get_pointer _snd_config_get_pointer = _snd_config_get_pointer_ptr.asFunction<_dart_snd_config_get_pointer>(); int snd_config_test_id( ffi.Pointer config, ffi.Pointer id, ) { return _snd_config_test_id( config, id, ); } late final _snd_config_test_id_ptr = _lookup>('snd_config_test_id'); late final _dart_snd_config_test_id _snd_config_test_id = _snd_config_test_id_ptr.asFunction<_dart_snd_config_test_id>(); ffi.Pointer snd_config_iterator_first( ffi.Pointer node, ) { return _snd_config_iterator_first( node, ); } late final _snd_config_iterator_first_ptr = _lookup>( 'snd_config_iterator_first'); late final _dart_snd_config_iterator_first _snd_config_iterator_first = _snd_config_iterator_first_ptr .asFunction<_dart_snd_config_iterator_first>(); ffi.Pointer snd_config_iterator_next( ffi.Pointer iterator, ) { return _snd_config_iterator_next( iterator, ); } late final _snd_config_iterator_next_ptr = _lookup>( 'snd_config_iterator_next'); late final _dart_snd_config_iterator_next _snd_config_iterator_next = _snd_config_iterator_next_ptr .asFunction<_dart_snd_config_iterator_next>(); ffi.Pointer snd_config_iterator_end( ffi.Pointer node, ) { return _snd_config_iterator_end( node, ); } late final _snd_config_iterator_end_ptr = _lookup>( 'snd_config_iterator_end'); late final _dart_snd_config_iterator_end _snd_config_iterator_end = _snd_config_iterator_end_ptr.asFunction<_dart_snd_config_iterator_end>(); ffi.Pointer snd_config_iterator_entry( ffi.Pointer iterator, ) { return _snd_config_iterator_entry( iterator, ); } late final _snd_config_iterator_entry_ptr = _lookup>( 'snd_config_iterator_entry'); late final _dart_snd_config_iterator_entry _snd_config_iterator_entry = _snd_config_iterator_entry_ptr .asFunction<_dart_snd_config_iterator_entry>(); int snd_config_get_bool_ascii( ffi.Pointer ascii, ) { return _snd_config_get_bool_ascii( ascii, ); } late final _snd_config_get_bool_ascii_ptr = _lookup>( 'snd_config_get_bool_ascii'); late final _dart_snd_config_get_bool_ascii _snd_config_get_bool_ascii = _snd_config_get_bool_ascii_ptr .asFunction<_dart_snd_config_get_bool_ascii>(); int snd_config_get_bool( ffi.Pointer conf, ) { return _snd_config_get_bool( conf, ); } late final _snd_config_get_bool_ptr = _lookup>( 'snd_config_get_bool'); late final _dart_snd_config_get_bool _snd_config_get_bool = _snd_config_get_bool_ptr.asFunction<_dart_snd_config_get_bool>(); int snd_config_get_ctl_iface_ascii( ffi.Pointer ascii, ) { return _snd_config_get_ctl_iface_ascii( ascii, ); } late final _snd_config_get_ctl_iface_ascii_ptr = _lookup>( 'snd_config_get_ctl_iface_ascii'); late final _dart_snd_config_get_ctl_iface_ascii _snd_config_get_ctl_iface_ascii = _snd_config_get_ctl_iface_ascii_ptr .asFunction<_dart_snd_config_get_ctl_iface_ascii>(); int snd_config_get_ctl_iface( ffi.Pointer conf, ) { return _snd_config_get_ctl_iface( conf, ); } late final _snd_config_get_ctl_iface_ptr = _lookup>( 'snd_config_get_ctl_iface'); late final _dart_snd_config_get_ctl_iface _snd_config_get_ctl_iface = _snd_config_get_ctl_iface_ptr .asFunction<_dart_snd_config_get_ctl_iface>(); int snd_names_list( ffi.Pointer iface, ffi.Pointer> list, ) { return _snd_names_list( iface, list, ); } late final _snd_names_list_ptr = _lookup>('snd_names_list'); late final _dart_snd_names_list _snd_names_list = _snd_names_list_ptr.asFunction<_dart_snd_names_list>(); void snd_names_list_free( ffi.Pointer list, ) { return _snd_names_list_free( list, ); } late final _snd_names_list_free_ptr = _lookup>( 'snd_names_list_free'); late final _dart_snd_names_list_free _snd_names_list_free = _snd_names_list_free_ptr.asFunction<_dart_snd_names_list_free>(); int snd_pcm_open( ffi.Pointer> pcm, ffi.Pointer name, int stream, int mode, ) { return _snd_pcm_open( pcm, name, stream, mode, ); } late final _snd_pcm_open_ptr = _lookup>('snd_pcm_open'); late final _dart_snd_pcm_open _snd_pcm_open = _snd_pcm_open_ptr.asFunction<_dart_snd_pcm_open>(); int snd_pcm_open_lconf( ffi.Pointer> pcm, ffi.Pointer name, int stream, int mode, ffi.Pointer lconf, ) { return _snd_pcm_open_lconf( pcm, name, stream, mode, lconf, ); } late final _snd_pcm_open_lconf_ptr = _lookup>('snd_pcm_open_lconf'); late final _dart_snd_pcm_open_lconf _snd_pcm_open_lconf = _snd_pcm_open_lconf_ptr.asFunction<_dart_snd_pcm_open_lconf>(); int snd_pcm_open_fallback( ffi.Pointer> pcm, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, int stream, int mode, ) { return _snd_pcm_open_fallback( pcm, root, name, orig_name, stream, mode, ); } late final _snd_pcm_open_fallback_ptr = _lookup>( 'snd_pcm_open_fallback'); late final _dart_snd_pcm_open_fallback _snd_pcm_open_fallback = _snd_pcm_open_fallback_ptr.asFunction<_dart_snd_pcm_open_fallback>(); int snd_pcm_close( ffi.Pointer pcm, ) { return _snd_pcm_close( pcm, ); } late final _snd_pcm_close_ptr = _lookup>('snd_pcm_close'); late final _dart_snd_pcm_close _snd_pcm_close = _snd_pcm_close_ptr.asFunction<_dart_snd_pcm_close>(); ffi.Pointer snd_pcm_name( ffi.Pointer pcm, ) { return _snd_pcm_name( pcm, ); } late final _snd_pcm_name_ptr = _lookup>('snd_pcm_name'); late final _dart_snd_pcm_name _snd_pcm_name = _snd_pcm_name_ptr.asFunction<_dart_snd_pcm_name>(); int snd_pcm_type( ffi.Pointer pcm, ) { return _snd_pcm_type( pcm, ); } late final _snd_pcm_type_ptr = _lookup>('snd_pcm_type'); late final _dart_snd_pcm_type _snd_pcm_type = _snd_pcm_type_ptr.asFunction<_dart_snd_pcm_type>(); int snd_pcm_stream( ffi.Pointer pcm, ) { return _snd_pcm_stream( pcm, ); } late final _snd_pcm_stream_ptr = _lookup>('snd_pcm_stream'); late final _dart_snd_pcm_stream _snd_pcm_stream = _snd_pcm_stream_ptr.asFunction<_dart_snd_pcm_stream>(); int snd_pcm_poll_descriptors_count( ffi.Pointer pcm, ) { return _snd_pcm_poll_descriptors_count( pcm, ); } late final _snd_pcm_poll_descriptors_count_ptr = _lookup>( 'snd_pcm_poll_descriptors_count'); late final _dart_snd_pcm_poll_descriptors_count _snd_pcm_poll_descriptors_count = _snd_pcm_poll_descriptors_count_ptr .asFunction<_dart_snd_pcm_poll_descriptors_count>(); int snd_pcm_poll_descriptors( ffi.Pointer pcm, ffi.Pointer pfds, int space, ) { return _snd_pcm_poll_descriptors( pcm, pfds, space, ); } late final _snd_pcm_poll_descriptors_ptr = _lookup>( 'snd_pcm_poll_descriptors'); late final _dart_snd_pcm_poll_descriptors _snd_pcm_poll_descriptors = _snd_pcm_poll_descriptors_ptr .asFunction<_dart_snd_pcm_poll_descriptors>(); int snd_pcm_poll_descriptors_revents( ffi.Pointer pcm, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_pcm_poll_descriptors_revents( pcm, pfds, nfds, revents, ); } late final _snd_pcm_poll_descriptors_revents_ptr = _lookup>( 'snd_pcm_poll_descriptors_revents'); late final _dart_snd_pcm_poll_descriptors_revents _snd_pcm_poll_descriptors_revents = _snd_pcm_poll_descriptors_revents_ptr .asFunction<_dart_snd_pcm_poll_descriptors_revents>(); int snd_pcm_nonblock( ffi.Pointer pcm, int nonblock, ) { return _snd_pcm_nonblock( pcm, nonblock, ); } late final _snd_pcm_nonblock_ptr = _lookup>('snd_pcm_nonblock'); late final _dart_snd_pcm_nonblock _snd_pcm_nonblock = _snd_pcm_nonblock_ptr.asFunction<_dart_snd_pcm_nonblock>(); int snd_async_add_pcm_handler( ffi.Pointer> handler, ffi.Pointer pcm, ffi.Pointer> callback, ffi.Pointer private_data, ) { return _snd_async_add_pcm_handler( handler, pcm, callback, private_data, ); } late final _snd_async_add_pcm_handler_ptr = _lookup>( 'snd_async_add_pcm_handler'); late final _dart_snd_async_add_pcm_handler _snd_async_add_pcm_handler = _snd_async_add_pcm_handler_ptr .asFunction<_dart_snd_async_add_pcm_handler>(); ffi.Pointer snd_async_handler_get_pcm( ffi.Pointer handler, ) { return _snd_async_handler_get_pcm( handler, ); } late final _snd_async_handler_get_pcm_ptr = _lookup>( 'snd_async_handler_get_pcm'); late final _dart_snd_async_handler_get_pcm _snd_async_handler_get_pcm = _snd_async_handler_get_pcm_ptr .asFunction<_dart_snd_async_handler_get_pcm>(); int snd_pcm_info( ffi.Pointer pcm, ffi.Pointer info, ) { return _snd_pcm_info( pcm, info, ); } late final _snd_pcm_info_ptr = _lookup>('snd_pcm_info'); late final _dart_snd_pcm_info _snd_pcm_info = _snd_pcm_info_ptr.asFunction<_dart_snd_pcm_info>(); int snd_pcm_hw_params_current( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_hw_params_current( pcm, params, ); } late final _snd_pcm_hw_params_current_ptr = _lookup>( 'snd_pcm_hw_params_current'); late final _dart_snd_pcm_hw_params_current _snd_pcm_hw_params_current = _snd_pcm_hw_params_current_ptr .asFunction<_dart_snd_pcm_hw_params_current>(); int snd_pcm_hw_params( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_hw_params( pcm, params, ); } late final _snd_pcm_hw_params_ptr = _lookup>('snd_pcm_hw_params'); late final _dart_snd_pcm_hw_params _snd_pcm_hw_params = _snd_pcm_hw_params_ptr.asFunction<_dart_snd_pcm_hw_params>(); int snd_pcm_hw_free( ffi.Pointer pcm, ) { return _snd_pcm_hw_free( pcm, ); } late final _snd_pcm_hw_free_ptr = _lookup>('snd_pcm_hw_free'); late final _dart_snd_pcm_hw_free _snd_pcm_hw_free = _snd_pcm_hw_free_ptr.asFunction<_dart_snd_pcm_hw_free>(); int snd_pcm_sw_params_current( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_sw_params_current( pcm, params, ); } late final _snd_pcm_sw_params_current_ptr = _lookup>( 'snd_pcm_sw_params_current'); late final _dart_snd_pcm_sw_params_current _snd_pcm_sw_params_current = _snd_pcm_sw_params_current_ptr .asFunction<_dart_snd_pcm_sw_params_current>(); int snd_pcm_sw_params( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_sw_params( pcm, params, ); } late final _snd_pcm_sw_params_ptr = _lookup>('snd_pcm_sw_params'); late final _dart_snd_pcm_sw_params _snd_pcm_sw_params = _snd_pcm_sw_params_ptr.asFunction<_dart_snd_pcm_sw_params>(); int snd_pcm_prepare( ffi.Pointer pcm, ) { return _snd_pcm_prepare( pcm, ); } late final _snd_pcm_prepare_ptr = _lookup>('snd_pcm_prepare'); late final _dart_snd_pcm_prepare _snd_pcm_prepare = _snd_pcm_prepare_ptr.asFunction<_dart_snd_pcm_prepare>(); int snd_pcm_reset( ffi.Pointer pcm, ) { return _snd_pcm_reset( pcm, ); } late final _snd_pcm_reset_ptr = _lookup>('snd_pcm_reset'); late final _dart_snd_pcm_reset _snd_pcm_reset = _snd_pcm_reset_ptr.asFunction<_dart_snd_pcm_reset>(); int snd_pcm_status( ffi.Pointer pcm, ffi.Pointer status, ) { return _snd_pcm_status( pcm, status, ); } late final _snd_pcm_status_ptr = _lookup>('snd_pcm_status'); late final _dart_snd_pcm_status _snd_pcm_status = _snd_pcm_status_ptr.asFunction<_dart_snd_pcm_status>(); int snd_pcm_start( ffi.Pointer pcm, ) { return _snd_pcm_start( pcm, ); } late final _snd_pcm_start_ptr = _lookup>('snd_pcm_start'); late final _dart_snd_pcm_start _snd_pcm_start = _snd_pcm_start_ptr.asFunction<_dart_snd_pcm_start>(); int snd_pcm_drop( ffi.Pointer pcm, ) { return _snd_pcm_drop( pcm, ); } late final _snd_pcm_drop_ptr = _lookup>('snd_pcm_drop'); late final _dart_snd_pcm_drop _snd_pcm_drop = _snd_pcm_drop_ptr.asFunction<_dart_snd_pcm_drop>(); int snd_pcm_drain( ffi.Pointer pcm, ) { return _snd_pcm_drain( pcm, ); } late final _snd_pcm_drain_ptr = _lookup>('snd_pcm_drain'); late final _dart_snd_pcm_drain _snd_pcm_drain = _snd_pcm_drain_ptr.asFunction<_dart_snd_pcm_drain>(); int snd_pcm_pause( ffi.Pointer pcm, int enable, ) { return _snd_pcm_pause( pcm, enable, ); } late final _snd_pcm_pause_ptr = _lookup>('snd_pcm_pause'); late final _dart_snd_pcm_pause _snd_pcm_pause = _snd_pcm_pause_ptr.asFunction<_dart_snd_pcm_pause>(); int snd_pcm_state( ffi.Pointer pcm, ) { return _snd_pcm_state( pcm, ); } late final _snd_pcm_state_ptr = _lookup>('snd_pcm_state'); late final _dart_snd_pcm_state _snd_pcm_state = _snd_pcm_state_ptr.asFunction<_dart_snd_pcm_state>(); int snd_pcm_hwsync( ffi.Pointer pcm, ) { return _snd_pcm_hwsync( pcm, ); } late final _snd_pcm_hwsync_ptr = _lookup>('snd_pcm_hwsync'); late final _dart_snd_pcm_hwsync _snd_pcm_hwsync = _snd_pcm_hwsync_ptr.asFunction<_dart_snd_pcm_hwsync>(); int snd_pcm_delay( ffi.Pointer pcm, ffi.Pointer delayp, ) { return _snd_pcm_delay( pcm, delayp, ); } late final _snd_pcm_delay_ptr = _lookup>('snd_pcm_delay'); late final _dart_snd_pcm_delay _snd_pcm_delay = _snd_pcm_delay_ptr.asFunction<_dart_snd_pcm_delay>(); int snd_pcm_resume( ffi.Pointer pcm, ) { return _snd_pcm_resume( pcm, ); } late final _snd_pcm_resume_ptr = _lookup>('snd_pcm_resume'); late final _dart_snd_pcm_resume _snd_pcm_resume = _snd_pcm_resume_ptr.asFunction<_dart_snd_pcm_resume>(); int snd_pcm_htimestamp( ffi.Pointer pcm, ffi.Pointer avail, ffi.Pointer tstamp, ) { return _snd_pcm_htimestamp( pcm, avail, tstamp, ); } late final _snd_pcm_htimestamp_ptr = _lookup>('snd_pcm_htimestamp'); late final _dart_snd_pcm_htimestamp _snd_pcm_htimestamp = _snd_pcm_htimestamp_ptr.asFunction<_dart_snd_pcm_htimestamp>(); int snd_pcm_avail( ffi.Pointer pcm, ) { return _snd_pcm_avail( pcm, ); } late final _snd_pcm_avail_ptr = _lookup>('snd_pcm_avail'); late final _dart_snd_pcm_avail _snd_pcm_avail = _snd_pcm_avail_ptr.asFunction<_dart_snd_pcm_avail>(); int snd_pcm_avail_update( ffi.Pointer pcm, ) { return _snd_pcm_avail_update( pcm, ); } late final _snd_pcm_avail_update_ptr = _lookup>( 'snd_pcm_avail_update'); late final _dart_snd_pcm_avail_update _snd_pcm_avail_update = _snd_pcm_avail_update_ptr.asFunction<_dart_snd_pcm_avail_update>(); int snd_pcm_avail_delay( ffi.Pointer pcm, ffi.Pointer availp, ffi.Pointer delayp, ) { return _snd_pcm_avail_delay( pcm, availp, delayp, ); } late final _snd_pcm_avail_delay_ptr = _lookup>( 'snd_pcm_avail_delay'); late final _dart_snd_pcm_avail_delay _snd_pcm_avail_delay = _snd_pcm_avail_delay_ptr.asFunction<_dart_snd_pcm_avail_delay>(); int snd_pcm_rewindable( ffi.Pointer pcm, ) { return _snd_pcm_rewindable( pcm, ); } late final _snd_pcm_rewindable_ptr = _lookup>('snd_pcm_rewindable'); late final _dart_snd_pcm_rewindable _snd_pcm_rewindable = _snd_pcm_rewindable_ptr.asFunction<_dart_snd_pcm_rewindable>(); int snd_pcm_rewind( ffi.Pointer pcm, int frames, ) { return _snd_pcm_rewind( pcm, frames, ); } late final _snd_pcm_rewind_ptr = _lookup>('snd_pcm_rewind'); late final _dart_snd_pcm_rewind _snd_pcm_rewind = _snd_pcm_rewind_ptr.asFunction<_dart_snd_pcm_rewind>(); int snd_pcm_forwardable( ffi.Pointer pcm, ) { return _snd_pcm_forwardable( pcm, ); } late final _snd_pcm_forwardable_ptr = _lookup>( 'snd_pcm_forwardable'); late final _dart_snd_pcm_forwardable _snd_pcm_forwardable = _snd_pcm_forwardable_ptr.asFunction<_dart_snd_pcm_forwardable>(); int snd_pcm_forward( ffi.Pointer pcm, int frames, ) { return _snd_pcm_forward( pcm, frames, ); } late final _snd_pcm_forward_ptr = _lookup>('snd_pcm_forward'); late final _dart_snd_pcm_forward _snd_pcm_forward = _snd_pcm_forward_ptr.asFunction<_dart_snd_pcm_forward>(); int snd_pcm_writei( ffi.Pointer pcm, ffi.Pointer buffer, int size, ) { return _snd_pcm_writei( pcm, buffer, size, ); } late final _snd_pcm_writei_ptr = _lookup>('snd_pcm_writei'); late final _dart_snd_pcm_writei _snd_pcm_writei = _snd_pcm_writei_ptr.asFunction<_dart_snd_pcm_writei>(); int snd_pcm_readi( ffi.Pointer pcm, ffi.Pointer buffer, int size, ) { return _snd_pcm_readi( pcm, buffer, size, ); } late final _snd_pcm_readi_ptr = _lookup>('snd_pcm_readi'); late final _dart_snd_pcm_readi _snd_pcm_readi = _snd_pcm_readi_ptr.asFunction<_dart_snd_pcm_readi>(); int snd_pcm_writen( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ) { return _snd_pcm_writen( pcm, bufs, size, ); } late final _snd_pcm_writen_ptr = _lookup>('snd_pcm_writen'); late final _dart_snd_pcm_writen _snd_pcm_writen = _snd_pcm_writen_ptr.asFunction<_dart_snd_pcm_writen>(); int snd_pcm_readn( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ) { return _snd_pcm_readn( pcm, bufs, size, ); } late final _snd_pcm_readn_ptr = _lookup>('snd_pcm_readn'); late final _dart_snd_pcm_readn _snd_pcm_readn = _snd_pcm_readn_ptr.asFunction<_dart_snd_pcm_readn>(); int snd_pcm_wait( ffi.Pointer pcm, int timeout, ) { return _snd_pcm_wait( pcm, timeout, ); } late final _snd_pcm_wait_ptr = _lookup>('snd_pcm_wait'); late final _dart_snd_pcm_wait _snd_pcm_wait = _snd_pcm_wait_ptr.asFunction<_dart_snd_pcm_wait>(); int snd_pcm_link( ffi.Pointer pcm1, ffi.Pointer pcm2, ) { return _snd_pcm_link( pcm1, pcm2, ); } late final _snd_pcm_link_ptr = _lookup>('snd_pcm_link'); late final _dart_snd_pcm_link _snd_pcm_link = _snd_pcm_link_ptr.asFunction<_dart_snd_pcm_link>(); int snd_pcm_unlink( ffi.Pointer pcm, ) { return _snd_pcm_unlink( pcm, ); } late final _snd_pcm_unlink_ptr = _lookup>('snd_pcm_unlink'); late final _dart_snd_pcm_unlink _snd_pcm_unlink = _snd_pcm_unlink_ptr.asFunction<_dart_snd_pcm_unlink>(); ffi.Pointer> snd_pcm_query_chmaps( ffi.Pointer pcm, ) { return _snd_pcm_query_chmaps( pcm, ); } late final _snd_pcm_query_chmaps_ptr = _lookup>( 'snd_pcm_query_chmaps'); late final _dart_snd_pcm_query_chmaps _snd_pcm_query_chmaps = _snd_pcm_query_chmaps_ptr.asFunction<_dart_snd_pcm_query_chmaps>(); ffi.Pointer> snd_pcm_query_chmaps_from_hw( int card, int dev, int subdev, int stream, ) { return _snd_pcm_query_chmaps_from_hw( card, dev, subdev, stream, ); } late final _snd_pcm_query_chmaps_from_hw_ptr = _lookup>( 'snd_pcm_query_chmaps_from_hw'); late final _dart_snd_pcm_query_chmaps_from_hw _snd_pcm_query_chmaps_from_hw = _snd_pcm_query_chmaps_from_hw_ptr .asFunction<_dart_snd_pcm_query_chmaps_from_hw>(); void snd_pcm_free_chmaps( ffi.Pointer> maps, ) { return _snd_pcm_free_chmaps( maps, ); } late final _snd_pcm_free_chmaps_ptr = _lookup>( 'snd_pcm_free_chmaps'); late final _dart_snd_pcm_free_chmaps _snd_pcm_free_chmaps = _snd_pcm_free_chmaps_ptr.asFunction<_dart_snd_pcm_free_chmaps>(); ffi.Pointer snd_pcm_get_chmap( ffi.Pointer pcm, ) { return _snd_pcm_get_chmap( pcm, ); } late final _snd_pcm_get_chmap_ptr = _lookup>('snd_pcm_get_chmap'); late final _dart_snd_pcm_get_chmap _snd_pcm_get_chmap = _snd_pcm_get_chmap_ptr.asFunction<_dart_snd_pcm_get_chmap>(); int snd_pcm_set_chmap( ffi.Pointer pcm, ffi.Pointer map, ) { return _snd_pcm_set_chmap( pcm, map, ); } late final _snd_pcm_set_chmap_ptr = _lookup>('snd_pcm_set_chmap'); late final _dart_snd_pcm_set_chmap _snd_pcm_set_chmap = _snd_pcm_set_chmap_ptr.asFunction<_dart_snd_pcm_set_chmap>(); ffi.Pointer snd_pcm_chmap_type_name( int val, ) { return _snd_pcm_chmap_type_name( val, ); } late final _snd_pcm_chmap_type_name_ptr = _lookup>( 'snd_pcm_chmap_type_name'); late final _dart_snd_pcm_chmap_type_name _snd_pcm_chmap_type_name = _snd_pcm_chmap_type_name_ptr.asFunction<_dart_snd_pcm_chmap_type_name>(); ffi.Pointer snd_pcm_chmap_name( int val, ) { return _snd_pcm_chmap_name( val, ); } late final _snd_pcm_chmap_name_ptr = _lookup>('snd_pcm_chmap_name'); late final _dart_snd_pcm_chmap_name _snd_pcm_chmap_name = _snd_pcm_chmap_name_ptr.asFunction<_dart_snd_pcm_chmap_name>(); ffi.Pointer snd_pcm_chmap_long_name( int val, ) { return _snd_pcm_chmap_long_name( val, ); } late final _snd_pcm_chmap_long_name_ptr = _lookup>( 'snd_pcm_chmap_long_name'); late final _dart_snd_pcm_chmap_long_name _snd_pcm_chmap_long_name = _snd_pcm_chmap_long_name_ptr.asFunction<_dart_snd_pcm_chmap_long_name>(); int snd_pcm_chmap_print( ffi.Pointer map, int maxlen, ffi.Pointer buf, ) { return _snd_pcm_chmap_print( map, maxlen, buf, ); } late final _snd_pcm_chmap_print_ptr = _lookup>( 'snd_pcm_chmap_print'); late final _dart_snd_pcm_chmap_print _snd_pcm_chmap_print = _snd_pcm_chmap_print_ptr.asFunction<_dart_snd_pcm_chmap_print>(); int snd_pcm_chmap_from_string( ffi.Pointer str, ) { return _snd_pcm_chmap_from_string( str, ); } late final _snd_pcm_chmap_from_string_ptr = _lookup>( 'snd_pcm_chmap_from_string'); late final _dart_snd_pcm_chmap_from_string _snd_pcm_chmap_from_string = _snd_pcm_chmap_from_string_ptr .asFunction<_dart_snd_pcm_chmap_from_string>(); ffi.Pointer snd_pcm_chmap_parse_string( ffi.Pointer str, ) { return _snd_pcm_chmap_parse_string( str, ); } late final _snd_pcm_chmap_parse_string_ptr = _lookup>( 'snd_pcm_chmap_parse_string'); late final _dart_snd_pcm_chmap_parse_string _snd_pcm_chmap_parse_string = _snd_pcm_chmap_parse_string_ptr .asFunction<_dart_snd_pcm_chmap_parse_string>(); int snd_pcm_recover( ffi.Pointer pcm, int err, int silent, ) { return _snd_pcm_recover( pcm, err, silent, ); } late final _snd_pcm_recover_ptr = _lookup>('snd_pcm_recover'); late final _dart_snd_pcm_recover _snd_pcm_recover = _snd_pcm_recover_ptr.asFunction<_dart_snd_pcm_recover>(); int snd_pcm_set_params( ffi.Pointer pcm, int format, int access, int channels, int rate, int soft_resample, int latency, ) { return _snd_pcm_set_params( pcm, format, access, channels, rate, soft_resample, latency, ); } late final _snd_pcm_set_params_ptr = _lookup>('snd_pcm_set_params'); late final _dart_snd_pcm_set_params _snd_pcm_set_params = _snd_pcm_set_params_ptr.asFunction<_dart_snd_pcm_set_params>(); int snd_pcm_get_params( ffi.Pointer pcm, ffi.Pointer buffer_size, ffi.Pointer period_size, ) { return _snd_pcm_get_params( pcm, buffer_size, period_size, ); } late final _snd_pcm_get_params_ptr = _lookup>('snd_pcm_get_params'); late final _dart_snd_pcm_get_params _snd_pcm_get_params = _snd_pcm_get_params_ptr.asFunction<_dart_snd_pcm_get_params>(); int snd_pcm_info_sizeof() { return _snd_pcm_info_sizeof(); } late final _snd_pcm_info_sizeof_ptr = _lookup>( 'snd_pcm_info_sizeof'); late final _dart_snd_pcm_info_sizeof _snd_pcm_info_sizeof = _snd_pcm_info_sizeof_ptr.asFunction<_dart_snd_pcm_info_sizeof>(); int snd_pcm_info_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_info_malloc( ptr, ); } late final _snd_pcm_info_malloc_ptr = _lookup>( 'snd_pcm_info_malloc'); late final _dart_snd_pcm_info_malloc _snd_pcm_info_malloc = _snd_pcm_info_malloc_ptr.asFunction<_dart_snd_pcm_info_malloc>(); void snd_pcm_info_free( ffi.Pointer obj, ) { return _snd_pcm_info_free( obj, ); } late final _snd_pcm_info_free_ptr = _lookup>('snd_pcm_info_free'); late final _dart_snd_pcm_info_free _snd_pcm_info_free = _snd_pcm_info_free_ptr.asFunction<_dart_snd_pcm_info_free>(); void snd_pcm_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_info_copy( dst, src, ); } late final _snd_pcm_info_copy_ptr = _lookup>('snd_pcm_info_copy'); late final _dart_snd_pcm_info_copy _snd_pcm_info_copy = _snd_pcm_info_copy_ptr.asFunction<_dart_snd_pcm_info_copy>(); int snd_pcm_info_get_device( ffi.Pointer obj, ) { return _snd_pcm_info_get_device( obj, ); } late final _snd_pcm_info_get_device_ptr = _lookup>( 'snd_pcm_info_get_device'); late final _dart_snd_pcm_info_get_device _snd_pcm_info_get_device = _snd_pcm_info_get_device_ptr.asFunction<_dart_snd_pcm_info_get_device>(); int snd_pcm_info_get_subdevice( ffi.Pointer obj, ) { return _snd_pcm_info_get_subdevice( obj, ); } late final _snd_pcm_info_get_subdevice_ptr = _lookup>( 'snd_pcm_info_get_subdevice'); late final _dart_snd_pcm_info_get_subdevice _snd_pcm_info_get_subdevice = _snd_pcm_info_get_subdevice_ptr .asFunction<_dart_snd_pcm_info_get_subdevice>(); int snd_pcm_info_get_stream( ffi.Pointer obj, ) { return _snd_pcm_info_get_stream( obj, ); } late final _snd_pcm_info_get_stream_ptr = _lookup>( 'snd_pcm_info_get_stream'); late final _dart_snd_pcm_info_get_stream _snd_pcm_info_get_stream = _snd_pcm_info_get_stream_ptr.asFunction<_dart_snd_pcm_info_get_stream>(); int snd_pcm_info_get_card( ffi.Pointer obj, ) { return _snd_pcm_info_get_card( obj, ); } late final _snd_pcm_info_get_card_ptr = _lookup>( 'snd_pcm_info_get_card'); late final _dart_snd_pcm_info_get_card _snd_pcm_info_get_card = _snd_pcm_info_get_card_ptr.asFunction<_dart_snd_pcm_info_get_card>(); ffi.Pointer snd_pcm_info_get_id( ffi.Pointer obj, ) { return _snd_pcm_info_get_id( obj, ); } late final _snd_pcm_info_get_id_ptr = _lookup>( 'snd_pcm_info_get_id'); late final _dart_snd_pcm_info_get_id _snd_pcm_info_get_id = _snd_pcm_info_get_id_ptr.asFunction<_dart_snd_pcm_info_get_id>(); ffi.Pointer snd_pcm_info_get_name( ffi.Pointer obj, ) { return _snd_pcm_info_get_name( obj, ); } late final _snd_pcm_info_get_name_ptr = _lookup>( 'snd_pcm_info_get_name'); late final _dart_snd_pcm_info_get_name _snd_pcm_info_get_name = _snd_pcm_info_get_name_ptr.asFunction<_dart_snd_pcm_info_get_name>(); ffi.Pointer snd_pcm_info_get_subdevice_name( ffi.Pointer obj, ) { return _snd_pcm_info_get_subdevice_name( obj, ); } late final _snd_pcm_info_get_subdevice_name_ptr = _lookup>( 'snd_pcm_info_get_subdevice_name'); late final _dart_snd_pcm_info_get_subdevice_name _snd_pcm_info_get_subdevice_name = _snd_pcm_info_get_subdevice_name_ptr .asFunction<_dart_snd_pcm_info_get_subdevice_name>(); int snd_pcm_info_get_class( ffi.Pointer obj, ) { return _snd_pcm_info_get_class( obj, ); } late final _snd_pcm_info_get_class_ptr = _lookup>( 'snd_pcm_info_get_class'); late final _dart_snd_pcm_info_get_class _snd_pcm_info_get_class = _snd_pcm_info_get_class_ptr.asFunction<_dart_snd_pcm_info_get_class>(); int snd_pcm_info_get_subclass( ffi.Pointer obj, ) { return _snd_pcm_info_get_subclass( obj, ); } late final _snd_pcm_info_get_subclass_ptr = _lookup>( 'snd_pcm_info_get_subclass'); late final _dart_snd_pcm_info_get_subclass _snd_pcm_info_get_subclass = _snd_pcm_info_get_subclass_ptr .asFunction<_dart_snd_pcm_info_get_subclass>(); int snd_pcm_info_get_subdevices_count( ffi.Pointer obj, ) { return _snd_pcm_info_get_subdevices_count( obj, ); } late final _snd_pcm_info_get_subdevices_count_ptr = _lookup>( 'snd_pcm_info_get_subdevices_count'); late final _dart_snd_pcm_info_get_subdevices_count _snd_pcm_info_get_subdevices_count = _snd_pcm_info_get_subdevices_count_ptr .asFunction<_dart_snd_pcm_info_get_subdevices_count>(); int snd_pcm_info_get_subdevices_avail( ffi.Pointer obj, ) { return _snd_pcm_info_get_subdevices_avail( obj, ); } late final _snd_pcm_info_get_subdevices_avail_ptr = _lookup>( 'snd_pcm_info_get_subdevices_avail'); late final _dart_snd_pcm_info_get_subdevices_avail _snd_pcm_info_get_subdevices_avail = _snd_pcm_info_get_subdevices_avail_ptr .asFunction<_dart_snd_pcm_info_get_subdevices_avail>(); void snd_pcm_info_set_device( ffi.Pointer obj, int val, ) { return _snd_pcm_info_set_device( obj, val, ); } late final _snd_pcm_info_set_device_ptr = _lookup>( 'snd_pcm_info_set_device'); late final _dart_snd_pcm_info_set_device _snd_pcm_info_set_device = _snd_pcm_info_set_device_ptr.asFunction<_dart_snd_pcm_info_set_device>(); void snd_pcm_info_set_subdevice( ffi.Pointer obj, int val, ) { return _snd_pcm_info_set_subdevice( obj, val, ); } late final _snd_pcm_info_set_subdevice_ptr = _lookup>( 'snd_pcm_info_set_subdevice'); late final _dart_snd_pcm_info_set_subdevice _snd_pcm_info_set_subdevice = _snd_pcm_info_set_subdevice_ptr .asFunction<_dart_snd_pcm_info_set_subdevice>(); void snd_pcm_info_set_stream( ffi.Pointer obj, int val, ) { return _snd_pcm_info_set_stream( obj, val, ); } late final _snd_pcm_info_set_stream_ptr = _lookup>( 'snd_pcm_info_set_stream'); late final _dart_snd_pcm_info_set_stream _snd_pcm_info_set_stream = _snd_pcm_info_set_stream_ptr.asFunction<_dart_snd_pcm_info_set_stream>(); int snd_pcm_hw_params_any( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_hw_params_any( pcm, params, ); } late final _snd_pcm_hw_params_any_ptr = _lookup>( 'snd_pcm_hw_params_any'); late final _dart_snd_pcm_hw_params_any _snd_pcm_hw_params_any = _snd_pcm_hw_params_any_ptr.asFunction<_dart_snd_pcm_hw_params_any>(); int snd_pcm_hw_params_can_mmap_sample_resolution( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_mmap_sample_resolution( params, ); } late final _snd_pcm_hw_params_can_mmap_sample_resolution_ptr = _lookup< ffi.NativeFunction<_c_snd_pcm_hw_params_can_mmap_sample_resolution>>( 'snd_pcm_hw_params_can_mmap_sample_resolution'); late final _dart_snd_pcm_hw_params_can_mmap_sample_resolution _snd_pcm_hw_params_can_mmap_sample_resolution = _snd_pcm_hw_params_can_mmap_sample_resolution_ptr .asFunction<_dart_snd_pcm_hw_params_can_mmap_sample_resolution>(); int snd_pcm_hw_params_is_double( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_double( params, ); } late final _snd_pcm_hw_params_is_double_ptr = _lookup>( 'snd_pcm_hw_params_is_double'); late final _dart_snd_pcm_hw_params_is_double _snd_pcm_hw_params_is_double = _snd_pcm_hw_params_is_double_ptr .asFunction<_dart_snd_pcm_hw_params_is_double>(); int snd_pcm_hw_params_is_batch( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_batch( params, ); } late final _snd_pcm_hw_params_is_batch_ptr = _lookup>( 'snd_pcm_hw_params_is_batch'); late final _dart_snd_pcm_hw_params_is_batch _snd_pcm_hw_params_is_batch = _snd_pcm_hw_params_is_batch_ptr .asFunction<_dart_snd_pcm_hw_params_is_batch>(); int snd_pcm_hw_params_is_block_transfer( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_block_transfer( params, ); } late final _snd_pcm_hw_params_is_block_transfer_ptr = _lookup>( 'snd_pcm_hw_params_is_block_transfer'); late final _dart_snd_pcm_hw_params_is_block_transfer _snd_pcm_hw_params_is_block_transfer = _snd_pcm_hw_params_is_block_transfer_ptr .asFunction<_dart_snd_pcm_hw_params_is_block_transfer>(); int snd_pcm_hw_params_is_monotonic( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_monotonic( params, ); } late final _snd_pcm_hw_params_is_monotonic_ptr = _lookup>( 'snd_pcm_hw_params_is_monotonic'); late final _dart_snd_pcm_hw_params_is_monotonic _snd_pcm_hw_params_is_monotonic = _snd_pcm_hw_params_is_monotonic_ptr .asFunction<_dart_snd_pcm_hw_params_is_monotonic>(); int snd_pcm_hw_params_can_overrange( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_overrange( params, ); } late final _snd_pcm_hw_params_can_overrange_ptr = _lookup>( 'snd_pcm_hw_params_can_overrange'); late final _dart_snd_pcm_hw_params_can_overrange _snd_pcm_hw_params_can_overrange = _snd_pcm_hw_params_can_overrange_ptr .asFunction<_dart_snd_pcm_hw_params_can_overrange>(); int snd_pcm_hw_params_can_pause( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_pause( params, ); } late final _snd_pcm_hw_params_can_pause_ptr = _lookup>( 'snd_pcm_hw_params_can_pause'); late final _dart_snd_pcm_hw_params_can_pause _snd_pcm_hw_params_can_pause = _snd_pcm_hw_params_can_pause_ptr .asFunction<_dart_snd_pcm_hw_params_can_pause>(); int snd_pcm_hw_params_can_resume( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_resume( params, ); } late final _snd_pcm_hw_params_can_resume_ptr = _lookup>( 'snd_pcm_hw_params_can_resume'); late final _dart_snd_pcm_hw_params_can_resume _snd_pcm_hw_params_can_resume = _snd_pcm_hw_params_can_resume_ptr .asFunction<_dart_snd_pcm_hw_params_can_resume>(); int snd_pcm_hw_params_is_half_duplex( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_half_duplex( params, ); } late final _snd_pcm_hw_params_is_half_duplex_ptr = _lookup>( 'snd_pcm_hw_params_is_half_duplex'); late final _dart_snd_pcm_hw_params_is_half_duplex _snd_pcm_hw_params_is_half_duplex = _snd_pcm_hw_params_is_half_duplex_ptr .asFunction<_dart_snd_pcm_hw_params_is_half_duplex>(); int snd_pcm_hw_params_is_joint_duplex( ffi.Pointer params, ) { return _snd_pcm_hw_params_is_joint_duplex( params, ); } late final _snd_pcm_hw_params_is_joint_duplex_ptr = _lookup>( 'snd_pcm_hw_params_is_joint_duplex'); late final _dart_snd_pcm_hw_params_is_joint_duplex _snd_pcm_hw_params_is_joint_duplex = _snd_pcm_hw_params_is_joint_duplex_ptr .asFunction<_dart_snd_pcm_hw_params_is_joint_duplex>(); int snd_pcm_hw_params_can_sync_start( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_sync_start( params, ); } late final _snd_pcm_hw_params_can_sync_start_ptr = _lookup>( 'snd_pcm_hw_params_can_sync_start'); late final _dart_snd_pcm_hw_params_can_sync_start _snd_pcm_hw_params_can_sync_start = _snd_pcm_hw_params_can_sync_start_ptr .asFunction<_dart_snd_pcm_hw_params_can_sync_start>(); int snd_pcm_hw_params_can_disable_period_wakeup( ffi.Pointer params, ) { return _snd_pcm_hw_params_can_disable_period_wakeup( params, ); } late final _snd_pcm_hw_params_can_disable_period_wakeup_ptr = _lookup< ffi.NativeFunction<_c_snd_pcm_hw_params_can_disable_period_wakeup>>( 'snd_pcm_hw_params_can_disable_period_wakeup'); late final _dart_snd_pcm_hw_params_can_disable_period_wakeup _snd_pcm_hw_params_can_disable_period_wakeup = _snd_pcm_hw_params_can_disable_period_wakeup_ptr .asFunction<_dart_snd_pcm_hw_params_can_disable_period_wakeup>(); int snd_pcm_hw_params_supports_audio_wallclock_ts( ffi.Pointer params, ) { return _snd_pcm_hw_params_supports_audio_wallclock_ts( params, ); } late final _snd_pcm_hw_params_supports_audio_wallclock_ts_ptr = _lookup< ffi.NativeFunction<_c_snd_pcm_hw_params_supports_audio_wallclock_ts>>( 'snd_pcm_hw_params_supports_audio_wallclock_ts'); late final _dart_snd_pcm_hw_params_supports_audio_wallclock_ts _snd_pcm_hw_params_supports_audio_wallclock_ts = _snd_pcm_hw_params_supports_audio_wallclock_ts_ptr .asFunction<_dart_snd_pcm_hw_params_supports_audio_wallclock_ts>(); int snd_pcm_hw_params_supports_audio_ts_type( ffi.Pointer params, int type, ) { return _snd_pcm_hw_params_supports_audio_ts_type( params, type, ); } late final _snd_pcm_hw_params_supports_audio_ts_type_ptr = _lookup>( 'snd_pcm_hw_params_supports_audio_ts_type'); late final _dart_snd_pcm_hw_params_supports_audio_ts_type _snd_pcm_hw_params_supports_audio_ts_type = _snd_pcm_hw_params_supports_audio_ts_type_ptr .asFunction<_dart_snd_pcm_hw_params_supports_audio_ts_type>(); int snd_pcm_hw_params_get_rate_numden( ffi.Pointer params, ffi.Pointer rate_num, ffi.Pointer rate_den, ) { return _snd_pcm_hw_params_get_rate_numden( params, rate_num, rate_den, ); } late final _snd_pcm_hw_params_get_rate_numden_ptr = _lookup>( 'snd_pcm_hw_params_get_rate_numden'); late final _dart_snd_pcm_hw_params_get_rate_numden _snd_pcm_hw_params_get_rate_numden = _snd_pcm_hw_params_get_rate_numden_ptr .asFunction<_dart_snd_pcm_hw_params_get_rate_numden>(); int snd_pcm_hw_params_get_sbits( ffi.Pointer params, ) { return _snd_pcm_hw_params_get_sbits( params, ); } late final _snd_pcm_hw_params_get_sbits_ptr = _lookup>( 'snd_pcm_hw_params_get_sbits'); late final _dart_snd_pcm_hw_params_get_sbits _snd_pcm_hw_params_get_sbits = _snd_pcm_hw_params_get_sbits_ptr .asFunction<_dart_snd_pcm_hw_params_get_sbits>(); int snd_pcm_hw_params_get_fifo_size( ffi.Pointer params, ) { return _snd_pcm_hw_params_get_fifo_size( params, ); } late final _snd_pcm_hw_params_get_fifo_size_ptr = _lookup>( 'snd_pcm_hw_params_get_fifo_size'); late final _dart_snd_pcm_hw_params_get_fifo_size _snd_pcm_hw_params_get_fifo_size = _snd_pcm_hw_params_get_fifo_size_ptr .asFunction<_dart_snd_pcm_hw_params_get_fifo_size>(); int snd_pcm_hw_params_sizeof() { return _snd_pcm_hw_params_sizeof(); } late final _snd_pcm_hw_params_sizeof_ptr = _lookup>( 'snd_pcm_hw_params_sizeof'); late final _dart_snd_pcm_hw_params_sizeof _snd_pcm_hw_params_sizeof = _snd_pcm_hw_params_sizeof_ptr .asFunction<_dart_snd_pcm_hw_params_sizeof>(); int snd_pcm_hw_params_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_hw_params_malloc( ptr, ); } late final _snd_pcm_hw_params_malloc_ptr = _lookup>( 'snd_pcm_hw_params_malloc'); late final _dart_snd_pcm_hw_params_malloc _snd_pcm_hw_params_malloc = _snd_pcm_hw_params_malloc_ptr .asFunction<_dart_snd_pcm_hw_params_malloc>(); void snd_pcm_hw_params_free( ffi.Pointer obj, ) { return _snd_pcm_hw_params_free( obj, ); } late final _snd_pcm_hw_params_free_ptr = _lookup>( 'snd_pcm_hw_params_free'); late final _dart_snd_pcm_hw_params_free _snd_pcm_hw_params_free = _snd_pcm_hw_params_free_ptr.asFunction<_dart_snd_pcm_hw_params_free>(); void snd_pcm_hw_params_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_hw_params_copy( dst, src, ); } late final _snd_pcm_hw_params_copy_ptr = _lookup>( 'snd_pcm_hw_params_copy'); late final _dart_snd_pcm_hw_params_copy _snd_pcm_hw_params_copy = _snd_pcm_hw_params_copy_ptr.asFunction<_dart_snd_pcm_hw_params_copy>(); int snd_pcm_hw_params_get_access( ffi.Pointer params, ffi.Pointer _access, ) { return _snd_pcm_hw_params_get_access( params, _access, ); } late final _snd_pcm_hw_params_get_access_ptr = _lookup>( 'snd_pcm_hw_params_get_access'); late final _dart_snd_pcm_hw_params_get_access _snd_pcm_hw_params_get_access = _snd_pcm_hw_params_get_access_ptr .asFunction<_dart_snd_pcm_hw_params_get_access>(); int snd_pcm_hw_params_test_access( ffi.Pointer pcm, ffi.Pointer params, int _access, ) { return _snd_pcm_hw_params_test_access( pcm, params, _access, ); } late final _snd_pcm_hw_params_test_access_ptr = _lookup>( 'snd_pcm_hw_params_test_access'); late final _dart_snd_pcm_hw_params_test_access _snd_pcm_hw_params_test_access = _snd_pcm_hw_params_test_access_ptr .asFunction<_dart_snd_pcm_hw_params_test_access>(); int snd_pcm_hw_params_set_access( ffi.Pointer pcm, ffi.Pointer params, int _access, ) { return _snd_pcm_hw_params_set_access( pcm, params, _access, ); } late final _snd_pcm_hw_params_set_access_ptr = _lookup>( 'snd_pcm_hw_params_set_access'); late final _dart_snd_pcm_hw_params_set_access _snd_pcm_hw_params_set_access = _snd_pcm_hw_params_set_access_ptr .asFunction<_dart_snd_pcm_hw_params_set_access>(); int snd_pcm_hw_params_set_access_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ) { return _snd_pcm_hw_params_set_access_first( pcm, params, _access, ); } late final _snd_pcm_hw_params_set_access_first_ptr = _lookup>( 'snd_pcm_hw_params_set_access_first'); late final _dart_snd_pcm_hw_params_set_access_first _snd_pcm_hw_params_set_access_first = _snd_pcm_hw_params_set_access_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_access_first>(); int snd_pcm_hw_params_set_access_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ) { return _snd_pcm_hw_params_set_access_last( pcm, params, _access, ); } late final _snd_pcm_hw_params_set_access_last_ptr = _lookup>( 'snd_pcm_hw_params_set_access_last'); late final _dart_snd_pcm_hw_params_set_access_last _snd_pcm_hw_params_set_access_last = _snd_pcm_hw_params_set_access_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_access_last>(); int snd_pcm_hw_params_set_access_mask( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_set_access_mask( pcm, params, mask, ); } late final _snd_pcm_hw_params_set_access_mask_ptr = _lookup>( 'snd_pcm_hw_params_set_access_mask'); late final _dart_snd_pcm_hw_params_set_access_mask _snd_pcm_hw_params_set_access_mask = _snd_pcm_hw_params_set_access_mask_ptr .asFunction<_dart_snd_pcm_hw_params_set_access_mask>(); int snd_pcm_hw_params_get_access_mask( ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_get_access_mask( params, mask, ); } late final _snd_pcm_hw_params_get_access_mask_ptr = _lookup>( 'snd_pcm_hw_params_get_access_mask'); late final _dart_snd_pcm_hw_params_get_access_mask _snd_pcm_hw_params_get_access_mask = _snd_pcm_hw_params_get_access_mask_ptr .asFunction<_dart_snd_pcm_hw_params_get_access_mask>(); int snd_pcm_hw_params_get_format( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_format( params, val, ); } late final _snd_pcm_hw_params_get_format_ptr = _lookup>( 'snd_pcm_hw_params_get_format'); late final _dart_snd_pcm_hw_params_get_format _snd_pcm_hw_params_get_format = _snd_pcm_hw_params_get_format_ptr .asFunction<_dart_snd_pcm_hw_params_get_format>(); int snd_pcm_hw_params_test_format( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_test_format( pcm, params, val, ); } late final _snd_pcm_hw_params_test_format_ptr = _lookup>( 'snd_pcm_hw_params_test_format'); late final _dart_snd_pcm_hw_params_test_format _snd_pcm_hw_params_test_format = _snd_pcm_hw_params_test_format_ptr .asFunction<_dart_snd_pcm_hw_params_test_format>(); int snd_pcm_hw_params_set_format( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_format( pcm, params, val, ); } late final _snd_pcm_hw_params_set_format_ptr = _lookup>( 'snd_pcm_hw_params_set_format'); late final _dart_snd_pcm_hw_params_set_format _snd_pcm_hw_params_set_format = _snd_pcm_hw_params_set_format_ptr .asFunction<_dart_snd_pcm_hw_params_set_format>(); int snd_pcm_hw_params_set_format_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ) { return _snd_pcm_hw_params_set_format_first( pcm, params, format, ); } late final _snd_pcm_hw_params_set_format_first_ptr = _lookup>( 'snd_pcm_hw_params_set_format_first'); late final _dart_snd_pcm_hw_params_set_format_first _snd_pcm_hw_params_set_format_first = _snd_pcm_hw_params_set_format_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_format_first>(); int snd_pcm_hw_params_set_format_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ) { return _snd_pcm_hw_params_set_format_last( pcm, params, format, ); } late final _snd_pcm_hw_params_set_format_last_ptr = _lookup>( 'snd_pcm_hw_params_set_format_last'); late final _dart_snd_pcm_hw_params_set_format_last _snd_pcm_hw_params_set_format_last = _snd_pcm_hw_params_set_format_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_format_last>(); int snd_pcm_hw_params_set_format_mask( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_set_format_mask( pcm, params, mask, ); } late final _snd_pcm_hw_params_set_format_mask_ptr = _lookup>( 'snd_pcm_hw_params_set_format_mask'); late final _dart_snd_pcm_hw_params_set_format_mask _snd_pcm_hw_params_set_format_mask = _snd_pcm_hw_params_set_format_mask_ptr .asFunction<_dart_snd_pcm_hw_params_set_format_mask>(); void snd_pcm_hw_params_get_format_mask( ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_get_format_mask( params, mask, ); } late final _snd_pcm_hw_params_get_format_mask_ptr = _lookup>( 'snd_pcm_hw_params_get_format_mask'); late final _dart_snd_pcm_hw_params_get_format_mask _snd_pcm_hw_params_get_format_mask = _snd_pcm_hw_params_get_format_mask_ptr .asFunction<_dart_snd_pcm_hw_params_get_format_mask>(); int snd_pcm_hw_params_get_subformat( ffi.Pointer params, ffi.Pointer subformat, ) { return _snd_pcm_hw_params_get_subformat( params, subformat, ); } late final _snd_pcm_hw_params_get_subformat_ptr = _lookup>( 'snd_pcm_hw_params_get_subformat'); late final _dart_snd_pcm_hw_params_get_subformat _snd_pcm_hw_params_get_subformat = _snd_pcm_hw_params_get_subformat_ptr .asFunction<_dart_snd_pcm_hw_params_get_subformat>(); int snd_pcm_hw_params_test_subformat( ffi.Pointer pcm, ffi.Pointer params, int subformat, ) { return _snd_pcm_hw_params_test_subformat( pcm, params, subformat, ); } late final _snd_pcm_hw_params_test_subformat_ptr = _lookup>( 'snd_pcm_hw_params_test_subformat'); late final _dart_snd_pcm_hw_params_test_subformat _snd_pcm_hw_params_test_subformat = _snd_pcm_hw_params_test_subformat_ptr .asFunction<_dart_snd_pcm_hw_params_test_subformat>(); int snd_pcm_hw_params_set_subformat( ffi.Pointer pcm, ffi.Pointer params, int subformat, ) { return _snd_pcm_hw_params_set_subformat( pcm, params, subformat, ); } late final _snd_pcm_hw_params_set_subformat_ptr = _lookup>( 'snd_pcm_hw_params_set_subformat'); late final _dart_snd_pcm_hw_params_set_subformat _snd_pcm_hw_params_set_subformat = _snd_pcm_hw_params_set_subformat_ptr .asFunction<_dart_snd_pcm_hw_params_set_subformat>(); int snd_pcm_hw_params_set_subformat_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ) { return _snd_pcm_hw_params_set_subformat_first( pcm, params, subformat, ); } late final _snd_pcm_hw_params_set_subformat_first_ptr = _lookup>( 'snd_pcm_hw_params_set_subformat_first'); late final _dart_snd_pcm_hw_params_set_subformat_first _snd_pcm_hw_params_set_subformat_first = _snd_pcm_hw_params_set_subformat_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_subformat_first>(); int snd_pcm_hw_params_set_subformat_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ) { return _snd_pcm_hw_params_set_subformat_last( pcm, params, subformat, ); } late final _snd_pcm_hw_params_set_subformat_last_ptr = _lookup>( 'snd_pcm_hw_params_set_subformat_last'); late final _dart_snd_pcm_hw_params_set_subformat_last _snd_pcm_hw_params_set_subformat_last = _snd_pcm_hw_params_set_subformat_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_subformat_last>(); int snd_pcm_hw_params_set_subformat_mask( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_set_subformat_mask( pcm, params, mask, ); } late final _snd_pcm_hw_params_set_subformat_mask_ptr = _lookup>( 'snd_pcm_hw_params_set_subformat_mask'); late final _dart_snd_pcm_hw_params_set_subformat_mask _snd_pcm_hw_params_set_subformat_mask = _snd_pcm_hw_params_set_subformat_mask_ptr .asFunction<_dart_snd_pcm_hw_params_set_subformat_mask>(); void snd_pcm_hw_params_get_subformat_mask( ffi.Pointer params, ffi.Pointer mask, ) { return _snd_pcm_hw_params_get_subformat_mask( params, mask, ); } late final _snd_pcm_hw_params_get_subformat_mask_ptr = _lookup>( 'snd_pcm_hw_params_get_subformat_mask'); late final _dart_snd_pcm_hw_params_get_subformat_mask _snd_pcm_hw_params_get_subformat_mask = _snd_pcm_hw_params_get_subformat_mask_ptr .asFunction<_dart_snd_pcm_hw_params_get_subformat_mask>(); int snd_pcm_hw_params_get_channels( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_channels( params, val, ); } late final _snd_pcm_hw_params_get_channels_ptr = _lookup>( 'snd_pcm_hw_params_get_channels'); late final _dart_snd_pcm_hw_params_get_channels _snd_pcm_hw_params_get_channels = _snd_pcm_hw_params_get_channels_ptr .asFunction<_dart_snd_pcm_hw_params_get_channels>(); int snd_pcm_hw_params_get_channels_min( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_channels_min( params, val, ); } late final _snd_pcm_hw_params_get_channels_min_ptr = _lookup>( 'snd_pcm_hw_params_get_channels_min'); late final _dart_snd_pcm_hw_params_get_channels_min _snd_pcm_hw_params_get_channels_min = _snd_pcm_hw_params_get_channels_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_channels_min>(); int snd_pcm_hw_params_get_channels_max( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_channels_max( params, val, ); } late final _snd_pcm_hw_params_get_channels_max_ptr = _lookup>( 'snd_pcm_hw_params_get_channels_max'); late final _dart_snd_pcm_hw_params_get_channels_max _snd_pcm_hw_params_get_channels_max = _snd_pcm_hw_params_get_channels_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_channels_max>(); int snd_pcm_hw_params_test_channels( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_test_channels( pcm, params, val, ); } late final _snd_pcm_hw_params_test_channels_ptr = _lookup>( 'snd_pcm_hw_params_test_channels'); late final _dart_snd_pcm_hw_params_test_channels _snd_pcm_hw_params_test_channels = _snd_pcm_hw_params_test_channels_ptr .asFunction<_dart_snd_pcm_hw_params_test_channels>(); int snd_pcm_hw_params_set_channels( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_channels( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_ptr = _lookup>( 'snd_pcm_hw_params_set_channels'); late final _dart_snd_pcm_hw_params_set_channels _snd_pcm_hw_params_set_channels = _snd_pcm_hw_params_set_channels_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels>(); int snd_pcm_hw_params_set_channels_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_channels_min( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_min_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_min'); late final _dart_snd_pcm_hw_params_set_channels_min _snd_pcm_hw_params_set_channels_min = _snd_pcm_hw_params_set_channels_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_min>(); int snd_pcm_hw_params_set_channels_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_channels_max( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_max_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_max'); late final _dart_snd_pcm_hw_params_set_channels_max _snd_pcm_hw_params_set_channels_max = _snd_pcm_hw_params_set_channels_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_max>(); int snd_pcm_hw_params_set_channels_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ) { return _snd_pcm_hw_params_set_channels_minmax( pcm, params, min, max, ); } late final _snd_pcm_hw_params_set_channels_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_minmax'); late final _dart_snd_pcm_hw_params_set_channels_minmax _snd_pcm_hw_params_set_channels_minmax = _snd_pcm_hw_params_set_channels_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_minmax>(); int snd_pcm_hw_params_set_channels_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_channels_near( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_near_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_near'); late final _dart_snd_pcm_hw_params_set_channels_near _snd_pcm_hw_params_set_channels_near = _snd_pcm_hw_params_set_channels_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_near>(); int snd_pcm_hw_params_set_channels_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_channels_first( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_first_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_first'); late final _dart_snd_pcm_hw_params_set_channels_first _snd_pcm_hw_params_set_channels_first = _snd_pcm_hw_params_set_channels_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_first>(); int snd_pcm_hw_params_set_channels_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_channels_last( pcm, params, val, ); } late final _snd_pcm_hw_params_set_channels_last_ptr = _lookup>( 'snd_pcm_hw_params_set_channels_last'); late final _dart_snd_pcm_hw_params_set_channels_last _snd_pcm_hw_params_set_channels_last = _snd_pcm_hw_params_set_channels_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_channels_last>(); int snd_pcm_hw_params_get_rate( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_rate( params, val, dir, ); } late final _snd_pcm_hw_params_get_rate_ptr = _lookup>( 'snd_pcm_hw_params_get_rate'); late final _dart_snd_pcm_hw_params_get_rate _snd_pcm_hw_params_get_rate = _snd_pcm_hw_params_get_rate_ptr .asFunction<_dart_snd_pcm_hw_params_get_rate>(); int snd_pcm_hw_params_get_rate_min( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_rate_min( params, val, dir, ); } late final _snd_pcm_hw_params_get_rate_min_ptr = _lookup>( 'snd_pcm_hw_params_get_rate_min'); late final _dart_snd_pcm_hw_params_get_rate_min _snd_pcm_hw_params_get_rate_min = _snd_pcm_hw_params_get_rate_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_rate_min>(); int snd_pcm_hw_params_get_rate_max( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_rate_max( params, val, dir, ); } late final _snd_pcm_hw_params_get_rate_max_ptr = _lookup>( 'snd_pcm_hw_params_get_rate_max'); late final _dart_snd_pcm_hw_params_get_rate_max _snd_pcm_hw_params_get_rate_max = _snd_pcm_hw_params_get_rate_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_rate_max>(); int snd_pcm_hw_params_test_rate( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_rate( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_rate_ptr = _lookup>( 'snd_pcm_hw_params_test_rate'); late final _dart_snd_pcm_hw_params_test_rate _snd_pcm_hw_params_test_rate = _snd_pcm_hw_params_test_rate_ptr .asFunction<_dart_snd_pcm_hw_params_test_rate>(); int snd_pcm_hw_params_set_rate( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_rate( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_ptr = _lookup>( 'snd_pcm_hw_params_set_rate'); late final _dart_snd_pcm_hw_params_set_rate _snd_pcm_hw_params_set_rate = _snd_pcm_hw_params_set_rate_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate>(); int snd_pcm_hw_params_set_rate_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_rate_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_min_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_min'); late final _dart_snd_pcm_hw_params_set_rate_min _snd_pcm_hw_params_set_rate_min = _snd_pcm_hw_params_set_rate_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_min>(); int snd_pcm_hw_params_set_rate_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_rate_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_max_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_max'); late final _dart_snd_pcm_hw_params_set_rate_max _snd_pcm_hw_params_set_rate_max = _snd_pcm_hw_params_set_rate_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_max>(); int snd_pcm_hw_params_set_rate_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_rate_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_rate_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_minmax'); late final _dart_snd_pcm_hw_params_set_rate_minmax _snd_pcm_hw_params_set_rate_minmax = _snd_pcm_hw_params_set_rate_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_minmax>(); int snd_pcm_hw_params_set_rate_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_rate_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_near_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_near'); late final _dart_snd_pcm_hw_params_set_rate_near _snd_pcm_hw_params_set_rate_near = _snd_pcm_hw_params_set_rate_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_near>(); int snd_pcm_hw_params_set_rate_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_rate_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_first_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_first'); late final _dart_snd_pcm_hw_params_set_rate_first _snd_pcm_hw_params_set_rate_first = _snd_pcm_hw_params_set_rate_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_first>(); int snd_pcm_hw_params_set_rate_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_rate_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_rate_last_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_last'); late final _dart_snd_pcm_hw_params_set_rate_last _snd_pcm_hw_params_set_rate_last = _snd_pcm_hw_params_set_rate_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_last>(); int snd_pcm_hw_params_set_rate_resample( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_rate_resample( pcm, params, val, ); } late final _snd_pcm_hw_params_set_rate_resample_ptr = _lookup>( 'snd_pcm_hw_params_set_rate_resample'); late final _dart_snd_pcm_hw_params_set_rate_resample _snd_pcm_hw_params_set_rate_resample = _snd_pcm_hw_params_set_rate_resample_ptr .asFunction<_dart_snd_pcm_hw_params_set_rate_resample>(); int snd_pcm_hw_params_get_rate_resample( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_rate_resample( pcm, params, val, ); } late final _snd_pcm_hw_params_get_rate_resample_ptr = _lookup>( 'snd_pcm_hw_params_get_rate_resample'); late final _dart_snd_pcm_hw_params_get_rate_resample _snd_pcm_hw_params_get_rate_resample = _snd_pcm_hw_params_get_rate_resample_ptr .asFunction<_dart_snd_pcm_hw_params_get_rate_resample>(); int snd_pcm_hw_params_set_export_buffer( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_export_buffer( pcm, params, val, ); } late final _snd_pcm_hw_params_set_export_buffer_ptr = _lookup>( 'snd_pcm_hw_params_set_export_buffer'); late final _dart_snd_pcm_hw_params_set_export_buffer _snd_pcm_hw_params_set_export_buffer = _snd_pcm_hw_params_set_export_buffer_ptr .asFunction<_dart_snd_pcm_hw_params_set_export_buffer>(); int snd_pcm_hw_params_get_export_buffer( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_export_buffer( pcm, params, val, ); } late final _snd_pcm_hw_params_get_export_buffer_ptr = _lookup>( 'snd_pcm_hw_params_get_export_buffer'); late final _dart_snd_pcm_hw_params_get_export_buffer _snd_pcm_hw_params_get_export_buffer = _snd_pcm_hw_params_get_export_buffer_ptr .asFunction<_dart_snd_pcm_hw_params_get_export_buffer>(); int snd_pcm_hw_params_set_period_wakeup( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_period_wakeup( pcm, params, val, ); } late final _snd_pcm_hw_params_set_period_wakeup_ptr = _lookup>( 'snd_pcm_hw_params_set_period_wakeup'); late final _dart_snd_pcm_hw_params_set_period_wakeup _snd_pcm_hw_params_set_period_wakeup = _snd_pcm_hw_params_set_period_wakeup_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_wakeup>(); int snd_pcm_hw_params_get_period_wakeup( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_period_wakeup( pcm, params, val, ); } late final _snd_pcm_hw_params_get_period_wakeup_ptr = _lookup>( 'snd_pcm_hw_params_get_period_wakeup'); late final _dart_snd_pcm_hw_params_get_period_wakeup _snd_pcm_hw_params_get_period_wakeup = _snd_pcm_hw_params_get_period_wakeup_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_wakeup>(); int snd_pcm_hw_params_get_period_time( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_time( params, val, dir, ); } late final _snd_pcm_hw_params_get_period_time_ptr = _lookup>( 'snd_pcm_hw_params_get_period_time'); late final _dart_snd_pcm_hw_params_get_period_time _snd_pcm_hw_params_get_period_time = _snd_pcm_hw_params_get_period_time_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_time>(); int snd_pcm_hw_params_get_period_time_min( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_time_min( params, val, dir, ); } late final _snd_pcm_hw_params_get_period_time_min_ptr = _lookup>( 'snd_pcm_hw_params_get_period_time_min'); late final _dart_snd_pcm_hw_params_get_period_time_min _snd_pcm_hw_params_get_period_time_min = _snd_pcm_hw_params_get_period_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_time_min>(); int snd_pcm_hw_params_get_period_time_max( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_time_max( params, val, dir, ); } late final _snd_pcm_hw_params_get_period_time_max_ptr = _lookup>( 'snd_pcm_hw_params_get_period_time_max'); late final _dart_snd_pcm_hw_params_get_period_time_max _snd_pcm_hw_params_get_period_time_max = _snd_pcm_hw_params_get_period_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_time_max>(); int snd_pcm_hw_params_test_period_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_period_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_period_time_ptr = _lookup>( 'snd_pcm_hw_params_test_period_time'); late final _dart_snd_pcm_hw_params_test_period_time _snd_pcm_hw_params_test_period_time = _snd_pcm_hw_params_test_period_time_ptr .asFunction<_dart_snd_pcm_hw_params_test_period_time>(); int snd_pcm_hw_params_set_period_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_period_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time'); late final _dart_snd_pcm_hw_params_set_period_time _snd_pcm_hw_params_set_period_time = _snd_pcm_hw_params_set_period_time_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time>(); int snd_pcm_hw_params_set_period_time_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_time_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_min_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_min'); late final _dart_snd_pcm_hw_params_set_period_time_min _snd_pcm_hw_params_set_period_time_min = _snd_pcm_hw_params_set_period_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_min>(); int snd_pcm_hw_params_set_period_time_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_time_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_max_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_max'); late final _dart_snd_pcm_hw_params_set_period_time_max _snd_pcm_hw_params_set_period_time_max = _snd_pcm_hw_params_set_period_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_max>(); int snd_pcm_hw_params_set_period_time_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_period_time_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_period_time_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_minmax'); late final _dart_snd_pcm_hw_params_set_period_time_minmax _snd_pcm_hw_params_set_period_time_minmax = _snd_pcm_hw_params_set_period_time_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_minmax>(); int snd_pcm_hw_params_set_period_time_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_time_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_near_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_near'); late final _dart_snd_pcm_hw_params_set_period_time_near _snd_pcm_hw_params_set_period_time_near = _snd_pcm_hw_params_set_period_time_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_near>(); int snd_pcm_hw_params_set_period_time_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_time_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_first_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_first'); late final _dart_snd_pcm_hw_params_set_period_time_first _snd_pcm_hw_params_set_period_time_first = _snd_pcm_hw_params_set_period_time_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_first>(); int snd_pcm_hw_params_set_period_time_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_time_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_time_last_ptr = _lookup>( 'snd_pcm_hw_params_set_period_time_last'); late final _dart_snd_pcm_hw_params_set_period_time_last _snd_pcm_hw_params_set_period_time_last = _snd_pcm_hw_params_set_period_time_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_time_last>(); int snd_pcm_hw_params_get_period_size( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_size( params, frames, dir, ); } late final _snd_pcm_hw_params_get_period_size_ptr = _lookup>( 'snd_pcm_hw_params_get_period_size'); late final _dart_snd_pcm_hw_params_get_period_size _snd_pcm_hw_params_get_period_size = _snd_pcm_hw_params_get_period_size_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_size>(); int snd_pcm_hw_params_get_period_size_min( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_size_min( params, frames, dir, ); } late final _snd_pcm_hw_params_get_period_size_min_ptr = _lookup>( 'snd_pcm_hw_params_get_period_size_min'); late final _dart_snd_pcm_hw_params_get_period_size_min _snd_pcm_hw_params_get_period_size_min = _snd_pcm_hw_params_get_period_size_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_size_min>(); int snd_pcm_hw_params_get_period_size_max( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_period_size_max( params, frames, dir, ); } late final _snd_pcm_hw_params_get_period_size_max_ptr = _lookup>( 'snd_pcm_hw_params_get_period_size_max'); late final _dart_snd_pcm_hw_params_get_period_size_max _snd_pcm_hw_params_get_period_size_max = _snd_pcm_hw_params_get_period_size_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_period_size_max>(); int snd_pcm_hw_params_test_period_size( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_period_size( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_period_size_ptr = _lookup>( 'snd_pcm_hw_params_test_period_size'); late final _dart_snd_pcm_hw_params_test_period_size _snd_pcm_hw_params_test_period_size = _snd_pcm_hw_params_test_period_size_ptr .asFunction<_dart_snd_pcm_hw_params_test_period_size>(); int snd_pcm_hw_params_set_period_size( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_period_size( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size'); late final _dart_snd_pcm_hw_params_set_period_size _snd_pcm_hw_params_set_period_size = _snd_pcm_hw_params_set_period_size_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size>(); int snd_pcm_hw_params_set_period_size_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_size_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_min_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_min'); late final _dart_snd_pcm_hw_params_set_period_size_min _snd_pcm_hw_params_set_period_size_min = _snd_pcm_hw_params_set_period_size_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_min>(); int snd_pcm_hw_params_set_period_size_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_size_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_max_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_max'); late final _dart_snd_pcm_hw_params_set_period_size_max _snd_pcm_hw_params_set_period_size_max = _snd_pcm_hw_params_set_period_size_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_max>(); int snd_pcm_hw_params_set_period_size_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_period_size_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_period_size_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_minmax'); late final _dart_snd_pcm_hw_params_set_period_size_minmax _snd_pcm_hw_params_set_period_size_minmax = _snd_pcm_hw_params_set_period_size_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_minmax>(); int snd_pcm_hw_params_set_period_size_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_size_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_near_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_near'); late final _dart_snd_pcm_hw_params_set_period_size_near _snd_pcm_hw_params_set_period_size_near = _snd_pcm_hw_params_set_period_size_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_near>(); int snd_pcm_hw_params_set_period_size_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_size_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_first_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_first'); late final _dart_snd_pcm_hw_params_set_period_size_first _snd_pcm_hw_params_set_period_size_first = _snd_pcm_hw_params_set_period_size_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_first>(); int snd_pcm_hw_params_set_period_size_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_period_size_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_period_size_last_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_last'); late final _dart_snd_pcm_hw_params_set_period_size_last _snd_pcm_hw_params_set_period_size_last = _snd_pcm_hw_params_set_period_size_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_last>(); int snd_pcm_hw_params_set_period_size_integer( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_hw_params_set_period_size_integer( pcm, params, ); } late final _snd_pcm_hw_params_set_period_size_integer_ptr = _lookup>( 'snd_pcm_hw_params_set_period_size_integer'); late final _dart_snd_pcm_hw_params_set_period_size_integer _snd_pcm_hw_params_set_period_size_integer = _snd_pcm_hw_params_set_period_size_integer_ptr .asFunction<_dart_snd_pcm_hw_params_set_period_size_integer>(); int snd_pcm_hw_params_get_periods( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_periods( params, val, dir, ); } late final _snd_pcm_hw_params_get_periods_ptr = _lookup>( 'snd_pcm_hw_params_get_periods'); late final _dart_snd_pcm_hw_params_get_periods _snd_pcm_hw_params_get_periods = _snd_pcm_hw_params_get_periods_ptr .asFunction<_dart_snd_pcm_hw_params_get_periods>(); int snd_pcm_hw_params_get_periods_min( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_periods_min( params, val, dir, ); } late final _snd_pcm_hw_params_get_periods_min_ptr = _lookup>( 'snd_pcm_hw_params_get_periods_min'); late final _dart_snd_pcm_hw_params_get_periods_min _snd_pcm_hw_params_get_periods_min = _snd_pcm_hw_params_get_periods_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_periods_min>(); int snd_pcm_hw_params_get_periods_max( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_periods_max( params, val, dir, ); } late final _snd_pcm_hw_params_get_periods_max_ptr = _lookup>( 'snd_pcm_hw_params_get_periods_max'); late final _dart_snd_pcm_hw_params_get_periods_max _snd_pcm_hw_params_get_periods_max = _snd_pcm_hw_params_get_periods_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_periods_max>(); int snd_pcm_hw_params_test_periods( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_periods( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_periods_ptr = _lookup>( 'snd_pcm_hw_params_test_periods'); late final _dart_snd_pcm_hw_params_test_periods _snd_pcm_hw_params_test_periods = _snd_pcm_hw_params_test_periods_ptr .asFunction<_dart_snd_pcm_hw_params_test_periods>(); int snd_pcm_hw_params_set_periods( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_periods( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_ptr = _lookup>( 'snd_pcm_hw_params_set_periods'); late final _dart_snd_pcm_hw_params_set_periods _snd_pcm_hw_params_set_periods = _snd_pcm_hw_params_set_periods_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods>(); int snd_pcm_hw_params_set_periods_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_periods_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_min_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_min'); late final _dart_snd_pcm_hw_params_set_periods_min _snd_pcm_hw_params_set_periods_min = _snd_pcm_hw_params_set_periods_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_min>(); int snd_pcm_hw_params_set_periods_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_periods_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_max_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_max'); late final _dart_snd_pcm_hw_params_set_periods_max _snd_pcm_hw_params_set_periods_max = _snd_pcm_hw_params_set_periods_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_max>(); int snd_pcm_hw_params_set_periods_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_periods_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_periods_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_minmax'); late final _dart_snd_pcm_hw_params_set_periods_minmax _snd_pcm_hw_params_set_periods_minmax = _snd_pcm_hw_params_set_periods_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_minmax>(); int snd_pcm_hw_params_set_periods_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_periods_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_near_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_near'); late final _dart_snd_pcm_hw_params_set_periods_near _snd_pcm_hw_params_set_periods_near = _snd_pcm_hw_params_set_periods_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_near>(); int snd_pcm_hw_params_set_periods_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_periods_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_first_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_first'); late final _dart_snd_pcm_hw_params_set_periods_first _snd_pcm_hw_params_set_periods_first = _snd_pcm_hw_params_set_periods_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_first>(); int snd_pcm_hw_params_set_periods_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_periods_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_periods_last_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_last'); late final _dart_snd_pcm_hw_params_set_periods_last _snd_pcm_hw_params_set_periods_last = _snd_pcm_hw_params_set_periods_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_last>(); int snd_pcm_hw_params_set_periods_integer( ffi.Pointer pcm, ffi.Pointer params, ) { return _snd_pcm_hw_params_set_periods_integer( pcm, params, ); } late final _snd_pcm_hw_params_set_periods_integer_ptr = _lookup>( 'snd_pcm_hw_params_set_periods_integer'); late final _dart_snd_pcm_hw_params_set_periods_integer _snd_pcm_hw_params_set_periods_integer = _snd_pcm_hw_params_set_periods_integer_ptr .asFunction<_dart_snd_pcm_hw_params_set_periods_integer>(); int snd_pcm_hw_params_get_buffer_time( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_buffer_time( params, val, dir, ); } late final _snd_pcm_hw_params_get_buffer_time_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_time'); late final _dart_snd_pcm_hw_params_get_buffer_time _snd_pcm_hw_params_get_buffer_time = _snd_pcm_hw_params_get_buffer_time_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_time>(); int snd_pcm_hw_params_get_buffer_time_min( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_buffer_time_min( params, val, dir, ); } late final _snd_pcm_hw_params_get_buffer_time_min_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_time_min'); late final _dart_snd_pcm_hw_params_get_buffer_time_min _snd_pcm_hw_params_get_buffer_time_min = _snd_pcm_hw_params_get_buffer_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_time_min>(); int snd_pcm_hw_params_get_buffer_time_max( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_buffer_time_max( params, val, dir, ); } late final _snd_pcm_hw_params_get_buffer_time_max_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_time_max'); late final _dart_snd_pcm_hw_params_get_buffer_time_max _snd_pcm_hw_params_get_buffer_time_max = _snd_pcm_hw_params_get_buffer_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_time_max>(); int snd_pcm_hw_params_test_buffer_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_buffer_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_buffer_time_ptr = _lookup>( 'snd_pcm_hw_params_test_buffer_time'); late final _dart_snd_pcm_hw_params_test_buffer_time _snd_pcm_hw_params_test_buffer_time = _snd_pcm_hw_params_test_buffer_time_ptr .asFunction<_dart_snd_pcm_hw_params_test_buffer_time>(); int snd_pcm_hw_params_set_buffer_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_buffer_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time'); late final _dart_snd_pcm_hw_params_set_buffer_time _snd_pcm_hw_params_set_buffer_time = _snd_pcm_hw_params_set_buffer_time_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time>(); int snd_pcm_hw_params_set_buffer_time_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_buffer_time_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_min_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_min'); late final _dart_snd_pcm_hw_params_set_buffer_time_min _snd_pcm_hw_params_set_buffer_time_min = _snd_pcm_hw_params_set_buffer_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_min>(); int snd_pcm_hw_params_set_buffer_time_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_buffer_time_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_max_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_max'); late final _dart_snd_pcm_hw_params_set_buffer_time_max _snd_pcm_hw_params_set_buffer_time_max = _snd_pcm_hw_params_set_buffer_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_max>(); int snd_pcm_hw_params_set_buffer_time_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_buffer_time_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_buffer_time_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_minmax'); late final _dart_snd_pcm_hw_params_set_buffer_time_minmax _snd_pcm_hw_params_set_buffer_time_minmax = _snd_pcm_hw_params_set_buffer_time_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_minmax>(); int snd_pcm_hw_params_set_buffer_time_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_buffer_time_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_near_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_near'); late final _dart_snd_pcm_hw_params_set_buffer_time_near _snd_pcm_hw_params_set_buffer_time_near = _snd_pcm_hw_params_set_buffer_time_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_near>(); int snd_pcm_hw_params_set_buffer_time_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_buffer_time_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_first_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_first'); late final _dart_snd_pcm_hw_params_set_buffer_time_first _snd_pcm_hw_params_set_buffer_time_first = _snd_pcm_hw_params_set_buffer_time_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_first>(); int snd_pcm_hw_params_set_buffer_time_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_buffer_time_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_buffer_time_last_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_time_last'); late final _dart_snd_pcm_hw_params_set_buffer_time_last _snd_pcm_hw_params_set_buffer_time_last = _snd_pcm_hw_params_set_buffer_time_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_time_last>(); int snd_pcm_hw_params_get_buffer_size( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_buffer_size( params, val, ); } late final _snd_pcm_hw_params_get_buffer_size_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_size'); late final _dart_snd_pcm_hw_params_get_buffer_size _snd_pcm_hw_params_get_buffer_size = _snd_pcm_hw_params_get_buffer_size_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_size>(); int snd_pcm_hw_params_get_buffer_size_min( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_buffer_size_min( params, val, ); } late final _snd_pcm_hw_params_get_buffer_size_min_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_size_min'); late final _dart_snd_pcm_hw_params_get_buffer_size_min _snd_pcm_hw_params_get_buffer_size_min = _snd_pcm_hw_params_get_buffer_size_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_size_min>(); int snd_pcm_hw_params_get_buffer_size_max( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_buffer_size_max( params, val, ); } late final _snd_pcm_hw_params_get_buffer_size_max_ptr = _lookup>( 'snd_pcm_hw_params_get_buffer_size_max'); late final _dart_snd_pcm_hw_params_get_buffer_size_max _snd_pcm_hw_params_get_buffer_size_max = _snd_pcm_hw_params_get_buffer_size_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_buffer_size_max>(); int snd_pcm_hw_params_test_buffer_size( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_test_buffer_size( pcm, params, val, ); } late final _snd_pcm_hw_params_test_buffer_size_ptr = _lookup>( 'snd_pcm_hw_params_test_buffer_size'); late final _dart_snd_pcm_hw_params_test_buffer_size _snd_pcm_hw_params_test_buffer_size = _snd_pcm_hw_params_test_buffer_size_ptr .asFunction<_dart_snd_pcm_hw_params_test_buffer_size>(); int snd_pcm_hw_params_set_buffer_size( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_hw_params_set_buffer_size( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size'); late final _dart_snd_pcm_hw_params_set_buffer_size _snd_pcm_hw_params_set_buffer_size = _snd_pcm_hw_params_set_buffer_size_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size>(); int snd_pcm_hw_params_set_buffer_size_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_buffer_size_min( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_min_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_min'); late final _dart_snd_pcm_hw_params_set_buffer_size_min _snd_pcm_hw_params_set_buffer_size_min = _snd_pcm_hw_params_set_buffer_size_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_min>(); int snd_pcm_hw_params_set_buffer_size_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_buffer_size_max( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_max_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_max'); late final _dart_snd_pcm_hw_params_set_buffer_size_max _snd_pcm_hw_params_set_buffer_size_max = _snd_pcm_hw_params_set_buffer_size_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_max>(); int snd_pcm_hw_params_set_buffer_size_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ) { return _snd_pcm_hw_params_set_buffer_size_minmax( pcm, params, min, max, ); } late final _snd_pcm_hw_params_set_buffer_size_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_minmax'); late final _dart_snd_pcm_hw_params_set_buffer_size_minmax _snd_pcm_hw_params_set_buffer_size_minmax = _snd_pcm_hw_params_set_buffer_size_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_minmax>(); int snd_pcm_hw_params_set_buffer_size_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_buffer_size_near( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_near_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_near'); late final _dart_snd_pcm_hw_params_set_buffer_size_near _snd_pcm_hw_params_set_buffer_size_near = _snd_pcm_hw_params_set_buffer_size_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_near>(); int snd_pcm_hw_params_set_buffer_size_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_buffer_size_first( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_first_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_first'); late final _dart_snd_pcm_hw_params_set_buffer_size_first _snd_pcm_hw_params_set_buffer_size_first = _snd_pcm_hw_params_set_buffer_size_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_first>(); int snd_pcm_hw_params_set_buffer_size_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_set_buffer_size_last( pcm, params, val, ); } late final _snd_pcm_hw_params_set_buffer_size_last_ptr = _lookup>( 'snd_pcm_hw_params_set_buffer_size_last'); late final _dart_snd_pcm_hw_params_set_buffer_size_last _snd_pcm_hw_params_set_buffer_size_last = _snd_pcm_hw_params_set_buffer_size_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_buffer_size_last>(); int snd_pcm_hw_params_get_min_align( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_hw_params_get_min_align( params, val, ); } late final _snd_pcm_hw_params_get_min_align_ptr = _lookup>( 'snd_pcm_hw_params_get_min_align'); late final _dart_snd_pcm_hw_params_get_min_align _snd_pcm_hw_params_get_min_align = _snd_pcm_hw_params_get_min_align_ptr .asFunction<_dart_snd_pcm_hw_params_get_min_align>(); int snd_pcm_sw_params_sizeof() { return _snd_pcm_sw_params_sizeof(); } late final _snd_pcm_sw_params_sizeof_ptr = _lookup>( 'snd_pcm_sw_params_sizeof'); late final _dart_snd_pcm_sw_params_sizeof _snd_pcm_sw_params_sizeof = _snd_pcm_sw_params_sizeof_ptr .asFunction<_dart_snd_pcm_sw_params_sizeof>(); int snd_pcm_sw_params_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_sw_params_malloc( ptr, ); } late final _snd_pcm_sw_params_malloc_ptr = _lookup>( 'snd_pcm_sw_params_malloc'); late final _dart_snd_pcm_sw_params_malloc _snd_pcm_sw_params_malloc = _snd_pcm_sw_params_malloc_ptr .asFunction<_dart_snd_pcm_sw_params_malloc>(); void snd_pcm_sw_params_free( ffi.Pointer obj, ) { return _snd_pcm_sw_params_free( obj, ); } late final _snd_pcm_sw_params_free_ptr = _lookup>( 'snd_pcm_sw_params_free'); late final _dart_snd_pcm_sw_params_free _snd_pcm_sw_params_free = _snd_pcm_sw_params_free_ptr.asFunction<_dart_snd_pcm_sw_params_free>(); void snd_pcm_sw_params_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_sw_params_copy( dst, src, ); } late final _snd_pcm_sw_params_copy_ptr = _lookup>( 'snd_pcm_sw_params_copy'); late final _dart_snd_pcm_sw_params_copy _snd_pcm_sw_params_copy = _snd_pcm_sw_params_copy_ptr.asFunction<_dart_snd_pcm_sw_params_copy>(); int snd_pcm_sw_params_get_boundary( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_boundary( params, val, ); } late final _snd_pcm_sw_params_get_boundary_ptr = _lookup>( 'snd_pcm_sw_params_get_boundary'); late final _dart_snd_pcm_sw_params_get_boundary _snd_pcm_sw_params_get_boundary = _snd_pcm_sw_params_get_boundary_ptr .asFunction<_dart_snd_pcm_sw_params_get_boundary>(); int snd_pcm_sw_params_set_tstamp_mode( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_tstamp_mode( pcm, params, val, ); } late final _snd_pcm_sw_params_set_tstamp_mode_ptr = _lookup>( 'snd_pcm_sw_params_set_tstamp_mode'); late final _dart_snd_pcm_sw_params_set_tstamp_mode _snd_pcm_sw_params_set_tstamp_mode = _snd_pcm_sw_params_set_tstamp_mode_ptr .asFunction<_dart_snd_pcm_sw_params_set_tstamp_mode>(); int snd_pcm_sw_params_get_tstamp_mode( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_tstamp_mode( params, val, ); } late final _snd_pcm_sw_params_get_tstamp_mode_ptr = _lookup>( 'snd_pcm_sw_params_get_tstamp_mode'); late final _dart_snd_pcm_sw_params_get_tstamp_mode _snd_pcm_sw_params_get_tstamp_mode = _snd_pcm_sw_params_get_tstamp_mode_ptr .asFunction<_dart_snd_pcm_sw_params_get_tstamp_mode>(); int snd_pcm_sw_params_set_tstamp_type( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_tstamp_type( pcm, params, val, ); } late final _snd_pcm_sw_params_set_tstamp_type_ptr = _lookup>( 'snd_pcm_sw_params_set_tstamp_type'); late final _dart_snd_pcm_sw_params_set_tstamp_type _snd_pcm_sw_params_set_tstamp_type = _snd_pcm_sw_params_set_tstamp_type_ptr .asFunction<_dart_snd_pcm_sw_params_set_tstamp_type>(); int snd_pcm_sw_params_get_tstamp_type( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_tstamp_type( params, val, ); } late final _snd_pcm_sw_params_get_tstamp_type_ptr = _lookup>( 'snd_pcm_sw_params_get_tstamp_type'); late final _dart_snd_pcm_sw_params_get_tstamp_type _snd_pcm_sw_params_get_tstamp_type = _snd_pcm_sw_params_get_tstamp_type_ptr .asFunction<_dart_snd_pcm_sw_params_get_tstamp_type>(); int snd_pcm_sw_params_set_avail_min( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_avail_min( pcm, params, val, ); } late final _snd_pcm_sw_params_set_avail_min_ptr = _lookup>( 'snd_pcm_sw_params_set_avail_min'); late final _dart_snd_pcm_sw_params_set_avail_min _snd_pcm_sw_params_set_avail_min = _snd_pcm_sw_params_set_avail_min_ptr .asFunction<_dart_snd_pcm_sw_params_set_avail_min>(); int snd_pcm_sw_params_get_avail_min( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_avail_min( params, val, ); } late final _snd_pcm_sw_params_get_avail_min_ptr = _lookup>( 'snd_pcm_sw_params_get_avail_min'); late final _dart_snd_pcm_sw_params_get_avail_min _snd_pcm_sw_params_get_avail_min = _snd_pcm_sw_params_get_avail_min_ptr .asFunction<_dart_snd_pcm_sw_params_get_avail_min>(); int snd_pcm_sw_params_set_period_event( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_period_event( pcm, params, val, ); } late final _snd_pcm_sw_params_set_period_event_ptr = _lookup>( 'snd_pcm_sw_params_set_period_event'); late final _dart_snd_pcm_sw_params_set_period_event _snd_pcm_sw_params_set_period_event = _snd_pcm_sw_params_set_period_event_ptr .asFunction<_dart_snd_pcm_sw_params_set_period_event>(); int snd_pcm_sw_params_get_period_event( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_period_event( params, val, ); } late final _snd_pcm_sw_params_get_period_event_ptr = _lookup>( 'snd_pcm_sw_params_get_period_event'); late final _dart_snd_pcm_sw_params_get_period_event _snd_pcm_sw_params_get_period_event = _snd_pcm_sw_params_get_period_event_ptr .asFunction<_dart_snd_pcm_sw_params_get_period_event>(); int snd_pcm_sw_params_set_start_threshold( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_start_threshold( pcm, params, val, ); } late final _snd_pcm_sw_params_set_start_threshold_ptr = _lookup>( 'snd_pcm_sw_params_set_start_threshold'); late final _dart_snd_pcm_sw_params_set_start_threshold _snd_pcm_sw_params_set_start_threshold = _snd_pcm_sw_params_set_start_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_set_start_threshold>(); int snd_pcm_sw_params_get_start_threshold( ffi.Pointer paramsm, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_start_threshold( paramsm, val, ); } late final _snd_pcm_sw_params_get_start_threshold_ptr = _lookup>( 'snd_pcm_sw_params_get_start_threshold'); late final _dart_snd_pcm_sw_params_get_start_threshold _snd_pcm_sw_params_get_start_threshold = _snd_pcm_sw_params_get_start_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_get_start_threshold>(); int snd_pcm_sw_params_set_stop_threshold( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_stop_threshold( pcm, params, val, ); } late final _snd_pcm_sw_params_set_stop_threshold_ptr = _lookup>( 'snd_pcm_sw_params_set_stop_threshold'); late final _dart_snd_pcm_sw_params_set_stop_threshold _snd_pcm_sw_params_set_stop_threshold = _snd_pcm_sw_params_set_stop_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_set_stop_threshold>(); int snd_pcm_sw_params_get_stop_threshold( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_stop_threshold( params, val, ); } late final _snd_pcm_sw_params_get_stop_threshold_ptr = _lookup>( 'snd_pcm_sw_params_get_stop_threshold'); late final _dart_snd_pcm_sw_params_get_stop_threshold _snd_pcm_sw_params_get_stop_threshold = _snd_pcm_sw_params_get_stop_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_get_stop_threshold>(); int snd_pcm_sw_params_set_silence_threshold( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_silence_threshold( pcm, params, val, ); } late final _snd_pcm_sw_params_set_silence_threshold_ptr = _lookup>( 'snd_pcm_sw_params_set_silence_threshold'); late final _dart_snd_pcm_sw_params_set_silence_threshold _snd_pcm_sw_params_set_silence_threshold = _snd_pcm_sw_params_set_silence_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_set_silence_threshold>(); int snd_pcm_sw_params_get_silence_threshold( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_silence_threshold( params, val, ); } late final _snd_pcm_sw_params_get_silence_threshold_ptr = _lookup>( 'snd_pcm_sw_params_get_silence_threshold'); late final _dart_snd_pcm_sw_params_get_silence_threshold _snd_pcm_sw_params_get_silence_threshold = _snd_pcm_sw_params_get_silence_threshold_ptr .asFunction<_dart_snd_pcm_sw_params_get_silence_threshold>(); int snd_pcm_sw_params_set_silence_size( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_silence_size( pcm, params, val, ); } late final _snd_pcm_sw_params_set_silence_size_ptr = _lookup>( 'snd_pcm_sw_params_set_silence_size'); late final _dart_snd_pcm_sw_params_set_silence_size _snd_pcm_sw_params_set_silence_size = _snd_pcm_sw_params_set_silence_size_ptr .asFunction<_dart_snd_pcm_sw_params_set_silence_size>(); int snd_pcm_sw_params_get_silence_size( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_silence_size( params, val, ); } late final _snd_pcm_sw_params_get_silence_size_ptr = _lookup>( 'snd_pcm_sw_params_get_silence_size'); late final _dart_snd_pcm_sw_params_get_silence_size _snd_pcm_sw_params_get_silence_size = _snd_pcm_sw_params_get_silence_size_ptr .asFunction<_dart_snd_pcm_sw_params_get_silence_size>(); int snd_pcm_access_mask_sizeof() { return _snd_pcm_access_mask_sizeof(); } late final _snd_pcm_access_mask_sizeof_ptr = _lookup>( 'snd_pcm_access_mask_sizeof'); late final _dart_snd_pcm_access_mask_sizeof _snd_pcm_access_mask_sizeof = _snd_pcm_access_mask_sizeof_ptr .asFunction<_dart_snd_pcm_access_mask_sizeof>(); int snd_pcm_access_mask_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_access_mask_malloc( ptr, ); } late final _snd_pcm_access_mask_malloc_ptr = _lookup>( 'snd_pcm_access_mask_malloc'); late final _dart_snd_pcm_access_mask_malloc _snd_pcm_access_mask_malloc = _snd_pcm_access_mask_malloc_ptr .asFunction<_dart_snd_pcm_access_mask_malloc>(); void snd_pcm_access_mask_free( ffi.Pointer obj, ) { return _snd_pcm_access_mask_free( obj, ); } late final _snd_pcm_access_mask_free_ptr = _lookup>( 'snd_pcm_access_mask_free'); late final _dart_snd_pcm_access_mask_free _snd_pcm_access_mask_free = _snd_pcm_access_mask_free_ptr .asFunction<_dart_snd_pcm_access_mask_free>(); void snd_pcm_access_mask_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_access_mask_copy( dst, src, ); } late final _snd_pcm_access_mask_copy_ptr = _lookup>( 'snd_pcm_access_mask_copy'); late final _dart_snd_pcm_access_mask_copy _snd_pcm_access_mask_copy = _snd_pcm_access_mask_copy_ptr .asFunction<_dart_snd_pcm_access_mask_copy>(); void snd_pcm_access_mask_none( ffi.Pointer mask, ) { return _snd_pcm_access_mask_none( mask, ); } late final _snd_pcm_access_mask_none_ptr = _lookup>( 'snd_pcm_access_mask_none'); late final _dart_snd_pcm_access_mask_none _snd_pcm_access_mask_none = _snd_pcm_access_mask_none_ptr .asFunction<_dart_snd_pcm_access_mask_none>(); void snd_pcm_access_mask_any( ffi.Pointer mask, ) { return _snd_pcm_access_mask_any( mask, ); } late final _snd_pcm_access_mask_any_ptr = _lookup>( 'snd_pcm_access_mask_any'); late final _dart_snd_pcm_access_mask_any _snd_pcm_access_mask_any = _snd_pcm_access_mask_any_ptr.asFunction<_dart_snd_pcm_access_mask_any>(); int snd_pcm_access_mask_test( ffi.Pointer mask, int val, ) { return _snd_pcm_access_mask_test( mask, val, ); } late final _snd_pcm_access_mask_test_ptr = _lookup>( 'snd_pcm_access_mask_test'); late final _dart_snd_pcm_access_mask_test _snd_pcm_access_mask_test = _snd_pcm_access_mask_test_ptr .asFunction<_dart_snd_pcm_access_mask_test>(); int snd_pcm_access_mask_empty( ffi.Pointer mask, ) { return _snd_pcm_access_mask_empty( mask, ); } late final _snd_pcm_access_mask_empty_ptr = _lookup>( 'snd_pcm_access_mask_empty'); late final _dart_snd_pcm_access_mask_empty _snd_pcm_access_mask_empty = _snd_pcm_access_mask_empty_ptr .asFunction<_dart_snd_pcm_access_mask_empty>(); void snd_pcm_access_mask_set( ffi.Pointer mask, int val, ) { return _snd_pcm_access_mask_set( mask, val, ); } late final _snd_pcm_access_mask_set_ptr = _lookup>( 'snd_pcm_access_mask_set'); late final _dart_snd_pcm_access_mask_set _snd_pcm_access_mask_set = _snd_pcm_access_mask_set_ptr.asFunction<_dart_snd_pcm_access_mask_set>(); void snd_pcm_access_mask_reset( ffi.Pointer mask, int val, ) { return _snd_pcm_access_mask_reset( mask, val, ); } late final _snd_pcm_access_mask_reset_ptr = _lookup>( 'snd_pcm_access_mask_reset'); late final _dart_snd_pcm_access_mask_reset _snd_pcm_access_mask_reset = _snd_pcm_access_mask_reset_ptr .asFunction<_dart_snd_pcm_access_mask_reset>(); int snd_pcm_format_mask_sizeof() { return _snd_pcm_format_mask_sizeof(); } late final _snd_pcm_format_mask_sizeof_ptr = _lookup>( 'snd_pcm_format_mask_sizeof'); late final _dart_snd_pcm_format_mask_sizeof _snd_pcm_format_mask_sizeof = _snd_pcm_format_mask_sizeof_ptr .asFunction<_dart_snd_pcm_format_mask_sizeof>(); int snd_pcm_format_mask_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_format_mask_malloc( ptr, ); } late final _snd_pcm_format_mask_malloc_ptr = _lookup>( 'snd_pcm_format_mask_malloc'); late final _dart_snd_pcm_format_mask_malloc _snd_pcm_format_mask_malloc = _snd_pcm_format_mask_malloc_ptr .asFunction<_dart_snd_pcm_format_mask_malloc>(); void snd_pcm_format_mask_free( ffi.Pointer obj, ) { return _snd_pcm_format_mask_free( obj, ); } late final _snd_pcm_format_mask_free_ptr = _lookup>( 'snd_pcm_format_mask_free'); late final _dart_snd_pcm_format_mask_free _snd_pcm_format_mask_free = _snd_pcm_format_mask_free_ptr .asFunction<_dart_snd_pcm_format_mask_free>(); void snd_pcm_format_mask_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_format_mask_copy( dst, src, ); } late final _snd_pcm_format_mask_copy_ptr = _lookup>( 'snd_pcm_format_mask_copy'); late final _dart_snd_pcm_format_mask_copy _snd_pcm_format_mask_copy = _snd_pcm_format_mask_copy_ptr .asFunction<_dart_snd_pcm_format_mask_copy>(); void snd_pcm_format_mask_none( ffi.Pointer mask, ) { return _snd_pcm_format_mask_none( mask, ); } late final _snd_pcm_format_mask_none_ptr = _lookup>( 'snd_pcm_format_mask_none'); late final _dart_snd_pcm_format_mask_none _snd_pcm_format_mask_none = _snd_pcm_format_mask_none_ptr .asFunction<_dart_snd_pcm_format_mask_none>(); void snd_pcm_format_mask_any( ffi.Pointer mask, ) { return _snd_pcm_format_mask_any( mask, ); } late final _snd_pcm_format_mask_any_ptr = _lookup>( 'snd_pcm_format_mask_any'); late final _dart_snd_pcm_format_mask_any _snd_pcm_format_mask_any = _snd_pcm_format_mask_any_ptr.asFunction<_dart_snd_pcm_format_mask_any>(); int snd_pcm_format_mask_test( ffi.Pointer mask, int val, ) { return _snd_pcm_format_mask_test( mask, val, ); } late final _snd_pcm_format_mask_test_ptr = _lookup>( 'snd_pcm_format_mask_test'); late final _dart_snd_pcm_format_mask_test _snd_pcm_format_mask_test = _snd_pcm_format_mask_test_ptr .asFunction<_dart_snd_pcm_format_mask_test>(); int snd_pcm_format_mask_empty( ffi.Pointer mask, ) { return _snd_pcm_format_mask_empty( mask, ); } late final _snd_pcm_format_mask_empty_ptr = _lookup>( 'snd_pcm_format_mask_empty'); late final _dart_snd_pcm_format_mask_empty _snd_pcm_format_mask_empty = _snd_pcm_format_mask_empty_ptr .asFunction<_dart_snd_pcm_format_mask_empty>(); void snd_pcm_format_mask_set( ffi.Pointer mask, int val, ) { return _snd_pcm_format_mask_set( mask, val, ); } late final _snd_pcm_format_mask_set_ptr = _lookup>( 'snd_pcm_format_mask_set'); late final _dart_snd_pcm_format_mask_set _snd_pcm_format_mask_set = _snd_pcm_format_mask_set_ptr.asFunction<_dart_snd_pcm_format_mask_set>(); void snd_pcm_format_mask_reset( ffi.Pointer mask, int val, ) { return _snd_pcm_format_mask_reset( mask, val, ); } late final _snd_pcm_format_mask_reset_ptr = _lookup>( 'snd_pcm_format_mask_reset'); late final _dart_snd_pcm_format_mask_reset _snd_pcm_format_mask_reset = _snd_pcm_format_mask_reset_ptr .asFunction<_dart_snd_pcm_format_mask_reset>(); int snd_pcm_subformat_mask_sizeof() { return _snd_pcm_subformat_mask_sizeof(); } late final _snd_pcm_subformat_mask_sizeof_ptr = _lookup>( 'snd_pcm_subformat_mask_sizeof'); late final _dart_snd_pcm_subformat_mask_sizeof _snd_pcm_subformat_mask_sizeof = _snd_pcm_subformat_mask_sizeof_ptr .asFunction<_dart_snd_pcm_subformat_mask_sizeof>(); int snd_pcm_subformat_mask_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_subformat_mask_malloc( ptr, ); } late final _snd_pcm_subformat_mask_malloc_ptr = _lookup>( 'snd_pcm_subformat_mask_malloc'); late final _dart_snd_pcm_subformat_mask_malloc _snd_pcm_subformat_mask_malloc = _snd_pcm_subformat_mask_malloc_ptr .asFunction<_dart_snd_pcm_subformat_mask_malloc>(); void snd_pcm_subformat_mask_free( ffi.Pointer obj, ) { return _snd_pcm_subformat_mask_free( obj, ); } late final _snd_pcm_subformat_mask_free_ptr = _lookup>( 'snd_pcm_subformat_mask_free'); late final _dart_snd_pcm_subformat_mask_free _snd_pcm_subformat_mask_free = _snd_pcm_subformat_mask_free_ptr .asFunction<_dart_snd_pcm_subformat_mask_free>(); void snd_pcm_subformat_mask_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_subformat_mask_copy( dst, src, ); } late final _snd_pcm_subformat_mask_copy_ptr = _lookup>( 'snd_pcm_subformat_mask_copy'); late final _dart_snd_pcm_subformat_mask_copy _snd_pcm_subformat_mask_copy = _snd_pcm_subformat_mask_copy_ptr .asFunction<_dart_snd_pcm_subformat_mask_copy>(); void snd_pcm_subformat_mask_none( ffi.Pointer mask, ) { return _snd_pcm_subformat_mask_none( mask, ); } late final _snd_pcm_subformat_mask_none_ptr = _lookup>( 'snd_pcm_subformat_mask_none'); late final _dart_snd_pcm_subformat_mask_none _snd_pcm_subformat_mask_none = _snd_pcm_subformat_mask_none_ptr .asFunction<_dart_snd_pcm_subformat_mask_none>(); void snd_pcm_subformat_mask_any( ffi.Pointer mask, ) { return _snd_pcm_subformat_mask_any( mask, ); } late final _snd_pcm_subformat_mask_any_ptr = _lookup>( 'snd_pcm_subformat_mask_any'); late final _dart_snd_pcm_subformat_mask_any _snd_pcm_subformat_mask_any = _snd_pcm_subformat_mask_any_ptr .asFunction<_dart_snd_pcm_subformat_mask_any>(); int snd_pcm_subformat_mask_test( ffi.Pointer mask, int val, ) { return _snd_pcm_subformat_mask_test( mask, val, ); } late final _snd_pcm_subformat_mask_test_ptr = _lookup>( 'snd_pcm_subformat_mask_test'); late final _dart_snd_pcm_subformat_mask_test _snd_pcm_subformat_mask_test = _snd_pcm_subformat_mask_test_ptr .asFunction<_dart_snd_pcm_subformat_mask_test>(); int snd_pcm_subformat_mask_empty( ffi.Pointer mask, ) { return _snd_pcm_subformat_mask_empty( mask, ); } late final _snd_pcm_subformat_mask_empty_ptr = _lookup>( 'snd_pcm_subformat_mask_empty'); late final _dart_snd_pcm_subformat_mask_empty _snd_pcm_subformat_mask_empty = _snd_pcm_subformat_mask_empty_ptr .asFunction<_dart_snd_pcm_subformat_mask_empty>(); void snd_pcm_subformat_mask_set( ffi.Pointer mask, int val, ) { return _snd_pcm_subformat_mask_set( mask, val, ); } late final _snd_pcm_subformat_mask_set_ptr = _lookup>( 'snd_pcm_subformat_mask_set'); late final _dart_snd_pcm_subformat_mask_set _snd_pcm_subformat_mask_set = _snd_pcm_subformat_mask_set_ptr .asFunction<_dart_snd_pcm_subformat_mask_set>(); void snd_pcm_subformat_mask_reset( ffi.Pointer mask, int val, ) { return _snd_pcm_subformat_mask_reset( mask, val, ); } late final _snd_pcm_subformat_mask_reset_ptr = _lookup>( 'snd_pcm_subformat_mask_reset'); late final _dart_snd_pcm_subformat_mask_reset _snd_pcm_subformat_mask_reset = _snd_pcm_subformat_mask_reset_ptr .asFunction<_dart_snd_pcm_subformat_mask_reset>(); int snd_pcm_status_sizeof() { return _snd_pcm_status_sizeof(); } late final _snd_pcm_status_sizeof_ptr = _lookup>( 'snd_pcm_status_sizeof'); late final _dart_snd_pcm_status_sizeof _snd_pcm_status_sizeof = _snd_pcm_status_sizeof_ptr.asFunction<_dart_snd_pcm_status_sizeof>(); int snd_pcm_status_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_status_malloc( ptr, ); } late final _snd_pcm_status_malloc_ptr = _lookup>( 'snd_pcm_status_malloc'); late final _dart_snd_pcm_status_malloc _snd_pcm_status_malloc = _snd_pcm_status_malloc_ptr.asFunction<_dart_snd_pcm_status_malloc>(); void snd_pcm_status_free( ffi.Pointer obj, ) { return _snd_pcm_status_free( obj, ); } late final _snd_pcm_status_free_ptr = _lookup>( 'snd_pcm_status_free'); late final _dart_snd_pcm_status_free _snd_pcm_status_free = _snd_pcm_status_free_ptr.asFunction<_dart_snd_pcm_status_free>(); void snd_pcm_status_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_pcm_status_copy( dst, src, ); } late final _snd_pcm_status_copy_ptr = _lookup>( 'snd_pcm_status_copy'); late final _dart_snd_pcm_status_copy _snd_pcm_status_copy = _snd_pcm_status_copy_ptr.asFunction<_dart_snd_pcm_status_copy>(); int snd_pcm_status_get_state( ffi.Pointer obj, ) { return _snd_pcm_status_get_state( obj, ); } late final _snd_pcm_status_get_state_ptr = _lookup>( 'snd_pcm_status_get_state'); late final _dart_snd_pcm_status_get_state _snd_pcm_status_get_state = _snd_pcm_status_get_state_ptr .asFunction<_dart_snd_pcm_status_get_state>(); void snd_pcm_status_get_trigger_tstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_trigger_tstamp( obj, ptr, ); } late final _snd_pcm_status_get_trigger_tstamp_ptr = _lookup>( 'snd_pcm_status_get_trigger_tstamp'); late final _dart_snd_pcm_status_get_trigger_tstamp _snd_pcm_status_get_trigger_tstamp = _snd_pcm_status_get_trigger_tstamp_ptr .asFunction<_dart_snd_pcm_status_get_trigger_tstamp>(); void snd_pcm_status_get_trigger_htstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_trigger_htstamp( obj, ptr, ); } late final _snd_pcm_status_get_trigger_htstamp_ptr = _lookup>( 'snd_pcm_status_get_trigger_htstamp'); late final _dart_snd_pcm_status_get_trigger_htstamp _snd_pcm_status_get_trigger_htstamp = _snd_pcm_status_get_trigger_htstamp_ptr .asFunction<_dart_snd_pcm_status_get_trigger_htstamp>(); void snd_pcm_status_get_tstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_tstamp( obj, ptr, ); } late final _snd_pcm_status_get_tstamp_ptr = _lookup>( 'snd_pcm_status_get_tstamp'); late final _dart_snd_pcm_status_get_tstamp _snd_pcm_status_get_tstamp = _snd_pcm_status_get_tstamp_ptr .asFunction<_dart_snd_pcm_status_get_tstamp>(); void snd_pcm_status_get_htstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_htstamp( obj, ptr, ); } late final _snd_pcm_status_get_htstamp_ptr = _lookup>( 'snd_pcm_status_get_htstamp'); late final _dart_snd_pcm_status_get_htstamp _snd_pcm_status_get_htstamp = _snd_pcm_status_get_htstamp_ptr .asFunction<_dart_snd_pcm_status_get_htstamp>(); void snd_pcm_status_get_audio_htstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_audio_htstamp( obj, ptr, ); } late final _snd_pcm_status_get_audio_htstamp_ptr = _lookup>( 'snd_pcm_status_get_audio_htstamp'); late final _dart_snd_pcm_status_get_audio_htstamp _snd_pcm_status_get_audio_htstamp = _snd_pcm_status_get_audio_htstamp_ptr .asFunction<_dart_snd_pcm_status_get_audio_htstamp>(); void snd_pcm_status_get_driver_htstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_pcm_status_get_driver_htstamp( obj, ptr, ); } late final _snd_pcm_status_get_driver_htstamp_ptr = _lookup>( 'snd_pcm_status_get_driver_htstamp'); late final _dart_snd_pcm_status_get_driver_htstamp _snd_pcm_status_get_driver_htstamp = _snd_pcm_status_get_driver_htstamp_ptr .asFunction<_dart_snd_pcm_status_get_driver_htstamp>(); void snd_pcm_status_get_audio_htstamp_report( ffi.Pointer obj, ffi.Pointer audio_tstamp_report, ) { return _snd_pcm_status_get_audio_htstamp_report( obj, audio_tstamp_report, ); } late final _snd_pcm_status_get_audio_htstamp_report_ptr = _lookup>( 'snd_pcm_status_get_audio_htstamp_report'); late final _dart_snd_pcm_status_get_audio_htstamp_report _snd_pcm_status_get_audio_htstamp_report = _snd_pcm_status_get_audio_htstamp_report_ptr .asFunction<_dart_snd_pcm_status_get_audio_htstamp_report>(); void snd_pcm_status_set_audio_htstamp_config( ffi.Pointer obj, ffi.Pointer audio_tstamp_config, ) { return _snd_pcm_status_set_audio_htstamp_config( obj, audio_tstamp_config, ); } late final _snd_pcm_status_set_audio_htstamp_config_ptr = _lookup>( 'snd_pcm_status_set_audio_htstamp_config'); late final _dart_snd_pcm_status_set_audio_htstamp_config _snd_pcm_status_set_audio_htstamp_config = _snd_pcm_status_set_audio_htstamp_config_ptr .asFunction<_dart_snd_pcm_status_set_audio_htstamp_config>(); int snd_pcm_status_get_delay( ffi.Pointer obj, ) { return _snd_pcm_status_get_delay( obj, ); } late final _snd_pcm_status_get_delay_ptr = _lookup>( 'snd_pcm_status_get_delay'); late final _dart_snd_pcm_status_get_delay _snd_pcm_status_get_delay = _snd_pcm_status_get_delay_ptr .asFunction<_dart_snd_pcm_status_get_delay>(); int snd_pcm_status_get_avail( ffi.Pointer obj, ) { return _snd_pcm_status_get_avail( obj, ); } late final _snd_pcm_status_get_avail_ptr = _lookup>( 'snd_pcm_status_get_avail'); late final _dart_snd_pcm_status_get_avail _snd_pcm_status_get_avail = _snd_pcm_status_get_avail_ptr .asFunction<_dart_snd_pcm_status_get_avail>(); int snd_pcm_status_get_avail_max( ffi.Pointer obj, ) { return _snd_pcm_status_get_avail_max( obj, ); } late final _snd_pcm_status_get_avail_max_ptr = _lookup>( 'snd_pcm_status_get_avail_max'); late final _dart_snd_pcm_status_get_avail_max _snd_pcm_status_get_avail_max = _snd_pcm_status_get_avail_max_ptr .asFunction<_dart_snd_pcm_status_get_avail_max>(); int snd_pcm_status_get_overrange( ffi.Pointer obj, ) { return _snd_pcm_status_get_overrange( obj, ); } late final _snd_pcm_status_get_overrange_ptr = _lookup>( 'snd_pcm_status_get_overrange'); late final _dart_snd_pcm_status_get_overrange _snd_pcm_status_get_overrange = _snd_pcm_status_get_overrange_ptr .asFunction<_dart_snd_pcm_status_get_overrange>(); ffi.Pointer snd_pcm_type_name( int type, ) { return _snd_pcm_type_name( type, ); } late final _snd_pcm_type_name_ptr = _lookup>('snd_pcm_type_name'); late final _dart_snd_pcm_type_name _snd_pcm_type_name = _snd_pcm_type_name_ptr.asFunction<_dart_snd_pcm_type_name>(); ffi.Pointer snd_pcm_stream_name( int stream, ) { return _snd_pcm_stream_name( stream, ); } late final _snd_pcm_stream_name_ptr = _lookup>( 'snd_pcm_stream_name'); late final _dart_snd_pcm_stream_name _snd_pcm_stream_name = _snd_pcm_stream_name_ptr.asFunction<_dart_snd_pcm_stream_name>(); ffi.Pointer snd_pcm_access_name( int _access, ) { return _snd_pcm_access_name( _access, ); } late final _snd_pcm_access_name_ptr = _lookup>( 'snd_pcm_access_name'); late final _dart_snd_pcm_access_name _snd_pcm_access_name = _snd_pcm_access_name_ptr.asFunction<_dart_snd_pcm_access_name>(); ffi.Pointer snd_pcm_format_name( int format, ) { return _snd_pcm_format_name( format, ); } late final _snd_pcm_format_name_ptr = _lookup>( 'snd_pcm_format_name'); late final _dart_snd_pcm_format_name _snd_pcm_format_name = _snd_pcm_format_name_ptr.asFunction<_dart_snd_pcm_format_name>(); ffi.Pointer snd_pcm_format_description( int format, ) { return _snd_pcm_format_description( format, ); } late final _snd_pcm_format_description_ptr = _lookup>( 'snd_pcm_format_description'); late final _dart_snd_pcm_format_description _snd_pcm_format_description = _snd_pcm_format_description_ptr .asFunction<_dart_snd_pcm_format_description>(); ffi.Pointer snd_pcm_subformat_name( int subformat, ) { return _snd_pcm_subformat_name( subformat, ); } late final _snd_pcm_subformat_name_ptr = _lookup>( 'snd_pcm_subformat_name'); late final _dart_snd_pcm_subformat_name _snd_pcm_subformat_name = _snd_pcm_subformat_name_ptr.asFunction<_dart_snd_pcm_subformat_name>(); ffi.Pointer snd_pcm_subformat_description( int subformat, ) { return _snd_pcm_subformat_description( subformat, ); } late final _snd_pcm_subformat_description_ptr = _lookup>( 'snd_pcm_subformat_description'); late final _dart_snd_pcm_subformat_description _snd_pcm_subformat_description = _snd_pcm_subformat_description_ptr .asFunction<_dart_snd_pcm_subformat_description>(); int snd_pcm_format_value( ffi.Pointer name, ) { return _snd_pcm_format_value( name, ); } late final _snd_pcm_format_value_ptr = _lookup>( 'snd_pcm_format_value'); late final _dart_snd_pcm_format_value _snd_pcm_format_value = _snd_pcm_format_value_ptr.asFunction<_dart_snd_pcm_format_value>(); ffi.Pointer snd_pcm_tstamp_mode_name( int mode, ) { return _snd_pcm_tstamp_mode_name( mode, ); } late final _snd_pcm_tstamp_mode_name_ptr = _lookup>( 'snd_pcm_tstamp_mode_name'); late final _dart_snd_pcm_tstamp_mode_name _snd_pcm_tstamp_mode_name = _snd_pcm_tstamp_mode_name_ptr .asFunction<_dart_snd_pcm_tstamp_mode_name>(); ffi.Pointer snd_pcm_state_name( int state, ) { return _snd_pcm_state_name( state, ); } late final _snd_pcm_state_name_ptr = _lookup>('snd_pcm_state_name'); late final _dart_snd_pcm_state_name _snd_pcm_state_name = _snd_pcm_state_name_ptr.asFunction<_dart_snd_pcm_state_name>(); int snd_pcm_dump( ffi.Pointer pcm, ffi.Pointer out, ) { return _snd_pcm_dump( pcm, out, ); } late final _snd_pcm_dump_ptr = _lookup>('snd_pcm_dump'); late final _dart_snd_pcm_dump _snd_pcm_dump = _snd_pcm_dump_ptr.asFunction<_dart_snd_pcm_dump>(); int snd_pcm_dump_hw_setup( ffi.Pointer pcm, ffi.Pointer out, ) { return _snd_pcm_dump_hw_setup( pcm, out, ); } late final _snd_pcm_dump_hw_setup_ptr = _lookup>( 'snd_pcm_dump_hw_setup'); late final _dart_snd_pcm_dump_hw_setup _snd_pcm_dump_hw_setup = _snd_pcm_dump_hw_setup_ptr.asFunction<_dart_snd_pcm_dump_hw_setup>(); int snd_pcm_dump_sw_setup( ffi.Pointer pcm, ffi.Pointer out, ) { return _snd_pcm_dump_sw_setup( pcm, out, ); } late final _snd_pcm_dump_sw_setup_ptr = _lookup>( 'snd_pcm_dump_sw_setup'); late final _dart_snd_pcm_dump_sw_setup _snd_pcm_dump_sw_setup = _snd_pcm_dump_sw_setup_ptr.asFunction<_dart_snd_pcm_dump_sw_setup>(); int snd_pcm_dump_setup( ffi.Pointer pcm, ffi.Pointer out, ) { return _snd_pcm_dump_setup( pcm, out, ); } late final _snd_pcm_dump_setup_ptr = _lookup>('snd_pcm_dump_setup'); late final _dart_snd_pcm_dump_setup _snd_pcm_dump_setup = _snd_pcm_dump_setup_ptr.asFunction<_dart_snd_pcm_dump_setup>(); int snd_pcm_hw_params_dump( ffi.Pointer params, ffi.Pointer out, ) { return _snd_pcm_hw_params_dump( params, out, ); } late final _snd_pcm_hw_params_dump_ptr = _lookup>( 'snd_pcm_hw_params_dump'); late final _dart_snd_pcm_hw_params_dump _snd_pcm_hw_params_dump = _snd_pcm_hw_params_dump_ptr.asFunction<_dart_snd_pcm_hw_params_dump>(); int snd_pcm_sw_params_dump( ffi.Pointer params, ffi.Pointer out, ) { return _snd_pcm_sw_params_dump( params, out, ); } late final _snd_pcm_sw_params_dump_ptr = _lookup>( 'snd_pcm_sw_params_dump'); late final _dart_snd_pcm_sw_params_dump _snd_pcm_sw_params_dump = _snd_pcm_sw_params_dump_ptr.asFunction<_dart_snd_pcm_sw_params_dump>(); int snd_pcm_status_dump( ffi.Pointer status, ffi.Pointer out, ) { return _snd_pcm_status_dump( status, out, ); } late final _snd_pcm_status_dump_ptr = _lookup>( 'snd_pcm_status_dump'); late final _dart_snd_pcm_status_dump _snd_pcm_status_dump = _snd_pcm_status_dump_ptr.asFunction<_dart_snd_pcm_status_dump>(); int snd_pcm_mmap_begin( ffi.Pointer pcm, ffi.Pointer> areas, ffi.Pointer offset, ffi.Pointer frames, ) { return _snd_pcm_mmap_begin( pcm, areas, offset, frames, ); } late final _snd_pcm_mmap_begin_ptr = _lookup>('snd_pcm_mmap_begin'); late final _dart_snd_pcm_mmap_begin _snd_pcm_mmap_begin = _snd_pcm_mmap_begin_ptr.asFunction<_dart_snd_pcm_mmap_begin>(); int snd_pcm_mmap_commit( ffi.Pointer pcm, int offset, int frames, ) { return _snd_pcm_mmap_commit( pcm, offset, frames, ); } late final _snd_pcm_mmap_commit_ptr = _lookup>( 'snd_pcm_mmap_commit'); late final _dart_snd_pcm_mmap_commit _snd_pcm_mmap_commit = _snd_pcm_mmap_commit_ptr.asFunction<_dart_snd_pcm_mmap_commit>(); int snd_pcm_mmap_writei( ffi.Pointer pcm, ffi.Pointer buffer, int size, ) { return _snd_pcm_mmap_writei( pcm, buffer, size, ); } late final _snd_pcm_mmap_writei_ptr = _lookup>( 'snd_pcm_mmap_writei'); late final _dart_snd_pcm_mmap_writei _snd_pcm_mmap_writei = _snd_pcm_mmap_writei_ptr.asFunction<_dart_snd_pcm_mmap_writei>(); int snd_pcm_mmap_readi( ffi.Pointer pcm, ffi.Pointer buffer, int size, ) { return _snd_pcm_mmap_readi( pcm, buffer, size, ); } late final _snd_pcm_mmap_readi_ptr = _lookup>('snd_pcm_mmap_readi'); late final _dart_snd_pcm_mmap_readi _snd_pcm_mmap_readi = _snd_pcm_mmap_readi_ptr.asFunction<_dart_snd_pcm_mmap_readi>(); int snd_pcm_mmap_writen( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ) { return _snd_pcm_mmap_writen( pcm, bufs, size, ); } late final _snd_pcm_mmap_writen_ptr = _lookup>( 'snd_pcm_mmap_writen'); late final _dart_snd_pcm_mmap_writen _snd_pcm_mmap_writen = _snd_pcm_mmap_writen_ptr.asFunction<_dart_snd_pcm_mmap_writen>(); int snd_pcm_mmap_readn( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ) { return _snd_pcm_mmap_readn( pcm, bufs, size, ); } late final _snd_pcm_mmap_readn_ptr = _lookup>('snd_pcm_mmap_readn'); late final _dart_snd_pcm_mmap_readn _snd_pcm_mmap_readn = _snd_pcm_mmap_readn_ptr.asFunction<_dart_snd_pcm_mmap_readn>(); int snd_pcm_format_signed( int format, ) { return _snd_pcm_format_signed( format, ); } late final _snd_pcm_format_signed_ptr = _lookup>( 'snd_pcm_format_signed'); late final _dart_snd_pcm_format_signed _snd_pcm_format_signed = _snd_pcm_format_signed_ptr.asFunction<_dart_snd_pcm_format_signed>(); int snd_pcm_format_unsigned( int format, ) { return _snd_pcm_format_unsigned( format, ); } late final _snd_pcm_format_unsigned_ptr = _lookup>( 'snd_pcm_format_unsigned'); late final _dart_snd_pcm_format_unsigned _snd_pcm_format_unsigned = _snd_pcm_format_unsigned_ptr.asFunction<_dart_snd_pcm_format_unsigned>(); int snd_pcm_format_linear( int format, ) { return _snd_pcm_format_linear( format, ); } late final _snd_pcm_format_linear_ptr = _lookup>( 'snd_pcm_format_linear'); late final _dart_snd_pcm_format_linear _snd_pcm_format_linear = _snd_pcm_format_linear_ptr.asFunction<_dart_snd_pcm_format_linear>(); int snd_pcm_format_float( int format, ) { return _snd_pcm_format_float( format, ); } late final _snd_pcm_format_float_ptr = _lookup>( 'snd_pcm_format_float'); late final _dart_snd_pcm_format_float _snd_pcm_format_float = _snd_pcm_format_float_ptr.asFunction<_dart_snd_pcm_format_float>(); int snd_pcm_format_little_endian( int format, ) { return _snd_pcm_format_little_endian( format, ); } late final _snd_pcm_format_little_endian_ptr = _lookup>( 'snd_pcm_format_little_endian'); late final _dart_snd_pcm_format_little_endian _snd_pcm_format_little_endian = _snd_pcm_format_little_endian_ptr .asFunction<_dart_snd_pcm_format_little_endian>(); int snd_pcm_format_big_endian( int format, ) { return _snd_pcm_format_big_endian( format, ); } late final _snd_pcm_format_big_endian_ptr = _lookup>( 'snd_pcm_format_big_endian'); late final _dart_snd_pcm_format_big_endian _snd_pcm_format_big_endian = _snd_pcm_format_big_endian_ptr .asFunction<_dart_snd_pcm_format_big_endian>(); int snd_pcm_format_cpu_endian( int format, ) { return _snd_pcm_format_cpu_endian( format, ); } late final _snd_pcm_format_cpu_endian_ptr = _lookup>( 'snd_pcm_format_cpu_endian'); late final _dart_snd_pcm_format_cpu_endian _snd_pcm_format_cpu_endian = _snd_pcm_format_cpu_endian_ptr .asFunction<_dart_snd_pcm_format_cpu_endian>(); int snd_pcm_format_width( int format, ) { return _snd_pcm_format_width( format, ); } late final _snd_pcm_format_width_ptr = _lookup>( 'snd_pcm_format_width'); late final _dart_snd_pcm_format_width _snd_pcm_format_width = _snd_pcm_format_width_ptr.asFunction<_dart_snd_pcm_format_width>(); int snd_pcm_format_physical_width( int format, ) { return _snd_pcm_format_physical_width( format, ); } late final _snd_pcm_format_physical_width_ptr = _lookup>( 'snd_pcm_format_physical_width'); late final _dart_snd_pcm_format_physical_width _snd_pcm_format_physical_width = _snd_pcm_format_physical_width_ptr .asFunction<_dart_snd_pcm_format_physical_width>(); int snd_pcm_build_linear_format( int width, int pwidth, int unsignd, int big_endian, ) { return _snd_pcm_build_linear_format( width, pwidth, unsignd, big_endian, ); } late final _snd_pcm_build_linear_format_ptr = _lookup>( 'snd_pcm_build_linear_format'); late final _dart_snd_pcm_build_linear_format _snd_pcm_build_linear_format = _snd_pcm_build_linear_format_ptr .asFunction<_dart_snd_pcm_build_linear_format>(); int snd_pcm_format_size( int format, int samples, ) { return _snd_pcm_format_size( format, samples, ); } late final _snd_pcm_format_size_ptr = _lookup>( 'snd_pcm_format_size'); late final _dart_snd_pcm_format_size _snd_pcm_format_size = _snd_pcm_format_size_ptr.asFunction<_dart_snd_pcm_format_size>(); int snd_pcm_format_silence( int format, ) { return _snd_pcm_format_silence( format, ); } late final _snd_pcm_format_silence_ptr = _lookup>( 'snd_pcm_format_silence'); late final _dart_snd_pcm_format_silence _snd_pcm_format_silence = _snd_pcm_format_silence_ptr.asFunction<_dart_snd_pcm_format_silence>(); int snd_pcm_format_silence_16( int format, ) { return _snd_pcm_format_silence_16( format, ); } late final _snd_pcm_format_silence_16_ptr = _lookup>( 'snd_pcm_format_silence_16'); late final _dart_snd_pcm_format_silence_16 _snd_pcm_format_silence_16 = _snd_pcm_format_silence_16_ptr .asFunction<_dart_snd_pcm_format_silence_16>(); int snd_pcm_format_silence_32( int format, ) { return _snd_pcm_format_silence_32( format, ); } late final _snd_pcm_format_silence_32_ptr = _lookup>( 'snd_pcm_format_silence_32'); late final _dart_snd_pcm_format_silence_32 _snd_pcm_format_silence_32 = _snd_pcm_format_silence_32_ptr .asFunction<_dart_snd_pcm_format_silence_32>(); int snd_pcm_format_silence_64( int format, ) { return _snd_pcm_format_silence_64( format, ); } late final _snd_pcm_format_silence_64_ptr = _lookup>( 'snd_pcm_format_silence_64'); late final _dart_snd_pcm_format_silence_64 _snd_pcm_format_silence_64 = _snd_pcm_format_silence_64_ptr .asFunction<_dart_snd_pcm_format_silence_64>(); int snd_pcm_format_set_silence( int format, ffi.Pointer buf, int samples, ) { return _snd_pcm_format_set_silence( format, buf, samples, ); } late final _snd_pcm_format_set_silence_ptr = _lookup>( 'snd_pcm_format_set_silence'); late final _dart_snd_pcm_format_set_silence _snd_pcm_format_set_silence = _snd_pcm_format_set_silence_ptr .asFunction<_dart_snd_pcm_format_set_silence>(); int snd_pcm_bytes_to_frames( ffi.Pointer pcm, int bytes, ) { return _snd_pcm_bytes_to_frames( pcm, bytes, ); } late final _snd_pcm_bytes_to_frames_ptr = _lookup>( 'snd_pcm_bytes_to_frames'); late final _dart_snd_pcm_bytes_to_frames _snd_pcm_bytes_to_frames = _snd_pcm_bytes_to_frames_ptr.asFunction<_dart_snd_pcm_bytes_to_frames>(); int snd_pcm_frames_to_bytes( ffi.Pointer pcm, int frames, ) { return _snd_pcm_frames_to_bytes( pcm, frames, ); } late final _snd_pcm_frames_to_bytes_ptr = _lookup>( 'snd_pcm_frames_to_bytes'); late final _dart_snd_pcm_frames_to_bytes _snd_pcm_frames_to_bytes = _snd_pcm_frames_to_bytes_ptr.asFunction<_dart_snd_pcm_frames_to_bytes>(); int snd_pcm_bytes_to_samples( ffi.Pointer pcm, int bytes, ) { return _snd_pcm_bytes_to_samples( pcm, bytes, ); } late final _snd_pcm_bytes_to_samples_ptr = _lookup>( 'snd_pcm_bytes_to_samples'); late final _dart_snd_pcm_bytes_to_samples _snd_pcm_bytes_to_samples = _snd_pcm_bytes_to_samples_ptr .asFunction<_dart_snd_pcm_bytes_to_samples>(); int snd_pcm_samples_to_bytes( ffi.Pointer pcm, int samples, ) { return _snd_pcm_samples_to_bytes( pcm, samples, ); } late final _snd_pcm_samples_to_bytes_ptr = _lookup>( 'snd_pcm_samples_to_bytes'); late final _dart_snd_pcm_samples_to_bytes _snd_pcm_samples_to_bytes = _snd_pcm_samples_to_bytes_ptr .asFunction<_dart_snd_pcm_samples_to_bytes>(); int snd_pcm_area_silence( ffi.Pointer dst_channel, int dst_offset, int samples, int format, ) { return _snd_pcm_area_silence( dst_channel, dst_offset, samples, format, ); } late final _snd_pcm_area_silence_ptr = _lookup>( 'snd_pcm_area_silence'); late final _dart_snd_pcm_area_silence _snd_pcm_area_silence = _snd_pcm_area_silence_ptr.asFunction<_dart_snd_pcm_area_silence>(); int snd_pcm_areas_silence( ffi.Pointer dst_channels, int dst_offset, int channels, int frames, int format, ) { return _snd_pcm_areas_silence( dst_channels, dst_offset, channels, frames, format, ); } late final _snd_pcm_areas_silence_ptr = _lookup>( 'snd_pcm_areas_silence'); late final _dart_snd_pcm_areas_silence _snd_pcm_areas_silence = _snd_pcm_areas_silence_ptr.asFunction<_dart_snd_pcm_areas_silence>(); int snd_pcm_area_copy( ffi.Pointer dst_channel, int dst_offset, ffi.Pointer src_channel, int src_offset, int samples, int format, ) { return _snd_pcm_area_copy( dst_channel, dst_offset, src_channel, src_offset, samples, format, ); } late final _snd_pcm_area_copy_ptr = _lookup>('snd_pcm_area_copy'); late final _dart_snd_pcm_area_copy _snd_pcm_area_copy = _snd_pcm_area_copy_ptr.asFunction<_dart_snd_pcm_area_copy>(); int snd_pcm_areas_copy( ffi.Pointer dst_channels, int dst_offset, ffi.Pointer src_channels, int src_offset, int channels, int frames, int format, ) { return _snd_pcm_areas_copy( dst_channels, dst_offset, src_channels, src_offset, channels, frames, format, ); } late final _snd_pcm_areas_copy_ptr = _lookup>('snd_pcm_areas_copy'); late final _dart_snd_pcm_areas_copy _snd_pcm_areas_copy = _snd_pcm_areas_copy_ptr.asFunction<_dart_snd_pcm_areas_copy>(); int snd_pcm_areas_copy_wrap( ffi.Pointer dst_channels, int dst_offset, int dst_size, ffi.Pointer src_channels, int src_offset, int src_size, int channels, int frames, int format, ) { return _snd_pcm_areas_copy_wrap( dst_channels, dst_offset, dst_size, src_channels, src_offset, src_size, channels, frames, format, ); } late final _snd_pcm_areas_copy_wrap_ptr = _lookup>( 'snd_pcm_areas_copy_wrap'); late final _dart_snd_pcm_areas_copy_wrap _snd_pcm_areas_copy_wrap = _snd_pcm_areas_copy_wrap_ptr.asFunction<_dart_snd_pcm_areas_copy_wrap>(); ffi.Pointer snd_pcm_hook_get_pcm( ffi.Pointer hook, ) { return _snd_pcm_hook_get_pcm( hook, ); } late final _snd_pcm_hook_get_pcm_ptr = _lookup>( 'snd_pcm_hook_get_pcm'); late final _dart_snd_pcm_hook_get_pcm _snd_pcm_hook_get_pcm = _snd_pcm_hook_get_pcm_ptr.asFunction<_dart_snd_pcm_hook_get_pcm>(); ffi.Pointer snd_pcm_hook_get_private( ffi.Pointer hook, ) { return _snd_pcm_hook_get_private( hook, ); } late final _snd_pcm_hook_get_private_ptr = _lookup>( 'snd_pcm_hook_get_private'); late final _dart_snd_pcm_hook_get_private _snd_pcm_hook_get_private = _snd_pcm_hook_get_private_ptr .asFunction<_dart_snd_pcm_hook_get_private>(); void snd_pcm_hook_set_private( ffi.Pointer hook, ffi.Pointer private_data, ) { return _snd_pcm_hook_set_private( hook, private_data, ); } late final _snd_pcm_hook_set_private_ptr = _lookup>( 'snd_pcm_hook_set_private'); late final _dart_snd_pcm_hook_set_private _snd_pcm_hook_set_private = _snd_pcm_hook_set_private_ptr .asFunction<_dart_snd_pcm_hook_set_private>(); int snd_pcm_hook_add( ffi.Pointer> hookp, ffi.Pointer pcm, int type, ffi.Pointer> func, ffi.Pointer private_data, ) { return _snd_pcm_hook_add( hookp, pcm, type, func, private_data, ); } late final _snd_pcm_hook_add_ptr = _lookup>('snd_pcm_hook_add'); late final _dart_snd_pcm_hook_add _snd_pcm_hook_add = _snd_pcm_hook_add_ptr.asFunction<_dart_snd_pcm_hook_add>(); int snd_pcm_hook_remove( ffi.Pointer hook, ) { return _snd_pcm_hook_remove( hook, ); } late final _snd_pcm_hook_remove_ptr = _lookup>( 'snd_pcm_hook_remove'); late final _dart_snd_pcm_hook_remove _snd_pcm_hook_remove = _snd_pcm_hook_remove_ptr.asFunction<_dart_snd_pcm_hook_remove>(); int snd_pcm_meter_get_bufsize( ffi.Pointer pcm, ) { return _snd_pcm_meter_get_bufsize( pcm, ); } late final _snd_pcm_meter_get_bufsize_ptr = _lookup>( 'snd_pcm_meter_get_bufsize'); late final _dart_snd_pcm_meter_get_bufsize _snd_pcm_meter_get_bufsize = _snd_pcm_meter_get_bufsize_ptr .asFunction<_dart_snd_pcm_meter_get_bufsize>(); int snd_pcm_meter_get_channels( ffi.Pointer pcm, ) { return _snd_pcm_meter_get_channels( pcm, ); } late final _snd_pcm_meter_get_channels_ptr = _lookup>( 'snd_pcm_meter_get_channels'); late final _dart_snd_pcm_meter_get_channels _snd_pcm_meter_get_channels = _snd_pcm_meter_get_channels_ptr .asFunction<_dart_snd_pcm_meter_get_channels>(); int snd_pcm_meter_get_rate( ffi.Pointer pcm, ) { return _snd_pcm_meter_get_rate( pcm, ); } late final _snd_pcm_meter_get_rate_ptr = _lookup>( 'snd_pcm_meter_get_rate'); late final _dart_snd_pcm_meter_get_rate _snd_pcm_meter_get_rate = _snd_pcm_meter_get_rate_ptr.asFunction<_dart_snd_pcm_meter_get_rate>(); int snd_pcm_meter_get_now( ffi.Pointer pcm, ) { return _snd_pcm_meter_get_now( pcm, ); } late final _snd_pcm_meter_get_now_ptr = _lookup>( 'snd_pcm_meter_get_now'); late final _dart_snd_pcm_meter_get_now _snd_pcm_meter_get_now = _snd_pcm_meter_get_now_ptr.asFunction<_dart_snd_pcm_meter_get_now>(); int snd_pcm_meter_get_boundary( ffi.Pointer pcm, ) { return _snd_pcm_meter_get_boundary( pcm, ); } late final _snd_pcm_meter_get_boundary_ptr = _lookup>( 'snd_pcm_meter_get_boundary'); late final _dart_snd_pcm_meter_get_boundary _snd_pcm_meter_get_boundary = _snd_pcm_meter_get_boundary_ptr .asFunction<_dart_snd_pcm_meter_get_boundary>(); int snd_pcm_meter_add_scope( ffi.Pointer pcm, ffi.Pointer scope, ) { return _snd_pcm_meter_add_scope( pcm, scope, ); } late final _snd_pcm_meter_add_scope_ptr = _lookup>( 'snd_pcm_meter_add_scope'); late final _dart_snd_pcm_meter_add_scope _snd_pcm_meter_add_scope = _snd_pcm_meter_add_scope_ptr.asFunction<_dart_snd_pcm_meter_add_scope>(); ffi.Pointer snd_pcm_meter_search_scope( ffi.Pointer pcm, ffi.Pointer name, ) { return _snd_pcm_meter_search_scope( pcm, name, ); } late final _snd_pcm_meter_search_scope_ptr = _lookup>( 'snd_pcm_meter_search_scope'); late final _dart_snd_pcm_meter_search_scope _snd_pcm_meter_search_scope = _snd_pcm_meter_search_scope_ptr .asFunction<_dart_snd_pcm_meter_search_scope>(); int snd_pcm_scope_malloc( ffi.Pointer> ptr, ) { return _snd_pcm_scope_malloc( ptr, ); } late final _snd_pcm_scope_malloc_ptr = _lookup>( 'snd_pcm_scope_malloc'); late final _dart_snd_pcm_scope_malloc _snd_pcm_scope_malloc = _snd_pcm_scope_malloc_ptr.asFunction<_dart_snd_pcm_scope_malloc>(); void snd_pcm_scope_set_ops( ffi.Pointer scope, ffi.Pointer val, ) { return _snd_pcm_scope_set_ops( scope, val, ); } late final _snd_pcm_scope_set_ops_ptr = _lookup>( 'snd_pcm_scope_set_ops'); late final _dart_snd_pcm_scope_set_ops _snd_pcm_scope_set_ops = _snd_pcm_scope_set_ops_ptr.asFunction<_dart_snd_pcm_scope_set_ops>(); void snd_pcm_scope_set_name( ffi.Pointer scope, ffi.Pointer val, ) { return _snd_pcm_scope_set_name( scope, val, ); } late final _snd_pcm_scope_set_name_ptr = _lookup>( 'snd_pcm_scope_set_name'); late final _dart_snd_pcm_scope_set_name _snd_pcm_scope_set_name = _snd_pcm_scope_set_name_ptr.asFunction<_dart_snd_pcm_scope_set_name>(); ffi.Pointer snd_pcm_scope_get_name( ffi.Pointer scope, ) { return _snd_pcm_scope_get_name( scope, ); } late final _snd_pcm_scope_get_name_ptr = _lookup>( 'snd_pcm_scope_get_name'); late final _dart_snd_pcm_scope_get_name _snd_pcm_scope_get_name = _snd_pcm_scope_get_name_ptr.asFunction<_dart_snd_pcm_scope_get_name>(); ffi.Pointer snd_pcm_scope_get_callback_private( ffi.Pointer scope, ) { return _snd_pcm_scope_get_callback_private( scope, ); } late final _snd_pcm_scope_get_callback_private_ptr = _lookup>( 'snd_pcm_scope_get_callback_private'); late final _dart_snd_pcm_scope_get_callback_private _snd_pcm_scope_get_callback_private = _snd_pcm_scope_get_callback_private_ptr .asFunction<_dart_snd_pcm_scope_get_callback_private>(); void snd_pcm_scope_set_callback_private( ffi.Pointer scope, ffi.Pointer val, ) { return _snd_pcm_scope_set_callback_private( scope, val, ); } late final _snd_pcm_scope_set_callback_private_ptr = _lookup>( 'snd_pcm_scope_set_callback_private'); late final _dart_snd_pcm_scope_set_callback_private _snd_pcm_scope_set_callback_private = _snd_pcm_scope_set_callback_private_ptr .asFunction<_dart_snd_pcm_scope_set_callback_private>(); int snd_pcm_scope_s16_open( ffi.Pointer pcm, ffi.Pointer name, ffi.Pointer> scopep, ) { return _snd_pcm_scope_s16_open( pcm, name, scopep, ); } late final _snd_pcm_scope_s16_open_ptr = _lookup>( 'snd_pcm_scope_s16_open'); late final _dart_snd_pcm_scope_s16_open _snd_pcm_scope_s16_open = _snd_pcm_scope_s16_open_ptr.asFunction<_dart_snd_pcm_scope_s16_open>(); ffi.Pointer snd_pcm_scope_s16_get_channel_buffer( ffi.Pointer scope, int channel, ) { return _snd_pcm_scope_s16_get_channel_buffer( scope, channel, ); } late final _snd_pcm_scope_s16_get_channel_buffer_ptr = _lookup>( 'snd_pcm_scope_s16_get_channel_buffer'); late final _dart_snd_pcm_scope_s16_get_channel_buffer _snd_pcm_scope_s16_get_channel_buffer = _snd_pcm_scope_s16_get_channel_buffer_ptr .asFunction<_dart_snd_pcm_scope_s16_get_channel_buffer>(); int snd_spcm_init( ffi.Pointer pcm, int rate, int channels, int format, int subformat, int latency, int _access, int xrun_type, ) { return _snd_spcm_init( pcm, rate, channels, format, subformat, latency, _access, xrun_type, ); } late final _snd_spcm_init_ptr = _lookup>('snd_spcm_init'); late final _dart_snd_spcm_init _snd_spcm_init = _snd_spcm_init_ptr.asFunction<_dart_snd_spcm_init>(); int snd_spcm_init_duplex( ffi.Pointer playback_pcm, ffi.Pointer capture_pcm, int rate, int channels, int format, int subformat, int latency, int _access, int xrun_type, int duplex_type, ) { return _snd_spcm_init_duplex( playback_pcm, capture_pcm, rate, channels, format, subformat, latency, _access, xrun_type, duplex_type, ); } late final _snd_spcm_init_duplex_ptr = _lookup>( 'snd_spcm_init_duplex'); late final _dart_snd_spcm_init_duplex _snd_spcm_init_duplex = _snd_spcm_init_duplex_ptr.asFunction<_dart_snd_spcm_init_duplex>(); int snd_spcm_init_get_params( ffi.Pointer pcm, ffi.Pointer rate, ffi.Pointer buffer_size, ffi.Pointer period_size, ) { return _snd_spcm_init_get_params( pcm, rate, buffer_size, period_size, ); } late final _snd_spcm_init_get_params_ptr = _lookup>( 'snd_spcm_init_get_params'); late final _dart_snd_spcm_init_get_params _snd_spcm_init_get_params = _snd_spcm_init_get_params_ptr .asFunction<_dart_snd_spcm_init_get_params>(); ffi.Pointer snd_pcm_start_mode_name( int mode, ) { return _snd_pcm_start_mode_name( mode, ); } late final _snd_pcm_start_mode_name_ptr = _lookup>( 'snd_pcm_start_mode_name'); late final _dart_snd_pcm_start_mode_name _snd_pcm_start_mode_name = _snd_pcm_start_mode_name_ptr.asFunction<_dart_snd_pcm_start_mode_name>(); ffi.Pointer snd_pcm_xrun_mode_name( int mode, ) { return _snd_pcm_xrun_mode_name( mode, ); } late final _snd_pcm_xrun_mode_name_ptr = _lookup>( 'snd_pcm_xrun_mode_name'); late final _dart_snd_pcm_xrun_mode_name _snd_pcm_xrun_mode_name = _snd_pcm_xrun_mode_name_ptr.asFunction<_dart_snd_pcm_xrun_mode_name>(); int snd_pcm_sw_params_set_start_mode( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_start_mode( pcm, params, val, ); } late final _snd_pcm_sw_params_set_start_mode_ptr = _lookup>( 'snd_pcm_sw_params_set_start_mode'); late final _dart_snd_pcm_sw_params_set_start_mode _snd_pcm_sw_params_set_start_mode = _snd_pcm_sw_params_set_start_mode_ptr .asFunction<_dart_snd_pcm_sw_params_set_start_mode>(); int snd_pcm_sw_params_get_start_mode( ffi.Pointer params, ) { return _snd_pcm_sw_params_get_start_mode( params, ); } late final _snd_pcm_sw_params_get_start_mode_ptr = _lookup>( 'snd_pcm_sw_params_get_start_mode'); late final _dart_snd_pcm_sw_params_get_start_mode _snd_pcm_sw_params_get_start_mode = _snd_pcm_sw_params_get_start_mode_ptr .asFunction<_dart_snd_pcm_sw_params_get_start_mode>(); int snd_pcm_sw_params_set_xrun_mode( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_xrun_mode( pcm, params, val, ); } late final _snd_pcm_sw_params_set_xrun_mode_ptr = _lookup>( 'snd_pcm_sw_params_set_xrun_mode'); late final _dart_snd_pcm_sw_params_set_xrun_mode _snd_pcm_sw_params_set_xrun_mode = _snd_pcm_sw_params_set_xrun_mode_ptr .asFunction<_dart_snd_pcm_sw_params_set_xrun_mode>(); int snd_pcm_sw_params_get_xrun_mode( ffi.Pointer params, ) { return _snd_pcm_sw_params_get_xrun_mode( params, ); } late final _snd_pcm_sw_params_get_xrun_mode_ptr = _lookup>( 'snd_pcm_sw_params_get_xrun_mode'); late final _dart_snd_pcm_sw_params_get_xrun_mode _snd_pcm_sw_params_get_xrun_mode = _snd_pcm_sw_params_get_xrun_mode_ptr .asFunction<_dart_snd_pcm_sw_params_get_xrun_mode>(); int snd_pcm_sw_params_set_xfer_align( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_xfer_align( pcm, params, val, ); } late final _snd_pcm_sw_params_set_xfer_align_ptr = _lookup>( 'snd_pcm_sw_params_set_xfer_align'); late final _dart_snd_pcm_sw_params_set_xfer_align _snd_pcm_sw_params_set_xfer_align = _snd_pcm_sw_params_set_xfer_align_ptr .asFunction<_dart_snd_pcm_sw_params_set_xfer_align>(); int snd_pcm_sw_params_get_xfer_align( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_xfer_align( params, val, ); } late final _snd_pcm_sw_params_get_xfer_align_ptr = _lookup>( 'snd_pcm_sw_params_get_xfer_align'); late final _dart_snd_pcm_sw_params_get_xfer_align _snd_pcm_sw_params_get_xfer_align = _snd_pcm_sw_params_get_xfer_align_ptr .asFunction<_dart_snd_pcm_sw_params_get_xfer_align>(); int snd_pcm_sw_params_set_sleep_min( ffi.Pointer pcm, ffi.Pointer params, int val, ) { return _snd_pcm_sw_params_set_sleep_min( pcm, params, val, ); } late final _snd_pcm_sw_params_set_sleep_min_ptr = _lookup>( 'snd_pcm_sw_params_set_sleep_min'); late final _dart_snd_pcm_sw_params_set_sleep_min _snd_pcm_sw_params_set_sleep_min = _snd_pcm_sw_params_set_sleep_min_ptr .asFunction<_dart_snd_pcm_sw_params_set_sleep_min>(); int snd_pcm_sw_params_get_sleep_min( ffi.Pointer params, ffi.Pointer val, ) { return _snd_pcm_sw_params_get_sleep_min( params, val, ); } late final _snd_pcm_sw_params_get_sleep_min_ptr = _lookup>( 'snd_pcm_sw_params_get_sleep_min'); late final _dart_snd_pcm_sw_params_get_sleep_min _snd_pcm_sw_params_get_sleep_min = _snd_pcm_sw_params_get_sleep_min_ptr .asFunction<_dart_snd_pcm_sw_params_get_sleep_min>(); int snd_pcm_hw_params_get_tick_time( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_tick_time( params, val, dir, ); } late final _snd_pcm_hw_params_get_tick_time_ptr = _lookup>( 'snd_pcm_hw_params_get_tick_time'); late final _dart_snd_pcm_hw_params_get_tick_time _snd_pcm_hw_params_get_tick_time = _snd_pcm_hw_params_get_tick_time_ptr .asFunction<_dart_snd_pcm_hw_params_get_tick_time>(); int snd_pcm_hw_params_get_tick_time_min( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_tick_time_min( params, val, dir, ); } late final _snd_pcm_hw_params_get_tick_time_min_ptr = _lookup>( 'snd_pcm_hw_params_get_tick_time_min'); late final _dart_snd_pcm_hw_params_get_tick_time_min _snd_pcm_hw_params_get_tick_time_min = _snd_pcm_hw_params_get_tick_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_get_tick_time_min>(); int snd_pcm_hw_params_get_tick_time_max( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_get_tick_time_max( params, val, dir, ); } late final _snd_pcm_hw_params_get_tick_time_max_ptr = _lookup>( 'snd_pcm_hw_params_get_tick_time_max'); late final _dart_snd_pcm_hw_params_get_tick_time_max _snd_pcm_hw_params_get_tick_time_max = _snd_pcm_hw_params_get_tick_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_get_tick_time_max>(); int snd_pcm_hw_params_test_tick_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_test_tick_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_test_tick_time_ptr = _lookup>( 'snd_pcm_hw_params_test_tick_time'); late final _dart_snd_pcm_hw_params_test_tick_time _snd_pcm_hw_params_test_tick_time = _snd_pcm_hw_params_test_tick_time_ptr .asFunction<_dart_snd_pcm_hw_params_test_tick_time>(); int snd_pcm_hw_params_set_tick_time( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ) { return _snd_pcm_hw_params_set_tick_time( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time'); late final _dart_snd_pcm_hw_params_set_tick_time _snd_pcm_hw_params_set_tick_time = _snd_pcm_hw_params_set_tick_time_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time>(); int snd_pcm_hw_params_set_tick_time_min( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_tick_time_min( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_min_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_min'); late final _dart_snd_pcm_hw_params_set_tick_time_min _snd_pcm_hw_params_set_tick_time_min = _snd_pcm_hw_params_set_tick_time_min_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_min>(); int snd_pcm_hw_params_set_tick_time_max( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_tick_time_max( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_max_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_max'); late final _dart_snd_pcm_hw_params_set_tick_time_max _snd_pcm_hw_params_set_tick_time_max = _snd_pcm_hw_params_set_tick_time_max_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_max>(); int snd_pcm_hw_params_set_tick_time_minmax( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ) { return _snd_pcm_hw_params_set_tick_time_minmax( pcm, params, min, mindir, max, maxdir, ); } late final _snd_pcm_hw_params_set_tick_time_minmax_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_minmax'); late final _dart_snd_pcm_hw_params_set_tick_time_minmax _snd_pcm_hw_params_set_tick_time_minmax = _snd_pcm_hw_params_set_tick_time_minmax_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_minmax>(); int snd_pcm_hw_params_set_tick_time_near( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_tick_time_near( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_near_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_near'); late final _dart_snd_pcm_hw_params_set_tick_time_near _snd_pcm_hw_params_set_tick_time_near = _snd_pcm_hw_params_set_tick_time_near_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_near>(); int snd_pcm_hw_params_set_tick_time_first( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_tick_time_first( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_first_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_first'); late final _dart_snd_pcm_hw_params_set_tick_time_first _snd_pcm_hw_params_set_tick_time_first = _snd_pcm_hw_params_set_tick_time_first_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_first>(); int snd_pcm_hw_params_set_tick_time_last( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ) { return _snd_pcm_hw_params_set_tick_time_last( pcm, params, val, dir, ); } late final _snd_pcm_hw_params_set_tick_time_last_ptr = _lookup>( 'snd_pcm_hw_params_set_tick_time_last'); late final _dart_snd_pcm_hw_params_set_tick_time_last _snd_pcm_hw_params_set_tick_time_last = _snd_pcm_hw_params_set_tick_time_last_ptr .asFunction<_dart_snd_pcm_hw_params_set_tick_time_last>(); int snd_rawmidi_open( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, int mode, ) { return _snd_rawmidi_open( in_rmidi, out_rmidi, name, mode, ); } late final _snd_rawmidi_open_ptr = _lookup>('snd_rawmidi_open'); late final _dart_snd_rawmidi_open _snd_rawmidi_open = _snd_rawmidi_open_ptr.asFunction<_dart_snd_rawmidi_open>(); int snd_rawmidi_open_lconf( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, int mode, ffi.Pointer lconf, ) { return _snd_rawmidi_open_lconf( in_rmidi, out_rmidi, name, mode, lconf, ); } late final _snd_rawmidi_open_lconf_ptr = _lookup>( 'snd_rawmidi_open_lconf'); late final _dart_snd_rawmidi_open_lconf _snd_rawmidi_open_lconf = _snd_rawmidi_open_lconf_ptr.asFunction<_dart_snd_rawmidi_open_lconf>(); int snd_rawmidi_close( ffi.Pointer rmidi, ) { return _snd_rawmidi_close( rmidi, ); } late final _snd_rawmidi_close_ptr = _lookup>('snd_rawmidi_close'); late final _dart_snd_rawmidi_close _snd_rawmidi_close = _snd_rawmidi_close_ptr.asFunction<_dart_snd_rawmidi_close>(); int snd_rawmidi_poll_descriptors_count( ffi.Pointer rmidi, ) { return _snd_rawmidi_poll_descriptors_count( rmidi, ); } late final _snd_rawmidi_poll_descriptors_count_ptr = _lookup>( 'snd_rawmidi_poll_descriptors_count'); late final _dart_snd_rawmidi_poll_descriptors_count _snd_rawmidi_poll_descriptors_count = _snd_rawmidi_poll_descriptors_count_ptr .asFunction<_dart_snd_rawmidi_poll_descriptors_count>(); int snd_rawmidi_poll_descriptors( ffi.Pointer rmidi, ffi.Pointer pfds, int space, ) { return _snd_rawmidi_poll_descriptors( rmidi, pfds, space, ); } late final _snd_rawmidi_poll_descriptors_ptr = _lookup>( 'snd_rawmidi_poll_descriptors'); late final _dart_snd_rawmidi_poll_descriptors _snd_rawmidi_poll_descriptors = _snd_rawmidi_poll_descriptors_ptr .asFunction<_dart_snd_rawmidi_poll_descriptors>(); int snd_rawmidi_poll_descriptors_revents( ffi.Pointer rawmidi, ffi.Pointer pfds, int nfds, ffi.Pointer revent, ) { return _snd_rawmidi_poll_descriptors_revents( rawmidi, pfds, nfds, revent, ); } late final _snd_rawmidi_poll_descriptors_revents_ptr = _lookup>( 'snd_rawmidi_poll_descriptors_revents'); late final _dart_snd_rawmidi_poll_descriptors_revents _snd_rawmidi_poll_descriptors_revents = _snd_rawmidi_poll_descriptors_revents_ptr .asFunction<_dart_snd_rawmidi_poll_descriptors_revents>(); int snd_rawmidi_nonblock( ffi.Pointer rmidi, int nonblock, ) { return _snd_rawmidi_nonblock( rmidi, nonblock, ); } late final _snd_rawmidi_nonblock_ptr = _lookup>( 'snd_rawmidi_nonblock'); late final _dart_snd_rawmidi_nonblock _snd_rawmidi_nonblock = _snd_rawmidi_nonblock_ptr.asFunction<_dart_snd_rawmidi_nonblock>(); int snd_rawmidi_info_sizeof() { return _snd_rawmidi_info_sizeof(); } late final _snd_rawmidi_info_sizeof_ptr = _lookup>( 'snd_rawmidi_info_sizeof'); late final _dart_snd_rawmidi_info_sizeof _snd_rawmidi_info_sizeof = _snd_rawmidi_info_sizeof_ptr.asFunction<_dart_snd_rawmidi_info_sizeof>(); int snd_rawmidi_info_malloc( ffi.Pointer> ptr, ) { return _snd_rawmidi_info_malloc( ptr, ); } late final _snd_rawmidi_info_malloc_ptr = _lookup>( 'snd_rawmidi_info_malloc'); late final _dart_snd_rawmidi_info_malloc _snd_rawmidi_info_malloc = _snd_rawmidi_info_malloc_ptr.asFunction<_dart_snd_rawmidi_info_malloc>(); void snd_rawmidi_info_free( ffi.Pointer obj, ) { return _snd_rawmidi_info_free( obj, ); } late final _snd_rawmidi_info_free_ptr = _lookup>( 'snd_rawmidi_info_free'); late final _dart_snd_rawmidi_info_free _snd_rawmidi_info_free = _snd_rawmidi_info_free_ptr.asFunction<_dart_snd_rawmidi_info_free>(); void snd_rawmidi_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_rawmidi_info_copy( dst, src, ); } late final _snd_rawmidi_info_copy_ptr = _lookup>( 'snd_rawmidi_info_copy'); late final _dart_snd_rawmidi_info_copy _snd_rawmidi_info_copy = _snd_rawmidi_info_copy_ptr.asFunction<_dart_snd_rawmidi_info_copy>(); int snd_rawmidi_info_get_device( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_device( obj, ); } late final _snd_rawmidi_info_get_device_ptr = _lookup>( 'snd_rawmidi_info_get_device'); late final _dart_snd_rawmidi_info_get_device _snd_rawmidi_info_get_device = _snd_rawmidi_info_get_device_ptr .asFunction<_dart_snd_rawmidi_info_get_device>(); int snd_rawmidi_info_get_subdevice( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_subdevice( obj, ); } late final _snd_rawmidi_info_get_subdevice_ptr = _lookup>( 'snd_rawmidi_info_get_subdevice'); late final _dart_snd_rawmidi_info_get_subdevice _snd_rawmidi_info_get_subdevice = _snd_rawmidi_info_get_subdevice_ptr .asFunction<_dart_snd_rawmidi_info_get_subdevice>(); int snd_rawmidi_info_get_stream( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_stream( obj, ); } late final _snd_rawmidi_info_get_stream_ptr = _lookup>( 'snd_rawmidi_info_get_stream'); late final _dart_snd_rawmidi_info_get_stream _snd_rawmidi_info_get_stream = _snd_rawmidi_info_get_stream_ptr .asFunction<_dart_snd_rawmidi_info_get_stream>(); int snd_rawmidi_info_get_card( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_card( obj, ); } late final _snd_rawmidi_info_get_card_ptr = _lookup>( 'snd_rawmidi_info_get_card'); late final _dart_snd_rawmidi_info_get_card _snd_rawmidi_info_get_card = _snd_rawmidi_info_get_card_ptr .asFunction<_dart_snd_rawmidi_info_get_card>(); int snd_rawmidi_info_get_flags( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_flags( obj, ); } late final _snd_rawmidi_info_get_flags_ptr = _lookup>( 'snd_rawmidi_info_get_flags'); late final _dart_snd_rawmidi_info_get_flags _snd_rawmidi_info_get_flags = _snd_rawmidi_info_get_flags_ptr .asFunction<_dart_snd_rawmidi_info_get_flags>(); ffi.Pointer snd_rawmidi_info_get_id( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_id( obj, ); } late final _snd_rawmidi_info_get_id_ptr = _lookup>( 'snd_rawmidi_info_get_id'); late final _dart_snd_rawmidi_info_get_id _snd_rawmidi_info_get_id = _snd_rawmidi_info_get_id_ptr.asFunction<_dart_snd_rawmidi_info_get_id>(); ffi.Pointer snd_rawmidi_info_get_name( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_name( obj, ); } late final _snd_rawmidi_info_get_name_ptr = _lookup>( 'snd_rawmidi_info_get_name'); late final _dart_snd_rawmidi_info_get_name _snd_rawmidi_info_get_name = _snd_rawmidi_info_get_name_ptr .asFunction<_dart_snd_rawmidi_info_get_name>(); ffi.Pointer snd_rawmidi_info_get_subdevice_name( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_subdevice_name( obj, ); } late final _snd_rawmidi_info_get_subdevice_name_ptr = _lookup>( 'snd_rawmidi_info_get_subdevice_name'); late final _dart_snd_rawmidi_info_get_subdevice_name _snd_rawmidi_info_get_subdevice_name = _snd_rawmidi_info_get_subdevice_name_ptr .asFunction<_dart_snd_rawmidi_info_get_subdevice_name>(); int snd_rawmidi_info_get_subdevices_count( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_subdevices_count( obj, ); } late final _snd_rawmidi_info_get_subdevices_count_ptr = _lookup>( 'snd_rawmidi_info_get_subdevices_count'); late final _dart_snd_rawmidi_info_get_subdevices_count _snd_rawmidi_info_get_subdevices_count = _snd_rawmidi_info_get_subdevices_count_ptr .asFunction<_dart_snd_rawmidi_info_get_subdevices_count>(); int snd_rawmidi_info_get_subdevices_avail( ffi.Pointer obj, ) { return _snd_rawmidi_info_get_subdevices_avail( obj, ); } late final _snd_rawmidi_info_get_subdevices_avail_ptr = _lookup>( 'snd_rawmidi_info_get_subdevices_avail'); late final _dart_snd_rawmidi_info_get_subdevices_avail _snd_rawmidi_info_get_subdevices_avail = _snd_rawmidi_info_get_subdevices_avail_ptr .asFunction<_dart_snd_rawmidi_info_get_subdevices_avail>(); void snd_rawmidi_info_set_device( ffi.Pointer obj, int val, ) { return _snd_rawmidi_info_set_device( obj, val, ); } late final _snd_rawmidi_info_set_device_ptr = _lookup>( 'snd_rawmidi_info_set_device'); late final _dart_snd_rawmidi_info_set_device _snd_rawmidi_info_set_device = _snd_rawmidi_info_set_device_ptr .asFunction<_dart_snd_rawmidi_info_set_device>(); void snd_rawmidi_info_set_subdevice( ffi.Pointer obj, int val, ) { return _snd_rawmidi_info_set_subdevice( obj, val, ); } late final _snd_rawmidi_info_set_subdevice_ptr = _lookup>( 'snd_rawmidi_info_set_subdevice'); late final _dart_snd_rawmidi_info_set_subdevice _snd_rawmidi_info_set_subdevice = _snd_rawmidi_info_set_subdevice_ptr .asFunction<_dart_snd_rawmidi_info_set_subdevice>(); void snd_rawmidi_info_set_stream( ffi.Pointer obj, int val, ) { return _snd_rawmidi_info_set_stream( obj, val, ); } late final _snd_rawmidi_info_set_stream_ptr = _lookup>( 'snd_rawmidi_info_set_stream'); late final _dart_snd_rawmidi_info_set_stream _snd_rawmidi_info_set_stream = _snd_rawmidi_info_set_stream_ptr .asFunction<_dart_snd_rawmidi_info_set_stream>(); int snd_rawmidi_info( ffi.Pointer rmidi, ffi.Pointer info, ) { return _snd_rawmidi_info( rmidi, info, ); } late final _snd_rawmidi_info_ptr = _lookup>('snd_rawmidi_info'); late final _dart_snd_rawmidi_info _snd_rawmidi_info = _snd_rawmidi_info_ptr.asFunction<_dart_snd_rawmidi_info>(); int snd_rawmidi_params_sizeof() { return _snd_rawmidi_params_sizeof(); } late final _snd_rawmidi_params_sizeof_ptr = _lookup>( 'snd_rawmidi_params_sizeof'); late final _dart_snd_rawmidi_params_sizeof _snd_rawmidi_params_sizeof = _snd_rawmidi_params_sizeof_ptr .asFunction<_dart_snd_rawmidi_params_sizeof>(); int snd_rawmidi_params_malloc( ffi.Pointer> ptr, ) { return _snd_rawmidi_params_malloc( ptr, ); } late final _snd_rawmidi_params_malloc_ptr = _lookup>( 'snd_rawmidi_params_malloc'); late final _dart_snd_rawmidi_params_malloc _snd_rawmidi_params_malloc = _snd_rawmidi_params_malloc_ptr .asFunction<_dart_snd_rawmidi_params_malloc>(); void snd_rawmidi_params_free( ffi.Pointer obj, ) { return _snd_rawmidi_params_free( obj, ); } late final _snd_rawmidi_params_free_ptr = _lookup>( 'snd_rawmidi_params_free'); late final _dart_snd_rawmidi_params_free _snd_rawmidi_params_free = _snd_rawmidi_params_free_ptr.asFunction<_dart_snd_rawmidi_params_free>(); void snd_rawmidi_params_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_rawmidi_params_copy( dst, src, ); } late final _snd_rawmidi_params_copy_ptr = _lookup>( 'snd_rawmidi_params_copy'); late final _dart_snd_rawmidi_params_copy _snd_rawmidi_params_copy = _snd_rawmidi_params_copy_ptr.asFunction<_dart_snd_rawmidi_params_copy>(); int snd_rawmidi_params_set_buffer_size( ffi.Pointer rmidi, ffi.Pointer params, int val, ) { return _snd_rawmidi_params_set_buffer_size( rmidi, params, val, ); } late final _snd_rawmidi_params_set_buffer_size_ptr = _lookup>( 'snd_rawmidi_params_set_buffer_size'); late final _dart_snd_rawmidi_params_set_buffer_size _snd_rawmidi_params_set_buffer_size = _snd_rawmidi_params_set_buffer_size_ptr .asFunction<_dart_snd_rawmidi_params_set_buffer_size>(); int snd_rawmidi_params_get_buffer_size( ffi.Pointer params, ) { return _snd_rawmidi_params_get_buffer_size( params, ); } late final _snd_rawmidi_params_get_buffer_size_ptr = _lookup>( 'snd_rawmidi_params_get_buffer_size'); late final _dart_snd_rawmidi_params_get_buffer_size _snd_rawmidi_params_get_buffer_size = _snd_rawmidi_params_get_buffer_size_ptr .asFunction<_dart_snd_rawmidi_params_get_buffer_size>(); int snd_rawmidi_params_set_avail_min( ffi.Pointer rmidi, ffi.Pointer params, int val, ) { return _snd_rawmidi_params_set_avail_min( rmidi, params, val, ); } late final _snd_rawmidi_params_set_avail_min_ptr = _lookup>( 'snd_rawmidi_params_set_avail_min'); late final _dart_snd_rawmidi_params_set_avail_min _snd_rawmidi_params_set_avail_min = _snd_rawmidi_params_set_avail_min_ptr .asFunction<_dart_snd_rawmidi_params_set_avail_min>(); int snd_rawmidi_params_get_avail_min( ffi.Pointer params, ) { return _snd_rawmidi_params_get_avail_min( params, ); } late final _snd_rawmidi_params_get_avail_min_ptr = _lookup>( 'snd_rawmidi_params_get_avail_min'); late final _dart_snd_rawmidi_params_get_avail_min _snd_rawmidi_params_get_avail_min = _snd_rawmidi_params_get_avail_min_ptr .asFunction<_dart_snd_rawmidi_params_get_avail_min>(); int snd_rawmidi_params_set_no_active_sensing( ffi.Pointer rmidi, ffi.Pointer params, int val, ) { return _snd_rawmidi_params_set_no_active_sensing( rmidi, params, val, ); } late final _snd_rawmidi_params_set_no_active_sensing_ptr = _lookup>( 'snd_rawmidi_params_set_no_active_sensing'); late final _dart_snd_rawmidi_params_set_no_active_sensing _snd_rawmidi_params_set_no_active_sensing = _snd_rawmidi_params_set_no_active_sensing_ptr .asFunction<_dart_snd_rawmidi_params_set_no_active_sensing>(); int snd_rawmidi_params_get_no_active_sensing( ffi.Pointer params, ) { return _snd_rawmidi_params_get_no_active_sensing( params, ); } late final _snd_rawmidi_params_get_no_active_sensing_ptr = _lookup>( 'snd_rawmidi_params_get_no_active_sensing'); late final _dart_snd_rawmidi_params_get_no_active_sensing _snd_rawmidi_params_get_no_active_sensing = _snd_rawmidi_params_get_no_active_sensing_ptr .asFunction<_dart_snd_rawmidi_params_get_no_active_sensing>(); int snd_rawmidi_params( ffi.Pointer rmidi, ffi.Pointer params, ) { return _snd_rawmidi_params( rmidi, params, ); } late final _snd_rawmidi_params_ptr = _lookup>('snd_rawmidi_params'); late final _dart_snd_rawmidi_params _snd_rawmidi_params = _snd_rawmidi_params_ptr.asFunction<_dart_snd_rawmidi_params>(); int snd_rawmidi_params_current( ffi.Pointer rmidi, ffi.Pointer params, ) { return _snd_rawmidi_params_current( rmidi, params, ); } late final _snd_rawmidi_params_current_ptr = _lookup>( 'snd_rawmidi_params_current'); late final _dart_snd_rawmidi_params_current _snd_rawmidi_params_current = _snd_rawmidi_params_current_ptr .asFunction<_dart_snd_rawmidi_params_current>(); int snd_rawmidi_status_sizeof() { return _snd_rawmidi_status_sizeof(); } late final _snd_rawmidi_status_sizeof_ptr = _lookup>( 'snd_rawmidi_status_sizeof'); late final _dart_snd_rawmidi_status_sizeof _snd_rawmidi_status_sizeof = _snd_rawmidi_status_sizeof_ptr .asFunction<_dart_snd_rawmidi_status_sizeof>(); int snd_rawmidi_status_malloc( ffi.Pointer> ptr, ) { return _snd_rawmidi_status_malloc( ptr, ); } late final _snd_rawmidi_status_malloc_ptr = _lookup>( 'snd_rawmidi_status_malloc'); late final _dart_snd_rawmidi_status_malloc _snd_rawmidi_status_malloc = _snd_rawmidi_status_malloc_ptr .asFunction<_dart_snd_rawmidi_status_malloc>(); void snd_rawmidi_status_free( ffi.Pointer obj, ) { return _snd_rawmidi_status_free( obj, ); } late final _snd_rawmidi_status_free_ptr = _lookup>( 'snd_rawmidi_status_free'); late final _dart_snd_rawmidi_status_free _snd_rawmidi_status_free = _snd_rawmidi_status_free_ptr.asFunction<_dart_snd_rawmidi_status_free>(); void snd_rawmidi_status_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_rawmidi_status_copy( dst, src, ); } late final _snd_rawmidi_status_copy_ptr = _lookup>( 'snd_rawmidi_status_copy'); late final _dart_snd_rawmidi_status_copy _snd_rawmidi_status_copy = _snd_rawmidi_status_copy_ptr.asFunction<_dart_snd_rawmidi_status_copy>(); void snd_rawmidi_status_get_tstamp( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_rawmidi_status_get_tstamp( obj, ptr, ); } late final _snd_rawmidi_status_get_tstamp_ptr = _lookup>( 'snd_rawmidi_status_get_tstamp'); late final _dart_snd_rawmidi_status_get_tstamp _snd_rawmidi_status_get_tstamp = _snd_rawmidi_status_get_tstamp_ptr .asFunction<_dart_snd_rawmidi_status_get_tstamp>(); int snd_rawmidi_status_get_avail( ffi.Pointer obj, ) { return _snd_rawmidi_status_get_avail( obj, ); } late final _snd_rawmidi_status_get_avail_ptr = _lookup>( 'snd_rawmidi_status_get_avail'); late final _dart_snd_rawmidi_status_get_avail _snd_rawmidi_status_get_avail = _snd_rawmidi_status_get_avail_ptr .asFunction<_dart_snd_rawmidi_status_get_avail>(); int snd_rawmidi_status_get_xruns( ffi.Pointer obj, ) { return _snd_rawmidi_status_get_xruns( obj, ); } late final _snd_rawmidi_status_get_xruns_ptr = _lookup>( 'snd_rawmidi_status_get_xruns'); late final _dart_snd_rawmidi_status_get_xruns _snd_rawmidi_status_get_xruns = _snd_rawmidi_status_get_xruns_ptr .asFunction<_dart_snd_rawmidi_status_get_xruns>(); int snd_rawmidi_status( ffi.Pointer rmidi, ffi.Pointer status, ) { return _snd_rawmidi_status( rmidi, status, ); } late final _snd_rawmidi_status_ptr = _lookup>('snd_rawmidi_status'); late final _dart_snd_rawmidi_status _snd_rawmidi_status = _snd_rawmidi_status_ptr.asFunction<_dart_snd_rawmidi_status>(); int snd_rawmidi_drain( ffi.Pointer rmidi, ) { return _snd_rawmidi_drain( rmidi, ); } late final _snd_rawmidi_drain_ptr = _lookup>('snd_rawmidi_drain'); late final _dart_snd_rawmidi_drain _snd_rawmidi_drain = _snd_rawmidi_drain_ptr.asFunction<_dart_snd_rawmidi_drain>(); int snd_rawmidi_drop( ffi.Pointer rmidi, ) { return _snd_rawmidi_drop( rmidi, ); } late final _snd_rawmidi_drop_ptr = _lookup>('snd_rawmidi_drop'); late final _dart_snd_rawmidi_drop _snd_rawmidi_drop = _snd_rawmidi_drop_ptr.asFunction<_dart_snd_rawmidi_drop>(); int snd_rawmidi_write( ffi.Pointer rmidi, ffi.Pointer buffer, int size, ) { return _snd_rawmidi_write( rmidi, buffer, size, ); } late final _snd_rawmidi_write_ptr = _lookup>('snd_rawmidi_write'); late final _dart_snd_rawmidi_write _snd_rawmidi_write = _snd_rawmidi_write_ptr.asFunction<_dart_snd_rawmidi_write>(); int snd_rawmidi_read( ffi.Pointer rmidi, ffi.Pointer buffer, int size, ) { return _snd_rawmidi_read( rmidi, buffer, size, ); } late final _snd_rawmidi_read_ptr = _lookup>('snd_rawmidi_read'); late final _dart_snd_rawmidi_read _snd_rawmidi_read = _snd_rawmidi_read_ptr.asFunction<_dart_snd_rawmidi_read>(); ffi.Pointer snd_rawmidi_name( ffi.Pointer rmidi, ) { return _snd_rawmidi_name( rmidi, ); } late final _snd_rawmidi_name_ptr = _lookup>('snd_rawmidi_name'); late final _dart_snd_rawmidi_name _snd_rawmidi_name = _snd_rawmidi_name_ptr.asFunction<_dart_snd_rawmidi_name>(); int snd_rawmidi_type( ffi.Pointer rmidi, ) { return _snd_rawmidi_type( rmidi, ); } late final _snd_rawmidi_type_ptr = _lookup>('snd_rawmidi_type'); late final _dart_snd_rawmidi_type _snd_rawmidi_type = _snd_rawmidi_type_ptr.asFunction<_dart_snd_rawmidi_type>(); int snd_rawmidi_stream( ffi.Pointer rawmidi, ) { return _snd_rawmidi_stream( rawmidi, ); } late final _snd_rawmidi_stream_ptr = _lookup>('snd_rawmidi_stream'); late final _dart_snd_rawmidi_stream _snd_rawmidi_stream = _snd_rawmidi_stream_ptr.asFunction<_dart_snd_rawmidi_stream>(); int snd_timer_query_open( ffi.Pointer> handle, ffi.Pointer name, int mode, ) { return _snd_timer_query_open( handle, name, mode, ); } late final _snd_timer_query_open_ptr = _lookup>( 'snd_timer_query_open'); late final _dart_snd_timer_query_open _snd_timer_query_open = _snd_timer_query_open_ptr.asFunction<_dart_snd_timer_query_open>(); int snd_timer_query_open_lconf( ffi.Pointer> handle, ffi.Pointer name, int mode, ffi.Pointer lconf, ) { return _snd_timer_query_open_lconf( handle, name, mode, lconf, ); } late final _snd_timer_query_open_lconf_ptr = _lookup>( 'snd_timer_query_open_lconf'); late final _dart_snd_timer_query_open_lconf _snd_timer_query_open_lconf = _snd_timer_query_open_lconf_ptr .asFunction<_dart_snd_timer_query_open_lconf>(); int snd_timer_query_close( ffi.Pointer handle, ) { return _snd_timer_query_close( handle, ); } late final _snd_timer_query_close_ptr = _lookup>( 'snd_timer_query_close'); late final _dart_snd_timer_query_close _snd_timer_query_close = _snd_timer_query_close_ptr.asFunction<_dart_snd_timer_query_close>(); int snd_timer_query_next_device( ffi.Pointer handle, ffi.Pointer tid, ) { return _snd_timer_query_next_device( handle, tid, ); } late final _snd_timer_query_next_device_ptr = _lookup>( 'snd_timer_query_next_device'); late final _dart_snd_timer_query_next_device _snd_timer_query_next_device = _snd_timer_query_next_device_ptr .asFunction<_dart_snd_timer_query_next_device>(); int snd_timer_query_info( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_timer_query_info( handle, info, ); } late final _snd_timer_query_info_ptr = _lookup>( 'snd_timer_query_info'); late final _dart_snd_timer_query_info _snd_timer_query_info = _snd_timer_query_info_ptr.asFunction<_dart_snd_timer_query_info>(); int snd_timer_query_params( ffi.Pointer handle, ffi.Pointer params, ) { return _snd_timer_query_params( handle, params, ); } late final _snd_timer_query_params_ptr = _lookup>( 'snd_timer_query_params'); late final _dart_snd_timer_query_params _snd_timer_query_params = _snd_timer_query_params_ptr.asFunction<_dart_snd_timer_query_params>(); int snd_timer_query_status( ffi.Pointer handle, ffi.Pointer status, ) { return _snd_timer_query_status( handle, status, ); } late final _snd_timer_query_status_ptr = _lookup>( 'snd_timer_query_status'); late final _dart_snd_timer_query_status _snd_timer_query_status = _snd_timer_query_status_ptr.asFunction<_dart_snd_timer_query_status>(); int snd_timer_open( ffi.Pointer> handle, ffi.Pointer name, int mode, ) { return _snd_timer_open( handle, name, mode, ); } late final _snd_timer_open_ptr = _lookup>('snd_timer_open'); late final _dart_snd_timer_open _snd_timer_open = _snd_timer_open_ptr.asFunction<_dart_snd_timer_open>(); int snd_timer_open_lconf( ffi.Pointer> handle, ffi.Pointer name, int mode, ffi.Pointer lconf, ) { return _snd_timer_open_lconf( handle, name, mode, lconf, ); } late final _snd_timer_open_lconf_ptr = _lookup>( 'snd_timer_open_lconf'); late final _dart_snd_timer_open_lconf _snd_timer_open_lconf = _snd_timer_open_lconf_ptr.asFunction<_dart_snd_timer_open_lconf>(); int snd_timer_close( ffi.Pointer handle, ) { return _snd_timer_close( handle, ); } late final _snd_timer_close_ptr = _lookup>('snd_timer_close'); late final _dart_snd_timer_close _snd_timer_close = _snd_timer_close_ptr.asFunction<_dart_snd_timer_close>(); int snd_async_add_timer_handler( ffi.Pointer> handler, ffi.Pointer timer, ffi.Pointer> callback, ffi.Pointer private_data, ) { return _snd_async_add_timer_handler( handler, timer, callback, private_data, ); } late final _snd_async_add_timer_handler_ptr = _lookup>( 'snd_async_add_timer_handler'); late final _dart_snd_async_add_timer_handler _snd_async_add_timer_handler = _snd_async_add_timer_handler_ptr .asFunction<_dart_snd_async_add_timer_handler>(); ffi.Pointer snd_async_handler_get_timer( ffi.Pointer handler, ) { return _snd_async_handler_get_timer( handler, ); } late final _snd_async_handler_get_timer_ptr = _lookup>( 'snd_async_handler_get_timer'); late final _dart_snd_async_handler_get_timer _snd_async_handler_get_timer = _snd_async_handler_get_timer_ptr .asFunction<_dart_snd_async_handler_get_timer>(); int snd_timer_poll_descriptors_count( ffi.Pointer handle, ) { return _snd_timer_poll_descriptors_count( handle, ); } late final _snd_timer_poll_descriptors_count_ptr = _lookup>( 'snd_timer_poll_descriptors_count'); late final _dart_snd_timer_poll_descriptors_count _snd_timer_poll_descriptors_count = _snd_timer_poll_descriptors_count_ptr .asFunction<_dart_snd_timer_poll_descriptors_count>(); int snd_timer_poll_descriptors( ffi.Pointer handle, ffi.Pointer pfds, int space, ) { return _snd_timer_poll_descriptors( handle, pfds, space, ); } late final _snd_timer_poll_descriptors_ptr = _lookup>( 'snd_timer_poll_descriptors'); late final _dart_snd_timer_poll_descriptors _snd_timer_poll_descriptors = _snd_timer_poll_descriptors_ptr .asFunction<_dart_snd_timer_poll_descriptors>(); int snd_timer_poll_descriptors_revents( ffi.Pointer timer, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_timer_poll_descriptors_revents( timer, pfds, nfds, revents, ); } late final _snd_timer_poll_descriptors_revents_ptr = _lookup>( 'snd_timer_poll_descriptors_revents'); late final _dart_snd_timer_poll_descriptors_revents _snd_timer_poll_descriptors_revents = _snd_timer_poll_descriptors_revents_ptr .asFunction<_dart_snd_timer_poll_descriptors_revents>(); int snd_timer_info( ffi.Pointer handle, ffi.Pointer timer, ) { return _snd_timer_info( handle, timer, ); } late final _snd_timer_info_ptr = _lookup>('snd_timer_info'); late final _dart_snd_timer_info _snd_timer_info = _snd_timer_info_ptr.asFunction<_dart_snd_timer_info>(); int snd_timer_params( ffi.Pointer handle, ffi.Pointer params, ) { return _snd_timer_params( handle, params, ); } late final _snd_timer_params_ptr = _lookup>('snd_timer_params'); late final _dart_snd_timer_params _snd_timer_params = _snd_timer_params_ptr.asFunction<_dart_snd_timer_params>(); int snd_timer_status( ffi.Pointer handle, ffi.Pointer status, ) { return _snd_timer_status( handle, status, ); } late final _snd_timer_status_ptr = _lookup>('snd_timer_status'); late final _dart_snd_timer_status _snd_timer_status = _snd_timer_status_ptr.asFunction<_dart_snd_timer_status>(); int snd_timer_start( ffi.Pointer handle, ) { return _snd_timer_start( handle, ); } late final _snd_timer_start_ptr = _lookup>('snd_timer_start'); late final _dart_snd_timer_start _snd_timer_start = _snd_timer_start_ptr.asFunction<_dart_snd_timer_start>(); int snd_timer_stop( ffi.Pointer handle, ) { return _snd_timer_stop( handle, ); } late final _snd_timer_stop_ptr = _lookup>('snd_timer_stop'); late final _dart_snd_timer_stop _snd_timer_stop = _snd_timer_stop_ptr.asFunction<_dart_snd_timer_stop>(); int snd_timer_continue( ffi.Pointer handle, ) { return _snd_timer_continue( handle, ); } late final _snd_timer_continue_ptr = _lookup>('snd_timer_continue'); late final _dart_snd_timer_continue _snd_timer_continue = _snd_timer_continue_ptr.asFunction<_dart_snd_timer_continue>(); int snd_timer_read( ffi.Pointer handle, ffi.Pointer buffer, int size, ) { return _snd_timer_read( handle, buffer, size, ); } late final _snd_timer_read_ptr = _lookup>('snd_timer_read'); late final _dart_snd_timer_read _snd_timer_read = _snd_timer_read_ptr.asFunction<_dart_snd_timer_read>(); int snd_timer_id_sizeof() { return _snd_timer_id_sizeof(); } late final _snd_timer_id_sizeof_ptr = _lookup>( 'snd_timer_id_sizeof'); late final _dart_snd_timer_id_sizeof _snd_timer_id_sizeof = _snd_timer_id_sizeof_ptr.asFunction<_dart_snd_timer_id_sizeof>(); int snd_timer_id_malloc( ffi.Pointer> ptr, ) { return _snd_timer_id_malloc( ptr, ); } late final _snd_timer_id_malloc_ptr = _lookup>( 'snd_timer_id_malloc'); late final _dart_snd_timer_id_malloc _snd_timer_id_malloc = _snd_timer_id_malloc_ptr.asFunction<_dart_snd_timer_id_malloc>(); void snd_timer_id_free( ffi.Pointer obj, ) { return _snd_timer_id_free( obj, ); } late final _snd_timer_id_free_ptr = _lookup>('snd_timer_id_free'); late final _dart_snd_timer_id_free _snd_timer_id_free = _snd_timer_id_free_ptr.asFunction<_dart_snd_timer_id_free>(); void snd_timer_id_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_timer_id_copy( dst, src, ); } late final _snd_timer_id_copy_ptr = _lookup>('snd_timer_id_copy'); late final _dart_snd_timer_id_copy _snd_timer_id_copy = _snd_timer_id_copy_ptr.asFunction<_dart_snd_timer_id_copy>(); void snd_timer_id_set_class( ffi.Pointer id, int dev_class, ) { return _snd_timer_id_set_class( id, dev_class, ); } late final _snd_timer_id_set_class_ptr = _lookup>( 'snd_timer_id_set_class'); late final _dart_snd_timer_id_set_class _snd_timer_id_set_class = _snd_timer_id_set_class_ptr.asFunction<_dart_snd_timer_id_set_class>(); int snd_timer_id_get_class( ffi.Pointer id, ) { return _snd_timer_id_get_class( id, ); } late final _snd_timer_id_get_class_ptr = _lookup>( 'snd_timer_id_get_class'); late final _dart_snd_timer_id_get_class _snd_timer_id_get_class = _snd_timer_id_get_class_ptr.asFunction<_dart_snd_timer_id_get_class>(); void snd_timer_id_set_sclass( ffi.Pointer id, int dev_sclass, ) { return _snd_timer_id_set_sclass( id, dev_sclass, ); } late final _snd_timer_id_set_sclass_ptr = _lookup>( 'snd_timer_id_set_sclass'); late final _dart_snd_timer_id_set_sclass _snd_timer_id_set_sclass = _snd_timer_id_set_sclass_ptr.asFunction<_dart_snd_timer_id_set_sclass>(); int snd_timer_id_get_sclass( ffi.Pointer id, ) { return _snd_timer_id_get_sclass( id, ); } late final _snd_timer_id_get_sclass_ptr = _lookup>( 'snd_timer_id_get_sclass'); late final _dart_snd_timer_id_get_sclass _snd_timer_id_get_sclass = _snd_timer_id_get_sclass_ptr.asFunction<_dart_snd_timer_id_get_sclass>(); void snd_timer_id_set_card( ffi.Pointer id, int card, ) { return _snd_timer_id_set_card( id, card, ); } late final _snd_timer_id_set_card_ptr = _lookup>( 'snd_timer_id_set_card'); late final _dart_snd_timer_id_set_card _snd_timer_id_set_card = _snd_timer_id_set_card_ptr.asFunction<_dart_snd_timer_id_set_card>(); int snd_timer_id_get_card( ffi.Pointer id, ) { return _snd_timer_id_get_card( id, ); } late final _snd_timer_id_get_card_ptr = _lookup>( 'snd_timer_id_get_card'); late final _dart_snd_timer_id_get_card _snd_timer_id_get_card = _snd_timer_id_get_card_ptr.asFunction<_dart_snd_timer_id_get_card>(); void snd_timer_id_set_device( ffi.Pointer id, int device, ) { return _snd_timer_id_set_device( id, device, ); } late final _snd_timer_id_set_device_ptr = _lookup>( 'snd_timer_id_set_device'); late final _dart_snd_timer_id_set_device _snd_timer_id_set_device = _snd_timer_id_set_device_ptr.asFunction<_dart_snd_timer_id_set_device>(); int snd_timer_id_get_device( ffi.Pointer id, ) { return _snd_timer_id_get_device( id, ); } late final _snd_timer_id_get_device_ptr = _lookup>( 'snd_timer_id_get_device'); late final _dart_snd_timer_id_get_device _snd_timer_id_get_device = _snd_timer_id_get_device_ptr.asFunction<_dart_snd_timer_id_get_device>(); void snd_timer_id_set_subdevice( ffi.Pointer id, int subdevice, ) { return _snd_timer_id_set_subdevice( id, subdevice, ); } late final _snd_timer_id_set_subdevice_ptr = _lookup>( 'snd_timer_id_set_subdevice'); late final _dart_snd_timer_id_set_subdevice _snd_timer_id_set_subdevice = _snd_timer_id_set_subdevice_ptr .asFunction<_dart_snd_timer_id_set_subdevice>(); int snd_timer_id_get_subdevice( ffi.Pointer id, ) { return _snd_timer_id_get_subdevice( id, ); } late final _snd_timer_id_get_subdevice_ptr = _lookup>( 'snd_timer_id_get_subdevice'); late final _dart_snd_timer_id_get_subdevice _snd_timer_id_get_subdevice = _snd_timer_id_get_subdevice_ptr .asFunction<_dart_snd_timer_id_get_subdevice>(); int snd_timer_ginfo_sizeof() { return _snd_timer_ginfo_sizeof(); } late final _snd_timer_ginfo_sizeof_ptr = _lookup>( 'snd_timer_ginfo_sizeof'); late final _dart_snd_timer_ginfo_sizeof _snd_timer_ginfo_sizeof = _snd_timer_ginfo_sizeof_ptr.asFunction<_dart_snd_timer_ginfo_sizeof>(); int snd_timer_ginfo_malloc( ffi.Pointer> ptr, ) { return _snd_timer_ginfo_malloc( ptr, ); } late final _snd_timer_ginfo_malloc_ptr = _lookup>( 'snd_timer_ginfo_malloc'); late final _dart_snd_timer_ginfo_malloc _snd_timer_ginfo_malloc = _snd_timer_ginfo_malloc_ptr.asFunction<_dart_snd_timer_ginfo_malloc>(); void snd_timer_ginfo_free( ffi.Pointer obj, ) { return _snd_timer_ginfo_free( obj, ); } late final _snd_timer_ginfo_free_ptr = _lookup>( 'snd_timer_ginfo_free'); late final _dart_snd_timer_ginfo_free _snd_timer_ginfo_free = _snd_timer_ginfo_free_ptr.asFunction<_dart_snd_timer_ginfo_free>(); void snd_timer_ginfo_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_timer_ginfo_copy( dst, src, ); } late final _snd_timer_ginfo_copy_ptr = _lookup>( 'snd_timer_ginfo_copy'); late final _dart_snd_timer_ginfo_copy _snd_timer_ginfo_copy = _snd_timer_ginfo_copy_ptr.asFunction<_dart_snd_timer_ginfo_copy>(); int snd_timer_ginfo_set_tid( ffi.Pointer obj, ffi.Pointer tid, ) { return _snd_timer_ginfo_set_tid( obj, tid, ); } late final _snd_timer_ginfo_set_tid_ptr = _lookup>( 'snd_timer_ginfo_set_tid'); late final _dart_snd_timer_ginfo_set_tid _snd_timer_ginfo_set_tid = _snd_timer_ginfo_set_tid_ptr.asFunction<_dart_snd_timer_ginfo_set_tid>(); ffi.Pointer snd_timer_ginfo_get_tid( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_tid( obj, ); } late final _snd_timer_ginfo_get_tid_ptr = _lookup>( 'snd_timer_ginfo_get_tid'); late final _dart_snd_timer_ginfo_get_tid _snd_timer_ginfo_get_tid = _snd_timer_ginfo_get_tid_ptr.asFunction<_dart_snd_timer_ginfo_get_tid>(); int snd_timer_ginfo_get_flags( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_flags( obj, ); } late final _snd_timer_ginfo_get_flags_ptr = _lookup>( 'snd_timer_ginfo_get_flags'); late final _dart_snd_timer_ginfo_get_flags _snd_timer_ginfo_get_flags = _snd_timer_ginfo_get_flags_ptr .asFunction<_dart_snd_timer_ginfo_get_flags>(); int snd_timer_ginfo_get_card( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_card( obj, ); } late final _snd_timer_ginfo_get_card_ptr = _lookup>( 'snd_timer_ginfo_get_card'); late final _dart_snd_timer_ginfo_get_card _snd_timer_ginfo_get_card = _snd_timer_ginfo_get_card_ptr .asFunction<_dart_snd_timer_ginfo_get_card>(); ffi.Pointer snd_timer_ginfo_get_id( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_id( obj, ); } late final _snd_timer_ginfo_get_id_ptr = _lookup>( 'snd_timer_ginfo_get_id'); late final _dart_snd_timer_ginfo_get_id _snd_timer_ginfo_get_id = _snd_timer_ginfo_get_id_ptr.asFunction<_dart_snd_timer_ginfo_get_id>(); ffi.Pointer snd_timer_ginfo_get_name( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_name( obj, ); } late final _snd_timer_ginfo_get_name_ptr = _lookup>( 'snd_timer_ginfo_get_name'); late final _dart_snd_timer_ginfo_get_name _snd_timer_ginfo_get_name = _snd_timer_ginfo_get_name_ptr .asFunction<_dart_snd_timer_ginfo_get_name>(); int snd_timer_ginfo_get_resolution( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_resolution( obj, ); } late final _snd_timer_ginfo_get_resolution_ptr = _lookup>( 'snd_timer_ginfo_get_resolution'); late final _dart_snd_timer_ginfo_get_resolution _snd_timer_ginfo_get_resolution = _snd_timer_ginfo_get_resolution_ptr .asFunction<_dart_snd_timer_ginfo_get_resolution>(); int snd_timer_ginfo_get_resolution_min( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_resolution_min( obj, ); } late final _snd_timer_ginfo_get_resolution_min_ptr = _lookup>( 'snd_timer_ginfo_get_resolution_min'); late final _dart_snd_timer_ginfo_get_resolution_min _snd_timer_ginfo_get_resolution_min = _snd_timer_ginfo_get_resolution_min_ptr .asFunction<_dart_snd_timer_ginfo_get_resolution_min>(); int snd_timer_ginfo_get_resolution_max( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_resolution_max( obj, ); } late final _snd_timer_ginfo_get_resolution_max_ptr = _lookup>( 'snd_timer_ginfo_get_resolution_max'); late final _dart_snd_timer_ginfo_get_resolution_max _snd_timer_ginfo_get_resolution_max = _snd_timer_ginfo_get_resolution_max_ptr .asFunction<_dart_snd_timer_ginfo_get_resolution_max>(); int snd_timer_ginfo_get_clients( ffi.Pointer obj, ) { return _snd_timer_ginfo_get_clients( obj, ); } late final _snd_timer_ginfo_get_clients_ptr = _lookup>( 'snd_timer_ginfo_get_clients'); late final _dart_snd_timer_ginfo_get_clients _snd_timer_ginfo_get_clients = _snd_timer_ginfo_get_clients_ptr .asFunction<_dart_snd_timer_ginfo_get_clients>(); int snd_timer_info_sizeof() { return _snd_timer_info_sizeof(); } late final _snd_timer_info_sizeof_ptr = _lookup>( 'snd_timer_info_sizeof'); late final _dart_snd_timer_info_sizeof _snd_timer_info_sizeof = _snd_timer_info_sizeof_ptr.asFunction<_dart_snd_timer_info_sizeof>(); int snd_timer_info_malloc( ffi.Pointer> ptr, ) { return _snd_timer_info_malloc( ptr, ); } late final _snd_timer_info_malloc_ptr = _lookup>( 'snd_timer_info_malloc'); late final _dart_snd_timer_info_malloc _snd_timer_info_malloc = _snd_timer_info_malloc_ptr.asFunction<_dart_snd_timer_info_malloc>(); void snd_timer_info_free( ffi.Pointer obj, ) { return _snd_timer_info_free( obj, ); } late final _snd_timer_info_free_ptr = _lookup>( 'snd_timer_info_free'); late final _dart_snd_timer_info_free _snd_timer_info_free = _snd_timer_info_free_ptr.asFunction<_dart_snd_timer_info_free>(); void snd_timer_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_timer_info_copy( dst, src, ); } late final _snd_timer_info_copy_ptr = _lookup>( 'snd_timer_info_copy'); late final _dart_snd_timer_info_copy _snd_timer_info_copy = _snd_timer_info_copy_ptr.asFunction<_dart_snd_timer_info_copy>(); int snd_timer_info_is_slave( ffi.Pointer info, ) { return _snd_timer_info_is_slave( info, ); } late final _snd_timer_info_is_slave_ptr = _lookup>( 'snd_timer_info_is_slave'); late final _dart_snd_timer_info_is_slave _snd_timer_info_is_slave = _snd_timer_info_is_slave_ptr.asFunction<_dart_snd_timer_info_is_slave>(); int snd_timer_info_get_card( ffi.Pointer info, ) { return _snd_timer_info_get_card( info, ); } late final _snd_timer_info_get_card_ptr = _lookup>( 'snd_timer_info_get_card'); late final _dart_snd_timer_info_get_card _snd_timer_info_get_card = _snd_timer_info_get_card_ptr.asFunction<_dart_snd_timer_info_get_card>(); ffi.Pointer snd_timer_info_get_id( ffi.Pointer info, ) { return _snd_timer_info_get_id( info, ); } late final _snd_timer_info_get_id_ptr = _lookup>( 'snd_timer_info_get_id'); late final _dart_snd_timer_info_get_id _snd_timer_info_get_id = _snd_timer_info_get_id_ptr.asFunction<_dart_snd_timer_info_get_id>(); ffi.Pointer snd_timer_info_get_name( ffi.Pointer info, ) { return _snd_timer_info_get_name( info, ); } late final _snd_timer_info_get_name_ptr = _lookup>( 'snd_timer_info_get_name'); late final _dart_snd_timer_info_get_name _snd_timer_info_get_name = _snd_timer_info_get_name_ptr.asFunction<_dart_snd_timer_info_get_name>(); int snd_timer_info_get_resolution( ffi.Pointer info, ) { return _snd_timer_info_get_resolution( info, ); } late final _snd_timer_info_get_resolution_ptr = _lookup>( 'snd_timer_info_get_resolution'); late final _dart_snd_timer_info_get_resolution _snd_timer_info_get_resolution = _snd_timer_info_get_resolution_ptr .asFunction<_dart_snd_timer_info_get_resolution>(); int snd_timer_params_sizeof() { return _snd_timer_params_sizeof(); } late final _snd_timer_params_sizeof_ptr = _lookup>( 'snd_timer_params_sizeof'); late final _dart_snd_timer_params_sizeof _snd_timer_params_sizeof = _snd_timer_params_sizeof_ptr.asFunction<_dart_snd_timer_params_sizeof>(); int snd_timer_params_malloc( ffi.Pointer> ptr, ) { return _snd_timer_params_malloc( ptr, ); } late final _snd_timer_params_malloc_ptr = _lookup>( 'snd_timer_params_malloc'); late final _dart_snd_timer_params_malloc _snd_timer_params_malloc = _snd_timer_params_malloc_ptr.asFunction<_dart_snd_timer_params_malloc>(); void snd_timer_params_free( ffi.Pointer obj, ) { return _snd_timer_params_free( obj, ); } late final _snd_timer_params_free_ptr = _lookup>( 'snd_timer_params_free'); late final _dart_snd_timer_params_free _snd_timer_params_free = _snd_timer_params_free_ptr.asFunction<_dart_snd_timer_params_free>(); void snd_timer_params_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_timer_params_copy( dst, src, ); } late final _snd_timer_params_copy_ptr = _lookup>( 'snd_timer_params_copy'); late final _dart_snd_timer_params_copy _snd_timer_params_copy = _snd_timer_params_copy_ptr.asFunction<_dart_snd_timer_params_copy>(); int snd_timer_params_set_auto_start( ffi.Pointer params, int auto_start, ) { return _snd_timer_params_set_auto_start( params, auto_start, ); } late final _snd_timer_params_set_auto_start_ptr = _lookup>( 'snd_timer_params_set_auto_start'); late final _dart_snd_timer_params_set_auto_start _snd_timer_params_set_auto_start = _snd_timer_params_set_auto_start_ptr .asFunction<_dart_snd_timer_params_set_auto_start>(); int snd_timer_params_get_auto_start( ffi.Pointer params, ) { return _snd_timer_params_get_auto_start( params, ); } late final _snd_timer_params_get_auto_start_ptr = _lookup>( 'snd_timer_params_get_auto_start'); late final _dart_snd_timer_params_get_auto_start _snd_timer_params_get_auto_start = _snd_timer_params_get_auto_start_ptr .asFunction<_dart_snd_timer_params_get_auto_start>(); int snd_timer_params_set_exclusive( ffi.Pointer params, int exclusive, ) { return _snd_timer_params_set_exclusive( params, exclusive, ); } late final _snd_timer_params_set_exclusive_ptr = _lookup>( 'snd_timer_params_set_exclusive'); late final _dart_snd_timer_params_set_exclusive _snd_timer_params_set_exclusive = _snd_timer_params_set_exclusive_ptr .asFunction<_dart_snd_timer_params_set_exclusive>(); int snd_timer_params_get_exclusive( ffi.Pointer params, ) { return _snd_timer_params_get_exclusive( params, ); } late final _snd_timer_params_get_exclusive_ptr = _lookup>( 'snd_timer_params_get_exclusive'); late final _dart_snd_timer_params_get_exclusive _snd_timer_params_get_exclusive = _snd_timer_params_get_exclusive_ptr .asFunction<_dart_snd_timer_params_get_exclusive>(); int snd_timer_params_set_early_event( ffi.Pointer params, int early_event, ) { return _snd_timer_params_set_early_event( params, early_event, ); } late final _snd_timer_params_set_early_event_ptr = _lookup>( 'snd_timer_params_set_early_event'); late final _dart_snd_timer_params_set_early_event _snd_timer_params_set_early_event = _snd_timer_params_set_early_event_ptr .asFunction<_dart_snd_timer_params_set_early_event>(); int snd_timer_params_get_early_event( ffi.Pointer params, ) { return _snd_timer_params_get_early_event( params, ); } late final _snd_timer_params_get_early_event_ptr = _lookup>( 'snd_timer_params_get_early_event'); late final _dart_snd_timer_params_get_early_event _snd_timer_params_get_early_event = _snd_timer_params_get_early_event_ptr .asFunction<_dart_snd_timer_params_get_early_event>(); void snd_timer_params_set_ticks( ffi.Pointer params, int ticks, ) { return _snd_timer_params_set_ticks( params, ticks, ); } late final _snd_timer_params_set_ticks_ptr = _lookup>( 'snd_timer_params_set_ticks'); late final _dart_snd_timer_params_set_ticks _snd_timer_params_set_ticks = _snd_timer_params_set_ticks_ptr .asFunction<_dart_snd_timer_params_set_ticks>(); int snd_timer_params_get_ticks( ffi.Pointer params, ) { return _snd_timer_params_get_ticks( params, ); } late final _snd_timer_params_get_ticks_ptr = _lookup>( 'snd_timer_params_get_ticks'); late final _dart_snd_timer_params_get_ticks _snd_timer_params_get_ticks = _snd_timer_params_get_ticks_ptr .asFunction<_dart_snd_timer_params_get_ticks>(); void snd_timer_params_set_queue_size( ffi.Pointer params, int queue_size, ) { return _snd_timer_params_set_queue_size( params, queue_size, ); } late final _snd_timer_params_set_queue_size_ptr = _lookup>( 'snd_timer_params_set_queue_size'); late final _dart_snd_timer_params_set_queue_size _snd_timer_params_set_queue_size = _snd_timer_params_set_queue_size_ptr .asFunction<_dart_snd_timer_params_set_queue_size>(); int snd_timer_params_get_queue_size( ffi.Pointer params, ) { return _snd_timer_params_get_queue_size( params, ); } late final _snd_timer_params_get_queue_size_ptr = _lookup>( 'snd_timer_params_get_queue_size'); late final _dart_snd_timer_params_get_queue_size _snd_timer_params_get_queue_size = _snd_timer_params_get_queue_size_ptr .asFunction<_dart_snd_timer_params_get_queue_size>(); void snd_timer_params_set_filter( ffi.Pointer params, int filter, ) { return _snd_timer_params_set_filter( params, filter, ); } late final _snd_timer_params_set_filter_ptr = _lookup>( 'snd_timer_params_set_filter'); late final _dart_snd_timer_params_set_filter _snd_timer_params_set_filter = _snd_timer_params_set_filter_ptr .asFunction<_dart_snd_timer_params_set_filter>(); int snd_timer_params_get_filter( ffi.Pointer params, ) { return _snd_timer_params_get_filter( params, ); } late final _snd_timer_params_get_filter_ptr = _lookup>( 'snd_timer_params_get_filter'); late final _dart_snd_timer_params_get_filter _snd_timer_params_get_filter = _snd_timer_params_get_filter_ptr .asFunction<_dart_snd_timer_params_get_filter>(); int snd_timer_status_sizeof() { return _snd_timer_status_sizeof(); } late final _snd_timer_status_sizeof_ptr = _lookup>( 'snd_timer_status_sizeof'); late final _dart_snd_timer_status_sizeof _snd_timer_status_sizeof = _snd_timer_status_sizeof_ptr.asFunction<_dart_snd_timer_status_sizeof>(); int snd_timer_status_malloc( ffi.Pointer> ptr, ) { return _snd_timer_status_malloc( ptr, ); } late final _snd_timer_status_malloc_ptr = _lookup>( 'snd_timer_status_malloc'); late final _dart_snd_timer_status_malloc _snd_timer_status_malloc = _snd_timer_status_malloc_ptr.asFunction<_dart_snd_timer_status_malloc>(); void snd_timer_status_free( ffi.Pointer obj, ) { return _snd_timer_status_free( obj, ); } late final _snd_timer_status_free_ptr = _lookup>( 'snd_timer_status_free'); late final _dart_snd_timer_status_free _snd_timer_status_free = _snd_timer_status_free_ptr.asFunction<_dart_snd_timer_status_free>(); void snd_timer_status_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_timer_status_copy( dst, src, ); } late final _snd_timer_status_copy_ptr = _lookup>( 'snd_timer_status_copy'); late final _dart_snd_timer_status_copy _snd_timer_status_copy = _snd_timer_status_copy_ptr.asFunction<_dart_snd_timer_status_copy>(); timespec snd_timer_status_get_timestamp( ffi.Pointer status, ) { return _snd_timer_status_get_timestamp( status, ); } late final _snd_timer_status_get_timestamp_ptr = _lookup>( 'snd_timer_status_get_timestamp'); late final _dart_snd_timer_status_get_timestamp _snd_timer_status_get_timestamp = _snd_timer_status_get_timestamp_ptr .asFunction<_dart_snd_timer_status_get_timestamp>(); int snd_timer_status_get_resolution( ffi.Pointer status, ) { return _snd_timer_status_get_resolution( status, ); } late final _snd_timer_status_get_resolution_ptr = _lookup>( 'snd_timer_status_get_resolution'); late final _dart_snd_timer_status_get_resolution _snd_timer_status_get_resolution = _snd_timer_status_get_resolution_ptr .asFunction<_dart_snd_timer_status_get_resolution>(); int snd_timer_status_get_lost( ffi.Pointer status, ) { return _snd_timer_status_get_lost( status, ); } late final _snd_timer_status_get_lost_ptr = _lookup>( 'snd_timer_status_get_lost'); late final _dart_snd_timer_status_get_lost _snd_timer_status_get_lost = _snd_timer_status_get_lost_ptr .asFunction<_dart_snd_timer_status_get_lost>(); int snd_timer_status_get_overrun( ffi.Pointer status, ) { return _snd_timer_status_get_overrun( status, ); } late final _snd_timer_status_get_overrun_ptr = _lookup>( 'snd_timer_status_get_overrun'); late final _dart_snd_timer_status_get_overrun _snd_timer_status_get_overrun = _snd_timer_status_get_overrun_ptr .asFunction<_dart_snd_timer_status_get_overrun>(); int snd_timer_status_get_queue( ffi.Pointer status, ) { return _snd_timer_status_get_queue( status, ); } late final _snd_timer_status_get_queue_ptr = _lookup>( 'snd_timer_status_get_queue'); late final _dart_snd_timer_status_get_queue _snd_timer_status_get_queue = _snd_timer_status_get_queue_ptr .asFunction<_dart_snd_timer_status_get_queue>(); int snd_timer_info_get_ticks( ffi.Pointer info, ) { return _snd_timer_info_get_ticks( info, ); } late final _snd_timer_info_get_ticks_ptr = _lookup>( 'snd_timer_info_get_ticks'); late final _dart_snd_timer_info_get_ticks _snd_timer_info_get_ticks = _snd_timer_info_get_ticks_ptr .asFunction<_dart_snd_timer_info_get_ticks>(); int snd_hwdep_open( ffi.Pointer> hwdep, ffi.Pointer name, int mode, ) { return _snd_hwdep_open( hwdep, name, mode, ); } late final _snd_hwdep_open_ptr = _lookup>('snd_hwdep_open'); late final _dart_snd_hwdep_open _snd_hwdep_open = _snd_hwdep_open_ptr.asFunction<_dart_snd_hwdep_open>(); int snd_hwdep_close( ffi.Pointer hwdep, ) { return _snd_hwdep_close( hwdep, ); } late final _snd_hwdep_close_ptr = _lookup>('snd_hwdep_close'); late final _dart_snd_hwdep_close _snd_hwdep_close = _snd_hwdep_close_ptr.asFunction<_dart_snd_hwdep_close>(); int snd_hwdep_poll_descriptors( ffi.Pointer hwdep, ffi.Pointer pfds, int space, ) { return _snd_hwdep_poll_descriptors( hwdep, pfds, space, ); } late final _snd_hwdep_poll_descriptors_ptr = _lookup>( 'snd_hwdep_poll_descriptors'); late final _dart_snd_hwdep_poll_descriptors _snd_hwdep_poll_descriptors = _snd_hwdep_poll_descriptors_ptr .asFunction<_dart_snd_hwdep_poll_descriptors>(); int snd_hwdep_poll_descriptors_count( ffi.Pointer hwdep, ) { return _snd_hwdep_poll_descriptors_count( hwdep, ); } late final _snd_hwdep_poll_descriptors_count_ptr = _lookup>( 'snd_hwdep_poll_descriptors_count'); late final _dart_snd_hwdep_poll_descriptors_count _snd_hwdep_poll_descriptors_count = _snd_hwdep_poll_descriptors_count_ptr .asFunction<_dart_snd_hwdep_poll_descriptors_count>(); int snd_hwdep_poll_descriptors_revents( ffi.Pointer hwdep, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_hwdep_poll_descriptors_revents( hwdep, pfds, nfds, revents, ); } late final _snd_hwdep_poll_descriptors_revents_ptr = _lookup>( 'snd_hwdep_poll_descriptors_revents'); late final _dart_snd_hwdep_poll_descriptors_revents _snd_hwdep_poll_descriptors_revents = _snd_hwdep_poll_descriptors_revents_ptr .asFunction<_dart_snd_hwdep_poll_descriptors_revents>(); int snd_hwdep_nonblock( ffi.Pointer hwdep, int nonblock, ) { return _snd_hwdep_nonblock( hwdep, nonblock, ); } late final _snd_hwdep_nonblock_ptr = _lookup>('snd_hwdep_nonblock'); late final _dart_snd_hwdep_nonblock _snd_hwdep_nonblock = _snd_hwdep_nonblock_ptr.asFunction<_dart_snd_hwdep_nonblock>(); int snd_hwdep_info( ffi.Pointer hwdep, ffi.Pointer info, ) { return _snd_hwdep_info( hwdep, info, ); } late final _snd_hwdep_info_ptr = _lookup>('snd_hwdep_info'); late final _dart_snd_hwdep_info _snd_hwdep_info = _snd_hwdep_info_ptr.asFunction<_dart_snd_hwdep_info>(); int snd_hwdep_dsp_status( ffi.Pointer hwdep, ffi.Pointer status, ) { return _snd_hwdep_dsp_status( hwdep, status, ); } late final _snd_hwdep_dsp_status_ptr = _lookup>( 'snd_hwdep_dsp_status'); late final _dart_snd_hwdep_dsp_status _snd_hwdep_dsp_status = _snd_hwdep_dsp_status_ptr.asFunction<_dart_snd_hwdep_dsp_status>(); int snd_hwdep_dsp_load( ffi.Pointer hwdep, ffi.Pointer block, ) { return _snd_hwdep_dsp_load( hwdep, block, ); } late final _snd_hwdep_dsp_load_ptr = _lookup>('snd_hwdep_dsp_load'); late final _dart_snd_hwdep_dsp_load _snd_hwdep_dsp_load = _snd_hwdep_dsp_load_ptr.asFunction<_dart_snd_hwdep_dsp_load>(); int snd_hwdep_ioctl( ffi.Pointer hwdep, int request, ffi.Pointer arg, ) { return _snd_hwdep_ioctl( hwdep, request, arg, ); } late final _snd_hwdep_ioctl_ptr = _lookup>('snd_hwdep_ioctl'); late final _dart_snd_hwdep_ioctl _snd_hwdep_ioctl = _snd_hwdep_ioctl_ptr.asFunction<_dart_snd_hwdep_ioctl>(); int snd_hwdep_write( ffi.Pointer hwdep, ffi.Pointer buffer, int size, ) { return _snd_hwdep_write( hwdep, buffer, size, ); } late final _snd_hwdep_write_ptr = _lookup>('snd_hwdep_write'); late final _dart_snd_hwdep_write _snd_hwdep_write = _snd_hwdep_write_ptr.asFunction<_dart_snd_hwdep_write>(); int snd_hwdep_read( ffi.Pointer hwdep, ffi.Pointer buffer, int size, ) { return _snd_hwdep_read( hwdep, buffer, size, ); } late final _snd_hwdep_read_ptr = _lookup>('snd_hwdep_read'); late final _dart_snd_hwdep_read _snd_hwdep_read = _snd_hwdep_read_ptr.asFunction<_dart_snd_hwdep_read>(); int snd_hwdep_info_sizeof() { return _snd_hwdep_info_sizeof(); } late final _snd_hwdep_info_sizeof_ptr = _lookup>( 'snd_hwdep_info_sizeof'); late final _dart_snd_hwdep_info_sizeof _snd_hwdep_info_sizeof = _snd_hwdep_info_sizeof_ptr.asFunction<_dart_snd_hwdep_info_sizeof>(); int snd_hwdep_info_malloc( ffi.Pointer> ptr, ) { return _snd_hwdep_info_malloc( ptr, ); } late final _snd_hwdep_info_malloc_ptr = _lookup>( 'snd_hwdep_info_malloc'); late final _dart_snd_hwdep_info_malloc _snd_hwdep_info_malloc = _snd_hwdep_info_malloc_ptr.asFunction<_dart_snd_hwdep_info_malloc>(); void snd_hwdep_info_free( ffi.Pointer obj, ) { return _snd_hwdep_info_free( obj, ); } late final _snd_hwdep_info_free_ptr = _lookup>( 'snd_hwdep_info_free'); late final _dart_snd_hwdep_info_free _snd_hwdep_info_free = _snd_hwdep_info_free_ptr.asFunction<_dart_snd_hwdep_info_free>(); void snd_hwdep_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_hwdep_info_copy( dst, src, ); } late final _snd_hwdep_info_copy_ptr = _lookup>( 'snd_hwdep_info_copy'); late final _dart_snd_hwdep_info_copy _snd_hwdep_info_copy = _snd_hwdep_info_copy_ptr.asFunction<_dart_snd_hwdep_info_copy>(); int snd_hwdep_info_get_device( ffi.Pointer obj, ) { return _snd_hwdep_info_get_device( obj, ); } late final _snd_hwdep_info_get_device_ptr = _lookup>( 'snd_hwdep_info_get_device'); late final _dart_snd_hwdep_info_get_device _snd_hwdep_info_get_device = _snd_hwdep_info_get_device_ptr .asFunction<_dart_snd_hwdep_info_get_device>(); int snd_hwdep_info_get_card( ffi.Pointer obj, ) { return _snd_hwdep_info_get_card( obj, ); } late final _snd_hwdep_info_get_card_ptr = _lookup>( 'snd_hwdep_info_get_card'); late final _dart_snd_hwdep_info_get_card _snd_hwdep_info_get_card = _snd_hwdep_info_get_card_ptr.asFunction<_dart_snd_hwdep_info_get_card>(); ffi.Pointer snd_hwdep_info_get_id( ffi.Pointer obj, ) { return _snd_hwdep_info_get_id( obj, ); } late final _snd_hwdep_info_get_id_ptr = _lookup>( 'snd_hwdep_info_get_id'); late final _dart_snd_hwdep_info_get_id _snd_hwdep_info_get_id = _snd_hwdep_info_get_id_ptr.asFunction<_dart_snd_hwdep_info_get_id>(); ffi.Pointer snd_hwdep_info_get_name( ffi.Pointer obj, ) { return _snd_hwdep_info_get_name( obj, ); } late final _snd_hwdep_info_get_name_ptr = _lookup>( 'snd_hwdep_info_get_name'); late final _dart_snd_hwdep_info_get_name _snd_hwdep_info_get_name = _snd_hwdep_info_get_name_ptr.asFunction<_dart_snd_hwdep_info_get_name>(); int snd_hwdep_info_get_iface( ffi.Pointer obj, ) { return _snd_hwdep_info_get_iface( obj, ); } late final _snd_hwdep_info_get_iface_ptr = _lookup>( 'snd_hwdep_info_get_iface'); late final _dart_snd_hwdep_info_get_iface _snd_hwdep_info_get_iface = _snd_hwdep_info_get_iface_ptr .asFunction<_dart_snd_hwdep_info_get_iface>(); void snd_hwdep_info_set_device( ffi.Pointer obj, int val, ) { return _snd_hwdep_info_set_device( obj, val, ); } late final _snd_hwdep_info_set_device_ptr = _lookup>( 'snd_hwdep_info_set_device'); late final _dart_snd_hwdep_info_set_device _snd_hwdep_info_set_device = _snd_hwdep_info_set_device_ptr .asFunction<_dart_snd_hwdep_info_set_device>(); int snd_hwdep_dsp_status_sizeof() { return _snd_hwdep_dsp_status_sizeof(); } late final _snd_hwdep_dsp_status_sizeof_ptr = _lookup>( 'snd_hwdep_dsp_status_sizeof'); late final _dart_snd_hwdep_dsp_status_sizeof _snd_hwdep_dsp_status_sizeof = _snd_hwdep_dsp_status_sizeof_ptr .asFunction<_dart_snd_hwdep_dsp_status_sizeof>(); int snd_hwdep_dsp_status_malloc( ffi.Pointer> ptr, ) { return _snd_hwdep_dsp_status_malloc( ptr, ); } late final _snd_hwdep_dsp_status_malloc_ptr = _lookup>( 'snd_hwdep_dsp_status_malloc'); late final _dart_snd_hwdep_dsp_status_malloc _snd_hwdep_dsp_status_malloc = _snd_hwdep_dsp_status_malloc_ptr .asFunction<_dart_snd_hwdep_dsp_status_malloc>(); void snd_hwdep_dsp_status_free( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_free( obj, ); } late final _snd_hwdep_dsp_status_free_ptr = _lookup>( 'snd_hwdep_dsp_status_free'); late final _dart_snd_hwdep_dsp_status_free _snd_hwdep_dsp_status_free = _snd_hwdep_dsp_status_free_ptr .asFunction<_dart_snd_hwdep_dsp_status_free>(); void snd_hwdep_dsp_status_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_hwdep_dsp_status_copy( dst, src, ); } late final _snd_hwdep_dsp_status_copy_ptr = _lookup>( 'snd_hwdep_dsp_status_copy'); late final _dart_snd_hwdep_dsp_status_copy _snd_hwdep_dsp_status_copy = _snd_hwdep_dsp_status_copy_ptr .asFunction<_dart_snd_hwdep_dsp_status_copy>(); int snd_hwdep_dsp_status_get_version( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_get_version( obj, ); } late final _snd_hwdep_dsp_status_get_version_ptr = _lookup>( 'snd_hwdep_dsp_status_get_version'); late final _dart_snd_hwdep_dsp_status_get_version _snd_hwdep_dsp_status_get_version = _snd_hwdep_dsp_status_get_version_ptr .asFunction<_dart_snd_hwdep_dsp_status_get_version>(); ffi.Pointer snd_hwdep_dsp_status_get_id( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_get_id( obj, ); } late final _snd_hwdep_dsp_status_get_id_ptr = _lookup>( 'snd_hwdep_dsp_status_get_id'); late final _dart_snd_hwdep_dsp_status_get_id _snd_hwdep_dsp_status_get_id = _snd_hwdep_dsp_status_get_id_ptr .asFunction<_dart_snd_hwdep_dsp_status_get_id>(); int snd_hwdep_dsp_status_get_num_dsps( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_get_num_dsps( obj, ); } late final _snd_hwdep_dsp_status_get_num_dsps_ptr = _lookup>( 'snd_hwdep_dsp_status_get_num_dsps'); late final _dart_snd_hwdep_dsp_status_get_num_dsps _snd_hwdep_dsp_status_get_num_dsps = _snd_hwdep_dsp_status_get_num_dsps_ptr .asFunction<_dart_snd_hwdep_dsp_status_get_num_dsps>(); int snd_hwdep_dsp_status_get_dsp_loaded( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_get_dsp_loaded( obj, ); } late final _snd_hwdep_dsp_status_get_dsp_loaded_ptr = _lookup>( 'snd_hwdep_dsp_status_get_dsp_loaded'); late final _dart_snd_hwdep_dsp_status_get_dsp_loaded _snd_hwdep_dsp_status_get_dsp_loaded = _snd_hwdep_dsp_status_get_dsp_loaded_ptr .asFunction<_dart_snd_hwdep_dsp_status_get_dsp_loaded>(); int snd_hwdep_dsp_status_get_chip_ready( ffi.Pointer obj, ) { return _snd_hwdep_dsp_status_get_chip_ready( obj, ); } late final _snd_hwdep_dsp_status_get_chip_ready_ptr = _lookup>( 'snd_hwdep_dsp_status_get_chip_ready'); late final _dart_snd_hwdep_dsp_status_get_chip_ready _snd_hwdep_dsp_status_get_chip_ready = _snd_hwdep_dsp_status_get_chip_ready_ptr .asFunction<_dart_snd_hwdep_dsp_status_get_chip_ready>(); int snd_hwdep_dsp_image_sizeof() { return _snd_hwdep_dsp_image_sizeof(); } late final _snd_hwdep_dsp_image_sizeof_ptr = _lookup>( 'snd_hwdep_dsp_image_sizeof'); late final _dart_snd_hwdep_dsp_image_sizeof _snd_hwdep_dsp_image_sizeof = _snd_hwdep_dsp_image_sizeof_ptr .asFunction<_dart_snd_hwdep_dsp_image_sizeof>(); int snd_hwdep_dsp_image_malloc( ffi.Pointer> ptr, ) { return _snd_hwdep_dsp_image_malloc( ptr, ); } late final _snd_hwdep_dsp_image_malloc_ptr = _lookup>( 'snd_hwdep_dsp_image_malloc'); late final _dart_snd_hwdep_dsp_image_malloc _snd_hwdep_dsp_image_malloc = _snd_hwdep_dsp_image_malloc_ptr .asFunction<_dart_snd_hwdep_dsp_image_malloc>(); void snd_hwdep_dsp_image_free( ffi.Pointer obj, ) { return _snd_hwdep_dsp_image_free( obj, ); } late final _snd_hwdep_dsp_image_free_ptr = _lookup>( 'snd_hwdep_dsp_image_free'); late final _dart_snd_hwdep_dsp_image_free _snd_hwdep_dsp_image_free = _snd_hwdep_dsp_image_free_ptr .asFunction<_dart_snd_hwdep_dsp_image_free>(); void snd_hwdep_dsp_image_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_hwdep_dsp_image_copy( dst, src, ); } late final _snd_hwdep_dsp_image_copy_ptr = _lookup>( 'snd_hwdep_dsp_image_copy'); late final _dart_snd_hwdep_dsp_image_copy _snd_hwdep_dsp_image_copy = _snd_hwdep_dsp_image_copy_ptr .asFunction<_dart_snd_hwdep_dsp_image_copy>(); int snd_hwdep_dsp_image_get_index( ffi.Pointer obj, ) { return _snd_hwdep_dsp_image_get_index( obj, ); } late final _snd_hwdep_dsp_image_get_index_ptr = _lookup>( 'snd_hwdep_dsp_image_get_index'); late final _dart_snd_hwdep_dsp_image_get_index _snd_hwdep_dsp_image_get_index = _snd_hwdep_dsp_image_get_index_ptr .asFunction<_dart_snd_hwdep_dsp_image_get_index>(); ffi.Pointer snd_hwdep_dsp_image_get_name( ffi.Pointer obj, ) { return _snd_hwdep_dsp_image_get_name( obj, ); } late final _snd_hwdep_dsp_image_get_name_ptr = _lookup>( 'snd_hwdep_dsp_image_get_name'); late final _dart_snd_hwdep_dsp_image_get_name _snd_hwdep_dsp_image_get_name = _snd_hwdep_dsp_image_get_name_ptr .asFunction<_dart_snd_hwdep_dsp_image_get_name>(); ffi.Pointer snd_hwdep_dsp_image_get_image( ffi.Pointer obj, ) { return _snd_hwdep_dsp_image_get_image( obj, ); } late final _snd_hwdep_dsp_image_get_image_ptr = _lookup>( 'snd_hwdep_dsp_image_get_image'); late final _dart_snd_hwdep_dsp_image_get_image _snd_hwdep_dsp_image_get_image = _snd_hwdep_dsp_image_get_image_ptr .asFunction<_dart_snd_hwdep_dsp_image_get_image>(); int snd_hwdep_dsp_image_get_length( ffi.Pointer obj, ) { return _snd_hwdep_dsp_image_get_length( obj, ); } late final _snd_hwdep_dsp_image_get_length_ptr = _lookup>( 'snd_hwdep_dsp_image_get_length'); late final _dart_snd_hwdep_dsp_image_get_length _snd_hwdep_dsp_image_get_length = _snd_hwdep_dsp_image_get_length_ptr .asFunction<_dart_snd_hwdep_dsp_image_get_length>(); void snd_hwdep_dsp_image_set_index( ffi.Pointer obj, int _index, ) { return _snd_hwdep_dsp_image_set_index( obj, _index, ); } late final _snd_hwdep_dsp_image_set_index_ptr = _lookup>( 'snd_hwdep_dsp_image_set_index'); late final _dart_snd_hwdep_dsp_image_set_index _snd_hwdep_dsp_image_set_index = _snd_hwdep_dsp_image_set_index_ptr .asFunction<_dart_snd_hwdep_dsp_image_set_index>(); void snd_hwdep_dsp_image_set_name( ffi.Pointer obj, ffi.Pointer name, ) { return _snd_hwdep_dsp_image_set_name( obj, name, ); } late final _snd_hwdep_dsp_image_set_name_ptr = _lookup>( 'snd_hwdep_dsp_image_set_name'); late final _dart_snd_hwdep_dsp_image_set_name _snd_hwdep_dsp_image_set_name = _snd_hwdep_dsp_image_set_name_ptr .asFunction<_dart_snd_hwdep_dsp_image_set_name>(); void snd_hwdep_dsp_image_set_image( ffi.Pointer obj, ffi.Pointer buffer, ) { return _snd_hwdep_dsp_image_set_image( obj, buffer, ); } late final _snd_hwdep_dsp_image_set_image_ptr = _lookup>( 'snd_hwdep_dsp_image_set_image'); late final _dart_snd_hwdep_dsp_image_set_image _snd_hwdep_dsp_image_set_image = _snd_hwdep_dsp_image_set_image_ptr .asFunction<_dart_snd_hwdep_dsp_image_set_image>(); void snd_hwdep_dsp_image_set_length( ffi.Pointer obj, int length, ) { return _snd_hwdep_dsp_image_set_length( obj, length, ); } late final _snd_hwdep_dsp_image_set_length_ptr = _lookup>( 'snd_hwdep_dsp_image_set_length'); late final _dart_snd_hwdep_dsp_image_set_length _snd_hwdep_dsp_image_set_length = _snd_hwdep_dsp_image_set_length_ptr .asFunction<_dart_snd_hwdep_dsp_image_set_length>(); int snd_card_load( int card, ) { return _snd_card_load( card, ); } late final _snd_card_load_ptr = _lookup>('snd_card_load'); late final _dart_snd_card_load _snd_card_load = _snd_card_load_ptr.asFunction<_dart_snd_card_load>(); int snd_card_next( ffi.Pointer card, ) { return _snd_card_next( card, ); } late final _snd_card_next_ptr = _lookup>('snd_card_next'); late final _dart_snd_card_next _snd_card_next = _snd_card_next_ptr.asFunction<_dart_snd_card_next>(); int snd_card_get_index( ffi.Pointer name, ) { return _snd_card_get_index( name, ); } late final _snd_card_get_index_ptr = _lookup>('snd_card_get_index'); late final _dart_snd_card_get_index _snd_card_get_index = _snd_card_get_index_ptr.asFunction<_dart_snd_card_get_index>(); int snd_card_get_name( int card, ffi.Pointer> name, ) { return _snd_card_get_name( card, name, ); } late final _snd_card_get_name_ptr = _lookup>('snd_card_get_name'); late final _dart_snd_card_get_name _snd_card_get_name = _snd_card_get_name_ptr.asFunction<_dart_snd_card_get_name>(); int snd_card_get_longname( int card, ffi.Pointer> name, ) { return _snd_card_get_longname( card, name, ); } late final _snd_card_get_longname_ptr = _lookup>( 'snd_card_get_longname'); late final _dart_snd_card_get_longname _snd_card_get_longname = _snd_card_get_longname_ptr.asFunction<_dart_snd_card_get_longname>(); int snd_device_name_hint( int card, ffi.Pointer iface, ffi.Pointer>> hints, ) { return _snd_device_name_hint( card, iface, hints, ); } late final _snd_device_name_hint_ptr = _lookup>( 'snd_device_name_hint'); late final _dart_snd_device_name_hint _snd_device_name_hint = _snd_device_name_hint_ptr.asFunction<_dart_snd_device_name_hint>(); int snd_device_name_free_hint( ffi.Pointer> hints, ) { return _snd_device_name_free_hint( hints, ); } late final _snd_device_name_free_hint_ptr = _lookup>( 'snd_device_name_free_hint'); late final _dart_snd_device_name_free_hint _snd_device_name_free_hint = _snd_device_name_free_hint_ptr .asFunction<_dart_snd_device_name_free_hint>(); ffi.Pointer snd_device_name_get_hint( ffi.Pointer hint, ffi.Pointer id, ) { return _snd_device_name_get_hint( hint, id, ); } late final _snd_device_name_get_hint_ptr = _lookup>( 'snd_device_name_get_hint'); late final _dart_snd_device_name_get_hint _snd_device_name_get_hint = _snd_device_name_get_hint_ptr .asFunction<_dart_snd_device_name_get_hint>(); int snd_ctl_open( ffi.Pointer> ctl, ffi.Pointer name, int mode, ) { return _snd_ctl_open( ctl, name, mode, ); } late final _snd_ctl_open_ptr = _lookup>('snd_ctl_open'); late final _dart_snd_ctl_open _snd_ctl_open = _snd_ctl_open_ptr.asFunction<_dart_snd_ctl_open>(); int snd_ctl_open_lconf( ffi.Pointer> ctl, ffi.Pointer name, int mode, ffi.Pointer lconf, ) { return _snd_ctl_open_lconf( ctl, name, mode, lconf, ); } late final _snd_ctl_open_lconf_ptr = _lookup>('snd_ctl_open_lconf'); late final _dart_snd_ctl_open_lconf _snd_ctl_open_lconf = _snd_ctl_open_lconf_ptr.asFunction<_dart_snd_ctl_open_lconf>(); int snd_ctl_open_fallback( ffi.Pointer> ctl, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, int mode, ) { return _snd_ctl_open_fallback( ctl, root, name, orig_name, mode, ); } late final _snd_ctl_open_fallback_ptr = _lookup>( 'snd_ctl_open_fallback'); late final _dart_snd_ctl_open_fallback _snd_ctl_open_fallback = _snd_ctl_open_fallback_ptr.asFunction<_dart_snd_ctl_open_fallback>(); int snd_ctl_close( ffi.Pointer ctl, ) { return _snd_ctl_close( ctl, ); } late final _snd_ctl_close_ptr = _lookup>('snd_ctl_close'); late final _dart_snd_ctl_close _snd_ctl_close = _snd_ctl_close_ptr.asFunction<_dart_snd_ctl_close>(); int snd_ctl_nonblock( ffi.Pointer ctl, int nonblock, ) { return _snd_ctl_nonblock( ctl, nonblock, ); } late final _snd_ctl_nonblock_ptr = _lookup>('snd_ctl_nonblock'); late final _dart_snd_ctl_nonblock _snd_ctl_nonblock = _snd_ctl_nonblock_ptr.asFunction<_dart_snd_ctl_nonblock>(); int snd_async_add_ctl_handler( ffi.Pointer> handler, ffi.Pointer ctl, ffi.Pointer> callback, ffi.Pointer private_data, ) { return _snd_async_add_ctl_handler( handler, ctl, callback, private_data, ); } late final _snd_async_add_ctl_handler_ptr = _lookup>( 'snd_async_add_ctl_handler'); late final _dart_snd_async_add_ctl_handler _snd_async_add_ctl_handler = _snd_async_add_ctl_handler_ptr .asFunction<_dart_snd_async_add_ctl_handler>(); ffi.Pointer snd_async_handler_get_ctl( ffi.Pointer handler, ) { return _snd_async_handler_get_ctl( handler, ); } late final _snd_async_handler_get_ctl_ptr = _lookup>( 'snd_async_handler_get_ctl'); late final _dart_snd_async_handler_get_ctl _snd_async_handler_get_ctl = _snd_async_handler_get_ctl_ptr .asFunction<_dart_snd_async_handler_get_ctl>(); int snd_ctl_poll_descriptors_count( ffi.Pointer ctl, ) { return _snd_ctl_poll_descriptors_count( ctl, ); } late final _snd_ctl_poll_descriptors_count_ptr = _lookup>( 'snd_ctl_poll_descriptors_count'); late final _dart_snd_ctl_poll_descriptors_count _snd_ctl_poll_descriptors_count = _snd_ctl_poll_descriptors_count_ptr .asFunction<_dart_snd_ctl_poll_descriptors_count>(); int snd_ctl_poll_descriptors( ffi.Pointer ctl, ffi.Pointer pfds, int space, ) { return _snd_ctl_poll_descriptors( ctl, pfds, space, ); } late final _snd_ctl_poll_descriptors_ptr = _lookup>( 'snd_ctl_poll_descriptors'); late final _dart_snd_ctl_poll_descriptors _snd_ctl_poll_descriptors = _snd_ctl_poll_descriptors_ptr .asFunction<_dart_snd_ctl_poll_descriptors>(); int snd_ctl_poll_descriptors_revents( ffi.Pointer ctl, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_ctl_poll_descriptors_revents( ctl, pfds, nfds, revents, ); } late final _snd_ctl_poll_descriptors_revents_ptr = _lookup>( 'snd_ctl_poll_descriptors_revents'); late final _dart_snd_ctl_poll_descriptors_revents _snd_ctl_poll_descriptors_revents = _snd_ctl_poll_descriptors_revents_ptr .asFunction<_dart_snd_ctl_poll_descriptors_revents>(); int snd_ctl_subscribe_events( ffi.Pointer ctl, int subscribe, ) { return _snd_ctl_subscribe_events( ctl, subscribe, ); } late final _snd_ctl_subscribe_events_ptr = _lookup>( 'snd_ctl_subscribe_events'); late final _dart_snd_ctl_subscribe_events _snd_ctl_subscribe_events = _snd_ctl_subscribe_events_ptr .asFunction<_dart_snd_ctl_subscribe_events>(); int snd_ctl_card_info( ffi.Pointer ctl, ffi.Pointer info, ) { return _snd_ctl_card_info( ctl, info, ); } late final _snd_ctl_card_info_ptr = _lookup>('snd_ctl_card_info'); late final _dart_snd_ctl_card_info _snd_ctl_card_info = _snd_ctl_card_info_ptr.asFunction<_dart_snd_ctl_card_info>(); int snd_ctl_elem_list( ffi.Pointer ctl, ffi.Pointer list, ) { return _snd_ctl_elem_list( ctl, list, ); } late final _snd_ctl_elem_list_ptr = _lookup>('snd_ctl_elem_list'); late final _dart_snd_ctl_elem_list _snd_ctl_elem_list = _snd_ctl_elem_list_ptr.asFunction<_dart_snd_ctl_elem_list>(); int snd_ctl_elem_info( ffi.Pointer ctl, ffi.Pointer info, ) { return _snd_ctl_elem_info( ctl, info, ); } late final _snd_ctl_elem_info_ptr = _lookup>('snd_ctl_elem_info'); late final _dart_snd_ctl_elem_info _snd_ctl_elem_info = _snd_ctl_elem_info_ptr.asFunction<_dart_snd_ctl_elem_info>(); int snd_ctl_elem_read( ffi.Pointer ctl, ffi.Pointer data, ) { return _snd_ctl_elem_read( ctl, data, ); } late final _snd_ctl_elem_read_ptr = _lookup>('snd_ctl_elem_read'); late final _dart_snd_ctl_elem_read _snd_ctl_elem_read = _snd_ctl_elem_read_ptr.asFunction<_dart_snd_ctl_elem_read>(); int snd_ctl_elem_write( ffi.Pointer ctl, ffi.Pointer data, ) { return _snd_ctl_elem_write( ctl, data, ); } late final _snd_ctl_elem_write_ptr = _lookup>('snd_ctl_elem_write'); late final _dart_snd_ctl_elem_write _snd_ctl_elem_write = _snd_ctl_elem_write_ptr.asFunction<_dart_snd_ctl_elem_write>(); int snd_ctl_elem_lock( ffi.Pointer ctl, ffi.Pointer id, ) { return _snd_ctl_elem_lock( ctl, id, ); } late final _snd_ctl_elem_lock_ptr = _lookup>('snd_ctl_elem_lock'); late final _dart_snd_ctl_elem_lock _snd_ctl_elem_lock = _snd_ctl_elem_lock_ptr.asFunction<_dart_snd_ctl_elem_lock>(); int snd_ctl_elem_unlock( ffi.Pointer ctl, ffi.Pointer id, ) { return _snd_ctl_elem_unlock( ctl, id, ); } late final _snd_ctl_elem_unlock_ptr = _lookup>( 'snd_ctl_elem_unlock'); late final _dart_snd_ctl_elem_unlock _snd_ctl_elem_unlock = _snd_ctl_elem_unlock_ptr.asFunction<_dart_snd_ctl_elem_unlock>(); int snd_ctl_elem_tlv_read( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, int tlv_size, ) { return _snd_ctl_elem_tlv_read( ctl, id, tlv, tlv_size, ); } late final _snd_ctl_elem_tlv_read_ptr = _lookup>( 'snd_ctl_elem_tlv_read'); late final _dart_snd_ctl_elem_tlv_read _snd_ctl_elem_tlv_read = _snd_ctl_elem_tlv_read_ptr.asFunction<_dart_snd_ctl_elem_tlv_read>(); int snd_ctl_elem_tlv_write( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ) { return _snd_ctl_elem_tlv_write( ctl, id, tlv, ); } late final _snd_ctl_elem_tlv_write_ptr = _lookup>( 'snd_ctl_elem_tlv_write'); late final _dart_snd_ctl_elem_tlv_write _snd_ctl_elem_tlv_write = _snd_ctl_elem_tlv_write_ptr.asFunction<_dart_snd_ctl_elem_tlv_write>(); int snd_ctl_elem_tlv_command( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ) { return _snd_ctl_elem_tlv_command( ctl, id, tlv, ); } late final _snd_ctl_elem_tlv_command_ptr = _lookup>( 'snd_ctl_elem_tlv_command'); late final _dart_snd_ctl_elem_tlv_command _snd_ctl_elem_tlv_command = _snd_ctl_elem_tlv_command_ptr .asFunction<_dart_snd_ctl_elem_tlv_command>(); int snd_ctl_hwdep_next_device( ffi.Pointer ctl, ffi.Pointer device, ) { return _snd_ctl_hwdep_next_device( ctl, device, ); } late final _snd_ctl_hwdep_next_device_ptr = _lookup>( 'snd_ctl_hwdep_next_device'); late final _dart_snd_ctl_hwdep_next_device _snd_ctl_hwdep_next_device = _snd_ctl_hwdep_next_device_ptr .asFunction<_dart_snd_ctl_hwdep_next_device>(); int snd_ctl_hwdep_info( ffi.Pointer ctl, ffi.Pointer info, ) { return _snd_ctl_hwdep_info( ctl, info, ); } late final _snd_ctl_hwdep_info_ptr = _lookup>('snd_ctl_hwdep_info'); late final _dart_snd_ctl_hwdep_info _snd_ctl_hwdep_info = _snd_ctl_hwdep_info_ptr.asFunction<_dart_snd_ctl_hwdep_info>(); int snd_ctl_pcm_next_device( ffi.Pointer ctl, ffi.Pointer device, ) { return _snd_ctl_pcm_next_device( ctl, device, ); } late final _snd_ctl_pcm_next_device_ptr = _lookup>( 'snd_ctl_pcm_next_device'); late final _dart_snd_ctl_pcm_next_device _snd_ctl_pcm_next_device = _snd_ctl_pcm_next_device_ptr.asFunction<_dart_snd_ctl_pcm_next_device>(); int snd_ctl_pcm_info( ffi.Pointer ctl, ffi.Pointer info, ) { return _snd_ctl_pcm_info( ctl, info, ); } late final _snd_ctl_pcm_info_ptr = _lookup>('snd_ctl_pcm_info'); late final _dart_snd_ctl_pcm_info _snd_ctl_pcm_info = _snd_ctl_pcm_info_ptr.asFunction<_dart_snd_ctl_pcm_info>(); int snd_ctl_pcm_prefer_subdevice( ffi.Pointer ctl, int subdev, ) { return _snd_ctl_pcm_prefer_subdevice( ctl, subdev, ); } late final _snd_ctl_pcm_prefer_subdevice_ptr = _lookup>( 'snd_ctl_pcm_prefer_subdevice'); late final _dart_snd_ctl_pcm_prefer_subdevice _snd_ctl_pcm_prefer_subdevice = _snd_ctl_pcm_prefer_subdevice_ptr .asFunction<_dart_snd_ctl_pcm_prefer_subdevice>(); int snd_ctl_rawmidi_next_device( ffi.Pointer ctl, ffi.Pointer device, ) { return _snd_ctl_rawmidi_next_device( ctl, device, ); } late final _snd_ctl_rawmidi_next_device_ptr = _lookup>( 'snd_ctl_rawmidi_next_device'); late final _dart_snd_ctl_rawmidi_next_device _snd_ctl_rawmidi_next_device = _snd_ctl_rawmidi_next_device_ptr .asFunction<_dart_snd_ctl_rawmidi_next_device>(); int snd_ctl_rawmidi_info( ffi.Pointer ctl, ffi.Pointer info, ) { return _snd_ctl_rawmidi_info( ctl, info, ); } late final _snd_ctl_rawmidi_info_ptr = _lookup>( 'snd_ctl_rawmidi_info'); late final _dart_snd_ctl_rawmidi_info _snd_ctl_rawmidi_info = _snd_ctl_rawmidi_info_ptr.asFunction<_dart_snd_ctl_rawmidi_info>(); int snd_ctl_rawmidi_prefer_subdevice( ffi.Pointer ctl, int subdev, ) { return _snd_ctl_rawmidi_prefer_subdevice( ctl, subdev, ); } late final _snd_ctl_rawmidi_prefer_subdevice_ptr = _lookup>( 'snd_ctl_rawmidi_prefer_subdevice'); late final _dart_snd_ctl_rawmidi_prefer_subdevice _snd_ctl_rawmidi_prefer_subdevice = _snd_ctl_rawmidi_prefer_subdevice_ptr .asFunction<_dart_snd_ctl_rawmidi_prefer_subdevice>(); int snd_ctl_set_power_state( ffi.Pointer ctl, int state, ) { return _snd_ctl_set_power_state( ctl, state, ); } late final _snd_ctl_set_power_state_ptr = _lookup>( 'snd_ctl_set_power_state'); late final _dart_snd_ctl_set_power_state _snd_ctl_set_power_state = _snd_ctl_set_power_state_ptr.asFunction<_dart_snd_ctl_set_power_state>(); int snd_ctl_get_power_state( ffi.Pointer ctl, ffi.Pointer state, ) { return _snd_ctl_get_power_state( ctl, state, ); } late final _snd_ctl_get_power_state_ptr = _lookup>( 'snd_ctl_get_power_state'); late final _dart_snd_ctl_get_power_state _snd_ctl_get_power_state = _snd_ctl_get_power_state_ptr.asFunction<_dart_snd_ctl_get_power_state>(); int snd_ctl_read( ffi.Pointer ctl, ffi.Pointer event, ) { return _snd_ctl_read( ctl, event, ); } late final _snd_ctl_read_ptr = _lookup>('snd_ctl_read'); late final _dart_snd_ctl_read _snd_ctl_read = _snd_ctl_read_ptr.asFunction<_dart_snd_ctl_read>(); int snd_ctl_wait( ffi.Pointer ctl, int timeout, ) { return _snd_ctl_wait( ctl, timeout, ); } late final _snd_ctl_wait_ptr = _lookup>('snd_ctl_wait'); late final _dart_snd_ctl_wait _snd_ctl_wait = _snd_ctl_wait_ptr.asFunction<_dart_snd_ctl_wait>(); ffi.Pointer snd_ctl_name( ffi.Pointer ctl, ) { return _snd_ctl_name( ctl, ); } late final _snd_ctl_name_ptr = _lookup>('snd_ctl_name'); late final _dart_snd_ctl_name _snd_ctl_name = _snd_ctl_name_ptr.asFunction<_dart_snd_ctl_name>(); int snd_ctl_type( ffi.Pointer ctl, ) { return _snd_ctl_type( ctl, ); } late final _snd_ctl_type_ptr = _lookup>('snd_ctl_type'); late final _dart_snd_ctl_type _snd_ctl_type = _snd_ctl_type_ptr.asFunction<_dart_snd_ctl_type>(); ffi.Pointer snd_ctl_elem_type_name( int type, ) { return _snd_ctl_elem_type_name( type, ); } late final _snd_ctl_elem_type_name_ptr = _lookup>( 'snd_ctl_elem_type_name'); late final _dart_snd_ctl_elem_type_name _snd_ctl_elem_type_name = _snd_ctl_elem_type_name_ptr.asFunction<_dart_snd_ctl_elem_type_name>(); ffi.Pointer snd_ctl_elem_iface_name( int iface, ) { return _snd_ctl_elem_iface_name( iface, ); } late final _snd_ctl_elem_iface_name_ptr = _lookup>( 'snd_ctl_elem_iface_name'); late final _dart_snd_ctl_elem_iface_name _snd_ctl_elem_iface_name = _snd_ctl_elem_iface_name_ptr.asFunction<_dart_snd_ctl_elem_iface_name>(); ffi.Pointer snd_ctl_event_type_name( int type, ) { return _snd_ctl_event_type_name( type, ); } late final _snd_ctl_event_type_name_ptr = _lookup>( 'snd_ctl_event_type_name'); late final _dart_snd_ctl_event_type_name _snd_ctl_event_type_name = _snd_ctl_event_type_name_ptr.asFunction<_dart_snd_ctl_event_type_name>(); int snd_ctl_event_elem_get_mask( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_mask( obj, ); } late final _snd_ctl_event_elem_get_mask_ptr = _lookup>( 'snd_ctl_event_elem_get_mask'); late final _dart_snd_ctl_event_elem_get_mask _snd_ctl_event_elem_get_mask = _snd_ctl_event_elem_get_mask_ptr .asFunction<_dart_snd_ctl_event_elem_get_mask>(); int snd_ctl_event_elem_get_numid( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_numid( obj, ); } late final _snd_ctl_event_elem_get_numid_ptr = _lookup>( 'snd_ctl_event_elem_get_numid'); late final _dart_snd_ctl_event_elem_get_numid _snd_ctl_event_elem_get_numid = _snd_ctl_event_elem_get_numid_ptr .asFunction<_dart_snd_ctl_event_elem_get_numid>(); void snd_ctl_event_elem_get_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_event_elem_get_id( obj, ptr, ); } late final _snd_ctl_event_elem_get_id_ptr = _lookup>( 'snd_ctl_event_elem_get_id'); late final _dart_snd_ctl_event_elem_get_id _snd_ctl_event_elem_get_id = _snd_ctl_event_elem_get_id_ptr .asFunction<_dart_snd_ctl_event_elem_get_id>(); int snd_ctl_event_elem_get_interface( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_interface( obj, ); } late final _snd_ctl_event_elem_get_interface_ptr = _lookup>( 'snd_ctl_event_elem_get_interface'); late final _dart_snd_ctl_event_elem_get_interface _snd_ctl_event_elem_get_interface = _snd_ctl_event_elem_get_interface_ptr .asFunction<_dart_snd_ctl_event_elem_get_interface>(); int snd_ctl_event_elem_get_device( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_device( obj, ); } late final _snd_ctl_event_elem_get_device_ptr = _lookup>( 'snd_ctl_event_elem_get_device'); late final _dart_snd_ctl_event_elem_get_device _snd_ctl_event_elem_get_device = _snd_ctl_event_elem_get_device_ptr .asFunction<_dart_snd_ctl_event_elem_get_device>(); int snd_ctl_event_elem_get_subdevice( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_subdevice( obj, ); } late final _snd_ctl_event_elem_get_subdevice_ptr = _lookup>( 'snd_ctl_event_elem_get_subdevice'); late final _dart_snd_ctl_event_elem_get_subdevice _snd_ctl_event_elem_get_subdevice = _snd_ctl_event_elem_get_subdevice_ptr .asFunction<_dart_snd_ctl_event_elem_get_subdevice>(); ffi.Pointer snd_ctl_event_elem_get_name( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_name( obj, ); } late final _snd_ctl_event_elem_get_name_ptr = _lookup>( 'snd_ctl_event_elem_get_name'); late final _dart_snd_ctl_event_elem_get_name _snd_ctl_event_elem_get_name = _snd_ctl_event_elem_get_name_ptr .asFunction<_dart_snd_ctl_event_elem_get_name>(); int snd_ctl_event_elem_get_index( ffi.Pointer obj, ) { return _snd_ctl_event_elem_get_index( obj, ); } late final _snd_ctl_event_elem_get_index_ptr = _lookup>( 'snd_ctl_event_elem_get_index'); late final _dart_snd_ctl_event_elem_get_index _snd_ctl_event_elem_get_index = _snd_ctl_event_elem_get_index_ptr .asFunction<_dart_snd_ctl_event_elem_get_index>(); int snd_ctl_elem_list_alloc_space( ffi.Pointer obj, int entries, ) { return _snd_ctl_elem_list_alloc_space( obj, entries, ); } late final _snd_ctl_elem_list_alloc_space_ptr = _lookup>( 'snd_ctl_elem_list_alloc_space'); late final _dart_snd_ctl_elem_list_alloc_space _snd_ctl_elem_list_alloc_space = _snd_ctl_elem_list_alloc_space_ptr .asFunction<_dart_snd_ctl_elem_list_alloc_space>(); void snd_ctl_elem_list_free_space( ffi.Pointer obj, ) { return _snd_ctl_elem_list_free_space( obj, ); } late final _snd_ctl_elem_list_free_space_ptr = _lookup>( 'snd_ctl_elem_list_free_space'); late final _dart_snd_ctl_elem_list_free_space _snd_ctl_elem_list_free_space = _snd_ctl_elem_list_free_space_ptr .asFunction<_dart_snd_ctl_elem_list_free_space>(); ffi.Pointer snd_ctl_ascii_elem_id_get( ffi.Pointer id, ) { return _snd_ctl_ascii_elem_id_get( id, ); } late final _snd_ctl_ascii_elem_id_get_ptr = _lookup>( 'snd_ctl_ascii_elem_id_get'); late final _dart_snd_ctl_ascii_elem_id_get _snd_ctl_ascii_elem_id_get = _snd_ctl_ascii_elem_id_get_ptr .asFunction<_dart_snd_ctl_ascii_elem_id_get>(); int snd_ctl_ascii_elem_id_parse( ffi.Pointer dst, ffi.Pointer str, ) { return _snd_ctl_ascii_elem_id_parse( dst, str, ); } late final _snd_ctl_ascii_elem_id_parse_ptr = _lookup>( 'snd_ctl_ascii_elem_id_parse'); late final _dart_snd_ctl_ascii_elem_id_parse _snd_ctl_ascii_elem_id_parse = _snd_ctl_ascii_elem_id_parse_ptr .asFunction<_dart_snd_ctl_ascii_elem_id_parse>(); int snd_ctl_ascii_value_parse( ffi.Pointer handle, ffi.Pointer dst, ffi.Pointer info, ffi.Pointer value, ) { return _snd_ctl_ascii_value_parse( handle, dst, info, value, ); } late final _snd_ctl_ascii_value_parse_ptr = _lookup>( 'snd_ctl_ascii_value_parse'); late final _dart_snd_ctl_ascii_value_parse _snd_ctl_ascii_value_parse = _snd_ctl_ascii_value_parse_ptr .asFunction<_dart_snd_ctl_ascii_value_parse>(); int snd_ctl_elem_id_sizeof() { return _snd_ctl_elem_id_sizeof(); } late final _snd_ctl_elem_id_sizeof_ptr = _lookup>( 'snd_ctl_elem_id_sizeof'); late final _dart_snd_ctl_elem_id_sizeof _snd_ctl_elem_id_sizeof = _snd_ctl_elem_id_sizeof_ptr.asFunction<_dart_snd_ctl_elem_id_sizeof>(); int snd_ctl_elem_id_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_elem_id_malloc( ptr, ); } late final _snd_ctl_elem_id_malloc_ptr = _lookup>( 'snd_ctl_elem_id_malloc'); late final _dart_snd_ctl_elem_id_malloc _snd_ctl_elem_id_malloc = _snd_ctl_elem_id_malloc_ptr.asFunction<_dart_snd_ctl_elem_id_malloc>(); void snd_ctl_elem_id_free( ffi.Pointer obj, ) { return _snd_ctl_elem_id_free( obj, ); } late final _snd_ctl_elem_id_free_ptr = _lookup>( 'snd_ctl_elem_id_free'); late final _dart_snd_ctl_elem_id_free _snd_ctl_elem_id_free = _snd_ctl_elem_id_free_ptr.asFunction<_dart_snd_ctl_elem_id_free>(); void snd_ctl_elem_id_clear( ffi.Pointer obj, ) { return _snd_ctl_elem_id_clear( obj, ); } late final _snd_ctl_elem_id_clear_ptr = _lookup>( 'snd_ctl_elem_id_clear'); late final _dart_snd_ctl_elem_id_clear _snd_ctl_elem_id_clear = _snd_ctl_elem_id_clear_ptr.asFunction<_dart_snd_ctl_elem_id_clear>(); void snd_ctl_elem_id_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_elem_id_copy( dst, src, ); } late final _snd_ctl_elem_id_copy_ptr = _lookup>( 'snd_ctl_elem_id_copy'); late final _dart_snd_ctl_elem_id_copy _snd_ctl_elem_id_copy = _snd_ctl_elem_id_copy_ptr.asFunction<_dart_snd_ctl_elem_id_copy>(); int snd_ctl_elem_id_get_numid( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_numid( obj, ); } late final _snd_ctl_elem_id_get_numid_ptr = _lookup>( 'snd_ctl_elem_id_get_numid'); late final _dart_snd_ctl_elem_id_get_numid _snd_ctl_elem_id_get_numid = _snd_ctl_elem_id_get_numid_ptr .asFunction<_dart_snd_ctl_elem_id_get_numid>(); int snd_ctl_elem_id_get_interface( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_interface( obj, ); } late final _snd_ctl_elem_id_get_interface_ptr = _lookup>( 'snd_ctl_elem_id_get_interface'); late final _dart_snd_ctl_elem_id_get_interface _snd_ctl_elem_id_get_interface = _snd_ctl_elem_id_get_interface_ptr .asFunction<_dart_snd_ctl_elem_id_get_interface>(); int snd_ctl_elem_id_get_device( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_device( obj, ); } late final _snd_ctl_elem_id_get_device_ptr = _lookup>( 'snd_ctl_elem_id_get_device'); late final _dart_snd_ctl_elem_id_get_device _snd_ctl_elem_id_get_device = _snd_ctl_elem_id_get_device_ptr .asFunction<_dart_snd_ctl_elem_id_get_device>(); int snd_ctl_elem_id_get_subdevice( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_subdevice( obj, ); } late final _snd_ctl_elem_id_get_subdevice_ptr = _lookup>( 'snd_ctl_elem_id_get_subdevice'); late final _dart_snd_ctl_elem_id_get_subdevice _snd_ctl_elem_id_get_subdevice = _snd_ctl_elem_id_get_subdevice_ptr .asFunction<_dart_snd_ctl_elem_id_get_subdevice>(); ffi.Pointer snd_ctl_elem_id_get_name( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_name( obj, ); } late final _snd_ctl_elem_id_get_name_ptr = _lookup>( 'snd_ctl_elem_id_get_name'); late final _dart_snd_ctl_elem_id_get_name _snd_ctl_elem_id_get_name = _snd_ctl_elem_id_get_name_ptr .asFunction<_dart_snd_ctl_elem_id_get_name>(); int snd_ctl_elem_id_get_index( ffi.Pointer obj, ) { return _snd_ctl_elem_id_get_index( obj, ); } late final _snd_ctl_elem_id_get_index_ptr = _lookup>( 'snd_ctl_elem_id_get_index'); late final _dart_snd_ctl_elem_id_get_index _snd_ctl_elem_id_get_index = _snd_ctl_elem_id_get_index_ptr .asFunction<_dart_snd_ctl_elem_id_get_index>(); void snd_ctl_elem_id_set_numid( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_id_set_numid( obj, val, ); } late final _snd_ctl_elem_id_set_numid_ptr = _lookup>( 'snd_ctl_elem_id_set_numid'); late final _dart_snd_ctl_elem_id_set_numid _snd_ctl_elem_id_set_numid = _snd_ctl_elem_id_set_numid_ptr .asFunction<_dart_snd_ctl_elem_id_set_numid>(); void snd_ctl_elem_id_set_interface( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_id_set_interface( obj, val, ); } late final _snd_ctl_elem_id_set_interface_ptr = _lookup>( 'snd_ctl_elem_id_set_interface'); late final _dart_snd_ctl_elem_id_set_interface _snd_ctl_elem_id_set_interface = _snd_ctl_elem_id_set_interface_ptr .asFunction<_dart_snd_ctl_elem_id_set_interface>(); void snd_ctl_elem_id_set_device( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_id_set_device( obj, val, ); } late final _snd_ctl_elem_id_set_device_ptr = _lookup>( 'snd_ctl_elem_id_set_device'); late final _dart_snd_ctl_elem_id_set_device _snd_ctl_elem_id_set_device = _snd_ctl_elem_id_set_device_ptr .asFunction<_dart_snd_ctl_elem_id_set_device>(); void snd_ctl_elem_id_set_subdevice( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_id_set_subdevice( obj, val, ); } late final _snd_ctl_elem_id_set_subdevice_ptr = _lookup>( 'snd_ctl_elem_id_set_subdevice'); late final _dart_snd_ctl_elem_id_set_subdevice _snd_ctl_elem_id_set_subdevice = _snd_ctl_elem_id_set_subdevice_ptr .asFunction<_dart_snd_ctl_elem_id_set_subdevice>(); void snd_ctl_elem_id_set_name( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_ctl_elem_id_set_name( obj, val, ); } late final _snd_ctl_elem_id_set_name_ptr = _lookup>( 'snd_ctl_elem_id_set_name'); late final _dart_snd_ctl_elem_id_set_name _snd_ctl_elem_id_set_name = _snd_ctl_elem_id_set_name_ptr .asFunction<_dart_snd_ctl_elem_id_set_name>(); void snd_ctl_elem_id_set_index( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_id_set_index( obj, val, ); } late final _snd_ctl_elem_id_set_index_ptr = _lookup>( 'snd_ctl_elem_id_set_index'); late final _dart_snd_ctl_elem_id_set_index _snd_ctl_elem_id_set_index = _snd_ctl_elem_id_set_index_ptr .asFunction<_dart_snd_ctl_elem_id_set_index>(); int snd_ctl_card_info_sizeof() { return _snd_ctl_card_info_sizeof(); } late final _snd_ctl_card_info_sizeof_ptr = _lookup>( 'snd_ctl_card_info_sizeof'); late final _dart_snd_ctl_card_info_sizeof _snd_ctl_card_info_sizeof = _snd_ctl_card_info_sizeof_ptr .asFunction<_dart_snd_ctl_card_info_sizeof>(); int snd_ctl_card_info_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_card_info_malloc( ptr, ); } late final _snd_ctl_card_info_malloc_ptr = _lookup>( 'snd_ctl_card_info_malloc'); late final _dart_snd_ctl_card_info_malloc _snd_ctl_card_info_malloc = _snd_ctl_card_info_malloc_ptr .asFunction<_dart_snd_ctl_card_info_malloc>(); void snd_ctl_card_info_free( ffi.Pointer obj, ) { return _snd_ctl_card_info_free( obj, ); } late final _snd_ctl_card_info_free_ptr = _lookup>( 'snd_ctl_card_info_free'); late final _dart_snd_ctl_card_info_free _snd_ctl_card_info_free = _snd_ctl_card_info_free_ptr.asFunction<_dart_snd_ctl_card_info_free>(); void snd_ctl_card_info_clear( ffi.Pointer obj, ) { return _snd_ctl_card_info_clear( obj, ); } late final _snd_ctl_card_info_clear_ptr = _lookup>( 'snd_ctl_card_info_clear'); late final _dart_snd_ctl_card_info_clear _snd_ctl_card_info_clear = _snd_ctl_card_info_clear_ptr.asFunction<_dart_snd_ctl_card_info_clear>(); void snd_ctl_card_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_card_info_copy( dst, src, ); } late final _snd_ctl_card_info_copy_ptr = _lookup>( 'snd_ctl_card_info_copy'); late final _dart_snd_ctl_card_info_copy _snd_ctl_card_info_copy = _snd_ctl_card_info_copy_ptr.asFunction<_dart_snd_ctl_card_info_copy>(); int snd_ctl_card_info_get_card( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_card( obj, ); } late final _snd_ctl_card_info_get_card_ptr = _lookup>( 'snd_ctl_card_info_get_card'); late final _dart_snd_ctl_card_info_get_card _snd_ctl_card_info_get_card = _snd_ctl_card_info_get_card_ptr .asFunction<_dart_snd_ctl_card_info_get_card>(); ffi.Pointer snd_ctl_card_info_get_id( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_id( obj, ); } late final _snd_ctl_card_info_get_id_ptr = _lookup>( 'snd_ctl_card_info_get_id'); late final _dart_snd_ctl_card_info_get_id _snd_ctl_card_info_get_id = _snd_ctl_card_info_get_id_ptr .asFunction<_dart_snd_ctl_card_info_get_id>(); ffi.Pointer snd_ctl_card_info_get_driver( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_driver( obj, ); } late final _snd_ctl_card_info_get_driver_ptr = _lookup>( 'snd_ctl_card_info_get_driver'); late final _dart_snd_ctl_card_info_get_driver _snd_ctl_card_info_get_driver = _snd_ctl_card_info_get_driver_ptr .asFunction<_dart_snd_ctl_card_info_get_driver>(); ffi.Pointer snd_ctl_card_info_get_name( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_name( obj, ); } late final _snd_ctl_card_info_get_name_ptr = _lookup>( 'snd_ctl_card_info_get_name'); late final _dart_snd_ctl_card_info_get_name _snd_ctl_card_info_get_name = _snd_ctl_card_info_get_name_ptr .asFunction<_dart_snd_ctl_card_info_get_name>(); ffi.Pointer snd_ctl_card_info_get_longname( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_longname( obj, ); } late final _snd_ctl_card_info_get_longname_ptr = _lookup>( 'snd_ctl_card_info_get_longname'); late final _dart_snd_ctl_card_info_get_longname _snd_ctl_card_info_get_longname = _snd_ctl_card_info_get_longname_ptr .asFunction<_dart_snd_ctl_card_info_get_longname>(); ffi.Pointer snd_ctl_card_info_get_mixername( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_mixername( obj, ); } late final _snd_ctl_card_info_get_mixername_ptr = _lookup>( 'snd_ctl_card_info_get_mixername'); late final _dart_snd_ctl_card_info_get_mixername _snd_ctl_card_info_get_mixername = _snd_ctl_card_info_get_mixername_ptr .asFunction<_dart_snd_ctl_card_info_get_mixername>(); ffi.Pointer snd_ctl_card_info_get_components( ffi.Pointer obj, ) { return _snd_ctl_card_info_get_components( obj, ); } late final _snd_ctl_card_info_get_components_ptr = _lookup>( 'snd_ctl_card_info_get_components'); late final _dart_snd_ctl_card_info_get_components _snd_ctl_card_info_get_components = _snd_ctl_card_info_get_components_ptr .asFunction<_dart_snd_ctl_card_info_get_components>(); int snd_ctl_event_sizeof() { return _snd_ctl_event_sizeof(); } late final _snd_ctl_event_sizeof_ptr = _lookup>( 'snd_ctl_event_sizeof'); late final _dart_snd_ctl_event_sizeof _snd_ctl_event_sizeof = _snd_ctl_event_sizeof_ptr.asFunction<_dart_snd_ctl_event_sizeof>(); int snd_ctl_event_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_event_malloc( ptr, ); } late final _snd_ctl_event_malloc_ptr = _lookup>( 'snd_ctl_event_malloc'); late final _dart_snd_ctl_event_malloc _snd_ctl_event_malloc = _snd_ctl_event_malloc_ptr.asFunction<_dart_snd_ctl_event_malloc>(); void snd_ctl_event_free( ffi.Pointer obj, ) { return _snd_ctl_event_free( obj, ); } late final _snd_ctl_event_free_ptr = _lookup>('snd_ctl_event_free'); late final _dart_snd_ctl_event_free _snd_ctl_event_free = _snd_ctl_event_free_ptr.asFunction<_dart_snd_ctl_event_free>(); void snd_ctl_event_clear( ffi.Pointer obj, ) { return _snd_ctl_event_clear( obj, ); } late final _snd_ctl_event_clear_ptr = _lookup>( 'snd_ctl_event_clear'); late final _dart_snd_ctl_event_clear _snd_ctl_event_clear = _snd_ctl_event_clear_ptr.asFunction<_dart_snd_ctl_event_clear>(); void snd_ctl_event_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_event_copy( dst, src, ); } late final _snd_ctl_event_copy_ptr = _lookup>('snd_ctl_event_copy'); late final _dart_snd_ctl_event_copy _snd_ctl_event_copy = _snd_ctl_event_copy_ptr.asFunction<_dart_snd_ctl_event_copy>(); int snd_ctl_event_get_type( ffi.Pointer obj, ) { return _snd_ctl_event_get_type( obj, ); } late final _snd_ctl_event_get_type_ptr = _lookup>( 'snd_ctl_event_get_type'); late final _dart_snd_ctl_event_get_type _snd_ctl_event_get_type = _snd_ctl_event_get_type_ptr.asFunction<_dart_snd_ctl_event_get_type>(); int snd_ctl_elem_list_sizeof() { return _snd_ctl_elem_list_sizeof(); } late final _snd_ctl_elem_list_sizeof_ptr = _lookup>( 'snd_ctl_elem_list_sizeof'); late final _dart_snd_ctl_elem_list_sizeof _snd_ctl_elem_list_sizeof = _snd_ctl_elem_list_sizeof_ptr .asFunction<_dart_snd_ctl_elem_list_sizeof>(); int snd_ctl_elem_list_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_elem_list_malloc( ptr, ); } late final _snd_ctl_elem_list_malloc_ptr = _lookup>( 'snd_ctl_elem_list_malloc'); late final _dart_snd_ctl_elem_list_malloc _snd_ctl_elem_list_malloc = _snd_ctl_elem_list_malloc_ptr .asFunction<_dart_snd_ctl_elem_list_malloc>(); void snd_ctl_elem_list_free( ffi.Pointer obj, ) { return _snd_ctl_elem_list_free( obj, ); } late final _snd_ctl_elem_list_free_ptr = _lookup>( 'snd_ctl_elem_list_free'); late final _dart_snd_ctl_elem_list_free _snd_ctl_elem_list_free = _snd_ctl_elem_list_free_ptr.asFunction<_dart_snd_ctl_elem_list_free>(); void snd_ctl_elem_list_clear( ffi.Pointer obj, ) { return _snd_ctl_elem_list_clear( obj, ); } late final _snd_ctl_elem_list_clear_ptr = _lookup>( 'snd_ctl_elem_list_clear'); late final _dart_snd_ctl_elem_list_clear _snd_ctl_elem_list_clear = _snd_ctl_elem_list_clear_ptr.asFunction<_dart_snd_ctl_elem_list_clear>(); void snd_ctl_elem_list_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_elem_list_copy( dst, src, ); } late final _snd_ctl_elem_list_copy_ptr = _lookup>( 'snd_ctl_elem_list_copy'); late final _dart_snd_ctl_elem_list_copy _snd_ctl_elem_list_copy = _snd_ctl_elem_list_copy_ptr.asFunction<_dart_snd_ctl_elem_list_copy>(); void snd_ctl_elem_list_set_offset( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_list_set_offset( obj, val, ); } late final _snd_ctl_elem_list_set_offset_ptr = _lookup>( 'snd_ctl_elem_list_set_offset'); late final _dart_snd_ctl_elem_list_set_offset _snd_ctl_elem_list_set_offset = _snd_ctl_elem_list_set_offset_ptr .asFunction<_dart_snd_ctl_elem_list_set_offset>(); int snd_ctl_elem_list_get_used( ffi.Pointer obj, ) { return _snd_ctl_elem_list_get_used( obj, ); } late final _snd_ctl_elem_list_get_used_ptr = _lookup>( 'snd_ctl_elem_list_get_used'); late final _dart_snd_ctl_elem_list_get_used _snd_ctl_elem_list_get_used = _snd_ctl_elem_list_get_used_ptr .asFunction<_dart_snd_ctl_elem_list_get_used>(); int snd_ctl_elem_list_get_count( ffi.Pointer obj, ) { return _snd_ctl_elem_list_get_count( obj, ); } late final _snd_ctl_elem_list_get_count_ptr = _lookup>( 'snd_ctl_elem_list_get_count'); late final _dart_snd_ctl_elem_list_get_count _snd_ctl_elem_list_get_count = _snd_ctl_elem_list_get_count_ptr .asFunction<_dart_snd_ctl_elem_list_get_count>(); void snd_ctl_elem_list_get_id( ffi.Pointer obj, int idx, ffi.Pointer ptr, ) { return _snd_ctl_elem_list_get_id( obj, idx, ptr, ); } late final _snd_ctl_elem_list_get_id_ptr = _lookup>( 'snd_ctl_elem_list_get_id'); late final _dart_snd_ctl_elem_list_get_id _snd_ctl_elem_list_get_id = _snd_ctl_elem_list_get_id_ptr .asFunction<_dart_snd_ctl_elem_list_get_id>(); int snd_ctl_elem_list_get_numid( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_numid( obj, idx, ); } late final _snd_ctl_elem_list_get_numid_ptr = _lookup>( 'snd_ctl_elem_list_get_numid'); late final _dart_snd_ctl_elem_list_get_numid _snd_ctl_elem_list_get_numid = _snd_ctl_elem_list_get_numid_ptr .asFunction<_dart_snd_ctl_elem_list_get_numid>(); int snd_ctl_elem_list_get_interface( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_interface( obj, idx, ); } late final _snd_ctl_elem_list_get_interface_ptr = _lookup>( 'snd_ctl_elem_list_get_interface'); late final _dart_snd_ctl_elem_list_get_interface _snd_ctl_elem_list_get_interface = _snd_ctl_elem_list_get_interface_ptr .asFunction<_dart_snd_ctl_elem_list_get_interface>(); int snd_ctl_elem_list_get_device( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_device( obj, idx, ); } late final _snd_ctl_elem_list_get_device_ptr = _lookup>( 'snd_ctl_elem_list_get_device'); late final _dart_snd_ctl_elem_list_get_device _snd_ctl_elem_list_get_device = _snd_ctl_elem_list_get_device_ptr .asFunction<_dart_snd_ctl_elem_list_get_device>(); int snd_ctl_elem_list_get_subdevice( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_subdevice( obj, idx, ); } late final _snd_ctl_elem_list_get_subdevice_ptr = _lookup>( 'snd_ctl_elem_list_get_subdevice'); late final _dart_snd_ctl_elem_list_get_subdevice _snd_ctl_elem_list_get_subdevice = _snd_ctl_elem_list_get_subdevice_ptr .asFunction<_dart_snd_ctl_elem_list_get_subdevice>(); ffi.Pointer snd_ctl_elem_list_get_name( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_name( obj, idx, ); } late final _snd_ctl_elem_list_get_name_ptr = _lookup>( 'snd_ctl_elem_list_get_name'); late final _dart_snd_ctl_elem_list_get_name _snd_ctl_elem_list_get_name = _snd_ctl_elem_list_get_name_ptr .asFunction<_dart_snd_ctl_elem_list_get_name>(); int snd_ctl_elem_list_get_index( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_list_get_index( obj, idx, ); } late final _snd_ctl_elem_list_get_index_ptr = _lookup>( 'snd_ctl_elem_list_get_index'); late final _dart_snd_ctl_elem_list_get_index _snd_ctl_elem_list_get_index = _snd_ctl_elem_list_get_index_ptr .asFunction<_dart_snd_ctl_elem_list_get_index>(); int snd_ctl_elem_info_sizeof() { return _snd_ctl_elem_info_sizeof(); } late final _snd_ctl_elem_info_sizeof_ptr = _lookup>( 'snd_ctl_elem_info_sizeof'); late final _dart_snd_ctl_elem_info_sizeof _snd_ctl_elem_info_sizeof = _snd_ctl_elem_info_sizeof_ptr .asFunction<_dart_snd_ctl_elem_info_sizeof>(); int snd_ctl_elem_info_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_elem_info_malloc( ptr, ); } late final _snd_ctl_elem_info_malloc_ptr = _lookup>( 'snd_ctl_elem_info_malloc'); late final _dart_snd_ctl_elem_info_malloc _snd_ctl_elem_info_malloc = _snd_ctl_elem_info_malloc_ptr .asFunction<_dart_snd_ctl_elem_info_malloc>(); void snd_ctl_elem_info_free( ffi.Pointer obj, ) { return _snd_ctl_elem_info_free( obj, ); } late final _snd_ctl_elem_info_free_ptr = _lookup>( 'snd_ctl_elem_info_free'); late final _dart_snd_ctl_elem_info_free _snd_ctl_elem_info_free = _snd_ctl_elem_info_free_ptr.asFunction<_dart_snd_ctl_elem_info_free>(); void snd_ctl_elem_info_clear( ffi.Pointer obj, ) { return _snd_ctl_elem_info_clear( obj, ); } late final _snd_ctl_elem_info_clear_ptr = _lookup>( 'snd_ctl_elem_info_clear'); late final _dart_snd_ctl_elem_info_clear _snd_ctl_elem_info_clear = _snd_ctl_elem_info_clear_ptr.asFunction<_dart_snd_ctl_elem_info_clear>(); void snd_ctl_elem_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_elem_info_copy( dst, src, ); } late final _snd_ctl_elem_info_copy_ptr = _lookup>( 'snd_ctl_elem_info_copy'); late final _dart_snd_ctl_elem_info_copy _snd_ctl_elem_info_copy = _snd_ctl_elem_info_copy_ptr.asFunction<_dart_snd_ctl_elem_info_copy>(); int snd_ctl_elem_info_get_type( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_type( obj, ); } late final _snd_ctl_elem_info_get_type_ptr = _lookup>( 'snd_ctl_elem_info_get_type'); late final _dart_snd_ctl_elem_info_get_type _snd_ctl_elem_info_get_type = _snd_ctl_elem_info_get_type_ptr .asFunction<_dart_snd_ctl_elem_info_get_type>(); int snd_ctl_elem_info_is_readable( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_readable( obj, ); } late final _snd_ctl_elem_info_is_readable_ptr = _lookup>( 'snd_ctl_elem_info_is_readable'); late final _dart_snd_ctl_elem_info_is_readable _snd_ctl_elem_info_is_readable = _snd_ctl_elem_info_is_readable_ptr .asFunction<_dart_snd_ctl_elem_info_is_readable>(); int snd_ctl_elem_info_is_writable( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_writable( obj, ); } late final _snd_ctl_elem_info_is_writable_ptr = _lookup>( 'snd_ctl_elem_info_is_writable'); late final _dart_snd_ctl_elem_info_is_writable _snd_ctl_elem_info_is_writable = _snd_ctl_elem_info_is_writable_ptr .asFunction<_dart_snd_ctl_elem_info_is_writable>(); int snd_ctl_elem_info_is_volatile( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_volatile( obj, ); } late final _snd_ctl_elem_info_is_volatile_ptr = _lookup>( 'snd_ctl_elem_info_is_volatile'); late final _dart_snd_ctl_elem_info_is_volatile _snd_ctl_elem_info_is_volatile = _snd_ctl_elem_info_is_volatile_ptr .asFunction<_dart_snd_ctl_elem_info_is_volatile>(); int snd_ctl_elem_info_is_inactive( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_inactive( obj, ); } late final _snd_ctl_elem_info_is_inactive_ptr = _lookup>( 'snd_ctl_elem_info_is_inactive'); late final _dart_snd_ctl_elem_info_is_inactive _snd_ctl_elem_info_is_inactive = _snd_ctl_elem_info_is_inactive_ptr .asFunction<_dart_snd_ctl_elem_info_is_inactive>(); int snd_ctl_elem_info_is_locked( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_locked( obj, ); } late final _snd_ctl_elem_info_is_locked_ptr = _lookup>( 'snd_ctl_elem_info_is_locked'); late final _dart_snd_ctl_elem_info_is_locked _snd_ctl_elem_info_is_locked = _snd_ctl_elem_info_is_locked_ptr .asFunction<_dart_snd_ctl_elem_info_is_locked>(); int snd_ctl_elem_info_is_tlv_readable( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_tlv_readable( obj, ); } late final _snd_ctl_elem_info_is_tlv_readable_ptr = _lookup>( 'snd_ctl_elem_info_is_tlv_readable'); late final _dart_snd_ctl_elem_info_is_tlv_readable _snd_ctl_elem_info_is_tlv_readable = _snd_ctl_elem_info_is_tlv_readable_ptr .asFunction<_dart_snd_ctl_elem_info_is_tlv_readable>(); int snd_ctl_elem_info_is_tlv_writable( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_tlv_writable( obj, ); } late final _snd_ctl_elem_info_is_tlv_writable_ptr = _lookup>( 'snd_ctl_elem_info_is_tlv_writable'); late final _dart_snd_ctl_elem_info_is_tlv_writable _snd_ctl_elem_info_is_tlv_writable = _snd_ctl_elem_info_is_tlv_writable_ptr .asFunction<_dart_snd_ctl_elem_info_is_tlv_writable>(); int snd_ctl_elem_info_is_tlv_commandable( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_tlv_commandable( obj, ); } late final _snd_ctl_elem_info_is_tlv_commandable_ptr = _lookup>( 'snd_ctl_elem_info_is_tlv_commandable'); late final _dart_snd_ctl_elem_info_is_tlv_commandable _snd_ctl_elem_info_is_tlv_commandable = _snd_ctl_elem_info_is_tlv_commandable_ptr .asFunction<_dart_snd_ctl_elem_info_is_tlv_commandable>(); int snd_ctl_elem_info_is_owner( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_owner( obj, ); } late final _snd_ctl_elem_info_is_owner_ptr = _lookup>( 'snd_ctl_elem_info_is_owner'); late final _dart_snd_ctl_elem_info_is_owner _snd_ctl_elem_info_is_owner = _snd_ctl_elem_info_is_owner_ptr .asFunction<_dart_snd_ctl_elem_info_is_owner>(); int snd_ctl_elem_info_is_user( ffi.Pointer obj, ) { return _snd_ctl_elem_info_is_user( obj, ); } late final _snd_ctl_elem_info_is_user_ptr = _lookup>( 'snd_ctl_elem_info_is_user'); late final _dart_snd_ctl_elem_info_is_user _snd_ctl_elem_info_is_user = _snd_ctl_elem_info_is_user_ptr .asFunction<_dart_snd_ctl_elem_info_is_user>(); int snd_ctl_elem_info_get_owner( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_owner( obj, ); } late final _snd_ctl_elem_info_get_owner_ptr = _lookup>( 'snd_ctl_elem_info_get_owner'); late final _dart_snd_ctl_elem_info_get_owner _snd_ctl_elem_info_get_owner = _snd_ctl_elem_info_get_owner_ptr .asFunction<_dart_snd_ctl_elem_info_get_owner>(); int snd_ctl_elem_info_get_count( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_count( obj, ); } late final _snd_ctl_elem_info_get_count_ptr = _lookup>( 'snd_ctl_elem_info_get_count'); late final _dart_snd_ctl_elem_info_get_count _snd_ctl_elem_info_get_count = _snd_ctl_elem_info_get_count_ptr .asFunction<_dart_snd_ctl_elem_info_get_count>(); int snd_ctl_elem_info_get_min( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_min( obj, ); } late final _snd_ctl_elem_info_get_min_ptr = _lookup>( 'snd_ctl_elem_info_get_min'); late final _dart_snd_ctl_elem_info_get_min _snd_ctl_elem_info_get_min = _snd_ctl_elem_info_get_min_ptr .asFunction<_dart_snd_ctl_elem_info_get_min>(); int snd_ctl_elem_info_get_max( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_max( obj, ); } late final _snd_ctl_elem_info_get_max_ptr = _lookup>( 'snd_ctl_elem_info_get_max'); late final _dart_snd_ctl_elem_info_get_max _snd_ctl_elem_info_get_max = _snd_ctl_elem_info_get_max_ptr .asFunction<_dart_snd_ctl_elem_info_get_max>(); int snd_ctl_elem_info_get_step( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_step( obj, ); } late final _snd_ctl_elem_info_get_step_ptr = _lookup>( 'snd_ctl_elem_info_get_step'); late final _dart_snd_ctl_elem_info_get_step _snd_ctl_elem_info_get_step = _snd_ctl_elem_info_get_step_ptr .asFunction<_dart_snd_ctl_elem_info_get_step>(); int snd_ctl_elem_info_get_min64( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_min64( obj, ); } late final _snd_ctl_elem_info_get_min64_ptr = _lookup>( 'snd_ctl_elem_info_get_min64'); late final _dart_snd_ctl_elem_info_get_min64 _snd_ctl_elem_info_get_min64 = _snd_ctl_elem_info_get_min64_ptr .asFunction<_dart_snd_ctl_elem_info_get_min64>(); int snd_ctl_elem_info_get_max64( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_max64( obj, ); } late final _snd_ctl_elem_info_get_max64_ptr = _lookup>( 'snd_ctl_elem_info_get_max64'); late final _dart_snd_ctl_elem_info_get_max64 _snd_ctl_elem_info_get_max64 = _snd_ctl_elem_info_get_max64_ptr .asFunction<_dart_snd_ctl_elem_info_get_max64>(); int snd_ctl_elem_info_get_step64( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_step64( obj, ); } late final _snd_ctl_elem_info_get_step64_ptr = _lookup>( 'snd_ctl_elem_info_get_step64'); late final _dart_snd_ctl_elem_info_get_step64 _snd_ctl_elem_info_get_step64 = _snd_ctl_elem_info_get_step64_ptr .asFunction<_dart_snd_ctl_elem_info_get_step64>(); int snd_ctl_elem_info_get_items( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_items( obj, ); } late final _snd_ctl_elem_info_get_items_ptr = _lookup>( 'snd_ctl_elem_info_get_items'); late final _dart_snd_ctl_elem_info_get_items _snd_ctl_elem_info_get_items = _snd_ctl_elem_info_get_items_ptr .asFunction<_dart_snd_ctl_elem_info_get_items>(); void snd_ctl_elem_info_set_item( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_item( obj, val, ); } late final _snd_ctl_elem_info_set_item_ptr = _lookup>( 'snd_ctl_elem_info_set_item'); late final _dart_snd_ctl_elem_info_set_item _snd_ctl_elem_info_set_item = _snd_ctl_elem_info_set_item_ptr .asFunction<_dart_snd_ctl_elem_info_set_item>(); ffi.Pointer snd_ctl_elem_info_get_item_name( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_item_name( obj, ); } late final _snd_ctl_elem_info_get_item_name_ptr = _lookup>( 'snd_ctl_elem_info_get_item_name'); late final _dart_snd_ctl_elem_info_get_item_name _snd_ctl_elem_info_get_item_name = _snd_ctl_elem_info_get_item_name_ptr .asFunction<_dart_snd_ctl_elem_info_get_item_name>(); int snd_ctl_elem_info_get_dimensions( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_dimensions( obj, ); } late final _snd_ctl_elem_info_get_dimensions_ptr = _lookup>( 'snd_ctl_elem_info_get_dimensions'); late final _dart_snd_ctl_elem_info_get_dimensions _snd_ctl_elem_info_get_dimensions = _snd_ctl_elem_info_get_dimensions_ptr .asFunction<_dart_snd_ctl_elem_info_get_dimensions>(); int snd_ctl_elem_info_get_dimension( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_info_get_dimension( obj, idx, ); } late final _snd_ctl_elem_info_get_dimension_ptr = _lookup>( 'snd_ctl_elem_info_get_dimension'); late final _dart_snd_ctl_elem_info_get_dimension _snd_ctl_elem_info_get_dimension = _snd_ctl_elem_info_get_dimension_ptr .asFunction<_dart_snd_ctl_elem_info_get_dimension>(); int snd_ctl_elem_info_set_dimension( ffi.Pointer info, ffi.Pointer dimension, ) { return _snd_ctl_elem_info_set_dimension( info, dimension, ); } late final _snd_ctl_elem_info_set_dimension_ptr = _lookup>( 'snd_ctl_elem_info_set_dimension'); late final _dart_snd_ctl_elem_info_set_dimension _snd_ctl_elem_info_set_dimension = _snd_ctl_elem_info_set_dimension_ptr .asFunction<_dart_snd_ctl_elem_info_set_dimension>(); void snd_ctl_elem_info_get_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_info_get_id( obj, ptr, ); } late final _snd_ctl_elem_info_get_id_ptr = _lookup>( 'snd_ctl_elem_info_get_id'); late final _dart_snd_ctl_elem_info_get_id _snd_ctl_elem_info_get_id = _snd_ctl_elem_info_get_id_ptr .asFunction<_dart_snd_ctl_elem_info_get_id>(); int snd_ctl_elem_info_get_numid( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_numid( obj, ); } late final _snd_ctl_elem_info_get_numid_ptr = _lookup>( 'snd_ctl_elem_info_get_numid'); late final _dart_snd_ctl_elem_info_get_numid _snd_ctl_elem_info_get_numid = _snd_ctl_elem_info_get_numid_ptr .asFunction<_dart_snd_ctl_elem_info_get_numid>(); int snd_ctl_elem_info_get_interface( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_interface( obj, ); } late final _snd_ctl_elem_info_get_interface_ptr = _lookup>( 'snd_ctl_elem_info_get_interface'); late final _dart_snd_ctl_elem_info_get_interface _snd_ctl_elem_info_get_interface = _snd_ctl_elem_info_get_interface_ptr .asFunction<_dart_snd_ctl_elem_info_get_interface>(); int snd_ctl_elem_info_get_device( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_device( obj, ); } late final _snd_ctl_elem_info_get_device_ptr = _lookup>( 'snd_ctl_elem_info_get_device'); late final _dart_snd_ctl_elem_info_get_device _snd_ctl_elem_info_get_device = _snd_ctl_elem_info_get_device_ptr .asFunction<_dart_snd_ctl_elem_info_get_device>(); int snd_ctl_elem_info_get_subdevice( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_subdevice( obj, ); } late final _snd_ctl_elem_info_get_subdevice_ptr = _lookup>( 'snd_ctl_elem_info_get_subdevice'); late final _dart_snd_ctl_elem_info_get_subdevice _snd_ctl_elem_info_get_subdevice = _snd_ctl_elem_info_get_subdevice_ptr .asFunction<_dart_snd_ctl_elem_info_get_subdevice>(); ffi.Pointer snd_ctl_elem_info_get_name( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_name( obj, ); } late final _snd_ctl_elem_info_get_name_ptr = _lookup>( 'snd_ctl_elem_info_get_name'); late final _dart_snd_ctl_elem_info_get_name _snd_ctl_elem_info_get_name = _snd_ctl_elem_info_get_name_ptr .asFunction<_dart_snd_ctl_elem_info_get_name>(); int snd_ctl_elem_info_get_index( ffi.Pointer obj, ) { return _snd_ctl_elem_info_get_index( obj, ); } late final _snd_ctl_elem_info_get_index_ptr = _lookup>( 'snd_ctl_elem_info_get_index'); late final _dart_snd_ctl_elem_info_get_index _snd_ctl_elem_info_get_index = _snd_ctl_elem_info_get_index_ptr .asFunction<_dart_snd_ctl_elem_info_get_index>(); void snd_ctl_elem_info_set_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_info_set_id( obj, ptr, ); } late final _snd_ctl_elem_info_set_id_ptr = _lookup>( 'snd_ctl_elem_info_set_id'); late final _dart_snd_ctl_elem_info_set_id _snd_ctl_elem_info_set_id = _snd_ctl_elem_info_set_id_ptr .asFunction<_dart_snd_ctl_elem_info_set_id>(); void snd_ctl_elem_info_set_numid( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_numid( obj, val, ); } late final _snd_ctl_elem_info_set_numid_ptr = _lookup>( 'snd_ctl_elem_info_set_numid'); late final _dart_snd_ctl_elem_info_set_numid _snd_ctl_elem_info_set_numid = _snd_ctl_elem_info_set_numid_ptr .asFunction<_dart_snd_ctl_elem_info_set_numid>(); void snd_ctl_elem_info_set_interface( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_interface( obj, val, ); } late final _snd_ctl_elem_info_set_interface_ptr = _lookup>( 'snd_ctl_elem_info_set_interface'); late final _dart_snd_ctl_elem_info_set_interface _snd_ctl_elem_info_set_interface = _snd_ctl_elem_info_set_interface_ptr .asFunction<_dart_snd_ctl_elem_info_set_interface>(); void snd_ctl_elem_info_set_device( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_device( obj, val, ); } late final _snd_ctl_elem_info_set_device_ptr = _lookup>( 'snd_ctl_elem_info_set_device'); late final _dart_snd_ctl_elem_info_set_device _snd_ctl_elem_info_set_device = _snd_ctl_elem_info_set_device_ptr .asFunction<_dart_snd_ctl_elem_info_set_device>(); void snd_ctl_elem_info_set_subdevice( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_subdevice( obj, val, ); } late final _snd_ctl_elem_info_set_subdevice_ptr = _lookup>( 'snd_ctl_elem_info_set_subdevice'); late final _dart_snd_ctl_elem_info_set_subdevice _snd_ctl_elem_info_set_subdevice = _snd_ctl_elem_info_set_subdevice_ptr .asFunction<_dart_snd_ctl_elem_info_set_subdevice>(); void snd_ctl_elem_info_set_name( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_ctl_elem_info_set_name( obj, val, ); } late final _snd_ctl_elem_info_set_name_ptr = _lookup>( 'snd_ctl_elem_info_set_name'); late final _dart_snd_ctl_elem_info_set_name _snd_ctl_elem_info_set_name = _snd_ctl_elem_info_set_name_ptr .asFunction<_dart_snd_ctl_elem_info_set_name>(); void snd_ctl_elem_info_set_index( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_info_set_index( obj, val, ); } late final _snd_ctl_elem_info_set_index_ptr = _lookup>( 'snd_ctl_elem_info_set_index'); late final _dart_snd_ctl_elem_info_set_index _snd_ctl_elem_info_set_index = _snd_ctl_elem_info_set_index_ptr .asFunction<_dart_snd_ctl_elem_info_set_index>(); int snd_ctl_add_integer_elem_set( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int min, int max, int step, ) { return _snd_ctl_add_integer_elem_set( ctl, info, element_count, member_count, min, max, step, ); } late final _snd_ctl_add_integer_elem_set_ptr = _lookup>( 'snd_ctl_add_integer_elem_set'); late final _dart_snd_ctl_add_integer_elem_set _snd_ctl_add_integer_elem_set = _snd_ctl_add_integer_elem_set_ptr .asFunction<_dart_snd_ctl_add_integer_elem_set>(); int snd_ctl_add_integer64_elem_set( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int min, int max, int step, ) { return _snd_ctl_add_integer64_elem_set( ctl, info, element_count, member_count, min, max, step, ); } late final _snd_ctl_add_integer64_elem_set_ptr = _lookup>( 'snd_ctl_add_integer64_elem_set'); late final _dart_snd_ctl_add_integer64_elem_set _snd_ctl_add_integer64_elem_set = _snd_ctl_add_integer64_elem_set_ptr .asFunction<_dart_snd_ctl_add_integer64_elem_set>(); int snd_ctl_add_boolean_elem_set( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, ) { return _snd_ctl_add_boolean_elem_set( ctl, info, element_count, member_count, ); } late final _snd_ctl_add_boolean_elem_set_ptr = _lookup>( 'snd_ctl_add_boolean_elem_set'); late final _dart_snd_ctl_add_boolean_elem_set _snd_ctl_add_boolean_elem_set = _snd_ctl_add_boolean_elem_set_ptr .asFunction<_dart_snd_ctl_add_boolean_elem_set>(); int snd_ctl_add_enumerated_elem_set( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int items, ffi.Pointer> labels, ) { return _snd_ctl_add_enumerated_elem_set( ctl, info, element_count, member_count, items, labels, ); } late final _snd_ctl_add_enumerated_elem_set_ptr = _lookup>( 'snd_ctl_add_enumerated_elem_set'); late final _dart_snd_ctl_add_enumerated_elem_set _snd_ctl_add_enumerated_elem_set = _snd_ctl_add_enumerated_elem_set_ptr .asFunction<_dart_snd_ctl_add_enumerated_elem_set>(); int snd_ctl_add_bytes_elem_set( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, ) { return _snd_ctl_add_bytes_elem_set( ctl, info, element_count, member_count, ); } late final _snd_ctl_add_bytes_elem_set_ptr = _lookup>( 'snd_ctl_add_bytes_elem_set'); late final _dart_snd_ctl_add_bytes_elem_set _snd_ctl_add_bytes_elem_set = _snd_ctl_add_bytes_elem_set_ptr .asFunction<_dart_snd_ctl_add_bytes_elem_set>(); int snd_ctl_elem_add_integer( ffi.Pointer ctl, ffi.Pointer id, int count, int imin, int imax, int istep, ) { return _snd_ctl_elem_add_integer( ctl, id, count, imin, imax, istep, ); } late final _snd_ctl_elem_add_integer_ptr = _lookup>( 'snd_ctl_elem_add_integer'); late final _dart_snd_ctl_elem_add_integer _snd_ctl_elem_add_integer = _snd_ctl_elem_add_integer_ptr .asFunction<_dart_snd_ctl_elem_add_integer>(); int snd_ctl_elem_add_integer64( ffi.Pointer ctl, ffi.Pointer id, int count, int imin, int imax, int istep, ) { return _snd_ctl_elem_add_integer64( ctl, id, count, imin, imax, istep, ); } late final _snd_ctl_elem_add_integer64_ptr = _lookup>( 'snd_ctl_elem_add_integer64'); late final _dart_snd_ctl_elem_add_integer64 _snd_ctl_elem_add_integer64 = _snd_ctl_elem_add_integer64_ptr .asFunction<_dart_snd_ctl_elem_add_integer64>(); int snd_ctl_elem_add_boolean( ffi.Pointer ctl, ffi.Pointer id, int count, ) { return _snd_ctl_elem_add_boolean( ctl, id, count, ); } late final _snd_ctl_elem_add_boolean_ptr = _lookup>( 'snd_ctl_elem_add_boolean'); late final _dart_snd_ctl_elem_add_boolean _snd_ctl_elem_add_boolean = _snd_ctl_elem_add_boolean_ptr .asFunction<_dart_snd_ctl_elem_add_boolean>(); int snd_ctl_elem_add_enumerated( ffi.Pointer ctl, ffi.Pointer id, int count, int items, ffi.Pointer> names, ) { return _snd_ctl_elem_add_enumerated( ctl, id, count, items, names, ); } late final _snd_ctl_elem_add_enumerated_ptr = _lookup>( 'snd_ctl_elem_add_enumerated'); late final _dart_snd_ctl_elem_add_enumerated _snd_ctl_elem_add_enumerated = _snd_ctl_elem_add_enumerated_ptr .asFunction<_dart_snd_ctl_elem_add_enumerated>(); int snd_ctl_elem_add_iec958( ffi.Pointer ctl, ffi.Pointer id, ) { return _snd_ctl_elem_add_iec958( ctl, id, ); } late final _snd_ctl_elem_add_iec958_ptr = _lookup>( 'snd_ctl_elem_add_iec958'); late final _dart_snd_ctl_elem_add_iec958 _snd_ctl_elem_add_iec958 = _snd_ctl_elem_add_iec958_ptr.asFunction<_dart_snd_ctl_elem_add_iec958>(); int snd_ctl_elem_remove( ffi.Pointer ctl, ffi.Pointer id, ) { return _snd_ctl_elem_remove( ctl, id, ); } late final _snd_ctl_elem_remove_ptr = _lookup>( 'snd_ctl_elem_remove'); late final _dart_snd_ctl_elem_remove _snd_ctl_elem_remove = _snd_ctl_elem_remove_ptr.asFunction<_dart_snd_ctl_elem_remove>(); int snd_ctl_elem_value_sizeof() { return _snd_ctl_elem_value_sizeof(); } late final _snd_ctl_elem_value_sizeof_ptr = _lookup>( 'snd_ctl_elem_value_sizeof'); late final _dart_snd_ctl_elem_value_sizeof _snd_ctl_elem_value_sizeof = _snd_ctl_elem_value_sizeof_ptr .asFunction<_dart_snd_ctl_elem_value_sizeof>(); int snd_ctl_elem_value_malloc( ffi.Pointer> ptr, ) { return _snd_ctl_elem_value_malloc( ptr, ); } late final _snd_ctl_elem_value_malloc_ptr = _lookup>( 'snd_ctl_elem_value_malloc'); late final _dart_snd_ctl_elem_value_malloc _snd_ctl_elem_value_malloc = _snd_ctl_elem_value_malloc_ptr .asFunction<_dart_snd_ctl_elem_value_malloc>(); void snd_ctl_elem_value_free( ffi.Pointer obj, ) { return _snd_ctl_elem_value_free( obj, ); } late final _snd_ctl_elem_value_free_ptr = _lookup>( 'snd_ctl_elem_value_free'); late final _dart_snd_ctl_elem_value_free _snd_ctl_elem_value_free = _snd_ctl_elem_value_free_ptr.asFunction<_dart_snd_ctl_elem_value_free>(); void snd_ctl_elem_value_clear( ffi.Pointer obj, ) { return _snd_ctl_elem_value_clear( obj, ); } late final _snd_ctl_elem_value_clear_ptr = _lookup>( 'snd_ctl_elem_value_clear'); late final _dart_snd_ctl_elem_value_clear _snd_ctl_elem_value_clear = _snd_ctl_elem_value_clear_ptr .asFunction<_dart_snd_ctl_elem_value_clear>(); void snd_ctl_elem_value_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_ctl_elem_value_copy( dst, src, ); } late final _snd_ctl_elem_value_copy_ptr = _lookup>( 'snd_ctl_elem_value_copy'); late final _dart_snd_ctl_elem_value_copy _snd_ctl_elem_value_copy = _snd_ctl_elem_value_copy_ptr.asFunction<_dart_snd_ctl_elem_value_copy>(); int snd_ctl_elem_value_compare( ffi.Pointer left, ffi.Pointer right, ) { return _snd_ctl_elem_value_compare( left, right, ); } late final _snd_ctl_elem_value_compare_ptr = _lookup>( 'snd_ctl_elem_value_compare'); late final _dart_snd_ctl_elem_value_compare _snd_ctl_elem_value_compare = _snd_ctl_elem_value_compare_ptr .asFunction<_dart_snd_ctl_elem_value_compare>(); void snd_ctl_elem_value_get_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_value_get_id( obj, ptr, ); } late final _snd_ctl_elem_value_get_id_ptr = _lookup>( 'snd_ctl_elem_value_get_id'); late final _dart_snd_ctl_elem_value_get_id _snd_ctl_elem_value_get_id = _snd_ctl_elem_value_get_id_ptr .asFunction<_dart_snd_ctl_elem_value_get_id>(); int snd_ctl_elem_value_get_numid( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_numid( obj, ); } late final _snd_ctl_elem_value_get_numid_ptr = _lookup>( 'snd_ctl_elem_value_get_numid'); late final _dart_snd_ctl_elem_value_get_numid _snd_ctl_elem_value_get_numid = _snd_ctl_elem_value_get_numid_ptr .asFunction<_dart_snd_ctl_elem_value_get_numid>(); int snd_ctl_elem_value_get_interface( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_interface( obj, ); } late final _snd_ctl_elem_value_get_interface_ptr = _lookup>( 'snd_ctl_elem_value_get_interface'); late final _dart_snd_ctl_elem_value_get_interface _snd_ctl_elem_value_get_interface = _snd_ctl_elem_value_get_interface_ptr .asFunction<_dart_snd_ctl_elem_value_get_interface>(); int snd_ctl_elem_value_get_device( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_device( obj, ); } late final _snd_ctl_elem_value_get_device_ptr = _lookup>( 'snd_ctl_elem_value_get_device'); late final _dart_snd_ctl_elem_value_get_device _snd_ctl_elem_value_get_device = _snd_ctl_elem_value_get_device_ptr .asFunction<_dart_snd_ctl_elem_value_get_device>(); int snd_ctl_elem_value_get_subdevice( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_subdevice( obj, ); } late final _snd_ctl_elem_value_get_subdevice_ptr = _lookup>( 'snd_ctl_elem_value_get_subdevice'); late final _dart_snd_ctl_elem_value_get_subdevice _snd_ctl_elem_value_get_subdevice = _snd_ctl_elem_value_get_subdevice_ptr .asFunction<_dart_snd_ctl_elem_value_get_subdevice>(); ffi.Pointer snd_ctl_elem_value_get_name( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_name( obj, ); } late final _snd_ctl_elem_value_get_name_ptr = _lookup>( 'snd_ctl_elem_value_get_name'); late final _dart_snd_ctl_elem_value_get_name _snd_ctl_elem_value_get_name = _snd_ctl_elem_value_get_name_ptr .asFunction<_dart_snd_ctl_elem_value_get_name>(); int snd_ctl_elem_value_get_index( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_index( obj, ); } late final _snd_ctl_elem_value_get_index_ptr = _lookup>( 'snd_ctl_elem_value_get_index'); late final _dart_snd_ctl_elem_value_get_index _snd_ctl_elem_value_get_index = _snd_ctl_elem_value_get_index_ptr .asFunction<_dart_snd_ctl_elem_value_get_index>(); void snd_ctl_elem_value_set_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_value_set_id( obj, ptr, ); } late final _snd_ctl_elem_value_set_id_ptr = _lookup>( 'snd_ctl_elem_value_set_id'); late final _dart_snd_ctl_elem_value_set_id _snd_ctl_elem_value_set_id = _snd_ctl_elem_value_set_id_ptr .asFunction<_dart_snd_ctl_elem_value_set_id>(); void snd_ctl_elem_value_set_numid( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_value_set_numid( obj, val, ); } late final _snd_ctl_elem_value_set_numid_ptr = _lookup>( 'snd_ctl_elem_value_set_numid'); late final _dart_snd_ctl_elem_value_set_numid _snd_ctl_elem_value_set_numid = _snd_ctl_elem_value_set_numid_ptr .asFunction<_dart_snd_ctl_elem_value_set_numid>(); void snd_ctl_elem_value_set_interface( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_value_set_interface( obj, val, ); } late final _snd_ctl_elem_value_set_interface_ptr = _lookup>( 'snd_ctl_elem_value_set_interface'); late final _dart_snd_ctl_elem_value_set_interface _snd_ctl_elem_value_set_interface = _snd_ctl_elem_value_set_interface_ptr .asFunction<_dart_snd_ctl_elem_value_set_interface>(); void snd_ctl_elem_value_set_device( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_value_set_device( obj, val, ); } late final _snd_ctl_elem_value_set_device_ptr = _lookup>( 'snd_ctl_elem_value_set_device'); late final _dart_snd_ctl_elem_value_set_device _snd_ctl_elem_value_set_device = _snd_ctl_elem_value_set_device_ptr .asFunction<_dart_snd_ctl_elem_value_set_device>(); void snd_ctl_elem_value_set_subdevice( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_value_set_subdevice( obj, val, ); } late final _snd_ctl_elem_value_set_subdevice_ptr = _lookup>( 'snd_ctl_elem_value_set_subdevice'); late final _dart_snd_ctl_elem_value_set_subdevice _snd_ctl_elem_value_set_subdevice = _snd_ctl_elem_value_set_subdevice_ptr .asFunction<_dart_snd_ctl_elem_value_set_subdevice>(); void snd_ctl_elem_value_set_name( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_ctl_elem_value_set_name( obj, val, ); } late final _snd_ctl_elem_value_set_name_ptr = _lookup>( 'snd_ctl_elem_value_set_name'); late final _dart_snd_ctl_elem_value_set_name _snd_ctl_elem_value_set_name = _snd_ctl_elem_value_set_name_ptr .asFunction<_dart_snd_ctl_elem_value_set_name>(); void snd_ctl_elem_value_set_index( ffi.Pointer obj, int val, ) { return _snd_ctl_elem_value_set_index( obj, val, ); } late final _snd_ctl_elem_value_set_index_ptr = _lookup>( 'snd_ctl_elem_value_set_index'); late final _dart_snd_ctl_elem_value_set_index _snd_ctl_elem_value_set_index = _snd_ctl_elem_value_set_index_ptr .asFunction<_dart_snd_ctl_elem_value_set_index>(); int snd_ctl_elem_value_get_boolean( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_value_get_boolean( obj, idx, ); } late final _snd_ctl_elem_value_get_boolean_ptr = _lookup>( 'snd_ctl_elem_value_get_boolean'); late final _dart_snd_ctl_elem_value_get_boolean _snd_ctl_elem_value_get_boolean = _snd_ctl_elem_value_get_boolean_ptr .asFunction<_dart_snd_ctl_elem_value_get_boolean>(); int snd_ctl_elem_value_get_integer( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_value_get_integer( obj, idx, ); } late final _snd_ctl_elem_value_get_integer_ptr = _lookup>( 'snd_ctl_elem_value_get_integer'); late final _dart_snd_ctl_elem_value_get_integer _snd_ctl_elem_value_get_integer = _snd_ctl_elem_value_get_integer_ptr .asFunction<_dart_snd_ctl_elem_value_get_integer>(); int snd_ctl_elem_value_get_integer64( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_value_get_integer64( obj, idx, ); } late final _snd_ctl_elem_value_get_integer64_ptr = _lookup>( 'snd_ctl_elem_value_get_integer64'); late final _dart_snd_ctl_elem_value_get_integer64 _snd_ctl_elem_value_get_integer64 = _snd_ctl_elem_value_get_integer64_ptr .asFunction<_dart_snd_ctl_elem_value_get_integer64>(); int snd_ctl_elem_value_get_enumerated( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_value_get_enumerated( obj, idx, ); } late final _snd_ctl_elem_value_get_enumerated_ptr = _lookup>( 'snd_ctl_elem_value_get_enumerated'); late final _dart_snd_ctl_elem_value_get_enumerated _snd_ctl_elem_value_get_enumerated = _snd_ctl_elem_value_get_enumerated_ptr .asFunction<_dart_snd_ctl_elem_value_get_enumerated>(); int snd_ctl_elem_value_get_byte( ffi.Pointer obj, int idx, ) { return _snd_ctl_elem_value_get_byte( obj, idx, ); } late final _snd_ctl_elem_value_get_byte_ptr = _lookup>( 'snd_ctl_elem_value_get_byte'); late final _dart_snd_ctl_elem_value_get_byte _snd_ctl_elem_value_get_byte = _snd_ctl_elem_value_get_byte_ptr .asFunction<_dart_snd_ctl_elem_value_get_byte>(); void snd_ctl_elem_value_set_boolean( ffi.Pointer obj, int idx, int val, ) { return _snd_ctl_elem_value_set_boolean( obj, idx, val, ); } late final _snd_ctl_elem_value_set_boolean_ptr = _lookup>( 'snd_ctl_elem_value_set_boolean'); late final _dart_snd_ctl_elem_value_set_boolean _snd_ctl_elem_value_set_boolean = _snd_ctl_elem_value_set_boolean_ptr .asFunction<_dart_snd_ctl_elem_value_set_boolean>(); void snd_ctl_elem_value_set_integer( ffi.Pointer obj, int idx, int val, ) { return _snd_ctl_elem_value_set_integer( obj, idx, val, ); } late final _snd_ctl_elem_value_set_integer_ptr = _lookup>( 'snd_ctl_elem_value_set_integer'); late final _dart_snd_ctl_elem_value_set_integer _snd_ctl_elem_value_set_integer = _snd_ctl_elem_value_set_integer_ptr .asFunction<_dart_snd_ctl_elem_value_set_integer>(); void snd_ctl_elem_value_set_integer64( ffi.Pointer obj, int idx, int val, ) { return _snd_ctl_elem_value_set_integer64( obj, idx, val, ); } late final _snd_ctl_elem_value_set_integer64_ptr = _lookup>( 'snd_ctl_elem_value_set_integer64'); late final _dart_snd_ctl_elem_value_set_integer64 _snd_ctl_elem_value_set_integer64 = _snd_ctl_elem_value_set_integer64_ptr .asFunction<_dart_snd_ctl_elem_value_set_integer64>(); void snd_ctl_elem_value_set_enumerated( ffi.Pointer obj, int idx, int val, ) { return _snd_ctl_elem_value_set_enumerated( obj, idx, val, ); } late final _snd_ctl_elem_value_set_enumerated_ptr = _lookup>( 'snd_ctl_elem_value_set_enumerated'); late final _dart_snd_ctl_elem_value_set_enumerated _snd_ctl_elem_value_set_enumerated = _snd_ctl_elem_value_set_enumerated_ptr .asFunction<_dart_snd_ctl_elem_value_set_enumerated>(); void snd_ctl_elem_value_set_byte( ffi.Pointer obj, int idx, int val, ) { return _snd_ctl_elem_value_set_byte( obj, idx, val, ); } late final _snd_ctl_elem_value_set_byte_ptr = _lookup>( 'snd_ctl_elem_value_set_byte'); late final _dart_snd_ctl_elem_value_set_byte _snd_ctl_elem_value_set_byte = _snd_ctl_elem_value_set_byte_ptr .asFunction<_dart_snd_ctl_elem_value_set_byte>(); void snd_ctl_elem_set_bytes( ffi.Pointer obj, ffi.Pointer data, int size, ) { return _snd_ctl_elem_set_bytes( obj, data, size, ); } late final _snd_ctl_elem_set_bytes_ptr = _lookup>( 'snd_ctl_elem_set_bytes'); late final _dart_snd_ctl_elem_set_bytes _snd_ctl_elem_set_bytes = _snd_ctl_elem_set_bytes_ptr.asFunction<_dart_snd_ctl_elem_set_bytes>(); ffi.Pointer snd_ctl_elem_value_get_bytes( ffi.Pointer obj, ) { return _snd_ctl_elem_value_get_bytes( obj, ); } late final _snd_ctl_elem_value_get_bytes_ptr = _lookup>( 'snd_ctl_elem_value_get_bytes'); late final _dart_snd_ctl_elem_value_get_bytes _snd_ctl_elem_value_get_bytes = _snd_ctl_elem_value_get_bytes_ptr .asFunction<_dart_snd_ctl_elem_value_get_bytes>(); void snd_ctl_elem_value_get_iec958( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_value_get_iec958( obj, ptr, ); } late final _snd_ctl_elem_value_get_iec958_ptr = _lookup>( 'snd_ctl_elem_value_get_iec958'); late final _dart_snd_ctl_elem_value_get_iec958 _snd_ctl_elem_value_get_iec958 = _snd_ctl_elem_value_get_iec958_ptr .asFunction<_dart_snd_ctl_elem_value_get_iec958>(); void snd_ctl_elem_value_set_iec958( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_ctl_elem_value_set_iec958( obj, ptr, ); } late final _snd_ctl_elem_value_set_iec958_ptr = _lookup>( 'snd_ctl_elem_value_set_iec958'); late final _dart_snd_ctl_elem_value_set_iec958 _snd_ctl_elem_value_set_iec958 = _snd_ctl_elem_value_set_iec958_ptr .asFunction<_dart_snd_ctl_elem_value_set_iec958>(); int snd_tlv_parse_dB_info( ffi.Pointer tlv, int tlv_size, ffi.Pointer> db_tlvp, ) { return _snd_tlv_parse_dB_info( tlv, tlv_size, db_tlvp, ); } late final _snd_tlv_parse_dB_info_ptr = _lookup>( 'snd_tlv_parse_dB_info'); late final _dart_snd_tlv_parse_dB_info _snd_tlv_parse_dB_info = _snd_tlv_parse_dB_info_ptr.asFunction<_dart_snd_tlv_parse_dB_info>(); int snd_tlv_get_dB_range( ffi.Pointer tlv, int rangemin, int rangemax, ffi.Pointer min, ffi.Pointer max, ) { return _snd_tlv_get_dB_range( tlv, rangemin, rangemax, min, max, ); } late final _snd_tlv_get_dB_range_ptr = _lookup>( 'snd_tlv_get_dB_range'); late final _dart_snd_tlv_get_dB_range _snd_tlv_get_dB_range = _snd_tlv_get_dB_range_ptr.asFunction<_dart_snd_tlv_get_dB_range>(); int snd_tlv_convert_to_dB( ffi.Pointer tlv, int rangemin, int rangemax, int volume, ffi.Pointer db_gain, ) { return _snd_tlv_convert_to_dB( tlv, rangemin, rangemax, volume, db_gain, ); } late final _snd_tlv_convert_to_dB_ptr = _lookup>( 'snd_tlv_convert_to_dB'); late final _dart_snd_tlv_convert_to_dB _snd_tlv_convert_to_dB = _snd_tlv_convert_to_dB_ptr.asFunction<_dart_snd_tlv_convert_to_dB>(); int snd_tlv_convert_from_dB( ffi.Pointer tlv, int rangemin, int rangemax, int db_gain, ffi.Pointer value, int xdir, ) { return _snd_tlv_convert_from_dB( tlv, rangemin, rangemax, db_gain, value, xdir, ); } late final _snd_tlv_convert_from_dB_ptr = _lookup>( 'snd_tlv_convert_from_dB'); late final _dart_snd_tlv_convert_from_dB _snd_tlv_convert_from_dB = _snd_tlv_convert_from_dB_ptr.asFunction<_dart_snd_tlv_convert_from_dB>(); int snd_ctl_get_dB_range( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer min, ffi.Pointer max, ) { return _snd_ctl_get_dB_range( ctl, id, min, max, ); } late final _snd_ctl_get_dB_range_ptr = _lookup>( 'snd_ctl_get_dB_range'); late final _dart_snd_ctl_get_dB_range _snd_ctl_get_dB_range = _snd_ctl_get_dB_range_ptr.asFunction<_dart_snd_ctl_get_dB_range>(); int snd_ctl_convert_to_dB( ffi.Pointer ctl, ffi.Pointer id, int volume, ffi.Pointer db_gain, ) { return _snd_ctl_convert_to_dB( ctl, id, volume, db_gain, ); } late final _snd_ctl_convert_to_dB_ptr = _lookup>( 'snd_ctl_convert_to_dB'); late final _dart_snd_ctl_convert_to_dB _snd_ctl_convert_to_dB = _snd_ctl_convert_to_dB_ptr.asFunction<_dart_snd_ctl_convert_to_dB>(); int snd_ctl_convert_from_dB( ffi.Pointer ctl, ffi.Pointer id, int db_gain, ffi.Pointer value, int xdir, ) { return _snd_ctl_convert_from_dB( ctl, id, db_gain, value, xdir, ); } late final _snd_ctl_convert_from_dB_ptr = _lookup>( 'snd_ctl_convert_from_dB'); late final _dart_snd_ctl_convert_from_dB _snd_ctl_convert_from_dB = _snd_ctl_convert_from_dB_ptr.asFunction<_dart_snd_ctl_convert_from_dB>(); int snd_hctl_compare_fast( ffi.Pointer c1, ffi.Pointer c2, ) { return _snd_hctl_compare_fast( c1, c2, ); } late final _snd_hctl_compare_fast_ptr = _lookup>( 'snd_hctl_compare_fast'); late final _dart_snd_hctl_compare_fast _snd_hctl_compare_fast = _snd_hctl_compare_fast_ptr.asFunction<_dart_snd_hctl_compare_fast>(); int snd_hctl_open( ffi.Pointer> hctl, ffi.Pointer name, int mode, ) { return _snd_hctl_open( hctl, name, mode, ); } late final _snd_hctl_open_ptr = _lookup>('snd_hctl_open'); late final _dart_snd_hctl_open _snd_hctl_open = _snd_hctl_open_ptr.asFunction<_dart_snd_hctl_open>(); int snd_hctl_open_ctl( ffi.Pointer> hctlp, ffi.Pointer ctl, ) { return _snd_hctl_open_ctl( hctlp, ctl, ); } late final _snd_hctl_open_ctl_ptr = _lookup>('snd_hctl_open_ctl'); late final _dart_snd_hctl_open_ctl _snd_hctl_open_ctl = _snd_hctl_open_ctl_ptr.asFunction<_dart_snd_hctl_open_ctl>(); int snd_hctl_close( ffi.Pointer hctl, ) { return _snd_hctl_close( hctl, ); } late final _snd_hctl_close_ptr = _lookup>('snd_hctl_close'); late final _dart_snd_hctl_close _snd_hctl_close = _snd_hctl_close_ptr.asFunction<_dart_snd_hctl_close>(); int snd_hctl_nonblock( ffi.Pointer hctl, int nonblock, ) { return _snd_hctl_nonblock( hctl, nonblock, ); } late final _snd_hctl_nonblock_ptr = _lookup>('snd_hctl_nonblock'); late final _dart_snd_hctl_nonblock _snd_hctl_nonblock = _snd_hctl_nonblock_ptr.asFunction<_dart_snd_hctl_nonblock>(); int snd_hctl_poll_descriptors_count( ffi.Pointer hctl, ) { return _snd_hctl_poll_descriptors_count( hctl, ); } late final _snd_hctl_poll_descriptors_count_ptr = _lookup>( 'snd_hctl_poll_descriptors_count'); late final _dart_snd_hctl_poll_descriptors_count _snd_hctl_poll_descriptors_count = _snd_hctl_poll_descriptors_count_ptr .asFunction<_dart_snd_hctl_poll_descriptors_count>(); int snd_hctl_poll_descriptors( ffi.Pointer hctl, ffi.Pointer pfds, int space, ) { return _snd_hctl_poll_descriptors( hctl, pfds, space, ); } late final _snd_hctl_poll_descriptors_ptr = _lookup>( 'snd_hctl_poll_descriptors'); late final _dart_snd_hctl_poll_descriptors _snd_hctl_poll_descriptors = _snd_hctl_poll_descriptors_ptr .asFunction<_dart_snd_hctl_poll_descriptors>(); int snd_hctl_poll_descriptors_revents( ffi.Pointer ctl, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_hctl_poll_descriptors_revents( ctl, pfds, nfds, revents, ); } late final _snd_hctl_poll_descriptors_revents_ptr = _lookup>( 'snd_hctl_poll_descriptors_revents'); late final _dart_snd_hctl_poll_descriptors_revents _snd_hctl_poll_descriptors_revents = _snd_hctl_poll_descriptors_revents_ptr .asFunction<_dart_snd_hctl_poll_descriptors_revents>(); int snd_hctl_get_count( ffi.Pointer hctl, ) { return _snd_hctl_get_count( hctl, ); } late final _snd_hctl_get_count_ptr = _lookup>('snd_hctl_get_count'); late final _dart_snd_hctl_get_count _snd_hctl_get_count = _snd_hctl_get_count_ptr.asFunction<_dart_snd_hctl_get_count>(); int snd_hctl_set_compare( ffi.Pointer hctl, ffi.Pointer> hsort, ) { return _snd_hctl_set_compare( hctl, hsort, ); } late final _snd_hctl_set_compare_ptr = _lookup>( 'snd_hctl_set_compare'); late final _dart_snd_hctl_set_compare _snd_hctl_set_compare = _snd_hctl_set_compare_ptr.asFunction<_dart_snd_hctl_set_compare>(); ffi.Pointer snd_hctl_first_elem( ffi.Pointer hctl, ) { return _snd_hctl_first_elem( hctl, ); } late final _snd_hctl_first_elem_ptr = _lookup>( 'snd_hctl_first_elem'); late final _dart_snd_hctl_first_elem _snd_hctl_first_elem = _snd_hctl_first_elem_ptr.asFunction<_dart_snd_hctl_first_elem>(); ffi.Pointer snd_hctl_last_elem( ffi.Pointer hctl, ) { return _snd_hctl_last_elem( hctl, ); } late final _snd_hctl_last_elem_ptr = _lookup>('snd_hctl_last_elem'); late final _dart_snd_hctl_last_elem _snd_hctl_last_elem = _snd_hctl_last_elem_ptr.asFunction<_dart_snd_hctl_last_elem>(); ffi.Pointer snd_hctl_find_elem( ffi.Pointer hctl, ffi.Pointer id, ) { return _snd_hctl_find_elem( hctl, id, ); } late final _snd_hctl_find_elem_ptr = _lookup>('snd_hctl_find_elem'); late final _dart_snd_hctl_find_elem _snd_hctl_find_elem = _snd_hctl_find_elem_ptr.asFunction<_dart_snd_hctl_find_elem>(); void snd_hctl_set_callback( ffi.Pointer hctl, ffi.Pointer> callback, ) { return _snd_hctl_set_callback( hctl, callback, ); } late final _snd_hctl_set_callback_ptr = _lookup>( 'snd_hctl_set_callback'); late final _dart_snd_hctl_set_callback _snd_hctl_set_callback = _snd_hctl_set_callback_ptr.asFunction<_dart_snd_hctl_set_callback>(); void snd_hctl_set_callback_private( ffi.Pointer hctl, ffi.Pointer data, ) { return _snd_hctl_set_callback_private( hctl, data, ); } late final _snd_hctl_set_callback_private_ptr = _lookup>( 'snd_hctl_set_callback_private'); late final _dart_snd_hctl_set_callback_private _snd_hctl_set_callback_private = _snd_hctl_set_callback_private_ptr .asFunction<_dart_snd_hctl_set_callback_private>(); ffi.Pointer snd_hctl_get_callback_private( ffi.Pointer hctl, ) { return _snd_hctl_get_callback_private( hctl, ); } late final _snd_hctl_get_callback_private_ptr = _lookup>( 'snd_hctl_get_callback_private'); late final _dart_snd_hctl_get_callback_private _snd_hctl_get_callback_private = _snd_hctl_get_callback_private_ptr .asFunction<_dart_snd_hctl_get_callback_private>(); int snd_hctl_load( ffi.Pointer hctl, ) { return _snd_hctl_load( hctl, ); } late final _snd_hctl_load_ptr = _lookup>('snd_hctl_load'); late final _dart_snd_hctl_load _snd_hctl_load = _snd_hctl_load_ptr.asFunction<_dart_snd_hctl_load>(); int snd_hctl_free( ffi.Pointer hctl, ) { return _snd_hctl_free( hctl, ); } late final _snd_hctl_free_ptr = _lookup>('snd_hctl_free'); late final _dart_snd_hctl_free _snd_hctl_free = _snd_hctl_free_ptr.asFunction<_dart_snd_hctl_free>(); int snd_hctl_handle_events( ffi.Pointer hctl, ) { return _snd_hctl_handle_events( hctl, ); } late final _snd_hctl_handle_events_ptr = _lookup>( 'snd_hctl_handle_events'); late final _dart_snd_hctl_handle_events _snd_hctl_handle_events = _snd_hctl_handle_events_ptr.asFunction<_dart_snd_hctl_handle_events>(); ffi.Pointer snd_hctl_name( ffi.Pointer hctl, ) { return _snd_hctl_name( hctl, ); } late final _snd_hctl_name_ptr = _lookup>('snd_hctl_name'); late final _dart_snd_hctl_name _snd_hctl_name = _snd_hctl_name_ptr.asFunction<_dart_snd_hctl_name>(); int snd_hctl_wait( ffi.Pointer hctl, int timeout, ) { return _snd_hctl_wait( hctl, timeout, ); } late final _snd_hctl_wait_ptr = _lookup>('snd_hctl_wait'); late final _dart_snd_hctl_wait _snd_hctl_wait = _snd_hctl_wait_ptr.asFunction<_dart_snd_hctl_wait>(); ffi.Pointer snd_hctl_ctl( ffi.Pointer hctl, ) { return _snd_hctl_ctl( hctl, ); } late final _snd_hctl_ctl_ptr = _lookup>('snd_hctl_ctl'); late final _dart_snd_hctl_ctl _snd_hctl_ctl = _snd_hctl_ctl_ptr.asFunction<_dart_snd_hctl_ctl>(); ffi.Pointer snd_hctl_elem_next( ffi.Pointer elem, ) { return _snd_hctl_elem_next( elem, ); } late final _snd_hctl_elem_next_ptr = _lookup>('snd_hctl_elem_next'); late final _dart_snd_hctl_elem_next _snd_hctl_elem_next = _snd_hctl_elem_next_ptr.asFunction<_dart_snd_hctl_elem_next>(); ffi.Pointer snd_hctl_elem_prev( ffi.Pointer elem, ) { return _snd_hctl_elem_prev( elem, ); } late final _snd_hctl_elem_prev_ptr = _lookup>('snd_hctl_elem_prev'); late final _dart_snd_hctl_elem_prev _snd_hctl_elem_prev = _snd_hctl_elem_prev_ptr.asFunction<_dart_snd_hctl_elem_prev>(); int snd_hctl_elem_info( ffi.Pointer elem, ffi.Pointer info, ) { return _snd_hctl_elem_info( elem, info, ); } late final _snd_hctl_elem_info_ptr = _lookup>('snd_hctl_elem_info'); late final _dart_snd_hctl_elem_info _snd_hctl_elem_info = _snd_hctl_elem_info_ptr.asFunction<_dart_snd_hctl_elem_info>(); int snd_hctl_elem_read( ffi.Pointer elem, ffi.Pointer value, ) { return _snd_hctl_elem_read( elem, value, ); } late final _snd_hctl_elem_read_ptr = _lookup>('snd_hctl_elem_read'); late final _dart_snd_hctl_elem_read _snd_hctl_elem_read = _snd_hctl_elem_read_ptr.asFunction<_dart_snd_hctl_elem_read>(); int snd_hctl_elem_write( ffi.Pointer elem, ffi.Pointer value, ) { return _snd_hctl_elem_write( elem, value, ); } late final _snd_hctl_elem_write_ptr = _lookup>( 'snd_hctl_elem_write'); late final _dart_snd_hctl_elem_write _snd_hctl_elem_write = _snd_hctl_elem_write_ptr.asFunction<_dart_snd_hctl_elem_write>(); int snd_hctl_elem_tlv_read( ffi.Pointer elem, ffi.Pointer tlv, int tlv_size, ) { return _snd_hctl_elem_tlv_read( elem, tlv, tlv_size, ); } late final _snd_hctl_elem_tlv_read_ptr = _lookup>( 'snd_hctl_elem_tlv_read'); late final _dart_snd_hctl_elem_tlv_read _snd_hctl_elem_tlv_read = _snd_hctl_elem_tlv_read_ptr.asFunction<_dart_snd_hctl_elem_tlv_read>(); int snd_hctl_elem_tlv_write( ffi.Pointer elem, ffi.Pointer tlv, ) { return _snd_hctl_elem_tlv_write( elem, tlv, ); } late final _snd_hctl_elem_tlv_write_ptr = _lookup>( 'snd_hctl_elem_tlv_write'); late final _dart_snd_hctl_elem_tlv_write _snd_hctl_elem_tlv_write = _snd_hctl_elem_tlv_write_ptr.asFunction<_dart_snd_hctl_elem_tlv_write>(); int snd_hctl_elem_tlv_command( ffi.Pointer elem, ffi.Pointer tlv, ) { return _snd_hctl_elem_tlv_command( elem, tlv, ); } late final _snd_hctl_elem_tlv_command_ptr = _lookup>( 'snd_hctl_elem_tlv_command'); late final _dart_snd_hctl_elem_tlv_command _snd_hctl_elem_tlv_command = _snd_hctl_elem_tlv_command_ptr .asFunction<_dart_snd_hctl_elem_tlv_command>(); ffi.Pointer snd_hctl_elem_get_hctl( ffi.Pointer elem, ) { return _snd_hctl_elem_get_hctl( elem, ); } late final _snd_hctl_elem_get_hctl_ptr = _lookup>( 'snd_hctl_elem_get_hctl'); late final _dart_snd_hctl_elem_get_hctl _snd_hctl_elem_get_hctl = _snd_hctl_elem_get_hctl_ptr.asFunction<_dart_snd_hctl_elem_get_hctl>(); void snd_hctl_elem_get_id( ffi.Pointer obj, ffi.Pointer ptr, ) { return _snd_hctl_elem_get_id( obj, ptr, ); } late final _snd_hctl_elem_get_id_ptr = _lookup>( 'snd_hctl_elem_get_id'); late final _dart_snd_hctl_elem_get_id _snd_hctl_elem_get_id = _snd_hctl_elem_get_id_ptr.asFunction<_dart_snd_hctl_elem_get_id>(); int snd_hctl_elem_get_numid( ffi.Pointer obj, ) { return _snd_hctl_elem_get_numid( obj, ); } late final _snd_hctl_elem_get_numid_ptr = _lookup>( 'snd_hctl_elem_get_numid'); late final _dart_snd_hctl_elem_get_numid _snd_hctl_elem_get_numid = _snd_hctl_elem_get_numid_ptr.asFunction<_dart_snd_hctl_elem_get_numid>(); int snd_hctl_elem_get_interface( ffi.Pointer obj, ) { return _snd_hctl_elem_get_interface( obj, ); } late final _snd_hctl_elem_get_interface_ptr = _lookup>( 'snd_hctl_elem_get_interface'); late final _dart_snd_hctl_elem_get_interface _snd_hctl_elem_get_interface = _snd_hctl_elem_get_interface_ptr .asFunction<_dart_snd_hctl_elem_get_interface>(); int snd_hctl_elem_get_device( ffi.Pointer obj, ) { return _snd_hctl_elem_get_device( obj, ); } late final _snd_hctl_elem_get_device_ptr = _lookup>( 'snd_hctl_elem_get_device'); late final _dart_snd_hctl_elem_get_device _snd_hctl_elem_get_device = _snd_hctl_elem_get_device_ptr .asFunction<_dart_snd_hctl_elem_get_device>(); int snd_hctl_elem_get_subdevice( ffi.Pointer obj, ) { return _snd_hctl_elem_get_subdevice( obj, ); } late final _snd_hctl_elem_get_subdevice_ptr = _lookup>( 'snd_hctl_elem_get_subdevice'); late final _dart_snd_hctl_elem_get_subdevice _snd_hctl_elem_get_subdevice = _snd_hctl_elem_get_subdevice_ptr .asFunction<_dart_snd_hctl_elem_get_subdevice>(); ffi.Pointer snd_hctl_elem_get_name( ffi.Pointer obj, ) { return _snd_hctl_elem_get_name( obj, ); } late final _snd_hctl_elem_get_name_ptr = _lookup>( 'snd_hctl_elem_get_name'); late final _dart_snd_hctl_elem_get_name _snd_hctl_elem_get_name = _snd_hctl_elem_get_name_ptr.asFunction<_dart_snd_hctl_elem_get_name>(); int snd_hctl_elem_get_index( ffi.Pointer obj, ) { return _snd_hctl_elem_get_index( obj, ); } late final _snd_hctl_elem_get_index_ptr = _lookup>( 'snd_hctl_elem_get_index'); late final _dart_snd_hctl_elem_get_index _snd_hctl_elem_get_index = _snd_hctl_elem_get_index_ptr.asFunction<_dart_snd_hctl_elem_get_index>(); void snd_hctl_elem_set_callback( ffi.Pointer obj, ffi.Pointer> val, ) { return _snd_hctl_elem_set_callback( obj, val, ); } late final _snd_hctl_elem_set_callback_ptr = _lookup>( 'snd_hctl_elem_set_callback'); late final _dart_snd_hctl_elem_set_callback _snd_hctl_elem_set_callback = _snd_hctl_elem_set_callback_ptr .asFunction<_dart_snd_hctl_elem_set_callback>(); ffi.Pointer snd_hctl_elem_get_callback_private( ffi.Pointer obj, ) { return _snd_hctl_elem_get_callback_private( obj, ); } late final _snd_hctl_elem_get_callback_private_ptr = _lookup>( 'snd_hctl_elem_get_callback_private'); late final _dart_snd_hctl_elem_get_callback_private _snd_hctl_elem_get_callback_private = _snd_hctl_elem_get_callback_private_ptr .asFunction<_dart_snd_hctl_elem_get_callback_private>(); void snd_hctl_elem_set_callback_private( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_hctl_elem_set_callback_private( obj, val, ); } late final _snd_hctl_elem_set_callback_private_ptr = _lookup>( 'snd_hctl_elem_set_callback_private'); late final _dart_snd_hctl_elem_set_callback_private _snd_hctl_elem_set_callback_private = _snd_hctl_elem_set_callback_private_ptr .asFunction<_dart_snd_hctl_elem_set_callback_private>(); int snd_sctl_build( ffi.Pointer> ctl, ffi.Pointer handle, ffi.Pointer config, ffi.Pointer private_data, int mode, ) { return _snd_sctl_build( ctl, handle, config, private_data, mode, ); } late final _snd_sctl_build_ptr = _lookup>('snd_sctl_build'); late final _dart_snd_sctl_build _snd_sctl_build = _snd_sctl_build_ptr.asFunction<_dart_snd_sctl_build>(); int snd_sctl_free( ffi.Pointer handle, ) { return _snd_sctl_free( handle, ); } late final _snd_sctl_free_ptr = _lookup>('snd_sctl_free'); late final _dart_snd_sctl_free _snd_sctl_free = _snd_sctl_free_ptr.asFunction<_dart_snd_sctl_free>(); int snd_sctl_install( ffi.Pointer handle, ) { return _snd_sctl_install( handle, ); } late final _snd_sctl_install_ptr = _lookup>('snd_sctl_install'); late final _dart_snd_sctl_install _snd_sctl_install = _snd_sctl_install_ptr.asFunction<_dart_snd_sctl_install>(); int snd_sctl_remove( ffi.Pointer handle, ) { return _snd_sctl_remove( handle, ); } late final _snd_sctl_remove_ptr = _lookup>('snd_sctl_remove'); late final _dart_snd_sctl_remove _snd_sctl_remove = _snd_sctl_remove_ptr.asFunction<_dart_snd_sctl_remove>(); int snd_mixer_open( ffi.Pointer> mixer, int mode, ) { return _snd_mixer_open( mixer, mode, ); } late final _snd_mixer_open_ptr = _lookup>('snd_mixer_open'); late final _dart_snd_mixer_open _snd_mixer_open = _snd_mixer_open_ptr.asFunction<_dart_snd_mixer_open>(); int snd_mixer_close( ffi.Pointer mixer, ) { return _snd_mixer_close( mixer, ); } late final _snd_mixer_close_ptr = _lookup>('snd_mixer_close'); late final _dart_snd_mixer_close _snd_mixer_close = _snd_mixer_close_ptr.asFunction<_dart_snd_mixer_close>(); ffi.Pointer snd_mixer_first_elem( ffi.Pointer mixer, ) { return _snd_mixer_first_elem( mixer, ); } late final _snd_mixer_first_elem_ptr = _lookup>( 'snd_mixer_first_elem'); late final _dart_snd_mixer_first_elem _snd_mixer_first_elem = _snd_mixer_first_elem_ptr.asFunction<_dart_snd_mixer_first_elem>(); ffi.Pointer snd_mixer_last_elem( ffi.Pointer mixer, ) { return _snd_mixer_last_elem( mixer, ); } late final _snd_mixer_last_elem_ptr = _lookup>( 'snd_mixer_last_elem'); late final _dart_snd_mixer_last_elem _snd_mixer_last_elem = _snd_mixer_last_elem_ptr.asFunction<_dart_snd_mixer_last_elem>(); int snd_mixer_handle_events( ffi.Pointer mixer, ) { return _snd_mixer_handle_events( mixer, ); } late final _snd_mixer_handle_events_ptr = _lookup>( 'snd_mixer_handle_events'); late final _dart_snd_mixer_handle_events _snd_mixer_handle_events = _snd_mixer_handle_events_ptr.asFunction<_dart_snd_mixer_handle_events>(); int snd_mixer_attach( ffi.Pointer mixer, ffi.Pointer name, ) { return _snd_mixer_attach( mixer, name, ); } late final _snd_mixer_attach_ptr = _lookup>('snd_mixer_attach'); late final _dart_snd_mixer_attach _snd_mixer_attach = _snd_mixer_attach_ptr.asFunction<_dart_snd_mixer_attach>(); int snd_mixer_attach_hctl( ffi.Pointer mixer, ffi.Pointer hctl, ) { return _snd_mixer_attach_hctl( mixer, hctl, ); } late final _snd_mixer_attach_hctl_ptr = _lookup>( 'snd_mixer_attach_hctl'); late final _dart_snd_mixer_attach_hctl _snd_mixer_attach_hctl = _snd_mixer_attach_hctl_ptr.asFunction<_dart_snd_mixer_attach_hctl>(); int snd_mixer_detach( ffi.Pointer mixer, ffi.Pointer name, ) { return _snd_mixer_detach( mixer, name, ); } late final _snd_mixer_detach_ptr = _lookup>('snd_mixer_detach'); late final _dart_snd_mixer_detach _snd_mixer_detach = _snd_mixer_detach_ptr.asFunction<_dart_snd_mixer_detach>(); int snd_mixer_detach_hctl( ffi.Pointer mixer, ffi.Pointer hctl, ) { return _snd_mixer_detach_hctl( mixer, hctl, ); } late final _snd_mixer_detach_hctl_ptr = _lookup>( 'snd_mixer_detach_hctl'); late final _dart_snd_mixer_detach_hctl _snd_mixer_detach_hctl = _snd_mixer_detach_hctl_ptr.asFunction<_dart_snd_mixer_detach_hctl>(); int snd_mixer_get_hctl( ffi.Pointer mixer, ffi.Pointer name, ffi.Pointer> hctl, ) { return _snd_mixer_get_hctl( mixer, name, hctl, ); } late final _snd_mixer_get_hctl_ptr = _lookup>('snd_mixer_get_hctl'); late final _dart_snd_mixer_get_hctl _snd_mixer_get_hctl = _snd_mixer_get_hctl_ptr.asFunction<_dart_snd_mixer_get_hctl>(); int snd_mixer_poll_descriptors_count( ffi.Pointer mixer, ) { return _snd_mixer_poll_descriptors_count( mixer, ); } late final _snd_mixer_poll_descriptors_count_ptr = _lookup>( 'snd_mixer_poll_descriptors_count'); late final _dart_snd_mixer_poll_descriptors_count _snd_mixer_poll_descriptors_count = _snd_mixer_poll_descriptors_count_ptr .asFunction<_dart_snd_mixer_poll_descriptors_count>(); int snd_mixer_poll_descriptors( ffi.Pointer mixer, ffi.Pointer pfds, int space, ) { return _snd_mixer_poll_descriptors( mixer, pfds, space, ); } late final _snd_mixer_poll_descriptors_ptr = _lookup>( 'snd_mixer_poll_descriptors'); late final _dart_snd_mixer_poll_descriptors _snd_mixer_poll_descriptors = _snd_mixer_poll_descriptors_ptr .asFunction<_dart_snd_mixer_poll_descriptors>(); int snd_mixer_poll_descriptors_revents( ffi.Pointer mixer, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_mixer_poll_descriptors_revents( mixer, pfds, nfds, revents, ); } late final _snd_mixer_poll_descriptors_revents_ptr = _lookup>( 'snd_mixer_poll_descriptors_revents'); late final _dart_snd_mixer_poll_descriptors_revents _snd_mixer_poll_descriptors_revents = _snd_mixer_poll_descriptors_revents_ptr .asFunction<_dart_snd_mixer_poll_descriptors_revents>(); int snd_mixer_load( ffi.Pointer mixer, ) { return _snd_mixer_load( mixer, ); } late final _snd_mixer_load_ptr = _lookup>('snd_mixer_load'); late final _dart_snd_mixer_load _snd_mixer_load = _snd_mixer_load_ptr.asFunction<_dart_snd_mixer_load>(); void snd_mixer_free( ffi.Pointer mixer, ) { return _snd_mixer_free( mixer, ); } late final _snd_mixer_free_ptr = _lookup>('snd_mixer_free'); late final _dart_snd_mixer_free _snd_mixer_free = _snd_mixer_free_ptr.asFunction<_dart_snd_mixer_free>(); int snd_mixer_wait( ffi.Pointer mixer, int timeout, ) { return _snd_mixer_wait( mixer, timeout, ); } late final _snd_mixer_wait_ptr = _lookup>('snd_mixer_wait'); late final _dart_snd_mixer_wait _snd_mixer_wait = _snd_mixer_wait_ptr.asFunction<_dart_snd_mixer_wait>(); int snd_mixer_set_compare( ffi.Pointer mixer, ffi.Pointer> msort, ) { return _snd_mixer_set_compare( mixer, msort, ); } late final _snd_mixer_set_compare_ptr = _lookup>( 'snd_mixer_set_compare'); late final _dart_snd_mixer_set_compare _snd_mixer_set_compare = _snd_mixer_set_compare_ptr.asFunction<_dart_snd_mixer_set_compare>(); void snd_mixer_set_callback( ffi.Pointer obj, ffi.Pointer> val, ) { return _snd_mixer_set_callback( obj, val, ); } late final _snd_mixer_set_callback_ptr = _lookup>( 'snd_mixer_set_callback'); late final _dart_snd_mixer_set_callback _snd_mixer_set_callback = _snd_mixer_set_callback_ptr.asFunction<_dart_snd_mixer_set_callback>(); ffi.Pointer snd_mixer_get_callback_private( ffi.Pointer obj, ) { return _snd_mixer_get_callback_private( obj, ); } late final _snd_mixer_get_callback_private_ptr = _lookup>( 'snd_mixer_get_callback_private'); late final _dart_snd_mixer_get_callback_private _snd_mixer_get_callback_private = _snd_mixer_get_callback_private_ptr .asFunction<_dart_snd_mixer_get_callback_private>(); void snd_mixer_set_callback_private( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_mixer_set_callback_private( obj, val, ); } late final _snd_mixer_set_callback_private_ptr = _lookup>( 'snd_mixer_set_callback_private'); late final _dart_snd_mixer_set_callback_private _snd_mixer_set_callback_private = _snd_mixer_set_callback_private_ptr .asFunction<_dart_snd_mixer_set_callback_private>(); int snd_mixer_get_count( ffi.Pointer obj, ) { return _snd_mixer_get_count( obj, ); } late final _snd_mixer_get_count_ptr = _lookup>( 'snd_mixer_get_count'); late final _dart_snd_mixer_get_count _snd_mixer_get_count = _snd_mixer_get_count_ptr.asFunction<_dart_snd_mixer_get_count>(); int snd_mixer_class_unregister( ffi.Pointer clss, ) { return _snd_mixer_class_unregister( clss, ); } late final _snd_mixer_class_unregister_ptr = _lookup>( 'snd_mixer_class_unregister'); late final _dart_snd_mixer_class_unregister _snd_mixer_class_unregister = _snd_mixer_class_unregister_ptr .asFunction<_dart_snd_mixer_class_unregister>(); ffi.Pointer snd_mixer_elem_next( ffi.Pointer elem, ) { return _snd_mixer_elem_next( elem, ); } late final _snd_mixer_elem_next_ptr = _lookup>( 'snd_mixer_elem_next'); late final _dart_snd_mixer_elem_next _snd_mixer_elem_next = _snd_mixer_elem_next_ptr.asFunction<_dart_snd_mixer_elem_next>(); ffi.Pointer snd_mixer_elem_prev( ffi.Pointer elem, ) { return _snd_mixer_elem_prev( elem, ); } late final _snd_mixer_elem_prev_ptr = _lookup>( 'snd_mixer_elem_prev'); late final _dart_snd_mixer_elem_prev _snd_mixer_elem_prev = _snd_mixer_elem_prev_ptr.asFunction<_dart_snd_mixer_elem_prev>(); void snd_mixer_elem_set_callback( ffi.Pointer obj, ffi.Pointer> val, ) { return _snd_mixer_elem_set_callback( obj, val, ); } late final _snd_mixer_elem_set_callback_ptr = _lookup>( 'snd_mixer_elem_set_callback'); late final _dart_snd_mixer_elem_set_callback _snd_mixer_elem_set_callback = _snd_mixer_elem_set_callback_ptr .asFunction<_dart_snd_mixer_elem_set_callback>(); ffi.Pointer snd_mixer_elem_get_callback_private( ffi.Pointer obj, ) { return _snd_mixer_elem_get_callback_private( obj, ); } late final _snd_mixer_elem_get_callback_private_ptr = _lookup>( 'snd_mixer_elem_get_callback_private'); late final _dart_snd_mixer_elem_get_callback_private _snd_mixer_elem_get_callback_private = _snd_mixer_elem_get_callback_private_ptr .asFunction<_dart_snd_mixer_elem_get_callback_private>(); void snd_mixer_elem_set_callback_private( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_mixer_elem_set_callback_private( obj, val, ); } late final _snd_mixer_elem_set_callback_private_ptr = _lookup>( 'snd_mixer_elem_set_callback_private'); late final _dart_snd_mixer_elem_set_callback_private _snd_mixer_elem_set_callback_private = _snd_mixer_elem_set_callback_private_ptr .asFunction<_dart_snd_mixer_elem_set_callback_private>(); int snd_mixer_elem_get_type( ffi.Pointer obj, ) { return _snd_mixer_elem_get_type( obj, ); } late final _snd_mixer_elem_get_type_ptr = _lookup>( 'snd_mixer_elem_get_type'); late final _dart_snd_mixer_elem_get_type _snd_mixer_elem_get_type = _snd_mixer_elem_get_type_ptr.asFunction<_dart_snd_mixer_elem_get_type>(); int snd_mixer_class_register( ffi.Pointer class_, ffi.Pointer mixer, ) { return _snd_mixer_class_register( class_, mixer, ); } late final _snd_mixer_class_register_ptr = _lookup>( 'snd_mixer_class_register'); late final _dart_snd_mixer_class_register _snd_mixer_class_register = _snd_mixer_class_register_ptr .asFunction<_dart_snd_mixer_class_register>(); int snd_mixer_elem_new( ffi.Pointer> elem, int type, int compare_weight, ffi.Pointer private_data, ffi.Pointer> private_free, ) { return _snd_mixer_elem_new( elem, type, compare_weight, private_data, private_free, ); } late final _snd_mixer_elem_new_ptr = _lookup>('snd_mixer_elem_new'); late final _dart_snd_mixer_elem_new _snd_mixer_elem_new = _snd_mixer_elem_new_ptr.asFunction<_dart_snd_mixer_elem_new>(); int snd_mixer_elem_add( ffi.Pointer elem, ffi.Pointer class_, ) { return _snd_mixer_elem_add( elem, class_, ); } late final _snd_mixer_elem_add_ptr = _lookup>('snd_mixer_elem_add'); late final _dart_snd_mixer_elem_add _snd_mixer_elem_add = _snd_mixer_elem_add_ptr.asFunction<_dart_snd_mixer_elem_add>(); int snd_mixer_elem_remove( ffi.Pointer elem, ) { return _snd_mixer_elem_remove( elem, ); } late final _snd_mixer_elem_remove_ptr = _lookup>( 'snd_mixer_elem_remove'); late final _dart_snd_mixer_elem_remove _snd_mixer_elem_remove = _snd_mixer_elem_remove_ptr.asFunction<_dart_snd_mixer_elem_remove>(); void snd_mixer_elem_free( ffi.Pointer elem, ) { return _snd_mixer_elem_free( elem, ); } late final _snd_mixer_elem_free_ptr = _lookup>( 'snd_mixer_elem_free'); late final _dart_snd_mixer_elem_free _snd_mixer_elem_free = _snd_mixer_elem_free_ptr.asFunction<_dart_snd_mixer_elem_free>(); int snd_mixer_elem_info( ffi.Pointer elem, ) { return _snd_mixer_elem_info( elem, ); } late final _snd_mixer_elem_info_ptr = _lookup>( 'snd_mixer_elem_info'); late final _dart_snd_mixer_elem_info _snd_mixer_elem_info = _snd_mixer_elem_info_ptr.asFunction<_dart_snd_mixer_elem_info>(); int snd_mixer_elem_value( ffi.Pointer elem, ) { return _snd_mixer_elem_value( elem, ); } late final _snd_mixer_elem_value_ptr = _lookup>( 'snd_mixer_elem_value'); late final _dart_snd_mixer_elem_value _snd_mixer_elem_value = _snd_mixer_elem_value_ptr.asFunction<_dart_snd_mixer_elem_value>(); int snd_mixer_elem_attach( ffi.Pointer melem, ffi.Pointer helem, ) { return _snd_mixer_elem_attach( melem, helem, ); } late final _snd_mixer_elem_attach_ptr = _lookup>( 'snd_mixer_elem_attach'); late final _dart_snd_mixer_elem_attach _snd_mixer_elem_attach = _snd_mixer_elem_attach_ptr.asFunction<_dart_snd_mixer_elem_attach>(); int snd_mixer_elem_detach( ffi.Pointer melem, ffi.Pointer helem, ) { return _snd_mixer_elem_detach( melem, helem, ); } late final _snd_mixer_elem_detach_ptr = _lookup>( 'snd_mixer_elem_detach'); late final _dart_snd_mixer_elem_detach _snd_mixer_elem_detach = _snd_mixer_elem_detach_ptr.asFunction<_dart_snd_mixer_elem_detach>(); int snd_mixer_elem_empty( ffi.Pointer melem, ) { return _snd_mixer_elem_empty( melem, ); } late final _snd_mixer_elem_empty_ptr = _lookup>( 'snd_mixer_elem_empty'); late final _dart_snd_mixer_elem_empty _snd_mixer_elem_empty = _snd_mixer_elem_empty_ptr.asFunction<_dart_snd_mixer_elem_empty>(); ffi.Pointer snd_mixer_elem_get_private( ffi.Pointer melem, ) { return _snd_mixer_elem_get_private( melem, ); } late final _snd_mixer_elem_get_private_ptr = _lookup>( 'snd_mixer_elem_get_private'); late final _dart_snd_mixer_elem_get_private _snd_mixer_elem_get_private = _snd_mixer_elem_get_private_ptr .asFunction<_dart_snd_mixer_elem_get_private>(); int snd_mixer_class_sizeof() { return _snd_mixer_class_sizeof(); } late final _snd_mixer_class_sizeof_ptr = _lookup>( 'snd_mixer_class_sizeof'); late final _dart_snd_mixer_class_sizeof _snd_mixer_class_sizeof = _snd_mixer_class_sizeof_ptr.asFunction<_dart_snd_mixer_class_sizeof>(); int snd_mixer_class_malloc( ffi.Pointer> ptr, ) { return _snd_mixer_class_malloc( ptr, ); } late final _snd_mixer_class_malloc_ptr = _lookup>( 'snd_mixer_class_malloc'); late final _dart_snd_mixer_class_malloc _snd_mixer_class_malloc = _snd_mixer_class_malloc_ptr.asFunction<_dart_snd_mixer_class_malloc>(); void snd_mixer_class_free( ffi.Pointer obj, ) { return _snd_mixer_class_free( obj, ); } late final _snd_mixer_class_free_ptr = _lookup>( 'snd_mixer_class_free'); late final _dart_snd_mixer_class_free _snd_mixer_class_free = _snd_mixer_class_free_ptr.asFunction<_dart_snd_mixer_class_free>(); void snd_mixer_class_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_mixer_class_copy( dst, src, ); } late final _snd_mixer_class_copy_ptr = _lookup>( 'snd_mixer_class_copy'); late final _dart_snd_mixer_class_copy _snd_mixer_class_copy = _snd_mixer_class_copy_ptr.asFunction<_dart_snd_mixer_class_copy>(); ffi.Pointer snd_mixer_class_get_mixer( ffi.Pointer class_, ) { return _snd_mixer_class_get_mixer( class_, ); } late final _snd_mixer_class_get_mixer_ptr = _lookup>( 'snd_mixer_class_get_mixer'); late final _dart_snd_mixer_class_get_mixer _snd_mixer_class_get_mixer = _snd_mixer_class_get_mixer_ptr .asFunction<_dart_snd_mixer_class_get_mixer>(); ffi.Pointer> snd_mixer_class_get_event( ffi.Pointer class_, ) { return _snd_mixer_class_get_event( class_, ); } late final _snd_mixer_class_get_event_ptr = _lookup>( 'snd_mixer_class_get_event'); late final _dart_snd_mixer_class_get_event _snd_mixer_class_get_event = _snd_mixer_class_get_event_ptr .asFunction<_dart_snd_mixer_class_get_event>(); ffi.Pointer snd_mixer_class_get_private( ffi.Pointer class_, ) { return _snd_mixer_class_get_private( class_, ); } late final _snd_mixer_class_get_private_ptr = _lookup>( 'snd_mixer_class_get_private'); late final _dart_snd_mixer_class_get_private _snd_mixer_class_get_private = _snd_mixer_class_get_private_ptr .asFunction<_dart_snd_mixer_class_get_private>(); ffi.Pointer> snd_mixer_class_get_compare( ffi.Pointer class_, ) { return _snd_mixer_class_get_compare( class_, ); } late final _snd_mixer_class_get_compare_ptr = _lookup>( 'snd_mixer_class_get_compare'); late final _dart_snd_mixer_class_get_compare _snd_mixer_class_get_compare = _snd_mixer_class_get_compare_ptr .asFunction<_dart_snd_mixer_class_get_compare>(); int snd_mixer_class_set_event( ffi.Pointer class_, ffi.Pointer> event, ) { return _snd_mixer_class_set_event( class_, event, ); } late final _snd_mixer_class_set_event_ptr = _lookup>( 'snd_mixer_class_set_event'); late final _dart_snd_mixer_class_set_event _snd_mixer_class_set_event = _snd_mixer_class_set_event_ptr .asFunction<_dart_snd_mixer_class_set_event>(); int snd_mixer_class_set_private( ffi.Pointer class_, ffi.Pointer private_data, ) { return _snd_mixer_class_set_private( class_, private_data, ); } late final _snd_mixer_class_set_private_ptr = _lookup>( 'snd_mixer_class_set_private'); late final _dart_snd_mixer_class_set_private _snd_mixer_class_set_private = _snd_mixer_class_set_private_ptr .asFunction<_dart_snd_mixer_class_set_private>(); int snd_mixer_class_set_private_free( ffi.Pointer class_, ffi.Pointer> private_free, ) { return _snd_mixer_class_set_private_free( class_, private_free, ); } late final _snd_mixer_class_set_private_free_ptr = _lookup>( 'snd_mixer_class_set_private_free'); late final _dart_snd_mixer_class_set_private_free _snd_mixer_class_set_private_free = _snd_mixer_class_set_private_free_ptr .asFunction<_dart_snd_mixer_class_set_private_free>(); int snd_mixer_class_set_compare( ffi.Pointer class_, ffi.Pointer> compare, ) { return _snd_mixer_class_set_compare( class_, compare, ); } late final _snd_mixer_class_set_compare_ptr = _lookup>( 'snd_mixer_class_set_compare'); late final _dart_snd_mixer_class_set_compare _snd_mixer_class_set_compare = _snd_mixer_class_set_compare_ptr .asFunction<_dart_snd_mixer_class_set_compare>(); ffi.Pointer snd_mixer_selem_channel_name( int channel, ) { return _snd_mixer_selem_channel_name( channel, ); } late final _snd_mixer_selem_channel_name_ptr = _lookup>( 'snd_mixer_selem_channel_name'); late final _dart_snd_mixer_selem_channel_name _snd_mixer_selem_channel_name = _snd_mixer_selem_channel_name_ptr .asFunction<_dart_snd_mixer_selem_channel_name>(); int snd_mixer_selem_register( ffi.Pointer mixer, ffi.Pointer options, ffi.Pointer> classp, ) { return _snd_mixer_selem_register( mixer, options, classp, ); } late final _snd_mixer_selem_register_ptr = _lookup>( 'snd_mixer_selem_register'); late final _dart_snd_mixer_selem_register _snd_mixer_selem_register = _snd_mixer_selem_register_ptr .asFunction<_dart_snd_mixer_selem_register>(); void snd_mixer_selem_get_id( ffi.Pointer element, ffi.Pointer id, ) { return _snd_mixer_selem_get_id( element, id, ); } late final _snd_mixer_selem_get_id_ptr = _lookup>( 'snd_mixer_selem_get_id'); late final _dart_snd_mixer_selem_get_id _snd_mixer_selem_get_id = _snd_mixer_selem_get_id_ptr.asFunction<_dart_snd_mixer_selem_get_id>(); ffi.Pointer snd_mixer_selem_get_name( ffi.Pointer elem, ) { return _snd_mixer_selem_get_name( elem, ); } late final _snd_mixer_selem_get_name_ptr = _lookup>( 'snd_mixer_selem_get_name'); late final _dart_snd_mixer_selem_get_name _snd_mixer_selem_get_name = _snd_mixer_selem_get_name_ptr .asFunction<_dart_snd_mixer_selem_get_name>(); int snd_mixer_selem_get_index( ffi.Pointer elem, ) { return _snd_mixer_selem_get_index( elem, ); } late final _snd_mixer_selem_get_index_ptr = _lookup>( 'snd_mixer_selem_get_index'); late final _dart_snd_mixer_selem_get_index _snd_mixer_selem_get_index = _snd_mixer_selem_get_index_ptr .asFunction<_dart_snd_mixer_selem_get_index>(); ffi.Pointer snd_mixer_find_selem( ffi.Pointer mixer, ffi.Pointer id, ) { return _snd_mixer_find_selem( mixer, id, ); } late final _snd_mixer_find_selem_ptr = _lookup>( 'snd_mixer_find_selem'); late final _dart_snd_mixer_find_selem _snd_mixer_find_selem = _snd_mixer_find_selem_ptr.asFunction<_dart_snd_mixer_find_selem>(); int snd_mixer_selem_is_active( ffi.Pointer elem, ) { return _snd_mixer_selem_is_active( elem, ); } late final _snd_mixer_selem_is_active_ptr = _lookup>( 'snd_mixer_selem_is_active'); late final _dart_snd_mixer_selem_is_active _snd_mixer_selem_is_active = _snd_mixer_selem_is_active_ptr .asFunction<_dart_snd_mixer_selem_is_active>(); int snd_mixer_selem_is_playback_mono( ffi.Pointer elem, ) { return _snd_mixer_selem_is_playback_mono( elem, ); } late final _snd_mixer_selem_is_playback_mono_ptr = _lookup>( 'snd_mixer_selem_is_playback_mono'); late final _dart_snd_mixer_selem_is_playback_mono _snd_mixer_selem_is_playback_mono = _snd_mixer_selem_is_playback_mono_ptr .asFunction<_dart_snd_mixer_selem_is_playback_mono>(); int snd_mixer_selem_has_playback_channel( ffi.Pointer obj, int channel, ) { return _snd_mixer_selem_has_playback_channel( obj, channel, ); } late final _snd_mixer_selem_has_playback_channel_ptr = _lookup>( 'snd_mixer_selem_has_playback_channel'); late final _dart_snd_mixer_selem_has_playback_channel _snd_mixer_selem_has_playback_channel = _snd_mixer_selem_has_playback_channel_ptr .asFunction<_dart_snd_mixer_selem_has_playback_channel>(); int snd_mixer_selem_is_capture_mono( ffi.Pointer elem, ) { return _snd_mixer_selem_is_capture_mono( elem, ); } late final _snd_mixer_selem_is_capture_mono_ptr = _lookup>( 'snd_mixer_selem_is_capture_mono'); late final _dart_snd_mixer_selem_is_capture_mono _snd_mixer_selem_is_capture_mono = _snd_mixer_selem_is_capture_mono_ptr .asFunction<_dart_snd_mixer_selem_is_capture_mono>(); int snd_mixer_selem_has_capture_channel( ffi.Pointer obj, int channel, ) { return _snd_mixer_selem_has_capture_channel( obj, channel, ); } late final _snd_mixer_selem_has_capture_channel_ptr = _lookup>( 'snd_mixer_selem_has_capture_channel'); late final _dart_snd_mixer_selem_has_capture_channel _snd_mixer_selem_has_capture_channel = _snd_mixer_selem_has_capture_channel_ptr .asFunction<_dart_snd_mixer_selem_has_capture_channel>(); int snd_mixer_selem_get_capture_group( ffi.Pointer elem, ) { return _snd_mixer_selem_get_capture_group( elem, ); } late final _snd_mixer_selem_get_capture_group_ptr = _lookup>( 'snd_mixer_selem_get_capture_group'); late final _dart_snd_mixer_selem_get_capture_group _snd_mixer_selem_get_capture_group = _snd_mixer_selem_get_capture_group_ptr .asFunction<_dart_snd_mixer_selem_get_capture_group>(); int snd_mixer_selem_has_common_volume( ffi.Pointer elem, ) { return _snd_mixer_selem_has_common_volume( elem, ); } late final _snd_mixer_selem_has_common_volume_ptr = _lookup>( 'snd_mixer_selem_has_common_volume'); late final _dart_snd_mixer_selem_has_common_volume _snd_mixer_selem_has_common_volume = _snd_mixer_selem_has_common_volume_ptr .asFunction<_dart_snd_mixer_selem_has_common_volume>(); int snd_mixer_selem_has_playback_volume( ffi.Pointer elem, ) { return _snd_mixer_selem_has_playback_volume( elem, ); } late final _snd_mixer_selem_has_playback_volume_ptr = _lookup>( 'snd_mixer_selem_has_playback_volume'); late final _dart_snd_mixer_selem_has_playback_volume _snd_mixer_selem_has_playback_volume = _snd_mixer_selem_has_playback_volume_ptr .asFunction<_dart_snd_mixer_selem_has_playback_volume>(); int snd_mixer_selem_has_playback_volume_joined( ffi.Pointer elem, ) { return _snd_mixer_selem_has_playback_volume_joined( elem, ); } late final _snd_mixer_selem_has_playback_volume_joined_ptr = _lookup< ffi.NativeFunction<_c_snd_mixer_selem_has_playback_volume_joined>>( 'snd_mixer_selem_has_playback_volume_joined'); late final _dart_snd_mixer_selem_has_playback_volume_joined _snd_mixer_selem_has_playback_volume_joined = _snd_mixer_selem_has_playback_volume_joined_ptr .asFunction<_dart_snd_mixer_selem_has_playback_volume_joined>(); int snd_mixer_selem_has_capture_volume( ffi.Pointer elem, ) { return _snd_mixer_selem_has_capture_volume( elem, ); } late final _snd_mixer_selem_has_capture_volume_ptr = _lookup>( 'snd_mixer_selem_has_capture_volume'); late final _dart_snd_mixer_selem_has_capture_volume _snd_mixer_selem_has_capture_volume = _snd_mixer_selem_has_capture_volume_ptr .asFunction<_dart_snd_mixer_selem_has_capture_volume>(); int snd_mixer_selem_has_capture_volume_joined( ffi.Pointer elem, ) { return _snd_mixer_selem_has_capture_volume_joined( elem, ); } late final _snd_mixer_selem_has_capture_volume_joined_ptr = _lookup>( 'snd_mixer_selem_has_capture_volume_joined'); late final _dart_snd_mixer_selem_has_capture_volume_joined _snd_mixer_selem_has_capture_volume_joined = _snd_mixer_selem_has_capture_volume_joined_ptr .asFunction<_dart_snd_mixer_selem_has_capture_volume_joined>(); int snd_mixer_selem_has_common_switch( ffi.Pointer elem, ) { return _snd_mixer_selem_has_common_switch( elem, ); } late final _snd_mixer_selem_has_common_switch_ptr = _lookup>( 'snd_mixer_selem_has_common_switch'); late final _dart_snd_mixer_selem_has_common_switch _snd_mixer_selem_has_common_switch = _snd_mixer_selem_has_common_switch_ptr .asFunction<_dart_snd_mixer_selem_has_common_switch>(); int snd_mixer_selem_has_playback_switch( ffi.Pointer elem, ) { return _snd_mixer_selem_has_playback_switch( elem, ); } late final _snd_mixer_selem_has_playback_switch_ptr = _lookup>( 'snd_mixer_selem_has_playback_switch'); late final _dart_snd_mixer_selem_has_playback_switch _snd_mixer_selem_has_playback_switch = _snd_mixer_selem_has_playback_switch_ptr .asFunction<_dart_snd_mixer_selem_has_playback_switch>(); int snd_mixer_selem_has_playback_switch_joined( ffi.Pointer elem, ) { return _snd_mixer_selem_has_playback_switch_joined( elem, ); } late final _snd_mixer_selem_has_playback_switch_joined_ptr = _lookup< ffi.NativeFunction<_c_snd_mixer_selem_has_playback_switch_joined>>( 'snd_mixer_selem_has_playback_switch_joined'); late final _dart_snd_mixer_selem_has_playback_switch_joined _snd_mixer_selem_has_playback_switch_joined = _snd_mixer_selem_has_playback_switch_joined_ptr .asFunction<_dart_snd_mixer_selem_has_playback_switch_joined>(); int snd_mixer_selem_has_capture_switch( ffi.Pointer elem, ) { return _snd_mixer_selem_has_capture_switch( elem, ); } late final _snd_mixer_selem_has_capture_switch_ptr = _lookup>( 'snd_mixer_selem_has_capture_switch'); late final _dart_snd_mixer_selem_has_capture_switch _snd_mixer_selem_has_capture_switch = _snd_mixer_selem_has_capture_switch_ptr .asFunction<_dart_snd_mixer_selem_has_capture_switch>(); int snd_mixer_selem_has_capture_switch_joined( ffi.Pointer elem, ) { return _snd_mixer_selem_has_capture_switch_joined( elem, ); } late final _snd_mixer_selem_has_capture_switch_joined_ptr = _lookup>( 'snd_mixer_selem_has_capture_switch_joined'); late final _dart_snd_mixer_selem_has_capture_switch_joined _snd_mixer_selem_has_capture_switch_joined = _snd_mixer_selem_has_capture_switch_joined_ptr .asFunction<_dart_snd_mixer_selem_has_capture_switch_joined>(); int snd_mixer_selem_has_capture_switch_exclusive( ffi.Pointer elem, ) { return _snd_mixer_selem_has_capture_switch_exclusive( elem, ); } late final _snd_mixer_selem_has_capture_switch_exclusive_ptr = _lookup< ffi.NativeFunction<_c_snd_mixer_selem_has_capture_switch_exclusive>>( 'snd_mixer_selem_has_capture_switch_exclusive'); late final _dart_snd_mixer_selem_has_capture_switch_exclusive _snd_mixer_selem_has_capture_switch_exclusive = _snd_mixer_selem_has_capture_switch_exclusive_ptr .asFunction<_dart_snd_mixer_selem_has_capture_switch_exclusive>(); int snd_mixer_selem_ask_playback_vol_dB( ffi.Pointer elem, int value, ffi.Pointer dBvalue, ) { return _snd_mixer_selem_ask_playback_vol_dB( elem, value, dBvalue, ); } late final _snd_mixer_selem_ask_playback_vol_dB_ptr = _lookup>( 'snd_mixer_selem_ask_playback_vol_dB'); late final _dart_snd_mixer_selem_ask_playback_vol_dB _snd_mixer_selem_ask_playback_vol_dB = _snd_mixer_selem_ask_playback_vol_dB_ptr .asFunction<_dart_snd_mixer_selem_ask_playback_vol_dB>(); int snd_mixer_selem_ask_capture_vol_dB( ffi.Pointer elem, int value, ffi.Pointer dBvalue, ) { return _snd_mixer_selem_ask_capture_vol_dB( elem, value, dBvalue, ); } late final _snd_mixer_selem_ask_capture_vol_dB_ptr = _lookup>( 'snd_mixer_selem_ask_capture_vol_dB'); late final _dart_snd_mixer_selem_ask_capture_vol_dB _snd_mixer_selem_ask_capture_vol_dB = _snd_mixer_selem_ask_capture_vol_dB_ptr .asFunction<_dart_snd_mixer_selem_ask_capture_vol_dB>(); int snd_mixer_selem_ask_playback_dB_vol( ffi.Pointer elem, int dBvalue, int dir, ffi.Pointer value, ) { return _snd_mixer_selem_ask_playback_dB_vol( elem, dBvalue, dir, value, ); } late final _snd_mixer_selem_ask_playback_dB_vol_ptr = _lookup>( 'snd_mixer_selem_ask_playback_dB_vol'); late final _dart_snd_mixer_selem_ask_playback_dB_vol _snd_mixer_selem_ask_playback_dB_vol = _snd_mixer_selem_ask_playback_dB_vol_ptr .asFunction<_dart_snd_mixer_selem_ask_playback_dB_vol>(); int snd_mixer_selem_ask_capture_dB_vol( ffi.Pointer elem, int dBvalue, int dir, ffi.Pointer value, ) { return _snd_mixer_selem_ask_capture_dB_vol( elem, dBvalue, dir, value, ); } late final _snd_mixer_selem_ask_capture_dB_vol_ptr = _lookup>( 'snd_mixer_selem_ask_capture_dB_vol'); late final _dart_snd_mixer_selem_ask_capture_dB_vol _snd_mixer_selem_ask_capture_dB_vol = _snd_mixer_selem_ask_capture_dB_vol_ptr .asFunction<_dart_snd_mixer_selem_ask_capture_dB_vol>(); int snd_mixer_selem_get_playback_volume( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_playback_volume( elem, channel, value, ); } late final _snd_mixer_selem_get_playback_volume_ptr = _lookup>( 'snd_mixer_selem_get_playback_volume'); late final _dart_snd_mixer_selem_get_playback_volume _snd_mixer_selem_get_playback_volume = _snd_mixer_selem_get_playback_volume_ptr .asFunction<_dart_snd_mixer_selem_get_playback_volume>(); int snd_mixer_selem_get_capture_volume( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_capture_volume( elem, channel, value, ); } late final _snd_mixer_selem_get_capture_volume_ptr = _lookup>( 'snd_mixer_selem_get_capture_volume'); late final _dart_snd_mixer_selem_get_capture_volume _snd_mixer_selem_get_capture_volume = _snd_mixer_selem_get_capture_volume_ptr .asFunction<_dart_snd_mixer_selem_get_capture_volume>(); int snd_mixer_selem_get_playback_dB( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_playback_dB( elem, channel, value, ); } late final _snd_mixer_selem_get_playback_dB_ptr = _lookup>( 'snd_mixer_selem_get_playback_dB'); late final _dart_snd_mixer_selem_get_playback_dB _snd_mixer_selem_get_playback_dB = _snd_mixer_selem_get_playback_dB_ptr .asFunction<_dart_snd_mixer_selem_get_playback_dB>(); int snd_mixer_selem_get_capture_dB( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_capture_dB( elem, channel, value, ); } late final _snd_mixer_selem_get_capture_dB_ptr = _lookup>( 'snd_mixer_selem_get_capture_dB'); late final _dart_snd_mixer_selem_get_capture_dB _snd_mixer_selem_get_capture_dB = _snd_mixer_selem_get_capture_dB_ptr .asFunction<_dart_snd_mixer_selem_get_capture_dB>(); int snd_mixer_selem_get_playback_switch( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_playback_switch( elem, channel, value, ); } late final _snd_mixer_selem_get_playback_switch_ptr = _lookup>( 'snd_mixer_selem_get_playback_switch'); late final _dart_snd_mixer_selem_get_playback_switch _snd_mixer_selem_get_playback_switch = _snd_mixer_selem_get_playback_switch_ptr .asFunction<_dart_snd_mixer_selem_get_playback_switch>(); int snd_mixer_selem_get_capture_switch( ffi.Pointer elem, int channel, ffi.Pointer value, ) { return _snd_mixer_selem_get_capture_switch( elem, channel, value, ); } late final _snd_mixer_selem_get_capture_switch_ptr = _lookup>( 'snd_mixer_selem_get_capture_switch'); late final _dart_snd_mixer_selem_get_capture_switch _snd_mixer_selem_get_capture_switch = _snd_mixer_selem_get_capture_switch_ptr .asFunction<_dart_snd_mixer_selem_get_capture_switch>(); int snd_mixer_selem_set_playback_volume( ffi.Pointer elem, int channel, int value, ) { return _snd_mixer_selem_set_playback_volume( elem, channel, value, ); } late final _snd_mixer_selem_set_playback_volume_ptr = _lookup>( 'snd_mixer_selem_set_playback_volume'); late final _dart_snd_mixer_selem_set_playback_volume _snd_mixer_selem_set_playback_volume = _snd_mixer_selem_set_playback_volume_ptr .asFunction<_dart_snd_mixer_selem_set_playback_volume>(); int snd_mixer_selem_set_capture_volume( ffi.Pointer elem, int channel, int value, ) { return _snd_mixer_selem_set_capture_volume( elem, channel, value, ); } late final _snd_mixer_selem_set_capture_volume_ptr = _lookup>( 'snd_mixer_selem_set_capture_volume'); late final _dart_snd_mixer_selem_set_capture_volume _snd_mixer_selem_set_capture_volume = _snd_mixer_selem_set_capture_volume_ptr .asFunction<_dart_snd_mixer_selem_set_capture_volume>(); int snd_mixer_selem_set_playback_dB( ffi.Pointer elem, int channel, int value, int dir, ) { return _snd_mixer_selem_set_playback_dB( elem, channel, value, dir, ); } late final _snd_mixer_selem_set_playback_dB_ptr = _lookup>( 'snd_mixer_selem_set_playback_dB'); late final _dart_snd_mixer_selem_set_playback_dB _snd_mixer_selem_set_playback_dB = _snd_mixer_selem_set_playback_dB_ptr .asFunction<_dart_snd_mixer_selem_set_playback_dB>(); int snd_mixer_selem_set_capture_dB( ffi.Pointer elem, int channel, int value, int dir, ) { return _snd_mixer_selem_set_capture_dB( elem, channel, value, dir, ); } late final _snd_mixer_selem_set_capture_dB_ptr = _lookup>( 'snd_mixer_selem_set_capture_dB'); late final _dart_snd_mixer_selem_set_capture_dB _snd_mixer_selem_set_capture_dB = _snd_mixer_selem_set_capture_dB_ptr .asFunction<_dart_snd_mixer_selem_set_capture_dB>(); int snd_mixer_selem_set_playback_volume_all( ffi.Pointer elem, int value, ) { return _snd_mixer_selem_set_playback_volume_all( elem, value, ); } late final _snd_mixer_selem_set_playback_volume_all_ptr = _lookup>( 'snd_mixer_selem_set_playback_volume_all'); late final _dart_snd_mixer_selem_set_playback_volume_all _snd_mixer_selem_set_playback_volume_all = _snd_mixer_selem_set_playback_volume_all_ptr .asFunction<_dart_snd_mixer_selem_set_playback_volume_all>(); int snd_mixer_selem_set_capture_volume_all( ffi.Pointer elem, int value, ) { return _snd_mixer_selem_set_capture_volume_all( elem, value, ); } late final _snd_mixer_selem_set_capture_volume_all_ptr = _lookup>( 'snd_mixer_selem_set_capture_volume_all'); late final _dart_snd_mixer_selem_set_capture_volume_all _snd_mixer_selem_set_capture_volume_all = _snd_mixer_selem_set_capture_volume_all_ptr .asFunction<_dart_snd_mixer_selem_set_capture_volume_all>(); int snd_mixer_selem_set_playback_dB_all( ffi.Pointer elem, int value, int dir, ) { return _snd_mixer_selem_set_playback_dB_all( elem, value, dir, ); } late final _snd_mixer_selem_set_playback_dB_all_ptr = _lookup>( 'snd_mixer_selem_set_playback_dB_all'); late final _dart_snd_mixer_selem_set_playback_dB_all _snd_mixer_selem_set_playback_dB_all = _snd_mixer_selem_set_playback_dB_all_ptr .asFunction<_dart_snd_mixer_selem_set_playback_dB_all>(); int snd_mixer_selem_set_capture_dB_all( ffi.Pointer elem, int value, int dir, ) { return _snd_mixer_selem_set_capture_dB_all( elem, value, dir, ); } late final _snd_mixer_selem_set_capture_dB_all_ptr = _lookup>( 'snd_mixer_selem_set_capture_dB_all'); late final _dart_snd_mixer_selem_set_capture_dB_all _snd_mixer_selem_set_capture_dB_all = _snd_mixer_selem_set_capture_dB_all_ptr .asFunction<_dart_snd_mixer_selem_set_capture_dB_all>(); int snd_mixer_selem_set_playback_switch( ffi.Pointer elem, int channel, int value, ) { return _snd_mixer_selem_set_playback_switch( elem, channel, value, ); } late final _snd_mixer_selem_set_playback_switch_ptr = _lookup>( 'snd_mixer_selem_set_playback_switch'); late final _dart_snd_mixer_selem_set_playback_switch _snd_mixer_selem_set_playback_switch = _snd_mixer_selem_set_playback_switch_ptr .asFunction<_dart_snd_mixer_selem_set_playback_switch>(); int snd_mixer_selem_set_capture_switch( ffi.Pointer elem, int channel, int value, ) { return _snd_mixer_selem_set_capture_switch( elem, channel, value, ); } late final _snd_mixer_selem_set_capture_switch_ptr = _lookup>( 'snd_mixer_selem_set_capture_switch'); late final _dart_snd_mixer_selem_set_capture_switch _snd_mixer_selem_set_capture_switch = _snd_mixer_selem_set_capture_switch_ptr .asFunction<_dart_snd_mixer_selem_set_capture_switch>(); int snd_mixer_selem_set_playback_switch_all( ffi.Pointer elem, int value, ) { return _snd_mixer_selem_set_playback_switch_all( elem, value, ); } late final _snd_mixer_selem_set_playback_switch_all_ptr = _lookup>( 'snd_mixer_selem_set_playback_switch_all'); late final _dart_snd_mixer_selem_set_playback_switch_all _snd_mixer_selem_set_playback_switch_all = _snd_mixer_selem_set_playback_switch_all_ptr .asFunction<_dart_snd_mixer_selem_set_playback_switch_all>(); int snd_mixer_selem_set_capture_switch_all( ffi.Pointer elem, int value, ) { return _snd_mixer_selem_set_capture_switch_all( elem, value, ); } late final _snd_mixer_selem_set_capture_switch_all_ptr = _lookup>( 'snd_mixer_selem_set_capture_switch_all'); late final _dart_snd_mixer_selem_set_capture_switch_all _snd_mixer_selem_set_capture_switch_all = _snd_mixer_selem_set_capture_switch_all_ptr .asFunction<_dart_snd_mixer_selem_set_capture_switch_all>(); int snd_mixer_selem_get_playback_volume_range( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ) { return _snd_mixer_selem_get_playback_volume_range( elem, min, max, ); } late final _snd_mixer_selem_get_playback_volume_range_ptr = _lookup>( 'snd_mixer_selem_get_playback_volume_range'); late final _dart_snd_mixer_selem_get_playback_volume_range _snd_mixer_selem_get_playback_volume_range = _snd_mixer_selem_get_playback_volume_range_ptr .asFunction<_dart_snd_mixer_selem_get_playback_volume_range>(); int snd_mixer_selem_get_playback_dB_range( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ) { return _snd_mixer_selem_get_playback_dB_range( elem, min, max, ); } late final _snd_mixer_selem_get_playback_dB_range_ptr = _lookup>( 'snd_mixer_selem_get_playback_dB_range'); late final _dart_snd_mixer_selem_get_playback_dB_range _snd_mixer_selem_get_playback_dB_range = _snd_mixer_selem_get_playback_dB_range_ptr .asFunction<_dart_snd_mixer_selem_get_playback_dB_range>(); int snd_mixer_selem_set_playback_volume_range( ffi.Pointer elem, int min, int max, ) { return _snd_mixer_selem_set_playback_volume_range( elem, min, max, ); } late final _snd_mixer_selem_set_playback_volume_range_ptr = _lookup>( 'snd_mixer_selem_set_playback_volume_range'); late final _dart_snd_mixer_selem_set_playback_volume_range _snd_mixer_selem_set_playback_volume_range = _snd_mixer_selem_set_playback_volume_range_ptr .asFunction<_dart_snd_mixer_selem_set_playback_volume_range>(); int snd_mixer_selem_get_capture_volume_range( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ) { return _snd_mixer_selem_get_capture_volume_range( elem, min, max, ); } late final _snd_mixer_selem_get_capture_volume_range_ptr = _lookup>( 'snd_mixer_selem_get_capture_volume_range'); late final _dart_snd_mixer_selem_get_capture_volume_range _snd_mixer_selem_get_capture_volume_range = _snd_mixer_selem_get_capture_volume_range_ptr .asFunction<_dart_snd_mixer_selem_get_capture_volume_range>(); int snd_mixer_selem_get_capture_dB_range( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ) { return _snd_mixer_selem_get_capture_dB_range( elem, min, max, ); } late final _snd_mixer_selem_get_capture_dB_range_ptr = _lookup>( 'snd_mixer_selem_get_capture_dB_range'); late final _dart_snd_mixer_selem_get_capture_dB_range _snd_mixer_selem_get_capture_dB_range = _snd_mixer_selem_get_capture_dB_range_ptr .asFunction<_dart_snd_mixer_selem_get_capture_dB_range>(); int snd_mixer_selem_set_capture_volume_range( ffi.Pointer elem, int min, int max, ) { return _snd_mixer_selem_set_capture_volume_range( elem, min, max, ); } late final _snd_mixer_selem_set_capture_volume_range_ptr = _lookup>( 'snd_mixer_selem_set_capture_volume_range'); late final _dart_snd_mixer_selem_set_capture_volume_range _snd_mixer_selem_set_capture_volume_range = _snd_mixer_selem_set_capture_volume_range_ptr .asFunction<_dart_snd_mixer_selem_set_capture_volume_range>(); int snd_mixer_selem_is_enumerated( ffi.Pointer elem, ) { return _snd_mixer_selem_is_enumerated( elem, ); } late final _snd_mixer_selem_is_enumerated_ptr = _lookup>( 'snd_mixer_selem_is_enumerated'); late final _dart_snd_mixer_selem_is_enumerated _snd_mixer_selem_is_enumerated = _snd_mixer_selem_is_enumerated_ptr .asFunction<_dart_snd_mixer_selem_is_enumerated>(); int snd_mixer_selem_is_enum_playback( ffi.Pointer elem, ) { return _snd_mixer_selem_is_enum_playback( elem, ); } late final _snd_mixer_selem_is_enum_playback_ptr = _lookup>( 'snd_mixer_selem_is_enum_playback'); late final _dart_snd_mixer_selem_is_enum_playback _snd_mixer_selem_is_enum_playback = _snd_mixer_selem_is_enum_playback_ptr .asFunction<_dart_snd_mixer_selem_is_enum_playback>(); int snd_mixer_selem_is_enum_capture( ffi.Pointer elem, ) { return _snd_mixer_selem_is_enum_capture( elem, ); } late final _snd_mixer_selem_is_enum_capture_ptr = _lookup>( 'snd_mixer_selem_is_enum_capture'); late final _dart_snd_mixer_selem_is_enum_capture _snd_mixer_selem_is_enum_capture = _snd_mixer_selem_is_enum_capture_ptr .asFunction<_dart_snd_mixer_selem_is_enum_capture>(); int snd_mixer_selem_get_enum_items( ffi.Pointer elem, ) { return _snd_mixer_selem_get_enum_items( elem, ); } late final _snd_mixer_selem_get_enum_items_ptr = _lookup>( 'snd_mixer_selem_get_enum_items'); late final _dart_snd_mixer_selem_get_enum_items _snd_mixer_selem_get_enum_items = _snd_mixer_selem_get_enum_items_ptr .asFunction<_dart_snd_mixer_selem_get_enum_items>(); int snd_mixer_selem_get_enum_item_name( ffi.Pointer elem, int idx, int maxlen, ffi.Pointer str, ) { return _snd_mixer_selem_get_enum_item_name( elem, idx, maxlen, str, ); } late final _snd_mixer_selem_get_enum_item_name_ptr = _lookup>( 'snd_mixer_selem_get_enum_item_name'); late final _dart_snd_mixer_selem_get_enum_item_name _snd_mixer_selem_get_enum_item_name = _snd_mixer_selem_get_enum_item_name_ptr .asFunction<_dart_snd_mixer_selem_get_enum_item_name>(); int snd_mixer_selem_get_enum_item( ffi.Pointer elem, int channel, ffi.Pointer idxp, ) { return _snd_mixer_selem_get_enum_item( elem, channel, idxp, ); } late final _snd_mixer_selem_get_enum_item_ptr = _lookup>( 'snd_mixer_selem_get_enum_item'); late final _dart_snd_mixer_selem_get_enum_item _snd_mixer_selem_get_enum_item = _snd_mixer_selem_get_enum_item_ptr .asFunction<_dart_snd_mixer_selem_get_enum_item>(); int snd_mixer_selem_set_enum_item( ffi.Pointer elem, int channel, int idx, ) { return _snd_mixer_selem_set_enum_item( elem, channel, idx, ); } late final _snd_mixer_selem_set_enum_item_ptr = _lookup>( 'snd_mixer_selem_set_enum_item'); late final _dart_snd_mixer_selem_set_enum_item _snd_mixer_selem_set_enum_item = _snd_mixer_selem_set_enum_item_ptr .asFunction<_dart_snd_mixer_selem_set_enum_item>(); int snd_mixer_selem_id_sizeof() { return _snd_mixer_selem_id_sizeof(); } late final _snd_mixer_selem_id_sizeof_ptr = _lookup>( 'snd_mixer_selem_id_sizeof'); late final _dart_snd_mixer_selem_id_sizeof _snd_mixer_selem_id_sizeof = _snd_mixer_selem_id_sizeof_ptr .asFunction<_dart_snd_mixer_selem_id_sizeof>(); int snd_mixer_selem_id_malloc( ffi.Pointer> ptr, ) { return _snd_mixer_selem_id_malloc( ptr, ); } late final _snd_mixer_selem_id_malloc_ptr = _lookup>( 'snd_mixer_selem_id_malloc'); late final _dart_snd_mixer_selem_id_malloc _snd_mixer_selem_id_malloc = _snd_mixer_selem_id_malloc_ptr .asFunction<_dart_snd_mixer_selem_id_malloc>(); void snd_mixer_selem_id_free( ffi.Pointer obj, ) { return _snd_mixer_selem_id_free( obj, ); } late final _snd_mixer_selem_id_free_ptr = _lookup>( 'snd_mixer_selem_id_free'); late final _dart_snd_mixer_selem_id_free _snd_mixer_selem_id_free = _snd_mixer_selem_id_free_ptr.asFunction<_dart_snd_mixer_selem_id_free>(); void snd_mixer_selem_id_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_mixer_selem_id_copy( dst, src, ); } late final _snd_mixer_selem_id_copy_ptr = _lookup>( 'snd_mixer_selem_id_copy'); late final _dart_snd_mixer_selem_id_copy _snd_mixer_selem_id_copy = _snd_mixer_selem_id_copy_ptr.asFunction<_dart_snd_mixer_selem_id_copy>(); ffi.Pointer snd_mixer_selem_id_get_name( ffi.Pointer obj, ) { return _snd_mixer_selem_id_get_name( obj, ); } late final _snd_mixer_selem_id_get_name_ptr = _lookup>( 'snd_mixer_selem_id_get_name'); late final _dart_snd_mixer_selem_id_get_name _snd_mixer_selem_id_get_name = _snd_mixer_selem_id_get_name_ptr .asFunction<_dart_snd_mixer_selem_id_get_name>(); int snd_mixer_selem_id_get_index( ffi.Pointer obj, ) { return _snd_mixer_selem_id_get_index( obj, ); } late final _snd_mixer_selem_id_get_index_ptr = _lookup>( 'snd_mixer_selem_id_get_index'); late final _dart_snd_mixer_selem_id_get_index _snd_mixer_selem_id_get_index = _snd_mixer_selem_id_get_index_ptr .asFunction<_dart_snd_mixer_selem_id_get_index>(); void snd_mixer_selem_id_set_name( ffi.Pointer obj, ffi.Pointer val, ) { return _snd_mixer_selem_id_set_name( obj, val, ); } late final _snd_mixer_selem_id_set_name_ptr = _lookup>( 'snd_mixer_selem_id_set_name'); late final _dart_snd_mixer_selem_id_set_name _snd_mixer_selem_id_set_name = _snd_mixer_selem_id_set_name_ptr .asFunction<_dart_snd_mixer_selem_id_set_name>(); void snd_mixer_selem_id_set_index( ffi.Pointer obj, int val, ) { return _snd_mixer_selem_id_set_index( obj, val, ); } late final _snd_mixer_selem_id_set_index_ptr = _lookup>( 'snd_mixer_selem_id_set_index'); late final _dart_snd_mixer_selem_id_set_index _snd_mixer_selem_id_set_index = _snd_mixer_selem_id_set_index_ptr .asFunction<_dart_snd_mixer_selem_id_set_index>(); int snd_mixer_selem_id_parse( ffi.Pointer dst, ffi.Pointer str, ) { return _snd_mixer_selem_id_parse( dst, str, ); } late final _snd_mixer_selem_id_parse_ptr = _lookup>( 'snd_mixer_selem_id_parse'); late final _dart_snd_mixer_selem_id_parse _snd_mixer_selem_id_parse = _snd_mixer_selem_id_parse_ptr .asFunction<_dart_snd_mixer_selem_id_parse>(); int snd_seq_open( ffi.Pointer> handle, ffi.Pointer name, int streams, int mode, ) { return _snd_seq_open( handle, name, streams, mode, ); } late final _snd_seq_open_ptr = _lookup>('snd_seq_open'); late final _dart_snd_seq_open _snd_seq_open = _snd_seq_open_ptr.asFunction<_dart_snd_seq_open>(); int snd_seq_open_lconf( ffi.Pointer> handle, ffi.Pointer name, int streams, int mode, ffi.Pointer lconf, ) { return _snd_seq_open_lconf( handle, name, streams, mode, lconf, ); } late final _snd_seq_open_lconf_ptr = _lookup>('snd_seq_open_lconf'); late final _dart_snd_seq_open_lconf _snd_seq_open_lconf = _snd_seq_open_lconf_ptr.asFunction<_dart_snd_seq_open_lconf>(); ffi.Pointer snd_seq_name( ffi.Pointer seq, ) { return _snd_seq_name( seq, ); } late final _snd_seq_name_ptr = _lookup>('snd_seq_name'); late final _dart_snd_seq_name _snd_seq_name = _snd_seq_name_ptr.asFunction<_dart_snd_seq_name>(); int snd_seq_type( ffi.Pointer seq, ) { return _snd_seq_type( seq, ); } late final _snd_seq_type_ptr = _lookup>('snd_seq_type'); late final _dart_snd_seq_type _snd_seq_type = _snd_seq_type_ptr.asFunction<_dart_snd_seq_type>(); int snd_seq_close( ffi.Pointer handle, ) { return _snd_seq_close( handle, ); } late final _snd_seq_close_ptr = _lookup>('snd_seq_close'); late final _dart_snd_seq_close _snd_seq_close = _snd_seq_close_ptr.asFunction<_dart_snd_seq_close>(); int snd_seq_poll_descriptors_count( ffi.Pointer handle, int events, ) { return _snd_seq_poll_descriptors_count( handle, events, ); } late final _snd_seq_poll_descriptors_count_ptr = _lookup>( 'snd_seq_poll_descriptors_count'); late final _dart_snd_seq_poll_descriptors_count _snd_seq_poll_descriptors_count = _snd_seq_poll_descriptors_count_ptr .asFunction<_dart_snd_seq_poll_descriptors_count>(); int snd_seq_poll_descriptors( ffi.Pointer handle, ffi.Pointer pfds, int space, int events, ) { return _snd_seq_poll_descriptors( handle, pfds, space, events, ); } late final _snd_seq_poll_descriptors_ptr = _lookup>( 'snd_seq_poll_descriptors'); late final _dart_snd_seq_poll_descriptors _snd_seq_poll_descriptors = _snd_seq_poll_descriptors_ptr .asFunction<_dart_snd_seq_poll_descriptors>(); int snd_seq_poll_descriptors_revents( ffi.Pointer seq, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ) { return _snd_seq_poll_descriptors_revents( seq, pfds, nfds, revents, ); } late final _snd_seq_poll_descriptors_revents_ptr = _lookup>( 'snd_seq_poll_descriptors_revents'); late final _dart_snd_seq_poll_descriptors_revents _snd_seq_poll_descriptors_revents = _snd_seq_poll_descriptors_revents_ptr .asFunction<_dart_snd_seq_poll_descriptors_revents>(); int snd_seq_nonblock( ffi.Pointer handle, int nonblock, ) { return _snd_seq_nonblock( handle, nonblock, ); } late final _snd_seq_nonblock_ptr = _lookup>('snd_seq_nonblock'); late final _dart_snd_seq_nonblock _snd_seq_nonblock = _snd_seq_nonblock_ptr.asFunction<_dart_snd_seq_nonblock>(); int snd_seq_client_id( ffi.Pointer handle, ) { return _snd_seq_client_id( handle, ); } late final _snd_seq_client_id_ptr = _lookup>('snd_seq_client_id'); late final _dart_snd_seq_client_id _snd_seq_client_id = _snd_seq_client_id_ptr.asFunction<_dart_snd_seq_client_id>(); int snd_seq_get_output_buffer_size( ffi.Pointer handle, ) { return _snd_seq_get_output_buffer_size( handle, ); } late final _snd_seq_get_output_buffer_size_ptr = _lookup>( 'snd_seq_get_output_buffer_size'); late final _dart_snd_seq_get_output_buffer_size _snd_seq_get_output_buffer_size = _snd_seq_get_output_buffer_size_ptr .asFunction<_dart_snd_seq_get_output_buffer_size>(); int snd_seq_get_input_buffer_size( ffi.Pointer handle, ) { return _snd_seq_get_input_buffer_size( handle, ); } late final _snd_seq_get_input_buffer_size_ptr = _lookup>( 'snd_seq_get_input_buffer_size'); late final _dart_snd_seq_get_input_buffer_size _snd_seq_get_input_buffer_size = _snd_seq_get_input_buffer_size_ptr .asFunction<_dart_snd_seq_get_input_buffer_size>(); int snd_seq_set_output_buffer_size( ffi.Pointer handle, int size, ) { return _snd_seq_set_output_buffer_size( handle, size, ); } late final _snd_seq_set_output_buffer_size_ptr = _lookup>( 'snd_seq_set_output_buffer_size'); late final _dart_snd_seq_set_output_buffer_size _snd_seq_set_output_buffer_size = _snd_seq_set_output_buffer_size_ptr .asFunction<_dart_snd_seq_set_output_buffer_size>(); int snd_seq_set_input_buffer_size( ffi.Pointer handle, int size, ) { return _snd_seq_set_input_buffer_size( handle, size, ); } late final _snd_seq_set_input_buffer_size_ptr = _lookup>( 'snd_seq_set_input_buffer_size'); late final _dart_snd_seq_set_input_buffer_size _snd_seq_set_input_buffer_size = _snd_seq_set_input_buffer_size_ptr .asFunction<_dart_snd_seq_set_input_buffer_size>(); int snd_seq_system_info_sizeof() { return _snd_seq_system_info_sizeof(); } late final _snd_seq_system_info_sizeof_ptr = _lookup>( 'snd_seq_system_info_sizeof'); late final _dart_snd_seq_system_info_sizeof _snd_seq_system_info_sizeof = _snd_seq_system_info_sizeof_ptr .asFunction<_dart_snd_seq_system_info_sizeof>(); int snd_seq_system_info_malloc( ffi.Pointer> ptr, ) { return _snd_seq_system_info_malloc( ptr, ); } late final _snd_seq_system_info_malloc_ptr = _lookup>( 'snd_seq_system_info_malloc'); late final _dart_snd_seq_system_info_malloc _snd_seq_system_info_malloc = _snd_seq_system_info_malloc_ptr .asFunction<_dart_snd_seq_system_info_malloc>(); void snd_seq_system_info_free( ffi.Pointer ptr, ) { return _snd_seq_system_info_free( ptr, ); } late final _snd_seq_system_info_free_ptr = _lookup>( 'snd_seq_system_info_free'); late final _dart_snd_seq_system_info_free _snd_seq_system_info_free = _snd_seq_system_info_free_ptr .asFunction<_dart_snd_seq_system_info_free>(); void snd_seq_system_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_system_info_copy( dst, src, ); } late final _snd_seq_system_info_copy_ptr = _lookup>( 'snd_seq_system_info_copy'); late final _dart_snd_seq_system_info_copy _snd_seq_system_info_copy = _snd_seq_system_info_copy_ptr .asFunction<_dart_snd_seq_system_info_copy>(); int snd_seq_system_info_get_queues( ffi.Pointer info, ) { return _snd_seq_system_info_get_queues( info, ); } late final _snd_seq_system_info_get_queues_ptr = _lookup>( 'snd_seq_system_info_get_queues'); late final _dart_snd_seq_system_info_get_queues _snd_seq_system_info_get_queues = _snd_seq_system_info_get_queues_ptr .asFunction<_dart_snd_seq_system_info_get_queues>(); int snd_seq_system_info_get_clients( ffi.Pointer info, ) { return _snd_seq_system_info_get_clients( info, ); } late final _snd_seq_system_info_get_clients_ptr = _lookup>( 'snd_seq_system_info_get_clients'); late final _dart_snd_seq_system_info_get_clients _snd_seq_system_info_get_clients = _snd_seq_system_info_get_clients_ptr .asFunction<_dart_snd_seq_system_info_get_clients>(); int snd_seq_system_info_get_ports( ffi.Pointer info, ) { return _snd_seq_system_info_get_ports( info, ); } late final _snd_seq_system_info_get_ports_ptr = _lookup>( 'snd_seq_system_info_get_ports'); late final _dart_snd_seq_system_info_get_ports _snd_seq_system_info_get_ports = _snd_seq_system_info_get_ports_ptr .asFunction<_dart_snd_seq_system_info_get_ports>(); int snd_seq_system_info_get_channels( ffi.Pointer info, ) { return _snd_seq_system_info_get_channels( info, ); } late final _snd_seq_system_info_get_channels_ptr = _lookup>( 'snd_seq_system_info_get_channels'); late final _dart_snd_seq_system_info_get_channels _snd_seq_system_info_get_channels = _snd_seq_system_info_get_channels_ptr .asFunction<_dart_snd_seq_system_info_get_channels>(); int snd_seq_system_info_get_cur_clients( ffi.Pointer info, ) { return _snd_seq_system_info_get_cur_clients( info, ); } late final _snd_seq_system_info_get_cur_clients_ptr = _lookup>( 'snd_seq_system_info_get_cur_clients'); late final _dart_snd_seq_system_info_get_cur_clients _snd_seq_system_info_get_cur_clients = _snd_seq_system_info_get_cur_clients_ptr .asFunction<_dart_snd_seq_system_info_get_cur_clients>(); int snd_seq_system_info_get_cur_queues( ffi.Pointer info, ) { return _snd_seq_system_info_get_cur_queues( info, ); } late final _snd_seq_system_info_get_cur_queues_ptr = _lookup>( 'snd_seq_system_info_get_cur_queues'); late final _dart_snd_seq_system_info_get_cur_queues _snd_seq_system_info_get_cur_queues = _snd_seq_system_info_get_cur_queues_ptr .asFunction<_dart_snd_seq_system_info_get_cur_queues>(); int snd_seq_system_info( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_system_info( handle, info, ); } late final _snd_seq_system_info_ptr = _lookup>( 'snd_seq_system_info'); late final _dart_snd_seq_system_info _snd_seq_system_info = _snd_seq_system_info_ptr.asFunction<_dart_snd_seq_system_info>(); int snd_seq_client_info_sizeof() { return _snd_seq_client_info_sizeof(); } late final _snd_seq_client_info_sizeof_ptr = _lookup>( 'snd_seq_client_info_sizeof'); late final _dart_snd_seq_client_info_sizeof _snd_seq_client_info_sizeof = _snd_seq_client_info_sizeof_ptr .asFunction<_dart_snd_seq_client_info_sizeof>(); int snd_seq_client_info_malloc( ffi.Pointer> ptr, ) { return _snd_seq_client_info_malloc( ptr, ); } late final _snd_seq_client_info_malloc_ptr = _lookup>( 'snd_seq_client_info_malloc'); late final _dart_snd_seq_client_info_malloc _snd_seq_client_info_malloc = _snd_seq_client_info_malloc_ptr .asFunction<_dart_snd_seq_client_info_malloc>(); void snd_seq_client_info_free( ffi.Pointer ptr, ) { return _snd_seq_client_info_free( ptr, ); } late final _snd_seq_client_info_free_ptr = _lookup>( 'snd_seq_client_info_free'); late final _dart_snd_seq_client_info_free _snd_seq_client_info_free = _snd_seq_client_info_free_ptr .asFunction<_dart_snd_seq_client_info_free>(); void snd_seq_client_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_client_info_copy( dst, src, ); } late final _snd_seq_client_info_copy_ptr = _lookup>( 'snd_seq_client_info_copy'); late final _dart_snd_seq_client_info_copy _snd_seq_client_info_copy = _snd_seq_client_info_copy_ptr .asFunction<_dart_snd_seq_client_info_copy>(); int snd_seq_client_info_get_client( ffi.Pointer info, ) { return _snd_seq_client_info_get_client( info, ); } late final _snd_seq_client_info_get_client_ptr = _lookup>( 'snd_seq_client_info_get_client'); late final _dart_snd_seq_client_info_get_client _snd_seq_client_info_get_client = _snd_seq_client_info_get_client_ptr .asFunction<_dart_snd_seq_client_info_get_client>(); int snd_seq_client_info_get_type( ffi.Pointer info, ) { return _snd_seq_client_info_get_type( info, ); } late final _snd_seq_client_info_get_type_ptr = _lookup>( 'snd_seq_client_info_get_type'); late final _dart_snd_seq_client_info_get_type _snd_seq_client_info_get_type = _snd_seq_client_info_get_type_ptr .asFunction<_dart_snd_seq_client_info_get_type>(); ffi.Pointer snd_seq_client_info_get_name( ffi.Pointer info, ) { return _snd_seq_client_info_get_name( info, ); } late final _snd_seq_client_info_get_name_ptr = _lookup>( 'snd_seq_client_info_get_name'); late final _dart_snd_seq_client_info_get_name _snd_seq_client_info_get_name = _snd_seq_client_info_get_name_ptr .asFunction<_dart_snd_seq_client_info_get_name>(); int snd_seq_client_info_get_broadcast_filter( ffi.Pointer info, ) { return _snd_seq_client_info_get_broadcast_filter( info, ); } late final _snd_seq_client_info_get_broadcast_filter_ptr = _lookup>( 'snd_seq_client_info_get_broadcast_filter'); late final _dart_snd_seq_client_info_get_broadcast_filter _snd_seq_client_info_get_broadcast_filter = _snd_seq_client_info_get_broadcast_filter_ptr .asFunction<_dart_snd_seq_client_info_get_broadcast_filter>(); int snd_seq_client_info_get_error_bounce( ffi.Pointer info, ) { return _snd_seq_client_info_get_error_bounce( info, ); } late final _snd_seq_client_info_get_error_bounce_ptr = _lookup>( 'snd_seq_client_info_get_error_bounce'); late final _dart_snd_seq_client_info_get_error_bounce _snd_seq_client_info_get_error_bounce = _snd_seq_client_info_get_error_bounce_ptr .asFunction<_dart_snd_seq_client_info_get_error_bounce>(); int snd_seq_client_info_get_card( ffi.Pointer info, ) { return _snd_seq_client_info_get_card( info, ); } late final _snd_seq_client_info_get_card_ptr = _lookup>( 'snd_seq_client_info_get_card'); late final _dart_snd_seq_client_info_get_card _snd_seq_client_info_get_card = _snd_seq_client_info_get_card_ptr .asFunction<_dart_snd_seq_client_info_get_card>(); int snd_seq_client_info_get_pid( ffi.Pointer info, ) { return _snd_seq_client_info_get_pid( info, ); } late final _snd_seq_client_info_get_pid_ptr = _lookup>( 'snd_seq_client_info_get_pid'); late final _dart_snd_seq_client_info_get_pid _snd_seq_client_info_get_pid = _snd_seq_client_info_get_pid_ptr .asFunction<_dart_snd_seq_client_info_get_pid>(); ffi.Pointer snd_seq_client_info_get_event_filter( ffi.Pointer info, ) { return _snd_seq_client_info_get_event_filter( info, ); } late final _snd_seq_client_info_get_event_filter_ptr = _lookup>( 'snd_seq_client_info_get_event_filter'); late final _dart_snd_seq_client_info_get_event_filter _snd_seq_client_info_get_event_filter = _snd_seq_client_info_get_event_filter_ptr .asFunction<_dart_snd_seq_client_info_get_event_filter>(); int snd_seq_client_info_get_num_ports( ffi.Pointer info, ) { return _snd_seq_client_info_get_num_ports( info, ); } late final _snd_seq_client_info_get_num_ports_ptr = _lookup>( 'snd_seq_client_info_get_num_ports'); late final _dart_snd_seq_client_info_get_num_ports _snd_seq_client_info_get_num_ports = _snd_seq_client_info_get_num_ports_ptr .asFunction<_dart_snd_seq_client_info_get_num_ports>(); int snd_seq_client_info_get_event_lost( ffi.Pointer info, ) { return _snd_seq_client_info_get_event_lost( info, ); } late final _snd_seq_client_info_get_event_lost_ptr = _lookup>( 'snd_seq_client_info_get_event_lost'); late final _dart_snd_seq_client_info_get_event_lost _snd_seq_client_info_get_event_lost = _snd_seq_client_info_get_event_lost_ptr .asFunction<_dart_snd_seq_client_info_get_event_lost>(); void snd_seq_client_info_set_client( ffi.Pointer info, int client, ) { return _snd_seq_client_info_set_client( info, client, ); } late final _snd_seq_client_info_set_client_ptr = _lookup>( 'snd_seq_client_info_set_client'); late final _dart_snd_seq_client_info_set_client _snd_seq_client_info_set_client = _snd_seq_client_info_set_client_ptr .asFunction<_dart_snd_seq_client_info_set_client>(); void snd_seq_client_info_set_name( ffi.Pointer info, ffi.Pointer name, ) { return _snd_seq_client_info_set_name( info, name, ); } late final _snd_seq_client_info_set_name_ptr = _lookup>( 'snd_seq_client_info_set_name'); late final _dart_snd_seq_client_info_set_name _snd_seq_client_info_set_name = _snd_seq_client_info_set_name_ptr .asFunction<_dart_snd_seq_client_info_set_name>(); void snd_seq_client_info_set_broadcast_filter( ffi.Pointer info, int val, ) { return _snd_seq_client_info_set_broadcast_filter( info, val, ); } late final _snd_seq_client_info_set_broadcast_filter_ptr = _lookup>( 'snd_seq_client_info_set_broadcast_filter'); late final _dart_snd_seq_client_info_set_broadcast_filter _snd_seq_client_info_set_broadcast_filter = _snd_seq_client_info_set_broadcast_filter_ptr .asFunction<_dart_snd_seq_client_info_set_broadcast_filter>(); void snd_seq_client_info_set_error_bounce( ffi.Pointer info, int val, ) { return _snd_seq_client_info_set_error_bounce( info, val, ); } late final _snd_seq_client_info_set_error_bounce_ptr = _lookup>( 'snd_seq_client_info_set_error_bounce'); late final _dart_snd_seq_client_info_set_error_bounce _snd_seq_client_info_set_error_bounce = _snd_seq_client_info_set_error_bounce_ptr .asFunction<_dart_snd_seq_client_info_set_error_bounce>(); void snd_seq_client_info_set_event_filter( ffi.Pointer info, ffi.Pointer filter, ) { return _snd_seq_client_info_set_event_filter( info, filter, ); } late final _snd_seq_client_info_set_event_filter_ptr = _lookup>( 'snd_seq_client_info_set_event_filter'); late final _dart_snd_seq_client_info_set_event_filter _snd_seq_client_info_set_event_filter = _snd_seq_client_info_set_event_filter_ptr .asFunction<_dart_snd_seq_client_info_set_event_filter>(); void snd_seq_client_info_event_filter_clear( ffi.Pointer info, ) { return _snd_seq_client_info_event_filter_clear( info, ); } late final _snd_seq_client_info_event_filter_clear_ptr = _lookup>( 'snd_seq_client_info_event_filter_clear'); late final _dart_snd_seq_client_info_event_filter_clear _snd_seq_client_info_event_filter_clear = _snd_seq_client_info_event_filter_clear_ptr .asFunction<_dart_snd_seq_client_info_event_filter_clear>(); void snd_seq_client_info_event_filter_add( ffi.Pointer info, int event_type, ) { return _snd_seq_client_info_event_filter_add( info, event_type, ); } late final _snd_seq_client_info_event_filter_add_ptr = _lookup>( 'snd_seq_client_info_event_filter_add'); late final _dart_snd_seq_client_info_event_filter_add _snd_seq_client_info_event_filter_add = _snd_seq_client_info_event_filter_add_ptr .asFunction<_dart_snd_seq_client_info_event_filter_add>(); void snd_seq_client_info_event_filter_del( ffi.Pointer info, int event_type, ) { return _snd_seq_client_info_event_filter_del( info, event_type, ); } late final _snd_seq_client_info_event_filter_del_ptr = _lookup>( 'snd_seq_client_info_event_filter_del'); late final _dart_snd_seq_client_info_event_filter_del _snd_seq_client_info_event_filter_del = _snd_seq_client_info_event_filter_del_ptr .asFunction<_dart_snd_seq_client_info_event_filter_del>(); int snd_seq_client_info_event_filter_check( ffi.Pointer info, int event_type, ) { return _snd_seq_client_info_event_filter_check( info, event_type, ); } late final _snd_seq_client_info_event_filter_check_ptr = _lookup>( 'snd_seq_client_info_event_filter_check'); late final _dart_snd_seq_client_info_event_filter_check _snd_seq_client_info_event_filter_check = _snd_seq_client_info_event_filter_check_ptr .asFunction<_dart_snd_seq_client_info_event_filter_check>(); int snd_seq_get_client_info( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_get_client_info( handle, info, ); } late final _snd_seq_get_client_info_ptr = _lookup>( 'snd_seq_get_client_info'); late final _dart_snd_seq_get_client_info _snd_seq_get_client_info = _snd_seq_get_client_info_ptr.asFunction<_dart_snd_seq_get_client_info>(); int snd_seq_get_any_client_info( ffi.Pointer handle, int client, ffi.Pointer info, ) { return _snd_seq_get_any_client_info( handle, client, info, ); } late final _snd_seq_get_any_client_info_ptr = _lookup>( 'snd_seq_get_any_client_info'); late final _dart_snd_seq_get_any_client_info _snd_seq_get_any_client_info = _snd_seq_get_any_client_info_ptr .asFunction<_dart_snd_seq_get_any_client_info>(); int snd_seq_set_client_info( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_set_client_info( handle, info, ); } late final _snd_seq_set_client_info_ptr = _lookup>( 'snd_seq_set_client_info'); late final _dart_snd_seq_set_client_info _snd_seq_set_client_info = _snd_seq_set_client_info_ptr.asFunction<_dart_snd_seq_set_client_info>(); int snd_seq_query_next_client( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_query_next_client( handle, info, ); } late final _snd_seq_query_next_client_ptr = _lookup>( 'snd_seq_query_next_client'); late final _dart_snd_seq_query_next_client _snd_seq_query_next_client = _snd_seq_query_next_client_ptr .asFunction<_dart_snd_seq_query_next_client>(); int snd_seq_client_pool_sizeof() { return _snd_seq_client_pool_sizeof(); } late final _snd_seq_client_pool_sizeof_ptr = _lookup>( 'snd_seq_client_pool_sizeof'); late final _dart_snd_seq_client_pool_sizeof _snd_seq_client_pool_sizeof = _snd_seq_client_pool_sizeof_ptr .asFunction<_dart_snd_seq_client_pool_sizeof>(); int snd_seq_client_pool_malloc( ffi.Pointer> ptr, ) { return _snd_seq_client_pool_malloc( ptr, ); } late final _snd_seq_client_pool_malloc_ptr = _lookup>( 'snd_seq_client_pool_malloc'); late final _dart_snd_seq_client_pool_malloc _snd_seq_client_pool_malloc = _snd_seq_client_pool_malloc_ptr .asFunction<_dart_snd_seq_client_pool_malloc>(); void snd_seq_client_pool_free( ffi.Pointer ptr, ) { return _snd_seq_client_pool_free( ptr, ); } late final _snd_seq_client_pool_free_ptr = _lookup>( 'snd_seq_client_pool_free'); late final _dart_snd_seq_client_pool_free _snd_seq_client_pool_free = _snd_seq_client_pool_free_ptr .asFunction<_dart_snd_seq_client_pool_free>(); void snd_seq_client_pool_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_client_pool_copy( dst, src, ); } late final _snd_seq_client_pool_copy_ptr = _lookup>( 'snd_seq_client_pool_copy'); late final _dart_snd_seq_client_pool_copy _snd_seq_client_pool_copy = _snd_seq_client_pool_copy_ptr .asFunction<_dart_snd_seq_client_pool_copy>(); int snd_seq_client_pool_get_client( ffi.Pointer info, ) { return _snd_seq_client_pool_get_client( info, ); } late final _snd_seq_client_pool_get_client_ptr = _lookup>( 'snd_seq_client_pool_get_client'); late final _dart_snd_seq_client_pool_get_client _snd_seq_client_pool_get_client = _snd_seq_client_pool_get_client_ptr .asFunction<_dart_snd_seq_client_pool_get_client>(); int snd_seq_client_pool_get_output_pool( ffi.Pointer info, ) { return _snd_seq_client_pool_get_output_pool( info, ); } late final _snd_seq_client_pool_get_output_pool_ptr = _lookup>( 'snd_seq_client_pool_get_output_pool'); late final _dart_snd_seq_client_pool_get_output_pool _snd_seq_client_pool_get_output_pool = _snd_seq_client_pool_get_output_pool_ptr .asFunction<_dart_snd_seq_client_pool_get_output_pool>(); int snd_seq_client_pool_get_input_pool( ffi.Pointer info, ) { return _snd_seq_client_pool_get_input_pool( info, ); } late final _snd_seq_client_pool_get_input_pool_ptr = _lookup>( 'snd_seq_client_pool_get_input_pool'); late final _dart_snd_seq_client_pool_get_input_pool _snd_seq_client_pool_get_input_pool = _snd_seq_client_pool_get_input_pool_ptr .asFunction<_dart_snd_seq_client_pool_get_input_pool>(); int snd_seq_client_pool_get_output_room( ffi.Pointer info, ) { return _snd_seq_client_pool_get_output_room( info, ); } late final _snd_seq_client_pool_get_output_room_ptr = _lookup>( 'snd_seq_client_pool_get_output_room'); late final _dart_snd_seq_client_pool_get_output_room _snd_seq_client_pool_get_output_room = _snd_seq_client_pool_get_output_room_ptr .asFunction<_dart_snd_seq_client_pool_get_output_room>(); int snd_seq_client_pool_get_output_free( ffi.Pointer info, ) { return _snd_seq_client_pool_get_output_free( info, ); } late final _snd_seq_client_pool_get_output_free_ptr = _lookup>( 'snd_seq_client_pool_get_output_free'); late final _dart_snd_seq_client_pool_get_output_free _snd_seq_client_pool_get_output_free = _snd_seq_client_pool_get_output_free_ptr .asFunction<_dart_snd_seq_client_pool_get_output_free>(); int snd_seq_client_pool_get_input_free( ffi.Pointer info, ) { return _snd_seq_client_pool_get_input_free( info, ); } late final _snd_seq_client_pool_get_input_free_ptr = _lookup>( 'snd_seq_client_pool_get_input_free'); late final _dart_snd_seq_client_pool_get_input_free _snd_seq_client_pool_get_input_free = _snd_seq_client_pool_get_input_free_ptr .asFunction<_dart_snd_seq_client_pool_get_input_free>(); void snd_seq_client_pool_set_output_pool( ffi.Pointer info, int size, ) { return _snd_seq_client_pool_set_output_pool( info, size, ); } late final _snd_seq_client_pool_set_output_pool_ptr = _lookup>( 'snd_seq_client_pool_set_output_pool'); late final _dart_snd_seq_client_pool_set_output_pool _snd_seq_client_pool_set_output_pool = _snd_seq_client_pool_set_output_pool_ptr .asFunction<_dart_snd_seq_client_pool_set_output_pool>(); void snd_seq_client_pool_set_input_pool( ffi.Pointer info, int size, ) { return _snd_seq_client_pool_set_input_pool( info, size, ); } late final _snd_seq_client_pool_set_input_pool_ptr = _lookup>( 'snd_seq_client_pool_set_input_pool'); late final _dart_snd_seq_client_pool_set_input_pool _snd_seq_client_pool_set_input_pool = _snd_seq_client_pool_set_input_pool_ptr .asFunction<_dart_snd_seq_client_pool_set_input_pool>(); void snd_seq_client_pool_set_output_room( ffi.Pointer info, int size, ) { return _snd_seq_client_pool_set_output_room( info, size, ); } late final _snd_seq_client_pool_set_output_room_ptr = _lookup>( 'snd_seq_client_pool_set_output_room'); late final _dart_snd_seq_client_pool_set_output_room _snd_seq_client_pool_set_output_room = _snd_seq_client_pool_set_output_room_ptr .asFunction<_dart_snd_seq_client_pool_set_output_room>(); int snd_seq_get_client_pool( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_get_client_pool( handle, info, ); } late final _snd_seq_get_client_pool_ptr = _lookup>( 'snd_seq_get_client_pool'); late final _dart_snd_seq_get_client_pool _snd_seq_get_client_pool = _snd_seq_get_client_pool_ptr.asFunction<_dart_snd_seq_get_client_pool>(); int snd_seq_set_client_pool( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_set_client_pool( handle, info, ); } late final _snd_seq_set_client_pool_ptr = _lookup>( 'snd_seq_set_client_pool'); late final _dart_snd_seq_set_client_pool _snd_seq_set_client_pool = _snd_seq_set_client_pool_ptr.asFunction<_dart_snd_seq_set_client_pool>(); int snd_seq_port_info_sizeof() { return _snd_seq_port_info_sizeof(); } late final _snd_seq_port_info_sizeof_ptr = _lookup>( 'snd_seq_port_info_sizeof'); late final _dart_snd_seq_port_info_sizeof _snd_seq_port_info_sizeof = _snd_seq_port_info_sizeof_ptr .asFunction<_dart_snd_seq_port_info_sizeof>(); int snd_seq_port_info_malloc( ffi.Pointer> ptr, ) { return _snd_seq_port_info_malloc( ptr, ); } late final _snd_seq_port_info_malloc_ptr = _lookup>( 'snd_seq_port_info_malloc'); late final _dart_snd_seq_port_info_malloc _snd_seq_port_info_malloc = _snd_seq_port_info_malloc_ptr .asFunction<_dart_snd_seq_port_info_malloc>(); void snd_seq_port_info_free( ffi.Pointer ptr, ) { return _snd_seq_port_info_free( ptr, ); } late final _snd_seq_port_info_free_ptr = _lookup>( 'snd_seq_port_info_free'); late final _dart_snd_seq_port_info_free _snd_seq_port_info_free = _snd_seq_port_info_free_ptr.asFunction<_dart_snd_seq_port_info_free>(); void snd_seq_port_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_port_info_copy( dst, src, ); } late final _snd_seq_port_info_copy_ptr = _lookup>( 'snd_seq_port_info_copy'); late final _dart_snd_seq_port_info_copy _snd_seq_port_info_copy = _snd_seq_port_info_copy_ptr.asFunction<_dart_snd_seq_port_info_copy>(); int snd_seq_port_info_get_client( ffi.Pointer info, ) { return _snd_seq_port_info_get_client( info, ); } late final _snd_seq_port_info_get_client_ptr = _lookup>( 'snd_seq_port_info_get_client'); late final _dart_snd_seq_port_info_get_client _snd_seq_port_info_get_client = _snd_seq_port_info_get_client_ptr .asFunction<_dart_snd_seq_port_info_get_client>(); int snd_seq_port_info_get_port( ffi.Pointer info, ) { return _snd_seq_port_info_get_port( info, ); } late final _snd_seq_port_info_get_port_ptr = _lookup>( 'snd_seq_port_info_get_port'); late final _dart_snd_seq_port_info_get_port _snd_seq_port_info_get_port = _snd_seq_port_info_get_port_ptr .asFunction<_dart_snd_seq_port_info_get_port>(); ffi.Pointer snd_seq_port_info_get_addr( ffi.Pointer info, ) { return _snd_seq_port_info_get_addr( info, ); } late final _snd_seq_port_info_get_addr_ptr = _lookup>( 'snd_seq_port_info_get_addr'); late final _dart_snd_seq_port_info_get_addr _snd_seq_port_info_get_addr = _snd_seq_port_info_get_addr_ptr .asFunction<_dart_snd_seq_port_info_get_addr>(); ffi.Pointer snd_seq_port_info_get_name( ffi.Pointer info, ) { return _snd_seq_port_info_get_name( info, ); } late final _snd_seq_port_info_get_name_ptr = _lookup>( 'snd_seq_port_info_get_name'); late final _dart_snd_seq_port_info_get_name _snd_seq_port_info_get_name = _snd_seq_port_info_get_name_ptr .asFunction<_dart_snd_seq_port_info_get_name>(); int snd_seq_port_info_get_capability( ffi.Pointer info, ) { return _snd_seq_port_info_get_capability( info, ); } late final _snd_seq_port_info_get_capability_ptr = _lookup>( 'snd_seq_port_info_get_capability'); late final _dart_snd_seq_port_info_get_capability _snd_seq_port_info_get_capability = _snd_seq_port_info_get_capability_ptr .asFunction<_dart_snd_seq_port_info_get_capability>(); int snd_seq_port_info_get_type( ffi.Pointer info, ) { return _snd_seq_port_info_get_type( info, ); } late final _snd_seq_port_info_get_type_ptr = _lookup>( 'snd_seq_port_info_get_type'); late final _dart_snd_seq_port_info_get_type _snd_seq_port_info_get_type = _snd_seq_port_info_get_type_ptr .asFunction<_dart_snd_seq_port_info_get_type>(); int snd_seq_port_info_get_midi_channels( ffi.Pointer info, ) { return _snd_seq_port_info_get_midi_channels( info, ); } late final _snd_seq_port_info_get_midi_channels_ptr = _lookup>( 'snd_seq_port_info_get_midi_channels'); late final _dart_snd_seq_port_info_get_midi_channels _snd_seq_port_info_get_midi_channels = _snd_seq_port_info_get_midi_channels_ptr .asFunction<_dart_snd_seq_port_info_get_midi_channels>(); int snd_seq_port_info_get_midi_voices( ffi.Pointer info, ) { return _snd_seq_port_info_get_midi_voices( info, ); } late final _snd_seq_port_info_get_midi_voices_ptr = _lookup>( 'snd_seq_port_info_get_midi_voices'); late final _dart_snd_seq_port_info_get_midi_voices _snd_seq_port_info_get_midi_voices = _snd_seq_port_info_get_midi_voices_ptr .asFunction<_dart_snd_seq_port_info_get_midi_voices>(); int snd_seq_port_info_get_synth_voices( ffi.Pointer info, ) { return _snd_seq_port_info_get_synth_voices( info, ); } late final _snd_seq_port_info_get_synth_voices_ptr = _lookup>( 'snd_seq_port_info_get_synth_voices'); late final _dart_snd_seq_port_info_get_synth_voices _snd_seq_port_info_get_synth_voices = _snd_seq_port_info_get_synth_voices_ptr .asFunction<_dart_snd_seq_port_info_get_synth_voices>(); int snd_seq_port_info_get_read_use( ffi.Pointer info, ) { return _snd_seq_port_info_get_read_use( info, ); } late final _snd_seq_port_info_get_read_use_ptr = _lookup>( 'snd_seq_port_info_get_read_use'); late final _dart_snd_seq_port_info_get_read_use _snd_seq_port_info_get_read_use = _snd_seq_port_info_get_read_use_ptr .asFunction<_dart_snd_seq_port_info_get_read_use>(); int snd_seq_port_info_get_write_use( ffi.Pointer info, ) { return _snd_seq_port_info_get_write_use( info, ); } late final _snd_seq_port_info_get_write_use_ptr = _lookup>( 'snd_seq_port_info_get_write_use'); late final _dart_snd_seq_port_info_get_write_use _snd_seq_port_info_get_write_use = _snd_seq_port_info_get_write_use_ptr .asFunction<_dart_snd_seq_port_info_get_write_use>(); int snd_seq_port_info_get_port_specified( ffi.Pointer info, ) { return _snd_seq_port_info_get_port_specified( info, ); } late final _snd_seq_port_info_get_port_specified_ptr = _lookup>( 'snd_seq_port_info_get_port_specified'); late final _dart_snd_seq_port_info_get_port_specified _snd_seq_port_info_get_port_specified = _snd_seq_port_info_get_port_specified_ptr .asFunction<_dart_snd_seq_port_info_get_port_specified>(); int snd_seq_port_info_get_timestamping( ffi.Pointer info, ) { return _snd_seq_port_info_get_timestamping( info, ); } late final _snd_seq_port_info_get_timestamping_ptr = _lookup>( 'snd_seq_port_info_get_timestamping'); late final _dart_snd_seq_port_info_get_timestamping _snd_seq_port_info_get_timestamping = _snd_seq_port_info_get_timestamping_ptr .asFunction<_dart_snd_seq_port_info_get_timestamping>(); int snd_seq_port_info_get_timestamp_real( ffi.Pointer info, ) { return _snd_seq_port_info_get_timestamp_real( info, ); } late final _snd_seq_port_info_get_timestamp_real_ptr = _lookup>( 'snd_seq_port_info_get_timestamp_real'); late final _dart_snd_seq_port_info_get_timestamp_real _snd_seq_port_info_get_timestamp_real = _snd_seq_port_info_get_timestamp_real_ptr .asFunction<_dart_snd_seq_port_info_get_timestamp_real>(); int snd_seq_port_info_get_timestamp_queue( ffi.Pointer info, ) { return _snd_seq_port_info_get_timestamp_queue( info, ); } late final _snd_seq_port_info_get_timestamp_queue_ptr = _lookup>( 'snd_seq_port_info_get_timestamp_queue'); late final _dart_snd_seq_port_info_get_timestamp_queue _snd_seq_port_info_get_timestamp_queue = _snd_seq_port_info_get_timestamp_queue_ptr .asFunction<_dart_snd_seq_port_info_get_timestamp_queue>(); void snd_seq_port_info_set_client( ffi.Pointer info, int client, ) { return _snd_seq_port_info_set_client( info, client, ); } late final _snd_seq_port_info_set_client_ptr = _lookup>( 'snd_seq_port_info_set_client'); late final _dart_snd_seq_port_info_set_client _snd_seq_port_info_set_client = _snd_seq_port_info_set_client_ptr .asFunction<_dart_snd_seq_port_info_set_client>(); void snd_seq_port_info_set_port( ffi.Pointer info, int port, ) { return _snd_seq_port_info_set_port( info, port, ); } late final _snd_seq_port_info_set_port_ptr = _lookup>( 'snd_seq_port_info_set_port'); late final _dart_snd_seq_port_info_set_port _snd_seq_port_info_set_port = _snd_seq_port_info_set_port_ptr .asFunction<_dart_snd_seq_port_info_set_port>(); void snd_seq_port_info_set_addr( ffi.Pointer info, ffi.Pointer addr, ) { return _snd_seq_port_info_set_addr( info, addr, ); } late final _snd_seq_port_info_set_addr_ptr = _lookup>( 'snd_seq_port_info_set_addr'); late final _dart_snd_seq_port_info_set_addr _snd_seq_port_info_set_addr = _snd_seq_port_info_set_addr_ptr .asFunction<_dart_snd_seq_port_info_set_addr>(); void snd_seq_port_info_set_name( ffi.Pointer info, ffi.Pointer name, ) { return _snd_seq_port_info_set_name( info, name, ); } late final _snd_seq_port_info_set_name_ptr = _lookup>( 'snd_seq_port_info_set_name'); late final _dart_snd_seq_port_info_set_name _snd_seq_port_info_set_name = _snd_seq_port_info_set_name_ptr .asFunction<_dart_snd_seq_port_info_set_name>(); void snd_seq_port_info_set_capability( ffi.Pointer info, int capability, ) { return _snd_seq_port_info_set_capability( info, capability, ); } late final _snd_seq_port_info_set_capability_ptr = _lookup>( 'snd_seq_port_info_set_capability'); late final _dart_snd_seq_port_info_set_capability _snd_seq_port_info_set_capability = _snd_seq_port_info_set_capability_ptr .asFunction<_dart_snd_seq_port_info_set_capability>(); void snd_seq_port_info_set_type( ffi.Pointer info, int type, ) { return _snd_seq_port_info_set_type( info, type, ); } late final _snd_seq_port_info_set_type_ptr = _lookup>( 'snd_seq_port_info_set_type'); late final _dart_snd_seq_port_info_set_type _snd_seq_port_info_set_type = _snd_seq_port_info_set_type_ptr .asFunction<_dart_snd_seq_port_info_set_type>(); void snd_seq_port_info_set_midi_channels( ffi.Pointer info, int channels, ) { return _snd_seq_port_info_set_midi_channels( info, channels, ); } late final _snd_seq_port_info_set_midi_channels_ptr = _lookup>( 'snd_seq_port_info_set_midi_channels'); late final _dart_snd_seq_port_info_set_midi_channels _snd_seq_port_info_set_midi_channels = _snd_seq_port_info_set_midi_channels_ptr .asFunction<_dart_snd_seq_port_info_set_midi_channels>(); void snd_seq_port_info_set_midi_voices( ffi.Pointer info, int voices, ) { return _snd_seq_port_info_set_midi_voices( info, voices, ); } late final _snd_seq_port_info_set_midi_voices_ptr = _lookup>( 'snd_seq_port_info_set_midi_voices'); late final _dart_snd_seq_port_info_set_midi_voices _snd_seq_port_info_set_midi_voices = _snd_seq_port_info_set_midi_voices_ptr .asFunction<_dart_snd_seq_port_info_set_midi_voices>(); void snd_seq_port_info_set_synth_voices( ffi.Pointer info, int voices, ) { return _snd_seq_port_info_set_synth_voices( info, voices, ); } late final _snd_seq_port_info_set_synth_voices_ptr = _lookup>( 'snd_seq_port_info_set_synth_voices'); late final _dart_snd_seq_port_info_set_synth_voices _snd_seq_port_info_set_synth_voices = _snd_seq_port_info_set_synth_voices_ptr .asFunction<_dart_snd_seq_port_info_set_synth_voices>(); void snd_seq_port_info_set_port_specified( ffi.Pointer info, int val, ) { return _snd_seq_port_info_set_port_specified( info, val, ); } late final _snd_seq_port_info_set_port_specified_ptr = _lookup>( 'snd_seq_port_info_set_port_specified'); late final _dart_snd_seq_port_info_set_port_specified _snd_seq_port_info_set_port_specified = _snd_seq_port_info_set_port_specified_ptr .asFunction<_dart_snd_seq_port_info_set_port_specified>(); void snd_seq_port_info_set_timestamping( ffi.Pointer info, int enable, ) { return _snd_seq_port_info_set_timestamping( info, enable, ); } late final _snd_seq_port_info_set_timestamping_ptr = _lookup>( 'snd_seq_port_info_set_timestamping'); late final _dart_snd_seq_port_info_set_timestamping _snd_seq_port_info_set_timestamping = _snd_seq_port_info_set_timestamping_ptr .asFunction<_dart_snd_seq_port_info_set_timestamping>(); void snd_seq_port_info_set_timestamp_real( ffi.Pointer info, int realtime, ) { return _snd_seq_port_info_set_timestamp_real( info, realtime, ); } late final _snd_seq_port_info_set_timestamp_real_ptr = _lookup>( 'snd_seq_port_info_set_timestamp_real'); late final _dart_snd_seq_port_info_set_timestamp_real _snd_seq_port_info_set_timestamp_real = _snd_seq_port_info_set_timestamp_real_ptr .asFunction<_dart_snd_seq_port_info_set_timestamp_real>(); void snd_seq_port_info_set_timestamp_queue( ffi.Pointer info, int queue, ) { return _snd_seq_port_info_set_timestamp_queue( info, queue, ); } late final _snd_seq_port_info_set_timestamp_queue_ptr = _lookup>( 'snd_seq_port_info_set_timestamp_queue'); late final _dart_snd_seq_port_info_set_timestamp_queue _snd_seq_port_info_set_timestamp_queue = _snd_seq_port_info_set_timestamp_queue_ptr .asFunction<_dart_snd_seq_port_info_set_timestamp_queue>(); int snd_seq_create_port( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_create_port( handle, info, ); } late final _snd_seq_create_port_ptr = _lookup>( 'snd_seq_create_port'); late final _dart_snd_seq_create_port _snd_seq_create_port = _snd_seq_create_port_ptr.asFunction<_dart_snd_seq_create_port>(); int snd_seq_delete_port( ffi.Pointer handle, int port, ) { return _snd_seq_delete_port( handle, port, ); } late final _snd_seq_delete_port_ptr = _lookup>( 'snd_seq_delete_port'); late final _dart_snd_seq_delete_port _snd_seq_delete_port = _snd_seq_delete_port_ptr.asFunction<_dart_snd_seq_delete_port>(); int snd_seq_get_port_info( ffi.Pointer handle, int port, ffi.Pointer info, ) { return _snd_seq_get_port_info( handle, port, info, ); } late final _snd_seq_get_port_info_ptr = _lookup>( 'snd_seq_get_port_info'); late final _dart_snd_seq_get_port_info _snd_seq_get_port_info = _snd_seq_get_port_info_ptr.asFunction<_dart_snd_seq_get_port_info>(); int snd_seq_get_any_port_info( ffi.Pointer handle, int client, int port, ffi.Pointer info, ) { return _snd_seq_get_any_port_info( handle, client, port, info, ); } late final _snd_seq_get_any_port_info_ptr = _lookup>( 'snd_seq_get_any_port_info'); late final _dart_snd_seq_get_any_port_info _snd_seq_get_any_port_info = _snd_seq_get_any_port_info_ptr .asFunction<_dart_snd_seq_get_any_port_info>(); int snd_seq_set_port_info( ffi.Pointer handle, int port, ffi.Pointer info, ) { return _snd_seq_set_port_info( handle, port, info, ); } late final _snd_seq_set_port_info_ptr = _lookup>( 'snd_seq_set_port_info'); late final _dart_snd_seq_set_port_info _snd_seq_set_port_info = _snd_seq_set_port_info_ptr.asFunction<_dart_snd_seq_set_port_info>(); int snd_seq_query_next_port( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_query_next_port( handle, info, ); } late final _snd_seq_query_next_port_ptr = _lookup>( 'snd_seq_query_next_port'); late final _dart_snd_seq_query_next_port _snd_seq_query_next_port = _snd_seq_query_next_port_ptr.asFunction<_dart_snd_seq_query_next_port>(); int snd_seq_port_subscribe_sizeof() { return _snd_seq_port_subscribe_sizeof(); } late final _snd_seq_port_subscribe_sizeof_ptr = _lookup>( 'snd_seq_port_subscribe_sizeof'); late final _dart_snd_seq_port_subscribe_sizeof _snd_seq_port_subscribe_sizeof = _snd_seq_port_subscribe_sizeof_ptr .asFunction<_dart_snd_seq_port_subscribe_sizeof>(); int snd_seq_port_subscribe_malloc( ffi.Pointer> ptr, ) { return _snd_seq_port_subscribe_malloc( ptr, ); } late final _snd_seq_port_subscribe_malloc_ptr = _lookup>( 'snd_seq_port_subscribe_malloc'); late final _dart_snd_seq_port_subscribe_malloc _snd_seq_port_subscribe_malloc = _snd_seq_port_subscribe_malloc_ptr .asFunction<_dart_snd_seq_port_subscribe_malloc>(); void snd_seq_port_subscribe_free( ffi.Pointer ptr, ) { return _snd_seq_port_subscribe_free( ptr, ); } late final _snd_seq_port_subscribe_free_ptr = _lookup>( 'snd_seq_port_subscribe_free'); late final _dart_snd_seq_port_subscribe_free _snd_seq_port_subscribe_free = _snd_seq_port_subscribe_free_ptr .asFunction<_dart_snd_seq_port_subscribe_free>(); void snd_seq_port_subscribe_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_port_subscribe_copy( dst, src, ); } late final _snd_seq_port_subscribe_copy_ptr = _lookup>( 'snd_seq_port_subscribe_copy'); late final _dart_snd_seq_port_subscribe_copy _snd_seq_port_subscribe_copy = _snd_seq_port_subscribe_copy_ptr .asFunction<_dart_snd_seq_port_subscribe_copy>(); ffi.Pointer snd_seq_port_subscribe_get_sender( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_sender( info, ); } late final _snd_seq_port_subscribe_get_sender_ptr = _lookup>( 'snd_seq_port_subscribe_get_sender'); late final _dart_snd_seq_port_subscribe_get_sender _snd_seq_port_subscribe_get_sender = _snd_seq_port_subscribe_get_sender_ptr .asFunction<_dart_snd_seq_port_subscribe_get_sender>(); ffi.Pointer snd_seq_port_subscribe_get_dest( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_dest( info, ); } late final _snd_seq_port_subscribe_get_dest_ptr = _lookup>( 'snd_seq_port_subscribe_get_dest'); late final _dart_snd_seq_port_subscribe_get_dest _snd_seq_port_subscribe_get_dest = _snd_seq_port_subscribe_get_dest_ptr .asFunction<_dart_snd_seq_port_subscribe_get_dest>(); int snd_seq_port_subscribe_get_queue( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_queue( info, ); } late final _snd_seq_port_subscribe_get_queue_ptr = _lookup>( 'snd_seq_port_subscribe_get_queue'); late final _dart_snd_seq_port_subscribe_get_queue _snd_seq_port_subscribe_get_queue = _snd_seq_port_subscribe_get_queue_ptr .asFunction<_dart_snd_seq_port_subscribe_get_queue>(); int snd_seq_port_subscribe_get_exclusive( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_exclusive( info, ); } late final _snd_seq_port_subscribe_get_exclusive_ptr = _lookup>( 'snd_seq_port_subscribe_get_exclusive'); late final _dart_snd_seq_port_subscribe_get_exclusive _snd_seq_port_subscribe_get_exclusive = _snd_seq_port_subscribe_get_exclusive_ptr .asFunction<_dart_snd_seq_port_subscribe_get_exclusive>(); int snd_seq_port_subscribe_get_time_update( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_time_update( info, ); } late final _snd_seq_port_subscribe_get_time_update_ptr = _lookup>( 'snd_seq_port_subscribe_get_time_update'); late final _dart_snd_seq_port_subscribe_get_time_update _snd_seq_port_subscribe_get_time_update = _snd_seq_port_subscribe_get_time_update_ptr .asFunction<_dart_snd_seq_port_subscribe_get_time_update>(); int snd_seq_port_subscribe_get_time_real( ffi.Pointer info, ) { return _snd_seq_port_subscribe_get_time_real( info, ); } late final _snd_seq_port_subscribe_get_time_real_ptr = _lookup>( 'snd_seq_port_subscribe_get_time_real'); late final _dart_snd_seq_port_subscribe_get_time_real _snd_seq_port_subscribe_get_time_real = _snd_seq_port_subscribe_get_time_real_ptr .asFunction<_dart_snd_seq_port_subscribe_get_time_real>(); void snd_seq_port_subscribe_set_sender( ffi.Pointer info, ffi.Pointer addr, ) { return _snd_seq_port_subscribe_set_sender( info, addr, ); } late final _snd_seq_port_subscribe_set_sender_ptr = _lookup>( 'snd_seq_port_subscribe_set_sender'); late final _dart_snd_seq_port_subscribe_set_sender _snd_seq_port_subscribe_set_sender = _snd_seq_port_subscribe_set_sender_ptr .asFunction<_dart_snd_seq_port_subscribe_set_sender>(); void snd_seq_port_subscribe_set_dest( ffi.Pointer info, ffi.Pointer addr, ) { return _snd_seq_port_subscribe_set_dest( info, addr, ); } late final _snd_seq_port_subscribe_set_dest_ptr = _lookup>( 'snd_seq_port_subscribe_set_dest'); late final _dart_snd_seq_port_subscribe_set_dest _snd_seq_port_subscribe_set_dest = _snd_seq_port_subscribe_set_dest_ptr .asFunction<_dart_snd_seq_port_subscribe_set_dest>(); void snd_seq_port_subscribe_set_queue( ffi.Pointer info, int q, ) { return _snd_seq_port_subscribe_set_queue( info, q, ); } late final _snd_seq_port_subscribe_set_queue_ptr = _lookup>( 'snd_seq_port_subscribe_set_queue'); late final _dart_snd_seq_port_subscribe_set_queue _snd_seq_port_subscribe_set_queue = _snd_seq_port_subscribe_set_queue_ptr .asFunction<_dart_snd_seq_port_subscribe_set_queue>(); void snd_seq_port_subscribe_set_exclusive( ffi.Pointer info, int val, ) { return _snd_seq_port_subscribe_set_exclusive( info, val, ); } late final _snd_seq_port_subscribe_set_exclusive_ptr = _lookup>( 'snd_seq_port_subscribe_set_exclusive'); late final _dart_snd_seq_port_subscribe_set_exclusive _snd_seq_port_subscribe_set_exclusive = _snd_seq_port_subscribe_set_exclusive_ptr .asFunction<_dart_snd_seq_port_subscribe_set_exclusive>(); void snd_seq_port_subscribe_set_time_update( ffi.Pointer info, int val, ) { return _snd_seq_port_subscribe_set_time_update( info, val, ); } late final _snd_seq_port_subscribe_set_time_update_ptr = _lookup>( 'snd_seq_port_subscribe_set_time_update'); late final _dart_snd_seq_port_subscribe_set_time_update _snd_seq_port_subscribe_set_time_update = _snd_seq_port_subscribe_set_time_update_ptr .asFunction<_dart_snd_seq_port_subscribe_set_time_update>(); void snd_seq_port_subscribe_set_time_real( ffi.Pointer info, int val, ) { return _snd_seq_port_subscribe_set_time_real( info, val, ); } late final _snd_seq_port_subscribe_set_time_real_ptr = _lookup>( 'snd_seq_port_subscribe_set_time_real'); late final _dart_snd_seq_port_subscribe_set_time_real _snd_seq_port_subscribe_set_time_real = _snd_seq_port_subscribe_set_time_real_ptr .asFunction<_dart_snd_seq_port_subscribe_set_time_real>(); int snd_seq_get_port_subscription( ffi.Pointer handle, ffi.Pointer sub, ) { return _snd_seq_get_port_subscription( handle, sub, ); } late final _snd_seq_get_port_subscription_ptr = _lookup>( 'snd_seq_get_port_subscription'); late final _dart_snd_seq_get_port_subscription _snd_seq_get_port_subscription = _snd_seq_get_port_subscription_ptr .asFunction<_dart_snd_seq_get_port_subscription>(); int snd_seq_subscribe_port( ffi.Pointer handle, ffi.Pointer sub, ) { return _snd_seq_subscribe_port( handle, sub, ); } late final _snd_seq_subscribe_port_ptr = _lookup>( 'snd_seq_subscribe_port'); late final _dart_snd_seq_subscribe_port _snd_seq_subscribe_port = _snd_seq_subscribe_port_ptr.asFunction<_dart_snd_seq_subscribe_port>(); int snd_seq_unsubscribe_port( ffi.Pointer handle, ffi.Pointer sub, ) { return _snd_seq_unsubscribe_port( handle, sub, ); } late final _snd_seq_unsubscribe_port_ptr = _lookup>( 'snd_seq_unsubscribe_port'); late final _dart_snd_seq_unsubscribe_port _snd_seq_unsubscribe_port = _snd_seq_unsubscribe_port_ptr .asFunction<_dart_snd_seq_unsubscribe_port>(); int snd_seq_query_subscribe_sizeof() { return _snd_seq_query_subscribe_sizeof(); } late final _snd_seq_query_subscribe_sizeof_ptr = _lookup>( 'snd_seq_query_subscribe_sizeof'); late final _dart_snd_seq_query_subscribe_sizeof _snd_seq_query_subscribe_sizeof = _snd_seq_query_subscribe_sizeof_ptr .asFunction<_dart_snd_seq_query_subscribe_sizeof>(); int snd_seq_query_subscribe_malloc( ffi.Pointer> ptr, ) { return _snd_seq_query_subscribe_malloc( ptr, ); } late final _snd_seq_query_subscribe_malloc_ptr = _lookup>( 'snd_seq_query_subscribe_malloc'); late final _dart_snd_seq_query_subscribe_malloc _snd_seq_query_subscribe_malloc = _snd_seq_query_subscribe_malloc_ptr .asFunction<_dart_snd_seq_query_subscribe_malloc>(); void snd_seq_query_subscribe_free( ffi.Pointer ptr, ) { return _snd_seq_query_subscribe_free( ptr, ); } late final _snd_seq_query_subscribe_free_ptr = _lookup>( 'snd_seq_query_subscribe_free'); late final _dart_snd_seq_query_subscribe_free _snd_seq_query_subscribe_free = _snd_seq_query_subscribe_free_ptr .asFunction<_dart_snd_seq_query_subscribe_free>(); void snd_seq_query_subscribe_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_query_subscribe_copy( dst, src, ); } late final _snd_seq_query_subscribe_copy_ptr = _lookup>( 'snd_seq_query_subscribe_copy'); late final _dart_snd_seq_query_subscribe_copy _snd_seq_query_subscribe_copy = _snd_seq_query_subscribe_copy_ptr .asFunction<_dart_snd_seq_query_subscribe_copy>(); int snd_seq_query_subscribe_get_client( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_client( info, ); } late final _snd_seq_query_subscribe_get_client_ptr = _lookup>( 'snd_seq_query_subscribe_get_client'); late final _dart_snd_seq_query_subscribe_get_client _snd_seq_query_subscribe_get_client = _snd_seq_query_subscribe_get_client_ptr .asFunction<_dart_snd_seq_query_subscribe_get_client>(); int snd_seq_query_subscribe_get_port( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_port( info, ); } late final _snd_seq_query_subscribe_get_port_ptr = _lookup>( 'snd_seq_query_subscribe_get_port'); late final _dart_snd_seq_query_subscribe_get_port _snd_seq_query_subscribe_get_port = _snd_seq_query_subscribe_get_port_ptr .asFunction<_dart_snd_seq_query_subscribe_get_port>(); ffi.Pointer snd_seq_query_subscribe_get_root( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_root( info, ); } late final _snd_seq_query_subscribe_get_root_ptr = _lookup>( 'snd_seq_query_subscribe_get_root'); late final _dart_snd_seq_query_subscribe_get_root _snd_seq_query_subscribe_get_root = _snd_seq_query_subscribe_get_root_ptr .asFunction<_dart_snd_seq_query_subscribe_get_root>(); int snd_seq_query_subscribe_get_type( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_type( info, ); } late final _snd_seq_query_subscribe_get_type_ptr = _lookup>( 'snd_seq_query_subscribe_get_type'); late final _dart_snd_seq_query_subscribe_get_type _snd_seq_query_subscribe_get_type = _snd_seq_query_subscribe_get_type_ptr .asFunction<_dart_snd_seq_query_subscribe_get_type>(); int snd_seq_query_subscribe_get_index( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_index( info, ); } late final _snd_seq_query_subscribe_get_index_ptr = _lookup>( 'snd_seq_query_subscribe_get_index'); late final _dart_snd_seq_query_subscribe_get_index _snd_seq_query_subscribe_get_index = _snd_seq_query_subscribe_get_index_ptr .asFunction<_dart_snd_seq_query_subscribe_get_index>(); int snd_seq_query_subscribe_get_num_subs( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_num_subs( info, ); } late final _snd_seq_query_subscribe_get_num_subs_ptr = _lookup>( 'snd_seq_query_subscribe_get_num_subs'); late final _dart_snd_seq_query_subscribe_get_num_subs _snd_seq_query_subscribe_get_num_subs = _snd_seq_query_subscribe_get_num_subs_ptr .asFunction<_dart_snd_seq_query_subscribe_get_num_subs>(); ffi.Pointer snd_seq_query_subscribe_get_addr( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_addr( info, ); } late final _snd_seq_query_subscribe_get_addr_ptr = _lookup>( 'snd_seq_query_subscribe_get_addr'); late final _dart_snd_seq_query_subscribe_get_addr _snd_seq_query_subscribe_get_addr = _snd_seq_query_subscribe_get_addr_ptr .asFunction<_dart_snd_seq_query_subscribe_get_addr>(); int snd_seq_query_subscribe_get_queue( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_queue( info, ); } late final _snd_seq_query_subscribe_get_queue_ptr = _lookup>( 'snd_seq_query_subscribe_get_queue'); late final _dart_snd_seq_query_subscribe_get_queue _snd_seq_query_subscribe_get_queue = _snd_seq_query_subscribe_get_queue_ptr .asFunction<_dart_snd_seq_query_subscribe_get_queue>(); int snd_seq_query_subscribe_get_exclusive( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_exclusive( info, ); } late final _snd_seq_query_subscribe_get_exclusive_ptr = _lookup>( 'snd_seq_query_subscribe_get_exclusive'); late final _dart_snd_seq_query_subscribe_get_exclusive _snd_seq_query_subscribe_get_exclusive = _snd_seq_query_subscribe_get_exclusive_ptr .asFunction<_dart_snd_seq_query_subscribe_get_exclusive>(); int snd_seq_query_subscribe_get_time_update( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_time_update( info, ); } late final _snd_seq_query_subscribe_get_time_update_ptr = _lookup>( 'snd_seq_query_subscribe_get_time_update'); late final _dart_snd_seq_query_subscribe_get_time_update _snd_seq_query_subscribe_get_time_update = _snd_seq_query_subscribe_get_time_update_ptr .asFunction<_dart_snd_seq_query_subscribe_get_time_update>(); int snd_seq_query_subscribe_get_time_real( ffi.Pointer info, ) { return _snd_seq_query_subscribe_get_time_real( info, ); } late final _snd_seq_query_subscribe_get_time_real_ptr = _lookup>( 'snd_seq_query_subscribe_get_time_real'); late final _dart_snd_seq_query_subscribe_get_time_real _snd_seq_query_subscribe_get_time_real = _snd_seq_query_subscribe_get_time_real_ptr .asFunction<_dart_snd_seq_query_subscribe_get_time_real>(); void snd_seq_query_subscribe_set_client( ffi.Pointer info, int client, ) { return _snd_seq_query_subscribe_set_client( info, client, ); } late final _snd_seq_query_subscribe_set_client_ptr = _lookup>( 'snd_seq_query_subscribe_set_client'); late final _dart_snd_seq_query_subscribe_set_client _snd_seq_query_subscribe_set_client = _snd_seq_query_subscribe_set_client_ptr .asFunction<_dart_snd_seq_query_subscribe_set_client>(); void snd_seq_query_subscribe_set_port( ffi.Pointer info, int port, ) { return _snd_seq_query_subscribe_set_port( info, port, ); } late final _snd_seq_query_subscribe_set_port_ptr = _lookup>( 'snd_seq_query_subscribe_set_port'); late final _dart_snd_seq_query_subscribe_set_port _snd_seq_query_subscribe_set_port = _snd_seq_query_subscribe_set_port_ptr .asFunction<_dart_snd_seq_query_subscribe_set_port>(); void snd_seq_query_subscribe_set_root( ffi.Pointer info, ffi.Pointer addr, ) { return _snd_seq_query_subscribe_set_root( info, addr, ); } late final _snd_seq_query_subscribe_set_root_ptr = _lookup>( 'snd_seq_query_subscribe_set_root'); late final _dart_snd_seq_query_subscribe_set_root _snd_seq_query_subscribe_set_root = _snd_seq_query_subscribe_set_root_ptr .asFunction<_dart_snd_seq_query_subscribe_set_root>(); void snd_seq_query_subscribe_set_type( ffi.Pointer info, int type, ) { return _snd_seq_query_subscribe_set_type( info, type, ); } late final _snd_seq_query_subscribe_set_type_ptr = _lookup>( 'snd_seq_query_subscribe_set_type'); late final _dart_snd_seq_query_subscribe_set_type _snd_seq_query_subscribe_set_type = _snd_seq_query_subscribe_set_type_ptr .asFunction<_dart_snd_seq_query_subscribe_set_type>(); void snd_seq_query_subscribe_set_index( ffi.Pointer info, int _index, ) { return _snd_seq_query_subscribe_set_index( info, _index, ); } late final _snd_seq_query_subscribe_set_index_ptr = _lookup>( 'snd_seq_query_subscribe_set_index'); late final _dart_snd_seq_query_subscribe_set_index _snd_seq_query_subscribe_set_index = _snd_seq_query_subscribe_set_index_ptr .asFunction<_dart_snd_seq_query_subscribe_set_index>(); int snd_seq_query_port_subscribers( ffi.Pointer seq, ffi.Pointer subs, ) { return _snd_seq_query_port_subscribers( seq, subs, ); } late final _snd_seq_query_port_subscribers_ptr = _lookup>( 'snd_seq_query_port_subscribers'); late final _dart_snd_seq_query_port_subscribers _snd_seq_query_port_subscribers = _snd_seq_query_port_subscribers_ptr .asFunction<_dart_snd_seq_query_port_subscribers>(); int snd_seq_queue_info_sizeof() { return _snd_seq_queue_info_sizeof(); } late final _snd_seq_queue_info_sizeof_ptr = _lookup>( 'snd_seq_queue_info_sizeof'); late final _dart_snd_seq_queue_info_sizeof _snd_seq_queue_info_sizeof = _snd_seq_queue_info_sizeof_ptr .asFunction<_dart_snd_seq_queue_info_sizeof>(); int snd_seq_queue_info_malloc( ffi.Pointer> ptr, ) { return _snd_seq_queue_info_malloc( ptr, ); } late final _snd_seq_queue_info_malloc_ptr = _lookup>( 'snd_seq_queue_info_malloc'); late final _dart_snd_seq_queue_info_malloc _snd_seq_queue_info_malloc = _snd_seq_queue_info_malloc_ptr .asFunction<_dart_snd_seq_queue_info_malloc>(); void snd_seq_queue_info_free( ffi.Pointer ptr, ) { return _snd_seq_queue_info_free( ptr, ); } late final _snd_seq_queue_info_free_ptr = _lookup>( 'snd_seq_queue_info_free'); late final _dart_snd_seq_queue_info_free _snd_seq_queue_info_free = _snd_seq_queue_info_free_ptr.asFunction<_dart_snd_seq_queue_info_free>(); void snd_seq_queue_info_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_queue_info_copy( dst, src, ); } late final _snd_seq_queue_info_copy_ptr = _lookup>( 'snd_seq_queue_info_copy'); late final _dart_snd_seq_queue_info_copy _snd_seq_queue_info_copy = _snd_seq_queue_info_copy_ptr.asFunction<_dart_snd_seq_queue_info_copy>(); int snd_seq_queue_info_get_queue( ffi.Pointer info, ) { return _snd_seq_queue_info_get_queue( info, ); } late final _snd_seq_queue_info_get_queue_ptr = _lookup>( 'snd_seq_queue_info_get_queue'); late final _dart_snd_seq_queue_info_get_queue _snd_seq_queue_info_get_queue = _snd_seq_queue_info_get_queue_ptr .asFunction<_dart_snd_seq_queue_info_get_queue>(); ffi.Pointer snd_seq_queue_info_get_name( ffi.Pointer info, ) { return _snd_seq_queue_info_get_name( info, ); } late final _snd_seq_queue_info_get_name_ptr = _lookup>( 'snd_seq_queue_info_get_name'); late final _dart_snd_seq_queue_info_get_name _snd_seq_queue_info_get_name = _snd_seq_queue_info_get_name_ptr .asFunction<_dart_snd_seq_queue_info_get_name>(); int snd_seq_queue_info_get_owner( ffi.Pointer info, ) { return _snd_seq_queue_info_get_owner( info, ); } late final _snd_seq_queue_info_get_owner_ptr = _lookup>( 'snd_seq_queue_info_get_owner'); late final _dart_snd_seq_queue_info_get_owner _snd_seq_queue_info_get_owner = _snd_seq_queue_info_get_owner_ptr .asFunction<_dart_snd_seq_queue_info_get_owner>(); int snd_seq_queue_info_get_locked( ffi.Pointer info, ) { return _snd_seq_queue_info_get_locked( info, ); } late final _snd_seq_queue_info_get_locked_ptr = _lookup>( 'snd_seq_queue_info_get_locked'); late final _dart_snd_seq_queue_info_get_locked _snd_seq_queue_info_get_locked = _snd_seq_queue_info_get_locked_ptr .asFunction<_dart_snd_seq_queue_info_get_locked>(); int snd_seq_queue_info_get_flags( ffi.Pointer info, ) { return _snd_seq_queue_info_get_flags( info, ); } late final _snd_seq_queue_info_get_flags_ptr = _lookup>( 'snd_seq_queue_info_get_flags'); late final _dart_snd_seq_queue_info_get_flags _snd_seq_queue_info_get_flags = _snd_seq_queue_info_get_flags_ptr .asFunction<_dart_snd_seq_queue_info_get_flags>(); void snd_seq_queue_info_set_name( ffi.Pointer info, ffi.Pointer name, ) { return _snd_seq_queue_info_set_name( info, name, ); } late final _snd_seq_queue_info_set_name_ptr = _lookup>( 'snd_seq_queue_info_set_name'); late final _dart_snd_seq_queue_info_set_name _snd_seq_queue_info_set_name = _snd_seq_queue_info_set_name_ptr .asFunction<_dart_snd_seq_queue_info_set_name>(); void snd_seq_queue_info_set_owner( ffi.Pointer info, int owner, ) { return _snd_seq_queue_info_set_owner( info, owner, ); } late final _snd_seq_queue_info_set_owner_ptr = _lookup>( 'snd_seq_queue_info_set_owner'); late final _dart_snd_seq_queue_info_set_owner _snd_seq_queue_info_set_owner = _snd_seq_queue_info_set_owner_ptr .asFunction<_dart_snd_seq_queue_info_set_owner>(); void snd_seq_queue_info_set_locked( ffi.Pointer info, int locked, ) { return _snd_seq_queue_info_set_locked( info, locked, ); } late final _snd_seq_queue_info_set_locked_ptr = _lookup>( 'snd_seq_queue_info_set_locked'); late final _dart_snd_seq_queue_info_set_locked _snd_seq_queue_info_set_locked = _snd_seq_queue_info_set_locked_ptr .asFunction<_dart_snd_seq_queue_info_set_locked>(); void snd_seq_queue_info_set_flags( ffi.Pointer info, int flags, ) { return _snd_seq_queue_info_set_flags( info, flags, ); } late final _snd_seq_queue_info_set_flags_ptr = _lookup>( 'snd_seq_queue_info_set_flags'); late final _dart_snd_seq_queue_info_set_flags _snd_seq_queue_info_set_flags = _snd_seq_queue_info_set_flags_ptr .asFunction<_dart_snd_seq_queue_info_set_flags>(); int snd_seq_create_queue( ffi.Pointer seq, ffi.Pointer info, ) { return _snd_seq_create_queue( seq, info, ); } late final _snd_seq_create_queue_ptr = _lookup>( 'snd_seq_create_queue'); late final _dart_snd_seq_create_queue _snd_seq_create_queue = _snd_seq_create_queue_ptr.asFunction<_dart_snd_seq_create_queue>(); int snd_seq_alloc_named_queue( ffi.Pointer seq, ffi.Pointer name, ) { return _snd_seq_alloc_named_queue( seq, name, ); } late final _snd_seq_alloc_named_queue_ptr = _lookup>( 'snd_seq_alloc_named_queue'); late final _dart_snd_seq_alloc_named_queue _snd_seq_alloc_named_queue = _snd_seq_alloc_named_queue_ptr .asFunction<_dart_snd_seq_alloc_named_queue>(); int snd_seq_alloc_queue( ffi.Pointer handle, ) { return _snd_seq_alloc_queue( handle, ); } late final _snd_seq_alloc_queue_ptr = _lookup>( 'snd_seq_alloc_queue'); late final _dart_snd_seq_alloc_queue _snd_seq_alloc_queue = _snd_seq_alloc_queue_ptr.asFunction<_dart_snd_seq_alloc_queue>(); int snd_seq_free_queue( ffi.Pointer handle, int q, ) { return _snd_seq_free_queue( handle, q, ); } late final _snd_seq_free_queue_ptr = _lookup>('snd_seq_free_queue'); late final _dart_snd_seq_free_queue _snd_seq_free_queue = _snd_seq_free_queue_ptr.asFunction<_dart_snd_seq_free_queue>(); int snd_seq_get_queue_info( ffi.Pointer seq, int q, ffi.Pointer info, ) { return _snd_seq_get_queue_info( seq, q, info, ); } late final _snd_seq_get_queue_info_ptr = _lookup>( 'snd_seq_get_queue_info'); late final _dart_snd_seq_get_queue_info _snd_seq_get_queue_info = _snd_seq_get_queue_info_ptr.asFunction<_dart_snd_seq_get_queue_info>(); int snd_seq_set_queue_info( ffi.Pointer seq, int q, ffi.Pointer info, ) { return _snd_seq_set_queue_info( seq, q, info, ); } late final _snd_seq_set_queue_info_ptr = _lookup>( 'snd_seq_set_queue_info'); late final _dart_snd_seq_set_queue_info _snd_seq_set_queue_info = _snd_seq_set_queue_info_ptr.asFunction<_dart_snd_seq_set_queue_info>(); int snd_seq_query_named_queue( ffi.Pointer seq, ffi.Pointer name, ) { return _snd_seq_query_named_queue( seq, name, ); } late final _snd_seq_query_named_queue_ptr = _lookup>( 'snd_seq_query_named_queue'); late final _dart_snd_seq_query_named_queue _snd_seq_query_named_queue = _snd_seq_query_named_queue_ptr .asFunction<_dart_snd_seq_query_named_queue>(); int snd_seq_get_queue_usage( ffi.Pointer handle, int q, ) { return _snd_seq_get_queue_usage( handle, q, ); } late final _snd_seq_get_queue_usage_ptr = _lookup>( 'snd_seq_get_queue_usage'); late final _dart_snd_seq_get_queue_usage _snd_seq_get_queue_usage = _snd_seq_get_queue_usage_ptr.asFunction<_dart_snd_seq_get_queue_usage>(); int snd_seq_set_queue_usage( ffi.Pointer handle, int q, int used, ) { return _snd_seq_set_queue_usage( handle, q, used, ); } late final _snd_seq_set_queue_usage_ptr = _lookup>( 'snd_seq_set_queue_usage'); late final _dart_snd_seq_set_queue_usage _snd_seq_set_queue_usage = _snd_seq_set_queue_usage_ptr.asFunction<_dart_snd_seq_set_queue_usage>(); int snd_seq_queue_status_sizeof() { return _snd_seq_queue_status_sizeof(); } late final _snd_seq_queue_status_sizeof_ptr = _lookup>( 'snd_seq_queue_status_sizeof'); late final _dart_snd_seq_queue_status_sizeof _snd_seq_queue_status_sizeof = _snd_seq_queue_status_sizeof_ptr .asFunction<_dart_snd_seq_queue_status_sizeof>(); int snd_seq_queue_status_malloc( ffi.Pointer> ptr, ) { return _snd_seq_queue_status_malloc( ptr, ); } late final _snd_seq_queue_status_malloc_ptr = _lookup>( 'snd_seq_queue_status_malloc'); late final _dart_snd_seq_queue_status_malloc _snd_seq_queue_status_malloc = _snd_seq_queue_status_malloc_ptr .asFunction<_dart_snd_seq_queue_status_malloc>(); void snd_seq_queue_status_free( ffi.Pointer ptr, ) { return _snd_seq_queue_status_free( ptr, ); } late final _snd_seq_queue_status_free_ptr = _lookup>( 'snd_seq_queue_status_free'); late final _dart_snd_seq_queue_status_free _snd_seq_queue_status_free = _snd_seq_queue_status_free_ptr .asFunction<_dart_snd_seq_queue_status_free>(); void snd_seq_queue_status_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_queue_status_copy( dst, src, ); } late final _snd_seq_queue_status_copy_ptr = _lookup>( 'snd_seq_queue_status_copy'); late final _dart_snd_seq_queue_status_copy _snd_seq_queue_status_copy = _snd_seq_queue_status_copy_ptr .asFunction<_dart_snd_seq_queue_status_copy>(); int snd_seq_queue_status_get_queue( ffi.Pointer info, ) { return _snd_seq_queue_status_get_queue( info, ); } late final _snd_seq_queue_status_get_queue_ptr = _lookup>( 'snd_seq_queue_status_get_queue'); late final _dart_snd_seq_queue_status_get_queue _snd_seq_queue_status_get_queue = _snd_seq_queue_status_get_queue_ptr .asFunction<_dart_snd_seq_queue_status_get_queue>(); int snd_seq_queue_status_get_events( ffi.Pointer info, ) { return _snd_seq_queue_status_get_events( info, ); } late final _snd_seq_queue_status_get_events_ptr = _lookup>( 'snd_seq_queue_status_get_events'); late final _dart_snd_seq_queue_status_get_events _snd_seq_queue_status_get_events = _snd_seq_queue_status_get_events_ptr .asFunction<_dart_snd_seq_queue_status_get_events>(); int snd_seq_queue_status_get_tick_time( ffi.Pointer info, ) { return _snd_seq_queue_status_get_tick_time( info, ); } late final _snd_seq_queue_status_get_tick_time_ptr = _lookup>( 'snd_seq_queue_status_get_tick_time'); late final _dart_snd_seq_queue_status_get_tick_time _snd_seq_queue_status_get_tick_time = _snd_seq_queue_status_get_tick_time_ptr .asFunction<_dart_snd_seq_queue_status_get_tick_time>(); ffi.Pointer snd_seq_queue_status_get_real_time( ffi.Pointer info, ) { return _snd_seq_queue_status_get_real_time( info, ); } late final _snd_seq_queue_status_get_real_time_ptr = _lookup>( 'snd_seq_queue_status_get_real_time'); late final _dart_snd_seq_queue_status_get_real_time _snd_seq_queue_status_get_real_time = _snd_seq_queue_status_get_real_time_ptr .asFunction<_dart_snd_seq_queue_status_get_real_time>(); int snd_seq_queue_status_get_status( ffi.Pointer info, ) { return _snd_seq_queue_status_get_status( info, ); } late final _snd_seq_queue_status_get_status_ptr = _lookup>( 'snd_seq_queue_status_get_status'); late final _dart_snd_seq_queue_status_get_status _snd_seq_queue_status_get_status = _snd_seq_queue_status_get_status_ptr .asFunction<_dart_snd_seq_queue_status_get_status>(); int snd_seq_get_queue_status( ffi.Pointer handle, int q, ffi.Pointer status, ) { return _snd_seq_get_queue_status( handle, q, status, ); } late final _snd_seq_get_queue_status_ptr = _lookup>( 'snd_seq_get_queue_status'); late final _dart_snd_seq_get_queue_status _snd_seq_get_queue_status = _snd_seq_get_queue_status_ptr .asFunction<_dart_snd_seq_get_queue_status>(); int snd_seq_queue_tempo_sizeof() { return _snd_seq_queue_tempo_sizeof(); } late final _snd_seq_queue_tempo_sizeof_ptr = _lookup>( 'snd_seq_queue_tempo_sizeof'); late final _dart_snd_seq_queue_tempo_sizeof _snd_seq_queue_tempo_sizeof = _snd_seq_queue_tempo_sizeof_ptr .asFunction<_dart_snd_seq_queue_tempo_sizeof>(); int snd_seq_queue_tempo_malloc( ffi.Pointer> ptr, ) { return _snd_seq_queue_tempo_malloc( ptr, ); } late final _snd_seq_queue_tempo_malloc_ptr = _lookup>( 'snd_seq_queue_tempo_malloc'); late final _dart_snd_seq_queue_tempo_malloc _snd_seq_queue_tempo_malloc = _snd_seq_queue_tempo_malloc_ptr .asFunction<_dart_snd_seq_queue_tempo_malloc>(); void snd_seq_queue_tempo_free( ffi.Pointer ptr, ) { return _snd_seq_queue_tempo_free( ptr, ); } late final _snd_seq_queue_tempo_free_ptr = _lookup>( 'snd_seq_queue_tempo_free'); late final _dart_snd_seq_queue_tempo_free _snd_seq_queue_tempo_free = _snd_seq_queue_tempo_free_ptr .asFunction<_dart_snd_seq_queue_tempo_free>(); void snd_seq_queue_tempo_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_queue_tempo_copy( dst, src, ); } late final _snd_seq_queue_tempo_copy_ptr = _lookup>( 'snd_seq_queue_tempo_copy'); late final _dart_snd_seq_queue_tempo_copy _snd_seq_queue_tempo_copy = _snd_seq_queue_tempo_copy_ptr .asFunction<_dart_snd_seq_queue_tempo_copy>(); int snd_seq_queue_tempo_get_queue( ffi.Pointer info, ) { return _snd_seq_queue_tempo_get_queue( info, ); } late final _snd_seq_queue_tempo_get_queue_ptr = _lookup>( 'snd_seq_queue_tempo_get_queue'); late final _dart_snd_seq_queue_tempo_get_queue _snd_seq_queue_tempo_get_queue = _snd_seq_queue_tempo_get_queue_ptr .asFunction<_dart_snd_seq_queue_tempo_get_queue>(); int snd_seq_queue_tempo_get_tempo( ffi.Pointer info, ) { return _snd_seq_queue_tempo_get_tempo( info, ); } late final _snd_seq_queue_tempo_get_tempo_ptr = _lookup>( 'snd_seq_queue_tempo_get_tempo'); late final _dart_snd_seq_queue_tempo_get_tempo _snd_seq_queue_tempo_get_tempo = _snd_seq_queue_tempo_get_tempo_ptr .asFunction<_dart_snd_seq_queue_tempo_get_tempo>(); int snd_seq_queue_tempo_get_ppq( ffi.Pointer info, ) { return _snd_seq_queue_tempo_get_ppq( info, ); } late final _snd_seq_queue_tempo_get_ppq_ptr = _lookup>( 'snd_seq_queue_tempo_get_ppq'); late final _dart_snd_seq_queue_tempo_get_ppq _snd_seq_queue_tempo_get_ppq = _snd_seq_queue_tempo_get_ppq_ptr .asFunction<_dart_snd_seq_queue_tempo_get_ppq>(); int snd_seq_queue_tempo_get_skew( ffi.Pointer info, ) { return _snd_seq_queue_tempo_get_skew( info, ); } late final _snd_seq_queue_tempo_get_skew_ptr = _lookup>( 'snd_seq_queue_tempo_get_skew'); late final _dart_snd_seq_queue_tempo_get_skew _snd_seq_queue_tempo_get_skew = _snd_seq_queue_tempo_get_skew_ptr .asFunction<_dart_snd_seq_queue_tempo_get_skew>(); int snd_seq_queue_tempo_get_skew_base( ffi.Pointer info, ) { return _snd_seq_queue_tempo_get_skew_base( info, ); } late final _snd_seq_queue_tempo_get_skew_base_ptr = _lookup>( 'snd_seq_queue_tempo_get_skew_base'); late final _dart_snd_seq_queue_tempo_get_skew_base _snd_seq_queue_tempo_get_skew_base = _snd_seq_queue_tempo_get_skew_base_ptr .asFunction<_dart_snd_seq_queue_tempo_get_skew_base>(); void snd_seq_queue_tempo_set_tempo( ffi.Pointer info, int tempo, ) { return _snd_seq_queue_tempo_set_tempo( info, tempo, ); } late final _snd_seq_queue_tempo_set_tempo_ptr = _lookup>( 'snd_seq_queue_tempo_set_tempo'); late final _dart_snd_seq_queue_tempo_set_tempo _snd_seq_queue_tempo_set_tempo = _snd_seq_queue_tempo_set_tempo_ptr .asFunction<_dart_snd_seq_queue_tempo_set_tempo>(); void snd_seq_queue_tempo_set_ppq( ffi.Pointer info, int ppq, ) { return _snd_seq_queue_tempo_set_ppq( info, ppq, ); } late final _snd_seq_queue_tempo_set_ppq_ptr = _lookup>( 'snd_seq_queue_tempo_set_ppq'); late final _dart_snd_seq_queue_tempo_set_ppq _snd_seq_queue_tempo_set_ppq = _snd_seq_queue_tempo_set_ppq_ptr .asFunction<_dart_snd_seq_queue_tempo_set_ppq>(); void snd_seq_queue_tempo_set_skew( ffi.Pointer info, int skew, ) { return _snd_seq_queue_tempo_set_skew( info, skew, ); } late final _snd_seq_queue_tempo_set_skew_ptr = _lookup>( 'snd_seq_queue_tempo_set_skew'); late final _dart_snd_seq_queue_tempo_set_skew _snd_seq_queue_tempo_set_skew = _snd_seq_queue_tempo_set_skew_ptr .asFunction<_dart_snd_seq_queue_tempo_set_skew>(); void snd_seq_queue_tempo_set_skew_base( ffi.Pointer info, int base, ) { return _snd_seq_queue_tempo_set_skew_base( info, base, ); } late final _snd_seq_queue_tempo_set_skew_base_ptr = _lookup>( 'snd_seq_queue_tempo_set_skew_base'); late final _dart_snd_seq_queue_tempo_set_skew_base _snd_seq_queue_tempo_set_skew_base = _snd_seq_queue_tempo_set_skew_base_ptr .asFunction<_dart_snd_seq_queue_tempo_set_skew_base>(); int snd_seq_get_queue_tempo( ffi.Pointer handle, int q, ffi.Pointer tempo, ) { return _snd_seq_get_queue_tempo( handle, q, tempo, ); } late final _snd_seq_get_queue_tempo_ptr = _lookup>( 'snd_seq_get_queue_tempo'); late final _dart_snd_seq_get_queue_tempo _snd_seq_get_queue_tempo = _snd_seq_get_queue_tempo_ptr.asFunction<_dart_snd_seq_get_queue_tempo>(); int snd_seq_set_queue_tempo( ffi.Pointer handle, int q, ffi.Pointer tempo, ) { return _snd_seq_set_queue_tempo( handle, q, tempo, ); } late final _snd_seq_set_queue_tempo_ptr = _lookup>( 'snd_seq_set_queue_tempo'); late final _dart_snd_seq_set_queue_tempo _snd_seq_set_queue_tempo = _snd_seq_set_queue_tempo_ptr.asFunction<_dart_snd_seq_set_queue_tempo>(); int snd_seq_queue_timer_sizeof() { return _snd_seq_queue_timer_sizeof(); } late final _snd_seq_queue_timer_sizeof_ptr = _lookup>( 'snd_seq_queue_timer_sizeof'); late final _dart_snd_seq_queue_timer_sizeof _snd_seq_queue_timer_sizeof = _snd_seq_queue_timer_sizeof_ptr .asFunction<_dart_snd_seq_queue_timer_sizeof>(); int snd_seq_queue_timer_malloc( ffi.Pointer> ptr, ) { return _snd_seq_queue_timer_malloc( ptr, ); } late final _snd_seq_queue_timer_malloc_ptr = _lookup>( 'snd_seq_queue_timer_malloc'); late final _dart_snd_seq_queue_timer_malloc _snd_seq_queue_timer_malloc = _snd_seq_queue_timer_malloc_ptr .asFunction<_dart_snd_seq_queue_timer_malloc>(); void snd_seq_queue_timer_free( ffi.Pointer ptr, ) { return _snd_seq_queue_timer_free( ptr, ); } late final _snd_seq_queue_timer_free_ptr = _lookup>( 'snd_seq_queue_timer_free'); late final _dart_snd_seq_queue_timer_free _snd_seq_queue_timer_free = _snd_seq_queue_timer_free_ptr .asFunction<_dart_snd_seq_queue_timer_free>(); void snd_seq_queue_timer_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_queue_timer_copy( dst, src, ); } late final _snd_seq_queue_timer_copy_ptr = _lookup>( 'snd_seq_queue_timer_copy'); late final _dart_snd_seq_queue_timer_copy _snd_seq_queue_timer_copy = _snd_seq_queue_timer_copy_ptr .asFunction<_dart_snd_seq_queue_timer_copy>(); int snd_seq_queue_timer_get_queue( ffi.Pointer info, ) { return _snd_seq_queue_timer_get_queue( info, ); } late final _snd_seq_queue_timer_get_queue_ptr = _lookup>( 'snd_seq_queue_timer_get_queue'); late final _dart_snd_seq_queue_timer_get_queue _snd_seq_queue_timer_get_queue = _snd_seq_queue_timer_get_queue_ptr .asFunction<_dart_snd_seq_queue_timer_get_queue>(); int snd_seq_queue_timer_get_type( ffi.Pointer info, ) { return _snd_seq_queue_timer_get_type( info, ); } late final _snd_seq_queue_timer_get_type_ptr = _lookup>( 'snd_seq_queue_timer_get_type'); late final _dart_snd_seq_queue_timer_get_type _snd_seq_queue_timer_get_type = _snd_seq_queue_timer_get_type_ptr .asFunction<_dart_snd_seq_queue_timer_get_type>(); ffi.Pointer snd_seq_queue_timer_get_id( ffi.Pointer info, ) { return _snd_seq_queue_timer_get_id( info, ); } late final _snd_seq_queue_timer_get_id_ptr = _lookup>( 'snd_seq_queue_timer_get_id'); late final _dart_snd_seq_queue_timer_get_id _snd_seq_queue_timer_get_id = _snd_seq_queue_timer_get_id_ptr .asFunction<_dart_snd_seq_queue_timer_get_id>(); int snd_seq_queue_timer_get_resolution( ffi.Pointer info, ) { return _snd_seq_queue_timer_get_resolution( info, ); } late final _snd_seq_queue_timer_get_resolution_ptr = _lookup>( 'snd_seq_queue_timer_get_resolution'); late final _dart_snd_seq_queue_timer_get_resolution _snd_seq_queue_timer_get_resolution = _snd_seq_queue_timer_get_resolution_ptr .asFunction<_dart_snd_seq_queue_timer_get_resolution>(); void snd_seq_queue_timer_set_type( ffi.Pointer info, int type, ) { return _snd_seq_queue_timer_set_type( info, type, ); } late final _snd_seq_queue_timer_set_type_ptr = _lookup>( 'snd_seq_queue_timer_set_type'); late final _dart_snd_seq_queue_timer_set_type _snd_seq_queue_timer_set_type = _snd_seq_queue_timer_set_type_ptr .asFunction<_dart_snd_seq_queue_timer_set_type>(); void snd_seq_queue_timer_set_id( ffi.Pointer info, ffi.Pointer id, ) { return _snd_seq_queue_timer_set_id( info, id, ); } late final _snd_seq_queue_timer_set_id_ptr = _lookup>( 'snd_seq_queue_timer_set_id'); late final _dart_snd_seq_queue_timer_set_id _snd_seq_queue_timer_set_id = _snd_seq_queue_timer_set_id_ptr .asFunction<_dart_snd_seq_queue_timer_set_id>(); void snd_seq_queue_timer_set_resolution( ffi.Pointer info, int resolution, ) { return _snd_seq_queue_timer_set_resolution( info, resolution, ); } late final _snd_seq_queue_timer_set_resolution_ptr = _lookup>( 'snd_seq_queue_timer_set_resolution'); late final _dart_snd_seq_queue_timer_set_resolution _snd_seq_queue_timer_set_resolution = _snd_seq_queue_timer_set_resolution_ptr .asFunction<_dart_snd_seq_queue_timer_set_resolution>(); int snd_seq_get_queue_timer( ffi.Pointer handle, int q, ffi.Pointer timer, ) { return _snd_seq_get_queue_timer( handle, q, timer, ); } late final _snd_seq_get_queue_timer_ptr = _lookup>( 'snd_seq_get_queue_timer'); late final _dart_snd_seq_get_queue_timer _snd_seq_get_queue_timer = _snd_seq_get_queue_timer_ptr.asFunction<_dart_snd_seq_get_queue_timer>(); int snd_seq_set_queue_timer( ffi.Pointer handle, int q, ffi.Pointer timer, ) { return _snd_seq_set_queue_timer( handle, q, timer, ); } late final _snd_seq_set_queue_timer_ptr = _lookup>( 'snd_seq_set_queue_timer'); late final _dart_snd_seq_set_queue_timer _snd_seq_set_queue_timer = _snd_seq_set_queue_timer_ptr.asFunction<_dart_snd_seq_set_queue_timer>(); int snd_seq_free_event( ffi.Pointer ev, ) { return _snd_seq_free_event( ev, ); } late final _snd_seq_free_event_ptr = _lookup>('snd_seq_free_event'); late final _dart_snd_seq_free_event _snd_seq_free_event = _snd_seq_free_event_ptr.asFunction<_dart_snd_seq_free_event>(); int snd_seq_event_length( ffi.Pointer ev, ) { return _snd_seq_event_length( ev, ); } late final _snd_seq_event_length_ptr = _lookup>( 'snd_seq_event_length'); late final _dart_snd_seq_event_length _snd_seq_event_length = _snd_seq_event_length_ptr.asFunction<_dart_snd_seq_event_length>(); int snd_seq_event_output( ffi.Pointer handle, ffi.Pointer ev, ) { return _snd_seq_event_output( handle, ev, ); } late final _snd_seq_event_output_ptr = _lookup>( 'snd_seq_event_output'); late final _dart_snd_seq_event_output _snd_seq_event_output = _snd_seq_event_output_ptr.asFunction<_dart_snd_seq_event_output>(); int snd_seq_event_output_buffer( ffi.Pointer handle, ffi.Pointer ev, ) { return _snd_seq_event_output_buffer( handle, ev, ); } late final _snd_seq_event_output_buffer_ptr = _lookup>( 'snd_seq_event_output_buffer'); late final _dart_snd_seq_event_output_buffer _snd_seq_event_output_buffer = _snd_seq_event_output_buffer_ptr .asFunction<_dart_snd_seq_event_output_buffer>(); int snd_seq_event_output_direct( ffi.Pointer handle, ffi.Pointer ev, ) { return _snd_seq_event_output_direct( handle, ev, ); } late final _snd_seq_event_output_direct_ptr = _lookup>( 'snd_seq_event_output_direct'); late final _dart_snd_seq_event_output_direct _snd_seq_event_output_direct = _snd_seq_event_output_direct_ptr .asFunction<_dart_snd_seq_event_output_direct>(); int snd_seq_event_input( ffi.Pointer handle, ffi.Pointer> ev, ) { return _snd_seq_event_input( handle, ev, ); } late final _snd_seq_event_input_ptr = _lookup>( 'snd_seq_event_input'); late final _dart_snd_seq_event_input _snd_seq_event_input = _snd_seq_event_input_ptr.asFunction<_dart_snd_seq_event_input>(); int snd_seq_event_input_pending( ffi.Pointer seq, int fetch_sequencer, ) { return _snd_seq_event_input_pending( seq, fetch_sequencer, ); } late final _snd_seq_event_input_pending_ptr = _lookup>( 'snd_seq_event_input_pending'); late final _dart_snd_seq_event_input_pending _snd_seq_event_input_pending = _snd_seq_event_input_pending_ptr .asFunction<_dart_snd_seq_event_input_pending>(); int snd_seq_drain_output( ffi.Pointer handle, ) { return _snd_seq_drain_output( handle, ); } late final _snd_seq_drain_output_ptr = _lookup>( 'snd_seq_drain_output'); late final _dart_snd_seq_drain_output _snd_seq_drain_output = _snd_seq_drain_output_ptr.asFunction<_dart_snd_seq_drain_output>(); int snd_seq_event_output_pending( ffi.Pointer seq, ) { return _snd_seq_event_output_pending( seq, ); } late final _snd_seq_event_output_pending_ptr = _lookup>( 'snd_seq_event_output_pending'); late final _dart_snd_seq_event_output_pending _snd_seq_event_output_pending = _snd_seq_event_output_pending_ptr .asFunction<_dart_snd_seq_event_output_pending>(); int snd_seq_extract_output( ffi.Pointer handle, ffi.Pointer> ev, ) { return _snd_seq_extract_output( handle, ev, ); } late final _snd_seq_extract_output_ptr = _lookup>( 'snd_seq_extract_output'); late final _dart_snd_seq_extract_output _snd_seq_extract_output = _snd_seq_extract_output_ptr.asFunction<_dart_snd_seq_extract_output>(); int snd_seq_drop_output( ffi.Pointer handle, ) { return _snd_seq_drop_output( handle, ); } late final _snd_seq_drop_output_ptr = _lookup>( 'snd_seq_drop_output'); late final _dart_snd_seq_drop_output _snd_seq_drop_output = _snd_seq_drop_output_ptr.asFunction<_dart_snd_seq_drop_output>(); int snd_seq_drop_output_buffer( ffi.Pointer handle, ) { return _snd_seq_drop_output_buffer( handle, ); } late final _snd_seq_drop_output_buffer_ptr = _lookup>( 'snd_seq_drop_output_buffer'); late final _dart_snd_seq_drop_output_buffer _snd_seq_drop_output_buffer = _snd_seq_drop_output_buffer_ptr .asFunction<_dart_snd_seq_drop_output_buffer>(); int snd_seq_drop_input( ffi.Pointer handle, ) { return _snd_seq_drop_input( handle, ); } late final _snd_seq_drop_input_ptr = _lookup>('snd_seq_drop_input'); late final _dart_snd_seq_drop_input _snd_seq_drop_input = _snd_seq_drop_input_ptr.asFunction<_dart_snd_seq_drop_input>(); int snd_seq_drop_input_buffer( ffi.Pointer handle, ) { return _snd_seq_drop_input_buffer( handle, ); } late final _snd_seq_drop_input_buffer_ptr = _lookup>( 'snd_seq_drop_input_buffer'); late final _dart_snd_seq_drop_input_buffer _snd_seq_drop_input_buffer = _snd_seq_drop_input_buffer_ptr .asFunction<_dart_snd_seq_drop_input_buffer>(); int snd_seq_remove_events_sizeof() { return _snd_seq_remove_events_sizeof(); } late final _snd_seq_remove_events_sizeof_ptr = _lookup>( 'snd_seq_remove_events_sizeof'); late final _dart_snd_seq_remove_events_sizeof _snd_seq_remove_events_sizeof = _snd_seq_remove_events_sizeof_ptr .asFunction<_dart_snd_seq_remove_events_sizeof>(); int snd_seq_remove_events_malloc( ffi.Pointer> ptr, ) { return _snd_seq_remove_events_malloc( ptr, ); } late final _snd_seq_remove_events_malloc_ptr = _lookup>( 'snd_seq_remove_events_malloc'); late final _dart_snd_seq_remove_events_malloc _snd_seq_remove_events_malloc = _snd_seq_remove_events_malloc_ptr .asFunction<_dart_snd_seq_remove_events_malloc>(); void snd_seq_remove_events_free( ffi.Pointer ptr, ) { return _snd_seq_remove_events_free( ptr, ); } late final _snd_seq_remove_events_free_ptr = _lookup>( 'snd_seq_remove_events_free'); late final _dart_snd_seq_remove_events_free _snd_seq_remove_events_free = _snd_seq_remove_events_free_ptr .asFunction<_dart_snd_seq_remove_events_free>(); void snd_seq_remove_events_copy( ffi.Pointer dst, ffi.Pointer src, ) { return _snd_seq_remove_events_copy( dst, src, ); } late final _snd_seq_remove_events_copy_ptr = _lookup>( 'snd_seq_remove_events_copy'); late final _dart_snd_seq_remove_events_copy _snd_seq_remove_events_copy = _snd_seq_remove_events_copy_ptr .asFunction<_dart_snd_seq_remove_events_copy>(); int snd_seq_remove_events_get_condition( ffi.Pointer info, ) { return _snd_seq_remove_events_get_condition( info, ); } late final _snd_seq_remove_events_get_condition_ptr = _lookup>( 'snd_seq_remove_events_get_condition'); late final _dart_snd_seq_remove_events_get_condition _snd_seq_remove_events_get_condition = _snd_seq_remove_events_get_condition_ptr .asFunction<_dart_snd_seq_remove_events_get_condition>(); int snd_seq_remove_events_get_queue( ffi.Pointer info, ) { return _snd_seq_remove_events_get_queue( info, ); } late final _snd_seq_remove_events_get_queue_ptr = _lookup>( 'snd_seq_remove_events_get_queue'); late final _dart_snd_seq_remove_events_get_queue _snd_seq_remove_events_get_queue = _snd_seq_remove_events_get_queue_ptr .asFunction<_dart_snd_seq_remove_events_get_queue>(); ffi.Pointer snd_seq_remove_events_get_dest( ffi.Pointer info, ) { return _snd_seq_remove_events_get_dest( info, ); } late final _snd_seq_remove_events_get_dest_ptr = _lookup>( 'snd_seq_remove_events_get_dest'); late final _dart_snd_seq_remove_events_get_dest _snd_seq_remove_events_get_dest = _snd_seq_remove_events_get_dest_ptr .asFunction<_dart_snd_seq_remove_events_get_dest>(); int snd_seq_remove_events_get_channel( ffi.Pointer info, ) { return _snd_seq_remove_events_get_channel( info, ); } late final _snd_seq_remove_events_get_channel_ptr = _lookup>( 'snd_seq_remove_events_get_channel'); late final _dart_snd_seq_remove_events_get_channel _snd_seq_remove_events_get_channel = _snd_seq_remove_events_get_channel_ptr .asFunction<_dart_snd_seq_remove_events_get_channel>(); int snd_seq_remove_events_get_event_type( ffi.Pointer info, ) { return _snd_seq_remove_events_get_event_type( info, ); } late final _snd_seq_remove_events_get_event_type_ptr = _lookup>( 'snd_seq_remove_events_get_event_type'); late final _dart_snd_seq_remove_events_get_event_type _snd_seq_remove_events_get_event_type = _snd_seq_remove_events_get_event_type_ptr .asFunction<_dart_snd_seq_remove_events_get_event_type>(); int snd_seq_remove_events_get_tag( ffi.Pointer info, ) { return _snd_seq_remove_events_get_tag( info, ); } late final _snd_seq_remove_events_get_tag_ptr = _lookup>( 'snd_seq_remove_events_get_tag'); late final _dart_snd_seq_remove_events_get_tag _snd_seq_remove_events_get_tag = _snd_seq_remove_events_get_tag_ptr .asFunction<_dart_snd_seq_remove_events_get_tag>(); void snd_seq_remove_events_set_condition( ffi.Pointer info, int flags, ) { return _snd_seq_remove_events_set_condition( info, flags, ); } late final _snd_seq_remove_events_set_condition_ptr = _lookup>( 'snd_seq_remove_events_set_condition'); late final _dart_snd_seq_remove_events_set_condition _snd_seq_remove_events_set_condition = _snd_seq_remove_events_set_condition_ptr .asFunction<_dart_snd_seq_remove_events_set_condition>(); void snd_seq_remove_events_set_queue( ffi.Pointer info, int queue, ) { return _snd_seq_remove_events_set_queue( info, queue, ); } late final _snd_seq_remove_events_set_queue_ptr = _lookup>( 'snd_seq_remove_events_set_queue'); late final _dart_snd_seq_remove_events_set_queue _snd_seq_remove_events_set_queue = _snd_seq_remove_events_set_queue_ptr .asFunction<_dart_snd_seq_remove_events_set_queue>(); void snd_seq_remove_events_set_dest( ffi.Pointer info, ffi.Pointer addr, ) { return _snd_seq_remove_events_set_dest( info, addr, ); } late final _snd_seq_remove_events_set_dest_ptr = _lookup>( 'snd_seq_remove_events_set_dest'); late final _dart_snd_seq_remove_events_set_dest _snd_seq_remove_events_set_dest = _snd_seq_remove_events_set_dest_ptr .asFunction<_dart_snd_seq_remove_events_set_dest>(); void snd_seq_remove_events_set_channel( ffi.Pointer info, int channel, ) { return _snd_seq_remove_events_set_channel( info, channel, ); } late final _snd_seq_remove_events_set_channel_ptr = _lookup>( 'snd_seq_remove_events_set_channel'); late final _dart_snd_seq_remove_events_set_channel _snd_seq_remove_events_set_channel = _snd_seq_remove_events_set_channel_ptr .asFunction<_dart_snd_seq_remove_events_set_channel>(); void snd_seq_remove_events_set_event_type( ffi.Pointer info, int type, ) { return _snd_seq_remove_events_set_event_type( info, type, ); } late final _snd_seq_remove_events_set_event_type_ptr = _lookup>( 'snd_seq_remove_events_set_event_type'); late final _dart_snd_seq_remove_events_set_event_type _snd_seq_remove_events_set_event_type = _snd_seq_remove_events_set_event_type_ptr .asFunction<_dart_snd_seq_remove_events_set_event_type>(); void snd_seq_remove_events_set_tag( ffi.Pointer info, int tag, ) { return _snd_seq_remove_events_set_tag( info, tag, ); } late final _snd_seq_remove_events_set_tag_ptr = _lookup>( 'snd_seq_remove_events_set_tag'); late final _dart_snd_seq_remove_events_set_tag _snd_seq_remove_events_set_tag = _snd_seq_remove_events_set_tag_ptr .asFunction<_dart_snd_seq_remove_events_set_tag>(); int snd_seq_remove_events( ffi.Pointer handle, ffi.Pointer info, ) { return _snd_seq_remove_events( handle, info, ); } late final _snd_seq_remove_events_ptr = _lookup>( 'snd_seq_remove_events'); late final _dart_snd_seq_remove_events _snd_seq_remove_events = _snd_seq_remove_events_ptr.asFunction<_dart_snd_seq_remove_events>(); void snd_seq_set_bit( int nr, ffi.Pointer array, ) { return _snd_seq_set_bit( nr, array, ); } late final _snd_seq_set_bit_ptr = _lookup>('snd_seq_set_bit'); late final _dart_snd_seq_set_bit _snd_seq_set_bit = _snd_seq_set_bit_ptr.asFunction<_dart_snd_seq_set_bit>(); void snd_seq_unset_bit( int nr, ffi.Pointer array, ) { return _snd_seq_unset_bit( nr, array, ); } late final _snd_seq_unset_bit_ptr = _lookup>('snd_seq_unset_bit'); late final _dart_snd_seq_unset_bit _snd_seq_unset_bit = _snd_seq_unset_bit_ptr.asFunction<_dart_snd_seq_unset_bit>(); int snd_seq_change_bit( int nr, ffi.Pointer array, ) { return _snd_seq_change_bit( nr, array, ); } late final _snd_seq_change_bit_ptr = _lookup>('snd_seq_change_bit'); late final _dart_snd_seq_change_bit _snd_seq_change_bit = _snd_seq_change_bit_ptr.asFunction<_dart_snd_seq_change_bit>(); int snd_seq_get_bit( int nr, ffi.Pointer array, ) { return _snd_seq_get_bit( nr, array, ); } late final _snd_seq_get_bit_ptr = _lookup>('snd_seq_get_bit'); late final _dart_snd_seq_get_bit _snd_seq_get_bit = _snd_seq_get_bit_ptr.asFunction<_dart_snd_seq_get_bit>(); late final ffi.Pointer> _snd_seq_event_types = _lookup>('snd_seq_event_types'); ffi.Pointer get snd_seq_event_types => _snd_seq_event_types.value; set snd_seq_event_types(ffi.Pointer value) => _snd_seq_event_types.value = value; int snd_seq_control_queue( ffi.Pointer seq, int q, int type, int value, ffi.Pointer ev, ) { return _snd_seq_control_queue( seq, q, type, value, ev, ); } late final _snd_seq_control_queue_ptr = _lookup>( 'snd_seq_control_queue'); late final _dart_snd_seq_control_queue _snd_seq_control_queue = _snd_seq_control_queue_ptr.asFunction<_dart_snd_seq_control_queue>(); int snd_seq_create_simple_port( ffi.Pointer seq, ffi.Pointer name, int caps, int type, ) { return _snd_seq_create_simple_port( seq, name, caps, type, ); } late final _snd_seq_create_simple_port_ptr = _lookup>( 'snd_seq_create_simple_port'); late final _dart_snd_seq_create_simple_port _snd_seq_create_simple_port = _snd_seq_create_simple_port_ptr .asFunction<_dart_snd_seq_create_simple_port>(); int snd_seq_delete_simple_port( ffi.Pointer seq, int port, ) { return _snd_seq_delete_simple_port( seq, port, ); } late final _snd_seq_delete_simple_port_ptr = _lookup>( 'snd_seq_delete_simple_port'); late final _dart_snd_seq_delete_simple_port _snd_seq_delete_simple_port = _snd_seq_delete_simple_port_ptr .asFunction<_dart_snd_seq_delete_simple_port>(); int snd_seq_connect_from( ffi.Pointer seq, int my_port, int src_client, int src_port, ) { return _snd_seq_connect_from( seq, my_port, src_client, src_port, ); } late final _snd_seq_connect_from_ptr = _lookup>( 'snd_seq_connect_from'); late final _dart_snd_seq_connect_from _snd_seq_connect_from = _snd_seq_connect_from_ptr.asFunction<_dart_snd_seq_connect_from>(); int snd_seq_connect_to( ffi.Pointer seq, int my_port, int dest_client, int dest_port, ) { return _snd_seq_connect_to( seq, my_port, dest_client, dest_port, ); } late final _snd_seq_connect_to_ptr = _lookup>('snd_seq_connect_to'); late final _dart_snd_seq_connect_to _snd_seq_connect_to = _snd_seq_connect_to_ptr.asFunction<_dart_snd_seq_connect_to>(); int snd_seq_disconnect_from( ffi.Pointer seq, int my_port, int src_client, int src_port, ) { return _snd_seq_disconnect_from( seq, my_port, src_client, src_port, ); } late final _snd_seq_disconnect_from_ptr = _lookup>( 'snd_seq_disconnect_from'); late final _dart_snd_seq_disconnect_from _snd_seq_disconnect_from = _snd_seq_disconnect_from_ptr.asFunction<_dart_snd_seq_disconnect_from>(); int snd_seq_disconnect_to( ffi.Pointer seq, int my_port, int dest_client, int dest_port, ) { return _snd_seq_disconnect_to( seq, my_port, dest_client, dest_port, ); } late final _snd_seq_disconnect_to_ptr = _lookup>( 'snd_seq_disconnect_to'); late final _dart_snd_seq_disconnect_to _snd_seq_disconnect_to = _snd_seq_disconnect_to_ptr.asFunction<_dart_snd_seq_disconnect_to>(); int snd_seq_set_client_name( ffi.Pointer seq, ffi.Pointer name, ) { return _snd_seq_set_client_name( seq, name, ); } late final _snd_seq_set_client_name_ptr = _lookup>( 'snd_seq_set_client_name'); late final _dart_snd_seq_set_client_name _snd_seq_set_client_name = _snd_seq_set_client_name_ptr.asFunction<_dart_snd_seq_set_client_name>(); int snd_seq_set_client_event_filter( ffi.Pointer seq, int event_type, ) { return _snd_seq_set_client_event_filter( seq, event_type, ); } late final _snd_seq_set_client_event_filter_ptr = _lookup>( 'snd_seq_set_client_event_filter'); late final _dart_snd_seq_set_client_event_filter _snd_seq_set_client_event_filter = _snd_seq_set_client_event_filter_ptr .asFunction<_dart_snd_seq_set_client_event_filter>(); int snd_seq_set_client_pool_output( ffi.Pointer seq, int size, ) { return _snd_seq_set_client_pool_output( seq, size, ); } late final _snd_seq_set_client_pool_output_ptr = _lookup>( 'snd_seq_set_client_pool_output'); late final _dart_snd_seq_set_client_pool_output _snd_seq_set_client_pool_output = _snd_seq_set_client_pool_output_ptr .asFunction<_dart_snd_seq_set_client_pool_output>(); int snd_seq_set_client_pool_output_room( ffi.Pointer seq, int size, ) { return _snd_seq_set_client_pool_output_room( seq, size, ); } late final _snd_seq_set_client_pool_output_room_ptr = _lookup>( 'snd_seq_set_client_pool_output_room'); late final _dart_snd_seq_set_client_pool_output_room _snd_seq_set_client_pool_output_room = _snd_seq_set_client_pool_output_room_ptr .asFunction<_dart_snd_seq_set_client_pool_output_room>(); int snd_seq_set_client_pool_input( ffi.Pointer seq, int size, ) { return _snd_seq_set_client_pool_input( seq, size, ); } late final _snd_seq_set_client_pool_input_ptr = _lookup>( 'snd_seq_set_client_pool_input'); late final _dart_snd_seq_set_client_pool_input _snd_seq_set_client_pool_input = _snd_seq_set_client_pool_input_ptr .asFunction<_dart_snd_seq_set_client_pool_input>(); int snd_seq_sync_output_queue( ffi.Pointer seq, ) { return _snd_seq_sync_output_queue( seq, ); } late final _snd_seq_sync_output_queue_ptr = _lookup>( 'snd_seq_sync_output_queue'); late final _dart_snd_seq_sync_output_queue _snd_seq_sync_output_queue = _snd_seq_sync_output_queue_ptr .asFunction<_dart_snd_seq_sync_output_queue>(); int snd_seq_parse_address( ffi.Pointer seq, ffi.Pointer addr, ffi.Pointer str, ) { return _snd_seq_parse_address( seq, addr, str, ); } late final _snd_seq_parse_address_ptr = _lookup>( 'snd_seq_parse_address'); late final _dart_snd_seq_parse_address _snd_seq_parse_address = _snd_seq_parse_address_ptr.asFunction<_dart_snd_seq_parse_address>(); int snd_seq_reset_pool_output( ffi.Pointer seq, ) { return _snd_seq_reset_pool_output( seq, ); } late final _snd_seq_reset_pool_output_ptr = _lookup>( 'snd_seq_reset_pool_output'); late final _dart_snd_seq_reset_pool_output _snd_seq_reset_pool_output = _snd_seq_reset_pool_output_ptr .asFunction<_dart_snd_seq_reset_pool_output>(); int snd_seq_reset_pool_input( ffi.Pointer seq, ) { return _snd_seq_reset_pool_input( seq, ); } late final _snd_seq_reset_pool_input_ptr = _lookup>( 'snd_seq_reset_pool_input'); late final _dart_snd_seq_reset_pool_input _snd_seq_reset_pool_input = _snd_seq_reset_pool_input_ptr .asFunction<_dart_snd_seq_reset_pool_input>(); int snd_midi_event_new( int bufsize, ffi.Pointer> rdev, ) { return _snd_midi_event_new( bufsize, rdev, ); } late final _snd_midi_event_new_ptr = _lookup>('snd_midi_event_new'); late final _dart_snd_midi_event_new _snd_midi_event_new = _snd_midi_event_new_ptr.asFunction<_dart_snd_midi_event_new>(); int snd_midi_event_resize_buffer( ffi.Pointer dev, int bufsize, ) { return _snd_midi_event_resize_buffer( dev, bufsize, ); } late final _snd_midi_event_resize_buffer_ptr = _lookup>( 'snd_midi_event_resize_buffer'); late final _dart_snd_midi_event_resize_buffer _snd_midi_event_resize_buffer = _snd_midi_event_resize_buffer_ptr .asFunction<_dart_snd_midi_event_resize_buffer>(); void snd_midi_event_free( ffi.Pointer dev, ) { return _snd_midi_event_free( dev, ); } late final _snd_midi_event_free_ptr = _lookup>( 'snd_midi_event_free'); late final _dart_snd_midi_event_free _snd_midi_event_free = _snd_midi_event_free_ptr.asFunction<_dart_snd_midi_event_free>(); void snd_midi_event_init( ffi.Pointer dev, ) { return _snd_midi_event_init( dev, ); } late final _snd_midi_event_init_ptr = _lookup>( 'snd_midi_event_init'); late final _dart_snd_midi_event_init _snd_midi_event_init = _snd_midi_event_init_ptr.asFunction<_dart_snd_midi_event_init>(); void snd_midi_event_reset_encode( ffi.Pointer dev, ) { return _snd_midi_event_reset_encode( dev, ); } late final _snd_midi_event_reset_encode_ptr = _lookup>( 'snd_midi_event_reset_encode'); late final _dart_snd_midi_event_reset_encode _snd_midi_event_reset_encode = _snd_midi_event_reset_encode_ptr .asFunction<_dart_snd_midi_event_reset_encode>(); void snd_midi_event_reset_decode( ffi.Pointer dev, ) { return _snd_midi_event_reset_decode( dev, ); } late final _snd_midi_event_reset_decode_ptr = _lookup>( 'snd_midi_event_reset_decode'); late final _dart_snd_midi_event_reset_decode _snd_midi_event_reset_decode = _snd_midi_event_reset_decode_ptr .asFunction<_dart_snd_midi_event_reset_decode>(); void snd_midi_event_no_status( ffi.Pointer dev, int on_1, ) { return _snd_midi_event_no_status( dev, on_1, ); } late final _snd_midi_event_no_status_ptr = _lookup>( 'snd_midi_event_no_status'); late final _dart_snd_midi_event_no_status _snd_midi_event_no_status = _snd_midi_event_no_status_ptr .asFunction<_dart_snd_midi_event_no_status>(); int snd_midi_event_encode( ffi.Pointer dev, ffi.Pointer buf, int count, ffi.Pointer ev, ) { return _snd_midi_event_encode( dev, buf, count, ev, ); } late final _snd_midi_event_encode_ptr = _lookup>( 'snd_midi_event_encode'); late final _dart_snd_midi_event_encode _snd_midi_event_encode = _snd_midi_event_encode_ptr.asFunction<_dart_snd_midi_event_encode>(); int snd_midi_event_encode_byte( ffi.Pointer dev, int c, ffi.Pointer ev, ) { return _snd_midi_event_encode_byte( dev, c, ev, ); } late final _snd_midi_event_encode_byte_ptr = _lookup>( 'snd_midi_event_encode_byte'); late final _dart_snd_midi_event_encode_byte _snd_midi_event_encode_byte = _snd_midi_event_encode_byte_ptr .asFunction<_dart_snd_midi_event_encode_byte>(); int snd_midi_event_decode( ffi.Pointer dev, ffi.Pointer buf, int count, ffi.Pointer ev, ) { return _snd_midi_event_decode( dev, buf, count, ev, ); } late final _snd_midi_event_decode_ptr = _lookup>( 'snd_midi_event_decode'); late final _dart_snd_midi_event_decode _snd_midi_event_decode = _snd_midi_event_decode_ptr.asFunction<_dart_snd_midi_event_decode>(); } class _fsid_t_ extends ffi.Opaque {} class _mbstate_t_ extends ffi.Opaque {} class _fpos_t_ extends ffi.Opaque {} class _fpos64_t_ extends ffi.Opaque {} class IO_marker_ extends ffi.Opaque {} class IO_codecvt_ extends ffi.Opaque {} class IO_wide_data_ extends ffi.Opaque {} class IO_FILE_ extends ffi.Opaque {} class _va_list_tag_ extends ffi.Struct { @ffi.Uint32() external int gp_offset; @ffi.Uint32() external int fp_offset; external ffi.Pointer overflow_arg_area; external ffi.Pointer reg_save_area; } abstract class idtype_t { static const int P_ALL = 0; static const int P_PID = 1; static const int P_PGID = 2; } class div_t extends ffi.Struct { @ffi.Int32() external int quot; @ffi.Int32() external int rem; } class ldiv_t extends ffi.Struct { @ffi.Int64() external int quot; @ffi.Int64() external int rem; } class lldiv_t extends ffi.Struct { @ffi.Int64() external int quot; @ffi.Int64() external int rem; } class _sigset_t_ extends ffi.Opaque {} class timeval extends ffi.Struct { @ffi.Int64() external int tv_sec; @ffi.Int64() external int tv_usec; } class timespec extends ffi.Struct { @ffi.Int64() external int tv_sec; @ffi.Int64() external int tv_nsec; } class fd_set extends ffi.Opaque {} class _pthread_list_t_ extends ffi.Struct { external ffi.Pointer<_pthread_list_t_> _prev_; external ffi.Pointer<_pthread_list_t_> _next_; } class _pthread_slist_t_ extends ffi.Struct { external ffi.Pointer<_pthread_slist_t_> _next_; } class _pthread_mutex_s_ extends ffi.Struct { @ffi.Int32() external int _lock_; @ffi.Uint32() external int _count_; @ffi.Int32() external int _owner_; @ffi.Uint32() external int _nusers_; @ffi.Int32() external int _kind_; @ffi.Int16() external int _spins_; @ffi.Int16() external int _elision_; external _pthread_list_t_ _list_; } class _pthread_rwlock_arch_t_ extends ffi.Opaque {} class _pthread_cond_s_ extends ffi.Opaque {} class random_data extends ffi.Struct { external ffi.Pointer fptr; external ffi.Pointer rptr; external ffi.Pointer state; @ffi.Int32() external int rand_type; @ffi.Int32() external int rand_deg; @ffi.Int32() external int rand_sep; external ffi.Pointer end_ptr; } class drand48_data extends ffi.Opaque {} class _locale_data_ extends ffi.Opaque {} class _locale_struct_ extends ffi.Opaque {} class flock extends ffi.Struct { @ffi.Int16() external int l_type; @ffi.Int16() external int l_whence; @ffi.Int64() external int l_start; @ffi.Int64() external int l_len; @ffi.Int32() external int l_pid; } class stat extends ffi.Opaque {} class pollfd extends ffi.Struct { @ffi.Int32() external int fd; @ffi.Int16() external int events; @ffi.Int16() external int revents; } class tm extends ffi.Struct { @ffi.Int32() external int tm_sec; @ffi.Int32() external int tm_min; @ffi.Int32() external int tm_hour; @ffi.Int32() external int tm_mday; @ffi.Int32() external int tm_mon; @ffi.Int32() external int tm_year; @ffi.Int32() external int tm_wday; @ffi.Int32() external int tm_yday; @ffi.Int32() external int tm_isdst; @ffi.Int64() external int tm_gmtoff; external ffi.Pointer tm_zone; } class itimerspec extends ffi.Struct { external timespec it_interval; external timespec it_value; } class sigevent extends ffi.Opaque {} class snd_dlsym_link extends ffi.Struct { external ffi.Pointer next; external ffi.Pointer dlsym_name; external ffi.Pointer dlsym_ptr; } class snd_async_handler_ extends ffi.Opaque {} class snd_shm_area extends ffi.Opaque {} class snd_input_ extends ffi.Opaque {} abstract class snd_input_type_t { static const int SND_INPUT_STDIO = 0; static const int SND_INPUT_BUFFER = 1; } class snd_output_ extends ffi.Opaque {} abstract class snd_output_type_t { static const int SND_OUTPUT_STDIO = 0; static const int SND_OUTPUT_BUFFER = 1; } abstract class snd_config_type_t { static const int SND_CONFIG_TYPE_INTEGER = 0; static const int SND_CONFIG_TYPE_INTEGER64 = 1; static const int SND_CONFIG_TYPE_REAL = 2; static const int SND_CONFIG_TYPE_STRING = 3; static const int SND_CONFIG_TYPE_POINTER = 4; static const int SND_CONFIG_TYPE_COMPOUND = 1024; } class snd_config_ extends ffi.Opaque {} class snd_config_iterator_ extends ffi.Opaque {} class snd_config_update_ extends ffi.Opaque {} class snd_devname extends ffi.Struct { external ffi.Pointer name; external ffi.Pointer comment; external ffi.Pointer next; } class snd_pcm_info_ extends ffi.Opaque {} class snd_pcm_hw_params_ extends ffi.Opaque {} class snd_pcm_sw_params_ extends ffi.Opaque {} class snd_pcm_status_ extends ffi.Opaque {} class snd_pcm_access_mask_ extends ffi.Opaque {} class snd_pcm_format_mask_ extends ffi.Opaque {} class snd_pcm_subformat_mask_ extends ffi.Opaque {} abstract class snd_pcm_class_t { static const int SND_PCM_CLASS_GENERIC = 0; static const int SND_PCM_CLASS_MULTI = 1; static const int SND_PCM_CLASS_MODEM = 2; static const int SND_PCM_CLASS_DIGITIZER = 3; static const int SND_PCM_CLASS_LAST = 3; } abstract class snd_pcm_subclass_t { static const int SND_PCM_SUBCLASS_GENERIC_MIX = 0; static const int SND_PCM_SUBCLASS_MULTI_MIX = 1; static const int SND_PCM_SUBCLASS_LAST = 1; } abstract class snd_pcm_stream_t { static const int SND_PCM_STREAM_PLAYBACK = 0; static const int SND_PCM_STREAM_CAPTURE = 1; static const int SND_PCM_STREAM_LAST = 1; } abstract class snd_pcm_access_t { static const int SND_PCM_ACCESS_MMAP_INTERLEAVED = 0; static const int SND_PCM_ACCESS_MMAP_NONINTERLEAVED = 1; static const int SND_PCM_ACCESS_MMAP_COMPLEX = 2; static const int SND_PCM_ACCESS_RW_INTERLEAVED = 3; static const int SND_PCM_ACCESS_RW_NONINTERLEAVED = 4; static const int SND_PCM_ACCESS_LAST = 4; } abstract class snd_pcm_format_t { static const int SND_PCM_FORMAT_UNKNOWN = -1; static const int SND_PCM_FORMAT_S8 = 0; static const int SND_PCM_FORMAT_U8 = 1; static const int SND_PCM_FORMAT_S16_LE = 2; static const int SND_PCM_FORMAT_S16_BE = 3; static const int SND_PCM_FORMAT_U16_LE = 4; static const int SND_PCM_FORMAT_U16_BE = 5; static const int SND_PCM_FORMAT_S24_LE = 6; static const int SND_PCM_FORMAT_S24_BE = 7; static const int SND_PCM_FORMAT_U24_LE = 8; static const int SND_PCM_FORMAT_U24_BE = 9; static const int SND_PCM_FORMAT_S32_LE = 10; static const int SND_PCM_FORMAT_S32_BE = 11; static const int SND_PCM_FORMAT_U32_LE = 12; static const int SND_PCM_FORMAT_U32_BE = 13; static const int SND_PCM_FORMAT_FLOAT_LE = 14; static const int SND_PCM_FORMAT_FLOAT_BE = 15; static const int SND_PCM_FORMAT_FLOAT64_LE = 16; static const int SND_PCM_FORMAT_FLOAT64_BE = 17; static const int SND_PCM_FORMAT_IEC958_SUBFRAME_LE = 18; static const int SND_PCM_FORMAT_IEC958_SUBFRAME_BE = 19; static const int SND_PCM_FORMAT_MU_LAW = 20; static const int SND_PCM_FORMAT_A_LAW = 21; static const int SND_PCM_FORMAT_IMA_ADPCM = 22; static const int SND_PCM_FORMAT_MPEG = 23; static const int SND_PCM_FORMAT_GSM = 24; static const int SND_PCM_FORMAT_S20_LE = 25; static const int SND_PCM_FORMAT_S20_BE = 26; static const int SND_PCM_FORMAT_U20_LE = 27; static const int SND_PCM_FORMAT_U20_BE = 28; static const int SND_PCM_FORMAT_SPECIAL = 31; static const int SND_PCM_FORMAT_S24_3LE = 32; static const int SND_PCM_FORMAT_S24_3BE = 33; static const int SND_PCM_FORMAT_U24_3LE = 34; static const int SND_PCM_FORMAT_U24_3BE = 35; static const int SND_PCM_FORMAT_S20_3LE = 36; static const int SND_PCM_FORMAT_S20_3BE = 37; static const int SND_PCM_FORMAT_U20_3LE = 38; static const int SND_PCM_FORMAT_U20_3BE = 39; static const int SND_PCM_FORMAT_S18_3LE = 40; static const int SND_PCM_FORMAT_S18_3BE = 41; static const int SND_PCM_FORMAT_U18_3LE = 42; static const int SND_PCM_FORMAT_U18_3BE = 43; static const int SND_PCM_FORMAT_G723_24 = 44; static const int SND_PCM_FORMAT_G723_24_1B = 45; static const int SND_PCM_FORMAT_G723_40 = 46; static const int SND_PCM_FORMAT_G723_40_1B = 47; static const int SND_PCM_FORMAT_DSD_U8 = 48; static const int SND_PCM_FORMAT_DSD_U16_LE = 49; static const int SND_PCM_FORMAT_DSD_U32_LE = 50; static const int SND_PCM_FORMAT_DSD_U16_BE = 51; static const int SND_PCM_FORMAT_DSD_U32_BE = 52; static const int SND_PCM_FORMAT_LAST = 52; static const int SND_PCM_FORMAT_S16 = 2; static const int SND_PCM_FORMAT_U16 = 4; static const int SND_PCM_FORMAT_S24 = 6; static const int SND_PCM_FORMAT_U24 = 8; static const int SND_PCM_FORMAT_S32 = 10; static const int SND_PCM_FORMAT_U32 = 12; static const int SND_PCM_FORMAT_FLOAT = 14; static const int SND_PCM_FORMAT_FLOAT64 = 16; static const int SND_PCM_FORMAT_IEC958_SUBFRAME = 18; static const int SND_PCM_FORMAT_S20 = 25; static const int SND_PCM_FORMAT_U20 = 27; } abstract class snd_pcm_subformat_t { static const int SND_PCM_SUBFORMAT_STD = 0; static const int SND_PCM_SUBFORMAT_LAST = 0; } abstract class snd_pcm_state_t { static const int SND_PCM_STATE_OPEN = 0; static const int SND_PCM_STATE_SETUP = 1; static const int SND_PCM_STATE_PREPARED = 2; static const int SND_PCM_STATE_RUNNING = 3; static const int SND_PCM_STATE_XRUN = 4; static const int SND_PCM_STATE_DRAINING = 5; static const int SND_PCM_STATE_PAUSED = 6; static const int SND_PCM_STATE_SUSPENDED = 7; static const int SND_PCM_STATE_DISCONNECTED = 8; static const int SND_PCM_STATE_LAST = 8; static const int SND_PCM_STATE_PRIVATE1 = 1024; } abstract class snd_pcm_start_t { static const int SND_PCM_START_DATA = 0; static const int SND_PCM_START_EXPLICIT = 1; static const int SND_PCM_START_LAST = 1; } abstract class snd_pcm_xrun_t { static const int SND_PCM_XRUN_NONE = 0; static const int SND_PCM_XRUN_STOP = 1; static const int SND_PCM_XRUN_LAST = 1; } abstract class snd_pcm_tstamp_t { static const int SND_PCM_TSTAMP_NONE = 0; static const int SND_PCM_TSTAMP_ENABLE = 1; static const int SND_PCM_TSTAMP_MMAP = 1; static const int SND_PCM_TSTAMP_LAST = 1; } abstract class snd_pcm_tstamp_type_t { static const int SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0; static const int SND_PCM_TSTAMP_TYPE_MONOTONIC = 1; static const int SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW = 2; static const int SND_PCM_TSTAMP_TYPE_LAST = 2; } class snd_pcm_audio_tstamp_config_t extends ffi.Opaque {} class snd_pcm_audio_tstamp_report_t extends ffi.Opaque {} class snd_pcm_ extends ffi.Opaque {} abstract class _snd_pcm_type { static const int SND_PCM_TYPE_HW = 0; static const int SND_PCM_TYPE_HOOKS = 1; static const int SND_PCM_TYPE_MULTI = 2; static const int SND_PCM_TYPE_FILE = 3; static const int SND_PCM_TYPE_NULL = 4; static const int SND_PCM_TYPE_SHM = 5; static const int SND_PCM_TYPE_INET = 6; static const int SND_PCM_TYPE_COPY = 7; static const int SND_PCM_TYPE_LINEAR = 8; static const int SND_PCM_TYPE_ALAW = 9; static const int SND_PCM_TYPE_MULAW = 10; static const int SND_PCM_TYPE_ADPCM = 11; static const int SND_PCM_TYPE_RATE = 12; static const int SND_PCM_TYPE_ROUTE = 13; static const int SND_PCM_TYPE_PLUG = 14; static const int SND_PCM_TYPE_SHARE = 15; static const int SND_PCM_TYPE_METER = 16; static const int SND_PCM_TYPE_MIX = 17; static const int SND_PCM_TYPE_DROUTE = 18; static const int SND_PCM_TYPE_LBSERVER = 19; static const int SND_PCM_TYPE_LINEAR_FLOAT = 20; static const int SND_PCM_TYPE_LADSPA = 21; static const int SND_PCM_TYPE_DMIX = 22; static const int SND_PCM_TYPE_JACK = 23; static const int SND_PCM_TYPE_DSNOOP = 24; static const int SND_PCM_TYPE_DSHARE = 25; static const int SND_PCM_TYPE_IEC958 = 26; static const int SND_PCM_TYPE_SOFTVOL = 27; static const int SND_PCM_TYPE_IOPLUG = 28; static const int SND_PCM_TYPE_EXTPLUG = 29; static const int SND_PCM_TYPE_MMAP_EMUL = 30; static const int SND_PCM_TYPE_LAST = 30; } class snd_pcm_channel_area_t extends ffi.Struct { external ffi.Pointer addr; @ffi.Uint32() external int first; @ffi.Uint32() external int step; } class snd_pcm_scope_ extends ffi.Opaque {} abstract class snd_pcm_chmap_type { static const int SND_CHMAP_TYPE_NONE = 0; static const int SND_CHMAP_TYPE_FIXED = 1; static const int SND_CHMAP_TYPE_VAR = 2; static const int SND_CHMAP_TYPE_PAIRED = 3; static const int SND_CHMAP_TYPE_LAST = 3; } abstract class snd_pcm_chmap_position { static const int SND_CHMAP_UNKNOWN = 0; static const int SND_CHMAP_NA = 1; static const int SND_CHMAP_MONO = 2; static const int SND_CHMAP_FL = 3; static const int SND_CHMAP_FR = 4; static const int SND_CHMAP_RL = 5; static const int SND_CHMAP_RR = 6; static const int SND_CHMAP_FC = 7; static const int SND_CHMAP_LFE = 8; static const int SND_CHMAP_SL = 9; static const int SND_CHMAP_SR = 10; static const int SND_CHMAP_RC = 11; static const int SND_CHMAP_FLC = 12; static const int SND_CHMAP_FRC = 13; static const int SND_CHMAP_RLC = 14; static const int SND_CHMAP_RRC = 15; static const int SND_CHMAP_FLW = 16; static const int SND_CHMAP_FRW = 17; static const int SND_CHMAP_FLH = 18; static const int SND_CHMAP_FCH = 19; static const int SND_CHMAP_FRH = 20; static const int SND_CHMAP_TC = 21; static const int SND_CHMAP_TFL = 22; static const int SND_CHMAP_TFR = 23; static const int SND_CHMAP_TFC = 24; static const int SND_CHMAP_TRL = 25; static const int SND_CHMAP_TRR = 26; static const int SND_CHMAP_TRC = 27; static const int SND_CHMAP_TFLC = 28; static const int SND_CHMAP_TFRC = 29; static const int SND_CHMAP_TSL = 30; static const int SND_CHMAP_TSR = 31; static const int SND_CHMAP_LLFE = 32; static const int SND_CHMAP_RLFE = 33; static const int SND_CHMAP_BC = 34; static const int SND_CHMAP_BLC = 35; static const int SND_CHMAP_BRC = 36; static const int SND_CHMAP_LAST = 36; } class snd_pcm_chmap_t extends ffi.Opaque {} class snd_pcm_chmap_query_t extends ffi.Opaque {} abstract class snd_pcm_hook_type_t { static const int SND_PCM_HOOK_TYPE_HW_PARAMS = 0; static const int SND_PCM_HOOK_TYPE_HW_FREE = 1; static const int SND_PCM_HOOK_TYPE_CLOSE = 2; static const int SND_PCM_HOOK_TYPE_LAST = 2; } class snd_pcm_hook_ extends ffi.Opaque {} class snd_pcm_scope_ops_t extends ffi.Struct { external ffi.Pointer> enable; external ffi.Pointer> disable; external ffi.Pointer> start; external ffi.Pointer> stop; external ffi.Pointer> update; external ffi.Pointer> reset; external ffi.Pointer> close; } abstract class snd_spcm_latency_t { static const int SND_SPCM_LATENCY_STANDARD = 0; static const int SND_SPCM_LATENCY_MEDIUM = 1; static const int SND_SPCM_LATENCY_REALTIME = 2; } abstract class snd_spcm_xrun_type_t { static const int SND_SPCM_XRUN_IGNORE = 0; static const int SND_SPCM_XRUN_STOP = 1; } abstract class snd_spcm_duplex_type_t { static const int SND_SPCM_DUPLEX_LIBERAL = 0; static const int SND_SPCM_DUPLEX_PEDANTIC = 1; } class snd_rawmidi_info_ extends ffi.Opaque {} class snd_rawmidi_params_ extends ffi.Opaque {} class snd_rawmidi_status_ extends ffi.Opaque {} abstract class snd_rawmidi_stream_t { static const int SND_RAWMIDI_STREAM_OUTPUT = 0; static const int SND_RAWMIDI_STREAM_INPUT = 1; static const int SND_RAWMIDI_STREAM_LAST = 1; } class snd_rawmidi_ extends ffi.Opaque {} abstract class snd_rawmidi_type_t { static const int SND_RAWMIDI_TYPE_HW = 0; static const int SND_RAWMIDI_TYPE_SHM = 1; static const int SND_RAWMIDI_TYPE_INET = 2; static const int SND_RAWMIDI_TYPE_VIRTUAL = 3; } class snd_timer_id_ extends ffi.Opaque {} class snd_timer_ginfo_ extends ffi.Opaque {} class snd_timer_gparams_ extends ffi.Opaque {} class snd_timer_gstatus_ extends ffi.Opaque {} class snd_timer_info_ extends ffi.Opaque {} class snd_timer_params_ extends ffi.Opaque {} class snd_timer_status_ extends ffi.Opaque {} abstract class snd_timer_class_t { static const int SND_TIMER_CLASS_NONE = -1; static const int SND_TIMER_CLASS_SLAVE = 0; static const int SND_TIMER_CLASS_GLOBAL = 1; static const int SND_TIMER_CLASS_CARD = 2; static const int SND_TIMER_CLASS_PCM = 3; static const int SND_TIMER_CLASS_LAST = 3; } abstract class snd_timer_slave_class_t { static const int SND_TIMER_SCLASS_NONE = 0; static const int SND_TIMER_SCLASS_APPLICATION = 1; static const int SND_TIMER_SCLASS_SEQUENCER = 2; static const int SND_TIMER_SCLASS_OSS_SEQUENCER = 3; static const int SND_TIMER_SCLASS_LAST = 3; } abstract class snd_timer_event_t { static const int SND_TIMER_EVENT_RESOLUTION = 0; static const int SND_TIMER_EVENT_TICK = 1; static const int SND_TIMER_EVENT_START = 2; static const int SND_TIMER_EVENT_STOP = 3; static const int SND_TIMER_EVENT_CONTINUE = 4; static const int SND_TIMER_EVENT_PAUSE = 5; static const int SND_TIMER_EVENT_EARLY = 6; static const int SND_TIMER_EVENT_SUSPEND = 7; static const int SND_TIMER_EVENT_RESUME = 8; static const int SND_TIMER_EVENT_MSTART = 12; static const int SND_TIMER_EVENT_MSTOP = 13; static const int SND_TIMER_EVENT_MCONTINUE = 14; static const int SND_TIMER_EVENT_MPAUSE = 15; static const int SND_TIMER_EVENT_MSUSPEND = 17; static const int SND_TIMER_EVENT_MRESUME = 18; } class snd_timer_read_t extends ffi.Struct { @ffi.Uint32() external int resolution; @ffi.Uint32() external int ticks; } class snd_timer_tread_t extends ffi.Struct { @ffi.Int32() external int event; external timespec tstamp; @ffi.Uint32() external int val; } abstract class snd_timer_type_t { static const int SND_TIMER_TYPE_HW = 0; static const int SND_TIMER_TYPE_SHM = 1; static const int SND_TIMER_TYPE_INET = 2; } class snd_timer_query_ extends ffi.Opaque {} class snd_timer_ extends ffi.Opaque {} class snd_hwdep_info_ extends ffi.Opaque {} class snd_hwdep_dsp_status_ extends ffi.Opaque {} class snd_hwdep_dsp_image_ extends ffi.Opaque {} abstract class snd_hwdep_iface_t { static const int SND_HWDEP_IFACE_OPL2 = 0; static const int SND_HWDEP_IFACE_OPL3 = 1; static const int SND_HWDEP_IFACE_OPL4 = 2; static const int SND_HWDEP_IFACE_SB16CSP = 3; static const int SND_HWDEP_IFACE_EMU10K1 = 4; static const int SND_HWDEP_IFACE_YSS225 = 5; static const int SND_HWDEP_IFACE_ICS2115 = 6; static const int SND_HWDEP_IFACE_SSCAPE = 7; static const int SND_HWDEP_IFACE_VX = 8; static const int SND_HWDEP_IFACE_MIXART = 9; static const int SND_HWDEP_IFACE_USX2Y = 10; static const int SND_HWDEP_IFACE_EMUX_WAVETABLE = 11; static const int SND_HWDEP_IFACE_BLUETOOTH = 12; static const int SND_HWDEP_IFACE_USX2Y_PCM = 13; static const int SND_HWDEP_IFACE_PCXHR = 14; static const int SND_HWDEP_IFACE_SB_RC = 15; static const int SND_HWDEP_IFACE_HDA = 16; static const int SND_HWDEP_IFACE_USB_STREAM = 17; static const int SND_HWDEP_IFACE_FW_DICE = 18; static const int SND_HWDEP_IFACE_FW_FIREWORKS = 19; static const int SND_HWDEP_IFACE_FW_BEBOB = 20; static const int SND_HWDEP_IFACE_FW_OXFW = 21; static const int SND_HWDEP_IFACE_FW_DIGI00X = 22; static const int SND_HWDEP_IFACE_FW_TASCAM = 23; static const int SND_HWDEP_IFACE_LINE6 = 24; static const int SND_HWDEP_IFACE_FW_MOTU = 25; static const int SND_HWDEP_IFACE_FW_FIREFACE = 26; static const int SND_HWDEP_IFACE_LAST = 26; } abstract class snd_hwdep_type_t { static const int SND_HWDEP_TYPE_HW = 0; static const int SND_HWDEP_TYPE_SHM = 1; static const int SND_HWDEP_TYPE_INET = 2; } class snd_hwdep_ extends ffi.Opaque {} class snd_aes_iec958_t extends ffi.Opaque {} class snd_ctl_card_info_ extends ffi.Opaque {} class snd_ctl_elem_id_ extends ffi.Opaque {} class snd_ctl_elem_list_ extends ffi.Opaque {} class snd_ctl_elem_info_ extends ffi.Opaque {} class snd_ctl_elem_value_ extends ffi.Opaque {} class snd_ctl_event_ extends ffi.Opaque {} abstract class snd_ctl_elem_type_t { static const int SND_CTL_ELEM_TYPE_NONE = 0; static const int SND_CTL_ELEM_TYPE_BOOLEAN = 1; static const int SND_CTL_ELEM_TYPE_INTEGER = 2; static const int SND_CTL_ELEM_TYPE_ENUMERATED = 3; static const int SND_CTL_ELEM_TYPE_BYTES = 4; static const int SND_CTL_ELEM_TYPE_IEC958 = 5; static const int SND_CTL_ELEM_TYPE_INTEGER64 = 6; static const int SND_CTL_ELEM_TYPE_LAST = 6; } abstract class snd_ctl_elem_iface_t { static const int SND_CTL_ELEM_IFACE_CARD = 0; static const int SND_CTL_ELEM_IFACE_HWDEP = 1; static const int SND_CTL_ELEM_IFACE_MIXER = 2; static const int SND_CTL_ELEM_IFACE_PCM = 3; static const int SND_CTL_ELEM_IFACE_RAWMIDI = 4; static const int SND_CTL_ELEM_IFACE_TIMER = 5; static const int SND_CTL_ELEM_IFACE_SEQUENCER = 6; static const int SND_CTL_ELEM_IFACE_LAST = 6; } abstract class snd_ctl_event_type_t { static const int SND_CTL_EVENT_ELEM = 0; static const int SND_CTL_EVENT_LAST = 0; } abstract class snd_ctl_type_t { static const int SND_CTL_TYPE_HW = 0; static const int SND_CTL_TYPE_SHM = 1; static const int SND_CTL_TYPE_INET = 2; static const int SND_CTL_TYPE_EXT = 3; } class snd_ctl_ extends ffi.Opaque {} class snd_sctl_ extends ffi.Opaque {} class snd_hctl_elem_ extends ffi.Opaque {} class snd_hctl_ extends ffi.Opaque {} class snd_mixer_ extends ffi.Opaque {} class snd_mixer_class_ extends ffi.Opaque {} class snd_mixer_elem_ extends ffi.Opaque {} abstract class snd_mixer_elem_type_t { static const int SND_MIXER_ELEM_SIMPLE = 0; static const int SND_MIXER_ELEM_LAST = 0; } abstract class snd_mixer_selem_channel_id_t { static const int SND_MIXER_SCHN_UNKNOWN = -1; static const int SND_MIXER_SCHN_FRONT_LEFT = 0; static const int SND_MIXER_SCHN_FRONT_RIGHT = 1; static const int SND_MIXER_SCHN_REAR_LEFT = 2; static const int SND_MIXER_SCHN_REAR_RIGHT = 3; static const int SND_MIXER_SCHN_FRONT_CENTER = 4; static const int SND_MIXER_SCHN_WOOFER = 5; static const int SND_MIXER_SCHN_SIDE_LEFT = 6; static const int SND_MIXER_SCHN_SIDE_RIGHT = 7; static const int SND_MIXER_SCHN_REAR_CENTER = 8; static const int SND_MIXER_SCHN_LAST = 31; static const int SND_MIXER_SCHN_MONO = 0; } abstract class snd_mixer_selem_regopt_abstract { static const int SND_MIXER_SABSTRACT_NONE = 0; static const int SND_MIXER_SABSTRACT_BASIC = 1; } class snd_mixer_selem_regopt extends ffi.Struct { @ffi.Int32() external int ver; @ffi.Int32() external int abstract_1; external ffi.Pointer device; external ffi.Pointer playback_pcm; external ffi.Pointer capture_pcm; } class snd_mixer_selem_id_ extends ffi.Opaque {} abstract class snd_seq_event_type { static const int SND_SEQ_EVENT_SYSTEM = 0; static const int SND_SEQ_EVENT_RESULT = 1; static const int SND_SEQ_EVENT_NOTE = 5; static const int SND_SEQ_EVENT_NOTEON = 6; static const int SND_SEQ_EVENT_NOTEOFF = 7; static const int SND_SEQ_EVENT_KEYPRESS = 8; static const int SND_SEQ_EVENT_CONTROLLER = 10; static const int SND_SEQ_EVENT_PGMCHANGE = 11; static const int SND_SEQ_EVENT_CHANPRESS = 12; static const int SND_SEQ_EVENT_PITCHBEND = 13; static const int SND_SEQ_EVENT_CONTROL14 = 14; static const int SND_SEQ_EVENT_NONREGPARAM = 15; static const int SND_SEQ_EVENT_REGPARAM = 16; static const int SND_SEQ_EVENT_SONGPOS = 20; static const int SND_SEQ_EVENT_SONGSEL = 21; static const int SND_SEQ_EVENT_QFRAME = 22; static const int SND_SEQ_EVENT_TIMESIGN = 23; static const int SND_SEQ_EVENT_KEYSIGN = 24; static const int SND_SEQ_EVENT_START = 30; static const int SND_SEQ_EVENT_CONTINUE = 31; static const int SND_SEQ_EVENT_STOP = 32; static const int SND_SEQ_EVENT_SETPOS_TICK = 33; static const int SND_SEQ_EVENT_SETPOS_TIME = 34; static const int SND_SEQ_EVENT_TEMPO = 35; static const int SND_SEQ_EVENT_CLOCK = 36; static const int SND_SEQ_EVENT_TICK = 37; static const int SND_SEQ_EVENT_QUEUE_SKEW = 38; static const int SND_SEQ_EVENT_SYNC_POS = 39; static const int SND_SEQ_EVENT_TUNE_REQUEST = 40; static const int SND_SEQ_EVENT_RESET = 41; static const int SND_SEQ_EVENT_SENSING = 42; static const int SND_SEQ_EVENT_ECHO = 50; static const int SND_SEQ_EVENT_OSS = 51; static const int SND_SEQ_EVENT_CLIENT_START = 60; static const int SND_SEQ_EVENT_CLIENT_EXIT = 61; static const int SND_SEQ_EVENT_CLIENT_CHANGE = 62; static const int SND_SEQ_EVENT_PORT_START = 63; static const int SND_SEQ_EVENT_PORT_EXIT = 64; static const int SND_SEQ_EVENT_PORT_CHANGE = 65; static const int SND_SEQ_EVENT_PORT_SUBSCRIBED = 66; static const int SND_SEQ_EVENT_PORT_UNSUBSCRIBED = 67; static const int SND_SEQ_EVENT_USR0 = 90; static const int SND_SEQ_EVENT_USR1 = 91; static const int SND_SEQ_EVENT_USR2 = 92; static const int SND_SEQ_EVENT_USR3 = 93; static const int SND_SEQ_EVENT_USR4 = 94; static const int SND_SEQ_EVENT_USR5 = 95; static const int SND_SEQ_EVENT_USR6 = 96; static const int SND_SEQ_EVENT_USR7 = 97; static const int SND_SEQ_EVENT_USR8 = 98; static const int SND_SEQ_EVENT_USR9 = 99; static const int SND_SEQ_EVENT_SYSEX = 130; static const int SND_SEQ_EVENT_BOUNCE = 131; static const int SND_SEQ_EVENT_USR_VAR0 = 135; static const int SND_SEQ_EVENT_USR_VAR1 = 136; static const int SND_SEQ_EVENT_USR_VAR2 = 137; static const int SND_SEQ_EVENT_USR_VAR3 = 138; static const int SND_SEQ_EVENT_USR_VAR4 = 139; static const int SND_SEQ_EVENT_NONE = 255; } class snd_seq_addr_t extends ffi.Struct { @ffi.Uint8() external int client; @ffi.Uint8() external int port; } class snd_seq_connect_t extends ffi.Struct { external snd_seq_addr_t sender; external snd_seq_addr_t dest; } class snd_seq_real_time_t extends ffi.Struct { @ffi.Uint32() external int tv_sec; @ffi.Uint32() external int tv_nsec; } class snd_seq_ev_note_t extends ffi.Struct { @ffi.Uint8() external int channel; @ffi.Uint8() external int note; @ffi.Uint8() external int velocity; @ffi.Uint8() external int off_velocity; @ffi.Uint32() external int duration; } class snd_seq_ev_ctrl_t extends ffi.Opaque {} class snd_seq_ev_raw8_t extends ffi.Opaque {} class snd_seq_ev_raw32_t extends ffi.Opaque {} class snd_seq_ev_ext extends ffi.Struct { @ffi.Uint32() external int len; external ffi.Pointer ptr; } class snd_seq_result_t extends ffi.Struct { @ffi.Int32() external int event; @ffi.Int32() external int result; } class snd_seq_queue_skew_t extends ffi.Struct { @ffi.Uint32() external int value; @ffi.Uint32() external int base; } class snd_seq_ev_queue_control_t extends ffi.Opaque {} class snd_seq_event_t extends ffi.Opaque {} class snd_seq_ extends ffi.Opaque {} abstract class snd_seq_type_t { static const int SND_SEQ_TYPE_HW = 0; static const int SND_SEQ_TYPE_SHM = 1; static const int SND_SEQ_TYPE_INET = 2; } class snd_seq_system_info_ extends ffi.Opaque {} class snd_seq_client_info_ extends ffi.Opaque {} abstract class snd_seq_client_type_t { static const int SND_SEQ_USER_CLIENT = 1; static const int SND_SEQ_KERNEL_CLIENT = 2; } class snd_seq_client_pool_ extends ffi.Opaque {} class snd_seq_port_info_ extends ffi.Opaque {} class snd_seq_port_subscribe_ extends ffi.Opaque {} class snd_seq_query_subscribe_ extends ffi.Opaque {} abstract class snd_seq_query_subs_type_t { static const int SND_SEQ_QUERY_SUBS_READ = 0; static const int SND_SEQ_QUERY_SUBS_WRITE = 1; } class snd_seq_queue_info_ extends ffi.Opaque {} class snd_seq_queue_status_ extends ffi.Opaque {} class snd_seq_queue_tempo_ extends ffi.Opaque {} class snd_seq_queue_timer_ extends ffi.Opaque {} abstract class snd_seq_queue_timer_type_t { static const int SND_SEQ_TIMER_ALSA = 0; static const int SND_SEQ_TIMER_MIDI_CLOCK = 1; static const int SND_SEQ_TIMER_MIDI_TICK = 2; } class snd_seq_remove_events_ extends ffi.Opaque {} class snd_midi_event extends ffi.Opaque {} const int _PC_LINK_MAX = 0; const int _PC_MAX_CANON = 1; const int _PC_MAX_INPUT = 2; const int _PC_NAME_MAX = 3; const int _PC_PATH_MAX = 4; const int _PC_PIPE_BUF = 5; const int _PC_CHOWN_RESTRICTED = 6; const int _PC_NO_TRUNC = 7; const int _PC_VDISABLE = 8; const int _PC_SYNC_IO = 9; const int _PC_ASYNC_IO = 10; const int _PC_PRIO_IO = 11; const int _PC_SOCK_MAXBUF = 12; const int _PC_FILESIZEBITS = 13; const int _PC_REC_INCR_XFER_SIZE = 14; const int _PC_REC_MAX_XFER_SIZE = 15; const int _PC_REC_MIN_XFER_SIZE = 16; const int _PC_REC_XFER_ALIGN = 17; const int _PC_ALLOC_SIZE_MIN = 18; const int _PC_SYMLINK_MAX = 19; const int _PC_2_SYMLINKS = 20; const int _SC_ARG_MAX = 0; const int _SC_CHILD_MAX = 1; const int _SC_CLK_TCK = 2; const int _SC_NGROUPS_MAX = 3; const int _SC_OPEN_MAX = 4; const int _SC_STREAM_MAX = 5; const int _SC_TZNAME_MAX = 6; const int _SC_JOB_CONTROL = 7; const int _SC_SAVED_IDS = 8; const int _SC_REALTIME_SIGNALS = 9; const int _SC_PRIORITY_SCHEDULING = 10; const int _SC_TIMERS = 11; const int _SC_ASYNCHRONOUS_IO = 12; const int _SC_PRIORITIZED_IO = 13; const int _SC_SYNCHRONIZED_IO = 14; const int _SC_FSYNC = 15; const int _SC_MAPPED_FILES = 16; const int _SC_MEMLOCK = 17; const int _SC_MEMLOCK_RANGE = 18; const int _SC_MEMORY_PROTECTION = 19; const int _SC_MESSAGE_PASSING = 20; const int _SC_SEMAPHORES = 21; const int _SC_SHARED_MEMORY_OBJECTS = 22; const int _SC_AIO_LISTIO_MAX = 23; const int _SC_AIO_MAX = 24; const int _SC_AIO_PRIO_DELTA_MAX = 25; const int _SC_DELAYTIMER_MAX = 26; const int _SC_MQ_OPEN_MAX = 27; const int _SC_MQ_PRIO_MAX = 28; const int _SC_VERSION = 29; const int _SC_PAGESIZE = 30; const int _SC_RTSIG_MAX = 31; const int _SC_SEM_NSEMS_MAX = 32; const int _SC_SEM_VALUE_MAX = 33; const int _SC_SIGQUEUE_MAX = 34; const int _SC_TIMER_MAX = 35; const int _SC_BC_BASE_MAX = 36; const int _SC_BC_DIM_MAX = 37; const int _SC_BC_SCALE_MAX = 38; const int _SC_BC_STRING_MAX = 39; const int _SC_COLL_WEIGHTS_MAX = 40; const int _SC_EQUIV_CLASS_MAX = 41; const int _SC_EXPR_NEST_MAX = 42; const int _SC_LINE_MAX = 43; const int _SC_RE_DUP_MAX = 44; const int _SC_CHARCLASS_NAME_MAX = 45; const int _SC_2_VERSION = 46; const int _SC_2_C_BIND = 47; const int _SC_2_C_DEV = 48; const int _SC_2_FORT_DEV = 49; const int _SC_2_FORT_RUN = 50; const int _SC_2_SW_DEV = 51; const int _SC_2_LOCALEDEF = 52; const int _SC_PII = 53; const int _SC_PII_XTI = 54; const int _SC_PII_SOCKET = 55; const int _SC_PII_INTERNET = 56; const int _SC_PII_OSI = 57; const int _SC_POLL = 58; const int _SC_SELECT = 59; const int _SC_UIO_MAXIOV = 60; const int _SC_IOV_MAX = 60; const int _SC_PII_INTERNET_STREAM = 61; const int _SC_PII_INTERNET_DGRAM = 62; const int _SC_PII_OSI_COTS = 63; const int _SC_PII_OSI_CLTS = 64; const int _SC_PII_OSI_M = 65; const int _SC_T_IOV_MAX = 66; const int _SC_THREADS = 67; const int _SC_THREAD_SAFE_FUNCTIONS = 68; const int _SC_GETGR_R_SIZE_MAX = 69; const int _SC_GETPW_R_SIZE_MAX = 70; const int _SC_LOGIN_NAME_MAX = 71; const int _SC_TTY_NAME_MAX = 72; const int _SC_THREAD_DESTRUCTOR_ITERATIONS = 73; const int _SC_THREAD_KEYS_MAX = 74; const int _SC_THREAD_STACK_MIN = 75; const int _SC_THREAD_THREADS_MAX = 76; const int _SC_THREAD_ATTR_STACKADDR = 77; const int _SC_THREAD_ATTR_STACKSIZE = 78; const int _SC_THREAD_PRIORITY_SCHEDULING = 79; const int _SC_THREAD_PRIO_INHERIT = 80; const int _SC_THREAD_PRIO_PROTECT = 81; const int _SC_THREAD_PROCESS_SHARED = 82; const int _SC_NPROCESSORS_CONF = 83; const int _SC_NPROCESSORS_ONLN = 84; const int _SC_PHYS_PAGES = 85; const int _SC_AVPHYS_PAGES = 86; const int _SC_ATEXIT_MAX = 87; const int _SC_PASS_MAX = 88; const int _SC_XOPEN_VERSION = 89; const int _SC_XOPEN_XCU_VERSION = 90; const int _SC_XOPEN_UNIX = 91; const int _SC_XOPEN_CRYPT = 92; const int _SC_XOPEN_ENH_I18N = 93; const int _SC_XOPEN_SHM = 94; const int _SC_2_CHAR_TERM = 95; const int _SC_2_C_VERSION = 96; const int _SC_2_UPE = 97; const int _SC_XOPEN_XPG2 = 98; const int _SC_XOPEN_XPG3 = 99; const int _SC_XOPEN_XPG4 = 100; const int _SC_CHAR_BIT = 101; const int _SC_CHAR_MAX = 102; const int _SC_CHAR_MIN = 103; const int _SC_INT_MAX = 104; const int _SC_INT_MIN = 105; const int _SC_LONG_BIT = 106; const int _SC_WORD_BIT = 107; const int _SC_MB_LEN_MAX = 108; const int _SC_NZERO = 109; const int _SC_SSIZE_MAX = 110; const int _SC_SCHAR_MAX = 111; const int _SC_SCHAR_MIN = 112; const int _SC_SHRT_MAX = 113; const int _SC_SHRT_MIN = 114; const int _SC_UCHAR_MAX = 115; const int _SC_UINT_MAX = 116; const int _SC_ULONG_MAX = 117; const int _SC_USHRT_MAX = 118; const int _SC_NL_ARGMAX = 119; const int _SC_NL_LANGMAX = 120; const int _SC_NL_MSGMAX = 121; const int _SC_NL_NMAX = 122; const int _SC_NL_SETMAX = 123; const int _SC_NL_TEXTMAX = 124; const int _SC_XBS5_ILP32_OFF32 = 125; const int _SC_XBS5_ILP32_OFFBIG = 126; const int _SC_XBS5_LP64_OFF64 = 127; const int _SC_XBS5_LPBIG_OFFBIG = 128; const int _SC_XOPEN_LEGACY = 129; const int _SC_XOPEN_REALTIME = 130; const int _SC_XOPEN_REALTIME_THREADS = 131; const int _SC_ADVISORY_INFO = 132; const int _SC_BARRIERS = 133; const int _SC_BASE = 134; const int _SC_C_LANG_SUPPORT = 135; const int _SC_C_LANG_SUPPORT_R = 136; const int _SC_CLOCK_SELECTION = 137; const int _SC_CPUTIME = 138; const int _SC_THREAD_CPUTIME = 139; const int _SC_DEVICE_IO = 140; const int _SC_DEVICE_SPECIFIC = 141; const int _SC_DEVICE_SPECIFIC_R = 142; const int _SC_FD_MGMT = 143; const int _SC_FIFO = 144; const int _SC_PIPE = 145; const int _SC_FILE_ATTRIBUTES = 146; const int _SC_FILE_LOCKING = 147; const int _SC_FILE_SYSTEM = 148; const int _SC_MONOTONIC_CLOCK = 149; const int _SC_MULTI_PROCESS = 150; const int _SC_SINGLE_PROCESS = 151; const int _SC_NETWORKING = 152; const int _SC_READER_WRITER_LOCKS = 153; const int _SC_SPIN_LOCKS = 154; const int _SC_REGEXP = 155; const int _SC_REGEX_VERSION = 156; const int _SC_SHELL = 157; const int _SC_SIGNALS = 158; const int _SC_SPAWN = 159; const int _SC_SPORADIC_SERVER = 160; const int _SC_THREAD_SPORADIC_SERVER = 161; const int _SC_SYSTEM_DATABASE = 162; const int _SC_SYSTEM_DATABASE_R = 163; const int _SC_TIMEOUTS = 164; const int _SC_TYPED_MEMORY_OBJECTS = 165; const int _SC_USER_GROUPS = 166; const int _SC_USER_GROUPS_R = 167; const int _SC_2_PBS = 168; const int _SC_2_PBS_ACCOUNTING = 169; const int _SC_2_PBS_LOCATE = 170; const int _SC_2_PBS_MESSAGE = 171; const int _SC_2_PBS_TRACK = 172; const int _SC_SYMLOOP_MAX = 173; const int _SC_STREAMS = 174; const int _SC_2_PBS_CHECKPOINT = 175; const int _SC_V6_ILP32_OFF32 = 176; const int _SC_V6_ILP32_OFFBIG = 177; const int _SC_V6_LP64_OFF64 = 178; const int _SC_V6_LPBIG_OFFBIG = 179; const int _SC_HOST_NAME_MAX = 180; const int _SC_TRACE = 181; const int _SC_TRACE_EVENT_FILTER = 182; const int _SC_TRACE_INHERIT = 183; const int _SC_TRACE_LOG = 184; const int _SC_LEVEL1_ICACHE_SIZE = 185; const int _SC_LEVEL1_ICACHE_ASSOC = 186; const int _SC_LEVEL1_ICACHE_LINESIZE = 187; const int _SC_LEVEL1_DCACHE_SIZE = 188; const int _SC_LEVEL1_DCACHE_ASSOC = 189; const int _SC_LEVEL1_DCACHE_LINESIZE = 190; const int _SC_LEVEL2_CACHE_SIZE = 191; const int _SC_LEVEL2_CACHE_ASSOC = 192; const int _SC_LEVEL2_CACHE_LINESIZE = 193; const int _SC_LEVEL3_CACHE_SIZE = 194; const int _SC_LEVEL3_CACHE_ASSOC = 195; const int _SC_LEVEL3_CACHE_LINESIZE = 196; const int _SC_LEVEL4_CACHE_SIZE = 197; const int _SC_LEVEL4_CACHE_ASSOC = 198; const int _SC_LEVEL4_CACHE_LINESIZE = 199; const int _SC_IPV6 = 235; const int _SC_RAW_SOCKETS = 236; const int _SC_V7_ILP32_OFF32 = 237; const int _SC_V7_ILP32_OFFBIG = 238; const int _SC_V7_LP64_OFF64 = 239; const int _SC_V7_LPBIG_OFFBIG = 240; const int _SC_SS_REPL_MAX = 241; const int _SC_TRACE_EVENT_NAME_MAX = 242; const int _SC_TRACE_NAME_MAX = 243; const int _SC_TRACE_SYS_MAX = 244; const int _SC_TRACE_USER_EVENT_MAX = 245; const int _SC_XOPEN_STREAMS = 246; const int _SC_THREAD_ROBUST_PRIO_INHERIT = 247; const int _SC_THREAD_ROBUST_PRIO_PROTECT = 248; const int _CS_PATH = 0; const int _CS_V6_WIDTH_RESTRICTED_ENVS = 1; const int _CS_GNU_LIBC_VERSION = 2; const int _CS_GNU_LIBPTHREAD_VERSION = 3; const int _CS_V5_WIDTH_RESTRICTED_ENVS = 4; const int _CS_V7_WIDTH_RESTRICTED_ENVS = 5; const int _CS_LFS_CFLAGS = 1000; const int _CS_LFS_LDFLAGS = 1001; const int _CS_LFS_LIBS = 1002; const int _CS_LFS_LINTFLAGS = 1003; const int _CS_LFS64_CFLAGS = 1004; const int _CS_LFS64_LDFLAGS = 1005; const int _CS_LFS64_LIBS = 1006; const int _CS_LFS64_LINTFLAGS = 1007; const int _CS_XBS5_ILP32_OFF32_CFLAGS = 1100; const int _CS_XBS5_ILP32_OFF32_LDFLAGS = 1101; const int _CS_XBS5_ILP32_OFF32_LIBS = 1102; const int _CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103; const int _CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104; const int _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105; const int _CS_XBS5_ILP32_OFFBIG_LIBS = 1106; const int _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107; const int _CS_XBS5_LP64_OFF64_CFLAGS = 1108; const int _CS_XBS5_LP64_OFF64_LDFLAGS = 1109; const int _CS_XBS5_LP64_OFF64_LIBS = 1110; const int _CS_XBS5_LP64_OFF64_LINTFLAGS = 1111; const int _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112; const int _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113; const int _CS_XBS5_LPBIG_OFFBIG_LIBS = 1114; const int _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115; const int _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116; const int _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117; const int _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118; const int _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119; const int _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120; const int _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121; const int _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122; const int _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123; const int _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124; const int _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125; const int _CS_POSIX_V6_LP64_OFF64_LIBS = 1126; const int _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127; const int _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128; const int _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129; const int _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130; const int _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131; const int _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132; const int _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133; const int _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134; const int _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135; const int _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136; const int _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137; const int _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138; const int _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139; const int _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140; const int _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141; const int _CS_POSIX_V7_LP64_OFF64_LIBS = 1142; const int _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143; const int _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144; const int _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145; const int _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146; const int _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147; const int _CS_V6_ENV = 1148; const int _CS_V7_ENV = 1149; const int SND_SEQ_EVFLG_RESULT = 0; const int SND_SEQ_EVFLG_NOTE = 1; const int SND_SEQ_EVFLG_CONTROL = 2; const int SND_SEQ_EVFLG_QUEUE = 3; const int SND_SEQ_EVFLG_SYSTEM = 4; const int SND_SEQ_EVFLG_MESSAGE = 5; const int SND_SEQ_EVFLG_CONNECTION = 6; const int SND_SEQ_EVFLG_SAMPLE = 7; const int SND_SEQ_EVFLG_USERS = 8; const int SND_SEQ_EVFLG_INSTR = 9; const int SND_SEQ_EVFLG_QUOTE = 10; const int SND_SEQ_EVFLG_NONE = 11; const int SND_SEQ_EVFLG_RAW = 12; const int SND_SEQ_EVFLG_FIXED = 13; const int SND_SEQ_EVFLG_VARIABLE = 14; const int SND_SEQ_EVFLG_VARUSR = 15; const int SND_SEQ_EVFLG_NOTE_ONEARG = 0; const int SND_SEQ_EVFLG_NOTE_TWOARG = 1; const int SND_SEQ_EVFLG_QUEUE_NOARG = 0; const int SND_SEQ_EVFLG_QUEUE_TICK = 1; const int SND_SEQ_EVFLG_QUEUE_TIME = 2; const int SND_SEQ_EVFLG_QUEUE_VALUE = 3; const int _UNISTD_H = 1; const int _FEATURES_H = 1; const int _DEFAULT_SOURCE = 1; const int __USE_ISOC11 = 1; const int __USE_ISOC99 = 1; const int __USE_ISOC95 = 1; const int _POSIX_SOURCE = 1; const int _POSIX_C_SOURCE = 200809; const int __USE_POSIX = 1; const int __USE_POSIX2 = 1; const int __USE_POSIX199309 = 1; const int __USE_POSIX199506 = 1; const int __USE_XOPEN2K = 1; const int __USE_XOPEN2K8 = 1; const int _ATFILE_SOURCE = 1; const int __USE_MISC = 1; const int __USE_ATFILE = 1; const int __USE_FORTIFY_LEVEL = 0; const int __GLIBC_USE_DEPRECATED_GETS = 0; const int _STDC_PREDEF_H = 1; const int __STDC_IEC_559__ = 1; const int __STDC_IEC_559_COMPLEX__ = 1; const int __STDC_ISO_10646__ = 201706; const int __GNU_LIBRARY__ = 6; const int __GLIBC__ = 2; const int __GLIBC_MINOR__ = 27; const int _SYS_CDEFS_H = 1; const int __glibc_c99_flexarr_available = 1; const int __WORDSIZE = 64; const int __WORDSIZE_TIME64_COMPAT32 = 1; const int __SYSCALL_WORDSIZE = 64; const int __HAVE_GENERIC_SELECTION = 0; const int _POSIX_VERSION = 200809; const int __POSIX2_THIS_VERSION = 200809; const int _POSIX2_VERSION = 200809; const int _POSIX2_C_VERSION = 200809; const int _POSIX2_C_BIND = 200809; const int _POSIX2_C_DEV = 200809; const int _POSIX2_SW_DEV = 200809; const int _POSIX2_LOCALEDEF = 200809; const int _XOPEN_VERSION = 700; const int _XOPEN_XCU_VERSION = 4; const int _XOPEN_XPG2 = 1; const int _XOPEN_XPG3 = 1; const int _XOPEN_XPG4 = 1; const int _XOPEN_UNIX = 1; const int _XOPEN_ENH_I18N = 1; const int _XOPEN_LEGACY = 1; const int _BITS_POSIX_OPT_H = 1; const int _POSIX_JOB_CONTROL = 1; const int _POSIX_SAVED_IDS = 1; const int _POSIX_PRIORITY_SCHEDULING = 200809; const int _POSIX_SYNCHRONIZED_IO = 200809; const int _POSIX_FSYNC = 200809; const int _POSIX_MAPPED_FILES = 200809; const int _POSIX_MEMLOCK = 200809; const int _POSIX_MEMLOCK_RANGE = 200809; const int _POSIX_MEMORY_PROTECTION = 200809; const int _POSIX_CHOWN_RESTRICTED = 0; const int _POSIX_VDISABLE = 0; const int _POSIX_NO_TRUNC = 1; const int _XOPEN_REALTIME = 1; const int _XOPEN_REALTIME_THREADS = 1; const int _XOPEN_SHM = 1; const int _POSIX_THREADS = 200809; const int _POSIX_REENTRANT_FUNCTIONS = 1; const int _POSIX_THREAD_SAFE_FUNCTIONS = 200809; const int _POSIX_THREAD_PRIORITY_SCHEDULING = 200809; const int _POSIX_THREAD_ATTR_STACKSIZE = 200809; const int _POSIX_THREAD_ATTR_STACKADDR = 200809; const int _POSIX_THREAD_PRIO_INHERIT = 200809; const int _POSIX_THREAD_PRIO_PROTECT = 200809; const int _POSIX_THREAD_ROBUST_PRIO_INHERIT = 200809; const int _POSIX_THREAD_ROBUST_PRIO_PROTECT = -1; const int _POSIX_SEMAPHORES = 200809; const int _POSIX_REALTIME_SIGNALS = 200809; const int _POSIX_ASYNCHRONOUS_IO = 200809; const int _POSIX_ASYNC_IO = 1; const int _LFS_ASYNCHRONOUS_IO = 1; const int _POSIX_PRIORITIZED_IO = 200809; const int _LFS64_ASYNCHRONOUS_IO = 1; const int _LFS_LARGEFILE = 1; const int _LFS64_LARGEFILE = 1; const int _LFS64_STDIO = 1; const int _POSIX_SHARED_MEMORY_OBJECTS = 200809; const int _POSIX_CPUTIME = 0; const int _POSIX_THREAD_CPUTIME = 0; const int _POSIX_REGEXP = 1; const int _POSIX_READER_WRITER_LOCKS = 200809; const int _POSIX_SHELL = 1; const int _POSIX_TIMEOUTS = 200809; const int _POSIX_SPIN_LOCKS = 200809; const int _POSIX_SPAWN = 200809; const int _POSIX_TIMERS = 200809; const int _POSIX_BARRIERS = 200809; const int _POSIX_MESSAGE_PASSING = 200809; const int _POSIX_THREAD_PROCESS_SHARED = 200809; const int _POSIX_MONOTONIC_CLOCK = 0; const int _POSIX_CLOCK_SELECTION = 200809; const int _POSIX_ADVISORY_INFO = 200809; const int _POSIX_IPV6 = 200809; const int _POSIX_RAW_SOCKETS = 200809; const int _POSIX2_CHAR_TERM = 200809; const int _POSIX_SPORADIC_SERVER = -1; const int _POSIX_THREAD_SPORADIC_SERVER = -1; const int _POSIX_TRACE = -1; const int _POSIX_TRACE_EVENT_FILTER = -1; const int _POSIX_TRACE_INHERIT = -1; const int _POSIX_TRACE_LOG = -1; const int _POSIX_TYPED_MEMORY_OBJECTS = -1; const int _POSIX_V7_LPBIG_OFFBIG = -1; const int _POSIX_V6_LPBIG_OFFBIG = -1; const int _XBS5_LPBIG_OFFBIG = -1; const int _POSIX_V7_LP64_OFF64 = 1; const int _POSIX_V6_LP64_OFF64 = 1; const int _XBS5_LP64_OFF64 = 1; const String __ILP32_OFF32_CFLAGS = '-m32'; const String __ILP32_OFF32_LDFLAGS = '-m32'; const String __ILP32_OFFBIG_CFLAGS = '-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'; const String __ILP32_OFFBIG_LDFLAGS = '-m32'; const String __LP64_OFF64_CFLAGS = '-m64'; const String __LP64_OFF64_LDFLAGS = '-m64'; const int STDIN_FILENO = 0; const int STDOUT_FILENO = 1; const int STDERR_FILENO = 2; const int _BITS_TYPES_H = 1; const int _BITS_TYPESIZES_H = 1; const int __OFF_T_MATCHES_OFF64_T = 1; const int __INO_T_MATCHES_INO64_T = 1; const int __RLIM_T_MATCHES_RLIM64_T = 1; const int __FD_SETSIZE = 1024; const int NULL = 0; const int R_OK = 4; const int W_OK = 2; const int X_OK = 1; const int F_OK = 0; const int SEEK_SET = 0; const int SEEK_CUR = 1; const int SEEK_END = 2; const int L_SET = 0; const int L_INCR = 1; const int L_XTND = 2; const int _PC_LINK_MAX_1 = 0; const int _PC_MAX_CANON_1 = 1; const int _PC_MAX_INPUT_1 = 2; const int _PC_NAME_MAX_1 = 3; const int _PC_PATH_MAX_1 = 4; const int _PC_PIPE_BUF_1 = 5; const int _PC_CHOWN_RESTRICTED_1 = 6; const int _PC_NO_TRUNC_1 = 7; const int _PC_VDISABLE_1 = 8; const int _PC_SYNC_IO_1 = 9; const int _PC_ASYNC_IO_1 = 10; const int _PC_PRIO_IO_1 = 11; const int _PC_SOCK_MAXBUF_1 = 12; const int _PC_FILESIZEBITS_1 = 13; const int _PC_REC_INCR_XFER_SIZE_1 = 14; const int _PC_REC_MAX_XFER_SIZE_1 = 15; const int _PC_REC_MIN_XFER_SIZE_1 = 16; const int _PC_REC_XFER_ALIGN_1 = 17; const int _PC_ALLOC_SIZE_MIN_1 = 18; const int _PC_SYMLINK_MAX_1 = 19; const int _PC_2_SYMLINKS_1 = 20; const int _SC_ARG_MAX_1 = 0; const int _SC_CHILD_MAX_1 = 1; const int _SC_CLK_TCK_1 = 2; const int _SC_NGROUPS_MAX_1 = 3; const int _SC_OPEN_MAX_1 = 4; const int _SC_STREAM_MAX_1 = 5; const int _SC_TZNAME_MAX_1 = 6; const int _SC_JOB_CONTROL_1 = 7; const int _SC_SAVED_IDS_1 = 8; const int _SC_REALTIME_SIGNALS_1 = 9; const int _SC_PRIORITY_SCHEDULING_1 = 10; const int _SC_TIMERS_1 = 11; const int _SC_ASYNCHRONOUS_IO_1 = 12; const int _SC_PRIORITIZED_IO_1 = 13; const int _SC_SYNCHRONIZED_IO_1 = 14; const int _SC_FSYNC_1 = 15; const int _SC_MAPPED_FILES_1 = 16; const int _SC_MEMLOCK_1 = 17; const int _SC_MEMLOCK_RANGE_1 = 18; const int _SC_MEMORY_PROTECTION_1 = 19; const int _SC_MESSAGE_PASSING_1 = 20; const int _SC_SEMAPHORES_1 = 21; const int _SC_SHARED_MEMORY_OBJECTS_1 = 22; const int _SC_AIO_LISTIO_MAX_1 = 23; const int _SC_AIO_MAX_1 = 24; const int _SC_AIO_PRIO_DELTA_MAX_1 = 25; const int _SC_DELAYTIMER_MAX_1 = 26; const int _SC_MQ_OPEN_MAX_1 = 27; const int _SC_MQ_PRIO_MAX_1 = 28; const int _SC_VERSION_1 = 29; const int _SC_PAGESIZE_1 = 30; const int _SC_PAGE_SIZE = 30; const int _SC_RTSIG_MAX_1 = 31; const int _SC_SEM_NSEMS_MAX_1 = 32; const int _SC_SEM_VALUE_MAX_1 = 33; const int _SC_SIGQUEUE_MAX_1 = 34; const int _SC_TIMER_MAX_1 = 35; const int _SC_BC_BASE_MAX_1 = 36; const int _SC_BC_DIM_MAX_1 = 37; const int _SC_BC_SCALE_MAX_1 = 38; const int _SC_BC_STRING_MAX_1 = 39; const int _SC_COLL_WEIGHTS_MAX_1 = 40; const int _SC_EQUIV_CLASS_MAX_1 = 41; const int _SC_EXPR_NEST_MAX_1 = 42; const int _SC_LINE_MAX_1 = 43; const int _SC_RE_DUP_MAX_1 = 44; const int _SC_CHARCLASS_NAME_MAX_1 = 45; const int _SC_2_VERSION_1 = 46; const int _SC_2_C_BIND_1 = 47; const int _SC_2_C_DEV_1 = 48; const int _SC_2_FORT_DEV_1 = 49; const int _SC_2_FORT_RUN_1 = 50; const int _SC_2_SW_DEV_1 = 51; const int _SC_2_LOCALEDEF_1 = 52; const int _SC_PII_1 = 53; const int _SC_PII_XTI_1 = 54; const int _SC_PII_SOCKET_1 = 55; const int _SC_PII_INTERNET_1 = 56; const int _SC_PII_OSI_1 = 57; const int _SC_POLL_1 = 58; const int _SC_SELECT_1 = 59; const int _SC_UIO_MAXIOV_1 = 60; const int _SC_IOV_MAX_1 = 60; const int _SC_PII_INTERNET_STREAM_1 = 61; const int _SC_PII_INTERNET_DGRAM_1 = 62; const int _SC_PII_OSI_COTS_1 = 63; const int _SC_PII_OSI_CLTS_1 = 64; const int _SC_PII_OSI_M_1 = 65; const int _SC_T_IOV_MAX_1 = 66; const int _SC_THREADS_1 = 67; const int _SC_THREAD_SAFE_FUNCTIONS_1 = 68; const int _SC_GETGR_R_SIZE_MAX_1 = 69; const int _SC_GETPW_R_SIZE_MAX_1 = 70; const int _SC_LOGIN_NAME_MAX_1 = 71; const int _SC_TTY_NAME_MAX_1 = 72; const int _SC_THREAD_DESTRUCTOR_ITERATIONS_1 = 73; const int _SC_THREAD_KEYS_MAX_1 = 74; const int _SC_THREAD_STACK_MIN_1 = 75; const int _SC_THREAD_THREADS_MAX_1 = 76; const int _SC_THREAD_ATTR_STACKADDR_1 = 77; const int _SC_THREAD_ATTR_STACKSIZE_1 = 78; const int _SC_THREAD_PRIORITY_SCHEDULING_1 = 79; const int _SC_THREAD_PRIO_INHERIT_1 = 80; const int _SC_THREAD_PRIO_PROTECT_1 = 81; const int _SC_THREAD_PROCESS_SHARED_1 = 82; const int _SC_NPROCESSORS_CONF_1 = 83; const int _SC_NPROCESSORS_ONLN_1 = 84; const int _SC_PHYS_PAGES_1 = 85; const int _SC_AVPHYS_PAGES_1 = 86; const int _SC_ATEXIT_MAX_1 = 87; const int _SC_PASS_MAX_1 = 88; const int _SC_XOPEN_VERSION_1 = 89; const int _SC_XOPEN_XCU_VERSION_1 = 90; const int _SC_XOPEN_UNIX_1 = 91; const int _SC_XOPEN_CRYPT_1 = 92; const int _SC_XOPEN_ENH_I18N_1 = 93; const int _SC_XOPEN_SHM_1 = 94; const int _SC_2_CHAR_TERM_1 = 95; const int _SC_2_C_VERSION_1 = 96; const int _SC_2_UPE_1 = 97; const int _SC_XOPEN_XPG2_1 = 98; const int _SC_XOPEN_XPG3_1 = 99; const int _SC_XOPEN_XPG4_1 = 100; const int _SC_CHAR_BIT_1 = 101; const int _SC_CHAR_MAX_1 = 102; const int _SC_CHAR_MIN_1 = 103; const int _SC_INT_MAX_1 = 104; const int _SC_INT_MIN_1 = 105; const int _SC_LONG_BIT_1 = 106; const int _SC_WORD_BIT_1 = 107; const int _SC_MB_LEN_MAX_1 = 108; const int _SC_NZERO_1 = 109; const int _SC_SSIZE_MAX_1 = 110; const int _SC_SCHAR_MAX_1 = 111; const int _SC_SCHAR_MIN_1 = 112; const int _SC_SHRT_MAX_1 = 113; const int _SC_SHRT_MIN_1 = 114; const int _SC_UCHAR_MAX_1 = 115; const int _SC_UINT_MAX_1 = 116; const int _SC_ULONG_MAX_1 = 117; const int _SC_USHRT_MAX_1 = 118; const int _SC_NL_ARGMAX_1 = 119; const int _SC_NL_LANGMAX_1 = 120; const int _SC_NL_MSGMAX_1 = 121; const int _SC_NL_NMAX_1 = 122; const int _SC_NL_SETMAX_1 = 123; const int _SC_NL_TEXTMAX_1 = 124; const int _SC_XBS5_ILP32_OFF32_1 = 125; const int _SC_XBS5_ILP32_OFFBIG_1 = 126; const int _SC_XBS5_LP64_OFF64_1 = 127; const int _SC_XBS5_LPBIG_OFFBIG_1 = 128; const int _SC_XOPEN_LEGACY_1 = 129; const int _SC_XOPEN_REALTIME_1 = 130; const int _SC_XOPEN_REALTIME_THREADS_1 = 131; const int _SC_ADVISORY_INFO_1 = 132; const int _SC_BARRIERS_1 = 133; const int _SC_BASE_1 = 134; const int _SC_C_LANG_SUPPORT_1 = 135; const int _SC_C_LANG_SUPPORT_R_1 = 136; const int _SC_CLOCK_SELECTION_1 = 137; const int _SC_CPUTIME_1 = 138; const int _SC_THREAD_CPUTIME_1 = 139; const int _SC_DEVICE_IO_1 = 140; const int _SC_DEVICE_SPECIFIC_1 = 141; const int _SC_DEVICE_SPECIFIC_R_1 = 142; const int _SC_FD_MGMT_1 = 143; const int _SC_FIFO_1 = 144; const int _SC_PIPE_1 = 145; const int _SC_FILE_ATTRIBUTES_1 = 146; const int _SC_FILE_LOCKING_1 = 147; const int _SC_FILE_SYSTEM_1 = 148; const int _SC_MONOTONIC_CLOCK_1 = 149; const int _SC_MULTI_PROCESS_1 = 150; const int _SC_SINGLE_PROCESS_1 = 151; const int _SC_NETWORKING_1 = 152; const int _SC_READER_WRITER_LOCKS_1 = 153; const int _SC_SPIN_LOCKS_1 = 154; const int _SC_REGEXP_1 = 155; const int _SC_REGEX_VERSION_1 = 156; const int _SC_SHELL_1 = 157; const int _SC_SIGNALS_1 = 158; const int _SC_SPAWN_1 = 159; const int _SC_SPORADIC_SERVER_1 = 160; const int _SC_THREAD_SPORADIC_SERVER_1 = 161; const int _SC_SYSTEM_DATABASE_1 = 162; const int _SC_SYSTEM_DATABASE_R_1 = 163; const int _SC_TIMEOUTS_1 = 164; const int _SC_TYPED_MEMORY_OBJECTS_1 = 165; const int _SC_USER_GROUPS_1 = 166; const int _SC_USER_GROUPS_R_1 = 167; const int _SC_2_PBS_1 = 168; const int _SC_2_PBS_ACCOUNTING_1 = 169; const int _SC_2_PBS_LOCATE_1 = 170; const int _SC_2_PBS_MESSAGE_1 = 171; const int _SC_2_PBS_TRACK_1 = 172; const int _SC_SYMLOOP_MAX_1 = 173; const int _SC_STREAMS_1 = 174; const int _SC_2_PBS_CHECKPOINT_1 = 175; const int _SC_V6_ILP32_OFF32_1 = 176; const int _SC_V6_ILP32_OFFBIG_1 = 177; const int _SC_V6_LP64_OFF64_1 = 178; const int _SC_V6_LPBIG_OFFBIG_1 = 179; const int _SC_HOST_NAME_MAX_1 = 180; const int _SC_TRACE_1 = 181; const int _SC_TRACE_EVENT_FILTER_1 = 182; const int _SC_TRACE_INHERIT_1 = 183; const int _SC_TRACE_LOG_1 = 184; const int _SC_LEVEL1_ICACHE_SIZE_1 = 185; const int _SC_LEVEL1_ICACHE_ASSOC_1 = 186; const int _SC_LEVEL1_ICACHE_LINESIZE_1 = 187; const int _SC_LEVEL1_DCACHE_SIZE_1 = 188; const int _SC_LEVEL1_DCACHE_ASSOC_1 = 189; const int _SC_LEVEL1_DCACHE_LINESIZE_1 = 190; const int _SC_LEVEL2_CACHE_SIZE_1 = 191; const int _SC_LEVEL2_CACHE_ASSOC_1 = 192; const int _SC_LEVEL2_CACHE_LINESIZE_1 = 193; const int _SC_LEVEL3_CACHE_SIZE_1 = 194; const int _SC_LEVEL3_CACHE_ASSOC_1 = 195; const int _SC_LEVEL3_CACHE_LINESIZE_1 = 196; const int _SC_LEVEL4_CACHE_SIZE_1 = 197; const int _SC_LEVEL4_CACHE_ASSOC_1 = 198; const int _SC_LEVEL4_CACHE_LINESIZE_1 = 199; const int _SC_IPV6_1 = 235; const int _SC_RAW_SOCKETS_1 = 236; const int _SC_V7_ILP32_OFF32_1 = 237; const int _SC_V7_ILP32_OFFBIG_1 = 238; const int _SC_V7_LP64_OFF64_1 = 239; const int _SC_V7_LPBIG_OFFBIG_1 = 240; const int _SC_SS_REPL_MAX_1 = 241; const int _SC_TRACE_EVENT_NAME_MAX_1 = 242; const int _SC_TRACE_NAME_MAX_1 = 243; const int _SC_TRACE_SYS_MAX_1 = 244; const int _SC_TRACE_USER_EVENT_MAX_1 = 245; const int _SC_XOPEN_STREAMS_1 = 246; const int _SC_THREAD_ROBUST_PRIO_INHERIT_1 = 247; const int _SC_THREAD_ROBUST_PRIO_PROTECT_1 = 248; const int _CS_PATH_1 = 0; const int _CS_V6_WIDTH_RESTRICTED_ENVS_1 = 1; const int _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1; const int _CS_GNU_LIBC_VERSION_1 = 2; const int _CS_GNU_LIBPTHREAD_VERSION_1 = 3; const int _CS_V5_WIDTH_RESTRICTED_ENVS_1 = 4; const int _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4; const int _CS_V7_WIDTH_RESTRICTED_ENVS_1 = 5; const int _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5; const int _CS_LFS_CFLAGS_1 = 1000; const int _CS_LFS_LDFLAGS_1 = 1001; const int _CS_LFS_LIBS_1 = 1002; const int _CS_LFS_LINTFLAGS_1 = 1003; const int _CS_LFS64_CFLAGS_1 = 1004; const int _CS_LFS64_LDFLAGS_1 = 1005; const int _CS_LFS64_LIBS_1 = 1006; const int _CS_LFS64_LINTFLAGS_1 = 1007; const int _CS_XBS5_ILP32_OFF32_CFLAGS_1 = 1100; const int _CS_XBS5_ILP32_OFF32_LDFLAGS_1 = 1101; const int _CS_XBS5_ILP32_OFF32_LIBS_1 = 1102; const int _CS_XBS5_ILP32_OFF32_LINTFLAGS_1 = 1103; const int _CS_XBS5_ILP32_OFFBIG_CFLAGS_1 = 1104; const int _CS_XBS5_ILP32_OFFBIG_LDFLAGS_1 = 1105; const int _CS_XBS5_ILP32_OFFBIG_LIBS_1 = 1106; const int _CS_XBS5_ILP32_OFFBIG_LINTFLAGS_1 = 1107; const int _CS_XBS5_LP64_OFF64_CFLAGS_1 = 1108; const int _CS_XBS5_LP64_OFF64_LDFLAGS_1 = 1109; const int _CS_XBS5_LP64_OFF64_LIBS_1 = 1110; const int _CS_XBS5_LP64_OFF64_LINTFLAGS_1 = 1111; const int _CS_XBS5_LPBIG_OFFBIG_CFLAGS_1 = 1112; const int _CS_XBS5_LPBIG_OFFBIG_LDFLAGS_1 = 1113; const int _CS_XBS5_LPBIG_OFFBIG_LIBS_1 = 1114; const int _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS_1 = 1115; const int _CS_POSIX_V6_ILP32_OFF32_CFLAGS_1 = 1116; const int _CS_POSIX_V6_ILP32_OFF32_LDFLAGS_1 = 1117; const int _CS_POSIX_V6_ILP32_OFF32_LIBS_1 = 1118; const int _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS_1 = 1119; const int _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS_1 = 1120; const int _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS_1 = 1121; const int _CS_POSIX_V6_ILP32_OFFBIG_LIBS_1 = 1122; const int _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS_1 = 1123; const int _CS_POSIX_V6_LP64_OFF64_CFLAGS_1 = 1124; const int _CS_POSIX_V6_LP64_OFF64_LDFLAGS_1 = 1125; const int _CS_POSIX_V6_LP64_OFF64_LIBS_1 = 1126; const int _CS_POSIX_V6_LP64_OFF64_LINTFLAGS_1 = 1127; const int _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS_1 = 1128; const int _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS_1 = 1129; const int _CS_POSIX_V6_LPBIG_OFFBIG_LIBS_1 = 1130; const int _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS_1 = 1131; const int _CS_POSIX_V7_ILP32_OFF32_CFLAGS_1 = 1132; const int _CS_POSIX_V7_ILP32_OFF32_LDFLAGS_1 = 1133; const int _CS_POSIX_V7_ILP32_OFF32_LIBS_1 = 1134; const int _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS_1 = 1135; const int _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS_1 = 1136; const int _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS_1 = 1137; const int _CS_POSIX_V7_ILP32_OFFBIG_LIBS_1 = 1138; const int _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS_1 = 1139; const int _CS_POSIX_V7_LP64_OFF64_CFLAGS_1 = 1140; const int _CS_POSIX_V7_LP64_OFF64_LDFLAGS_1 = 1141; const int _CS_POSIX_V7_LP64_OFF64_LIBS_1 = 1142; const int _CS_POSIX_V7_LP64_OFF64_LINTFLAGS_1 = 1143; const int _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS_1 = 1144; const int _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS_1 = 1145; const int _CS_POSIX_V7_LPBIG_OFFBIG_LIBS_1 = 1146; const int _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS_1 = 1147; const int _CS_V6_ENV_1 = 1148; const int _CS_V7_ENV_1 = 1149; const int _GETOPT_POSIX_H = 1; const int _GETOPT_CORE_H = 1; const int F_ULOCK = 0; const int F_LOCK = 1; const int F_TLOCK = 2; const int F_TEST = 3; const int _STDIO_H = 1; const int __GLIBC_USE_LIB_EXT2 = 1; const int __GLIBC_USE_IEC_60559_BFP_EXT = 1; const int __GLIBC_USE_IEC_60559_FUNCS_EXT = 1; const int __GLIBC_USE_IEC_60559_TYPES_EXT = 1; const int __GNUC_VA_LIST = 1; const int ____mbstate_t_defined = 1; const int ____FILE_defined = 1; const int __FILE_defined = 1; const int _IO_EOF_SEEN = 16; const int _IO_ERR_SEEN = 32; const int _IO_USER_LOCK = 32768; const int _IOFBF = 0; const int _IOLBF = 1; const int _IONBF = 2; const int BUFSIZ = 8192; const int EOF = -1; const String P_tmpdir = '/tmp'; const int _BITS_STDIO_LIM_H = 1; const int L_tmpnam = 20; const int TMP_MAX = 238328; const int FILENAME_MAX = 4096; const int L_ctermid = 9; const int FOPEN_MAX = 16; const int _STDLIB_H = 1; const int WNOHANG = 1; const int WUNTRACED = 2; const int WSTOPPED = 2; const int WEXITED = 4; const int WCONTINUED = 8; const int WNOWAIT = 16777216; const int __WNOTHREAD = 536870912; const int __WALL = 1073741824; const int __WCLONE = 2147483648; const int __ENUM_IDTYPE_T = 1; const int __W_CONTINUED = 65535; const int __WCOREFLAG = 128; const int __HAVE_FLOAT128 = 0; const int __HAVE_DISTINCT_FLOAT128 = 0; const int __HAVE_FLOAT64X = 1; const int __HAVE_FLOAT64X_LONG_DOUBLE = 1; const int __HAVE_FLOAT16 = 0; const int __HAVE_FLOAT32 = 1; const int __HAVE_FLOAT64 = 1; const int __HAVE_FLOAT32X = 1; const int __HAVE_FLOAT128X = 0; const int __HAVE_DISTINCT_FLOAT16 = 0; const int __HAVE_DISTINCT_FLOAT32 = 0; const int __HAVE_DISTINCT_FLOAT64 = 0; const int __HAVE_DISTINCT_FLOAT32X = 0; const int __HAVE_DISTINCT_FLOAT64X = 0; const int __HAVE_DISTINCT_FLOAT128X = 0; const int __HAVE_FLOATN_NOT_TYPEDEF = 0; const int __ldiv_t_defined = 1; const int __lldiv_t_defined = 1; const int RAND_MAX = 2147483647; const int EXIT_FAILURE = 1; const int EXIT_SUCCESS = 0; const int _SYS_TYPES_H = 1; const int __clock_t_defined = 1; const int __clockid_t_defined = 1; const int __time_t_defined = 1; const int __timer_t_defined = 1; const int _BITS_STDINT_INTN_H = 1; const int __BIT_TYPES_DEFINED__ = 1; const int _ENDIAN_H = 1; const int __LITTLE_ENDIAN = 1234; const int __BIG_ENDIAN = 4321; const int __PDP_ENDIAN = 3412; const int __BYTE_ORDER = 1234; const int __FLOAT_WORD_ORDER = 1234; const int LITTLE_ENDIAN = 1234; const int BIG_ENDIAN = 4321; const int PDP_ENDIAN = 3412; const int BYTE_ORDER = 1234; const int _BITS_BYTESWAP_H = 1; const int _BITS_UINTN_IDENTITY_H = 1; const int _SYS_SELECT_H = 1; const String __FD_ZERO_STOS = 'stosq'; const int __sigset_t_defined = 1; const int _SIGSET_NWORDS = 16; const int __timeval_defined = 1; const int _STRUCT_TIMESPEC = 1; const int __NFDBITS = 64; const int FD_SETSIZE = 1024; const int NFDBITS = 64; const int _BITS_PTHREADTYPES_COMMON_H = 1; const int _THREAD_SHARED_TYPES_H = 1; const int _BITS_PTHREADTYPES_ARCH_H = 1; const int __SIZEOF_PTHREAD_MUTEX_T = 40; const int __SIZEOF_PTHREAD_ATTR_T = 56; const int __SIZEOF_PTHREAD_RWLOCK_T = 56; const int __SIZEOF_PTHREAD_BARRIER_T = 32; const int __SIZEOF_PTHREAD_MUTEXATTR_T = 4; const int __SIZEOF_PTHREAD_COND_T = 48; const int __SIZEOF_PTHREAD_CONDATTR_T = 4; const int __SIZEOF_PTHREAD_RWLOCKATTR_T = 8; const int __SIZEOF_PTHREAD_BARRIERATTR_T = 4; const int __PTHREAD_MUTEX_HAVE_PREV = 1; const int __PTHREAD_RWLOCK_ELISION_EXTRA = 0; const int __have_pthread_attr_t = 1; const int _ALLOCA_H = 1; const int _STRING_H = 1; const int _BITS_TYPES_LOCALE_T_H = 1; const int _BITS_TYPES___LOCALE_T_H = 1; const int _STRINGS_H = 1; const int _FCNTL_H = 1; const int __O_LARGEFILE = 0; const int F_GETLK64 = 5; const int F_SETLK64 = 6; const int F_SETLKW64 = 7; const int O_ACCMODE = 3; const int O_RDONLY = 0; const int O_WRONLY = 1; const int O_RDWR = 2; const int O_CREAT = 64; const int O_EXCL = 128; const int O_NOCTTY = 256; const int O_TRUNC = 512; const int O_APPEND = 1024; const int O_NONBLOCK = 2048; const int O_NDELAY = 2048; const int O_SYNC = 1052672; const int O_FSYNC = 1052672; const int O_ASYNC = 8192; const int __O_DIRECTORY = 65536; const int __O_NOFOLLOW = 131072; const int __O_CLOEXEC = 524288; const int __O_DIRECT = 16384; const int __O_NOATIME = 262144; const int __O_PATH = 2097152; const int __O_DSYNC = 4096; const int __O_TMPFILE = 4259840; const int F_GETLK = 5; const int F_SETLK = 6; const int F_SETLKW = 7; const int O_DIRECTORY = 65536; const int O_NOFOLLOW = 131072; const int O_CLOEXEC = 524288; const int O_DSYNC = 4096; const int O_RSYNC = 1052672; const int F_DUPFD = 0; const int F_GETFD = 1; const int F_SETFD = 2; const int F_GETFL = 3; const int F_SETFL = 4; const int __F_SETOWN = 8; const int __F_GETOWN = 9; const int F_SETOWN = 8; const int F_GETOWN = 9; const int __F_SETSIG = 10; const int __F_GETSIG = 11; const int __F_SETOWN_EX = 15; const int __F_GETOWN_EX = 16; const int F_DUPFD_CLOEXEC = 1030; const int FD_CLOEXEC = 1; const int F_RDLCK = 0; const int F_WRLCK = 1; const int F_UNLCK = 2; const int F_EXLCK = 4; const int F_SHLCK = 8; const int LOCK_SH = 1; const int LOCK_EX = 2; const int LOCK_NB = 4; const int LOCK_UN = 8; const int FAPPEND = 1024; const int FFSYNC = 1052672; const int FASYNC = 8192; const int FNONBLOCK = 2048; const int FNDELAY = 2048; const int __POSIX_FADV_DONTNEED = 4; const int __POSIX_FADV_NOREUSE = 5; const int POSIX_FADV_NORMAL = 0; const int POSIX_FADV_RANDOM = 1; const int POSIX_FADV_SEQUENTIAL = 2; const int POSIX_FADV_WILLNEED = 3; const int POSIX_FADV_DONTNEED = 4; const int POSIX_FADV_NOREUSE = 5; const int AT_FDCWD = -100; const int AT_SYMLINK_NOFOLLOW = 256; const int AT_REMOVEDIR = 512; const int AT_SYMLINK_FOLLOW = 1024; const int AT_EACCESS = 512; const int _BITS_STAT_H = 1; const int _STAT_VER_KERNEL = 0; const int _STAT_VER_LINUX = 1; const int _MKNOD_VER_LINUX = 0; const int _STAT_VER = 1; const int __S_IFMT = 61440; const int __S_IFDIR = 16384; const int __S_IFCHR = 8192; const int __S_IFBLK = 24576; const int __S_IFREG = 32768; const int __S_IFIFO = 4096; const int __S_IFLNK = 40960; const int __S_IFSOCK = 49152; const int __S_ISUID = 2048; const int __S_ISGID = 1024; const int __S_ISVTX = 512; const int __S_IREAD = 256; const int __S_IWRITE = 128; const int __S_IEXEC = 64; const int UTIME_NOW = 1073741823; const int UTIME_OMIT = 1073741822; const int S_IFMT = 61440; const int S_IFDIR = 16384; const int S_IFCHR = 8192; const int S_IFBLK = 24576; const int S_IFREG = 32768; const int S_IFIFO = 4096; const int S_IFLNK = 40960; const int S_IFSOCK = 49152; const int S_ISUID = 2048; const int S_ISGID = 1024; const int S_ISVTX = 512; const int S_IRUSR = 256; const int S_IWUSR = 128; const int S_IXUSR = 64; const int S_IRWXU = 448; const int S_IRGRP = 32; const int S_IWGRP = 16; const int S_IXGRP = 8; const int S_IRWXG = 56; const int S_IROTH = 4; const int S_IWOTH = 2; const int S_IXOTH = 1; const int S_IRWXO = 7; const int _ASSERT_H = 1; const int _SYS_POLL_H = 1; const int POLLIN = 1; const int POLLPRI = 2; const int POLLOUT = 4; const int POLLRDNORM = 64; const int POLLRDBAND = 128; const int POLLWRNORM = 256; const int POLLWRBAND = 512; const int POLLERR = 8; const int POLLHUP = 16; const int POLLNVAL = 32; const int _ERRNO_H = 1; const int _BITS_ERRNO_H = 1; const int EPERM = 1; const int ENOENT = 2; const int ESRCH = 3; const int EINTR = 4; const int EIO = 5; const int ENXIO = 6; const int E2BIG = 7; const int ENOEXEC = 8; const int EBADF = 9; const int ECHILD = 10; const int EAGAIN = 11; const int ENOMEM = 12; const int EACCES = 13; const int EFAULT = 14; const int ENOTBLK = 15; const int EBUSY = 16; const int EEXIST = 17; const int EXDEV = 18; const int ENODEV = 19; const int ENOTDIR = 20; const int EISDIR = 21; const int EINVAL = 22; const int ENFILE = 23; const int EMFILE = 24; const int ENOTTY = 25; const int ETXTBSY = 26; const int EFBIG = 27; const int ENOSPC = 28; const int ESPIPE = 29; const int EROFS = 30; const int EMLINK = 31; const int EPIPE = 32; const int EDOM = 33; const int ERANGE = 34; const int EDEADLK = 35; const int ENAMETOOLONG = 36; const int ENOLCK = 37; const int ENOSYS = 38; const int ENOTEMPTY = 39; const int ELOOP = 40; const int EWOULDBLOCK = 11; const int ENOMSG = 42; const int EIDRM = 43; const int ECHRNG = 44; const int EL2NSYNC = 45; const int EL3HLT = 46; const int EL3RST = 47; const int ELNRNG = 48; const int EUNATCH = 49; const int ENOCSI = 50; const int EL2HLT = 51; const int EBADE = 52; const int EBADR = 53; const int EXFULL = 54; const int ENOANO = 55; const int EBADRQC = 56; const int EBADSLT = 57; const int EDEADLOCK = 35; const int EBFONT = 59; const int ENOSTR = 60; const int ENODATA = 61; const int ETIME = 62; const int ENOSR = 63; const int ENONET = 64; const int ENOPKG = 65; const int EREMOTE = 66; const int ENOLINK = 67; const int EADV = 68; const int ESRMNT = 69; const int ECOMM = 70; const int EPROTO = 71; const int EMULTIHOP = 72; const int EDOTDOT = 73; const int EBADMSG = 74; const int EOVERFLOW = 75; const int ENOTUNIQ = 76; const int EBADFD = 77; const int EREMCHG = 78; const int ELIBACC = 79; const int ELIBBAD = 80; const int ELIBSCN = 81; const int ELIBMAX = 82; const int ELIBEXEC = 83; const int EILSEQ = 84; const int ERESTART = 85; const int ESTRPIPE = 86; const int EUSERS = 87; const int ENOTSOCK = 88; const int EDESTADDRREQ = 89; const int EMSGSIZE = 90; const int EPROTOTYPE = 91; const int ENOPROTOOPT = 92; const int EPROTONOSUPPORT = 93; const int ESOCKTNOSUPPORT = 94; const int EOPNOTSUPP = 95; const int EPFNOSUPPORT = 96; const int EAFNOSUPPORT = 97; const int EADDRINUSE = 98; const int EADDRNOTAVAIL = 99; const int ENETDOWN = 100; const int ENETUNREACH = 101; const int ENETRESET = 102; const int ECONNABORTED = 103; const int ECONNRESET = 104; const int ENOBUFS = 105; const int EISCONN = 106; const int ENOTCONN = 107; const int ESHUTDOWN = 108; const int ETOOMANYREFS = 109; const int ETIMEDOUT = 110; const int ECONNREFUSED = 111; const int EHOSTDOWN = 112; const int EHOSTUNREACH = 113; const int EALREADY = 114; const int EINPROGRESS = 115; const int ESTALE = 116; const int EUCLEAN = 117; const int ENOTNAM = 118; const int ENAVAIL = 119; const int EISNAM = 120; const int EREMOTEIO = 121; const int EDQUOT = 122; const int ENOMEDIUM = 123; const int EMEDIUMTYPE = 124; const int ECANCELED = 125; const int ENOKEY = 126; const int EKEYEXPIRED = 127; const int EKEYREVOKED = 128; const int EKEYREJECTED = 129; const int EOWNERDEAD = 130; const int ENOTRECOVERABLE = 131; const int ERFKILL = 132; const int EHWPOISON = 133; const int ENOTSUP = 95; const int IEC958_AES0_PROFESSIONAL = 1; const int IEC958_AES0_NONAUDIO = 2; const int IEC958_AES0_PRO_EMPHASIS = 28; const int IEC958_AES0_PRO_EMPHASIS_NOTID = 0; const int IEC958_AES0_PRO_EMPHASIS_NONE = 4; const int IEC958_AES0_PRO_EMPHASIS_5015 = 12; const int IEC958_AES0_PRO_EMPHASIS_CCITT = 28; const int IEC958_AES0_PRO_FREQ_UNLOCKED = 32; const int IEC958_AES0_PRO_FS = 192; const int IEC958_AES0_PRO_FS_NOTID = 0; const int IEC958_AES0_PRO_FS_44100 = 64; const int IEC958_AES0_PRO_FS_48000 = 128; const int IEC958_AES0_PRO_FS_32000 = 192; const int IEC958_AES0_CON_NOT_COPYRIGHT = 4; const int IEC958_AES0_CON_EMPHASIS = 56; const int IEC958_AES0_CON_EMPHASIS_NONE = 0; const int IEC958_AES0_CON_EMPHASIS_5015 = 8; const int IEC958_AES0_CON_MODE = 192; const int IEC958_AES1_PRO_MODE = 15; const int IEC958_AES1_PRO_MODE_NOTID = 0; const int IEC958_AES1_PRO_MODE_STEREOPHONIC = 2; const int IEC958_AES1_PRO_MODE_SINGLE = 4; const int IEC958_AES1_PRO_MODE_TWO = 8; const int IEC958_AES1_PRO_MODE_PRIMARY = 12; const int IEC958_AES1_PRO_MODE_BYTE3 = 15; const int IEC958_AES1_PRO_USERBITS = 240; const int IEC958_AES1_PRO_USERBITS_NOTID = 0; const int IEC958_AES1_PRO_USERBITS_192 = 128; const int IEC958_AES1_PRO_USERBITS_UDEF = 192; const int IEC958_AES1_CON_CATEGORY = 127; const int IEC958_AES1_CON_GENERAL = 0; const int IEC958_AES1_CON_LASEROPT_MASK = 7; const int IEC958_AES1_CON_LASEROPT_ID = 1; const int IEC958_AES1_CON_IEC908_CD = 1; const int IEC958_AES1_CON_NON_IEC908_CD = 9; const int IEC958_AES1_CON_MINI_DISC = 73; const int IEC958_AES1_CON_DVD = 25; const int IEC958_AES1_CON_LASTEROPT_OTHER = 121; const int IEC958_AES1_CON_DIGDIGCONV_MASK = 7; const int IEC958_AES1_CON_DIGDIGCONV_ID = 2; const int IEC958_AES1_CON_PCM_CODER = 2; const int IEC958_AES1_CON_MIXER = 18; const int IEC958_AES1_CON_RATE_CONVERTER = 26; const int IEC958_AES1_CON_SAMPLER = 34; const int IEC958_AES1_CON_DSP = 42; const int IEC958_AES1_CON_DIGDIGCONV_OTHER = 122; const int IEC958_AES1_CON_MAGNETIC_MASK = 7; const int IEC958_AES1_CON_MAGNETIC_ID = 3; const int IEC958_AES1_CON_DAT = 3; const int IEC958_AES1_CON_VCR = 11; const int IEC958_AES1_CON_DCC = 67; const int IEC958_AES1_CON_MAGNETIC_DISC = 27; const int IEC958_AES1_CON_MAGNETIC_OTHER = 123; const int IEC958_AES1_CON_BROADCAST1_MASK = 7; const int IEC958_AES1_CON_BROADCAST1_ID = 4; const int IEC958_AES1_CON_DAB_JAPAN = 4; const int IEC958_AES1_CON_DAB_EUROPE = 12; const int IEC958_AES1_CON_DAB_USA = 100; const int IEC958_AES1_CON_SOFTWARE = 68; const int IEC958_AES1_CON_IEC62105 = 36; const int IEC958_AES1_CON_BROADCAST1_OTHER = 124; const int IEC958_AES1_CON_BROADCAST2_MASK = 15; const int IEC958_AES1_CON_BROADCAST2_ID = 14; const int IEC958_AES1_CON_MUSICAL_MASK = 7; const int IEC958_AES1_CON_MUSICAL_ID = 5; const int IEC958_AES1_CON_SYNTHESIZER = 5; const int IEC958_AES1_CON_MICROPHONE = 13; const int IEC958_AES1_CON_MUSICAL_OTHER = 125; const int IEC958_AES1_CON_ADC_MASK = 31; const int IEC958_AES1_CON_ADC_ID = 6; const int IEC958_AES1_CON_ADC = 6; const int IEC958_AES1_CON_ADC_OTHER = 102; const int IEC958_AES1_CON_ADC_COPYRIGHT_MASK = 31; const int IEC958_AES1_CON_ADC_COPYRIGHT_ID = 22; const int IEC958_AES1_CON_ADC_COPYRIGHT = 22; const int IEC958_AES1_CON_ADC_COPYRIGHT_OTHER = 118; const int IEC958_AES1_CON_SOLIDMEM_MASK = 15; const int IEC958_AES1_CON_SOLIDMEM_ID = 8; const int IEC958_AES1_CON_SOLIDMEM_DIGITAL_RECORDER_PLAYER = 8; const int IEC958_AES1_CON_SOLIDMEM_OTHER = 120; const int IEC958_AES1_CON_EXPERIMENTAL = 64; const int IEC958_AES1_CON_ORIGINAL = 128; const int IEC958_AES2_PRO_SBITS = 7; const int IEC958_AES2_PRO_SBITS_20 = 2; const int IEC958_AES2_PRO_SBITS_24 = 4; const int IEC958_AES2_PRO_SBITS_UDEF = 6; const int IEC958_AES2_PRO_WORDLEN = 56; const int IEC958_AES2_PRO_WORDLEN_NOTID = 0; const int IEC958_AES2_PRO_WORDLEN_22_18 = 16; const int IEC958_AES2_PRO_WORDLEN_23_19 = 32; const int IEC958_AES2_PRO_WORDLEN_24_20 = 40; const int IEC958_AES2_PRO_WORDLEN_20_16 = 48; const int IEC958_AES2_CON_SOURCE = 15; const int IEC958_AES2_CON_SOURCE_UNSPEC = 0; const int IEC958_AES2_CON_CHANNEL = 240; const int IEC958_AES2_CON_CHANNEL_UNSPEC = 0; const int IEC958_AES3_CON_FS = 15; const int IEC958_AES3_CON_FS_44100 = 0; const int IEC958_AES3_CON_FS_NOTID = 1; const int IEC958_AES3_CON_FS_48000 = 2; const int IEC958_AES3_CON_FS_32000 = 3; const int IEC958_AES3_CON_FS_22050 = 4; const int IEC958_AES3_CON_FS_24000 = 6; const int IEC958_AES3_CON_FS_88200 = 8; const int IEC958_AES3_CON_FS_768000 = 9; const int IEC958_AES3_CON_FS_96000 = 10; const int IEC958_AES3_CON_FS_176400 = 12; const int IEC958_AES3_CON_FS_192000 = 14; const int IEC958_AES3_CON_CLOCK = 48; const int IEC958_AES3_CON_CLOCK_1000PPM = 0; const int IEC958_AES3_CON_CLOCK_50PPM = 16; const int IEC958_AES3_CON_CLOCK_VARIABLE = 32; const int IEC958_AES4_CON_MAX_WORDLEN_24 = 1; const int IEC958_AES4_CON_WORDLEN = 14; const int IEC958_AES4_CON_WORDLEN_NOTID = 0; const int IEC958_AES4_CON_WORDLEN_20_16 = 2; const int IEC958_AES4_CON_WORDLEN_22_18 = 4; const int IEC958_AES4_CON_WORDLEN_23_19 = 8; const int IEC958_AES4_CON_WORDLEN_24_20 = 10; const int IEC958_AES4_CON_WORDLEN_21_17 = 12; const int IEC958_AES4_CON_ORIGFS = 240; const int IEC958_AES4_CON_ORIGFS_NOTID = 0; const int IEC958_AES4_CON_ORIGFS_192000 = 16; const int IEC958_AES4_CON_ORIGFS_12000 = 32; const int IEC958_AES4_CON_ORIGFS_176400 = 48; const int IEC958_AES4_CON_ORIGFS_96000 = 80; const int IEC958_AES4_CON_ORIGFS_8000 = 96; const int IEC958_AES4_CON_ORIGFS_88200 = 112; const int IEC958_AES4_CON_ORIGFS_16000 = 128; const int IEC958_AES4_CON_ORIGFS_24000 = 144; const int IEC958_AES4_CON_ORIGFS_11025 = 160; const int IEC958_AES4_CON_ORIGFS_22050 = 176; const int IEC958_AES4_CON_ORIGFS_32000 = 192; const int IEC958_AES4_CON_ORIGFS_48000 = 208; const int IEC958_AES4_CON_ORIGFS_44100 = 240; const int IEC958_AES5_CON_CGMSA = 3; const int IEC958_AES5_CON_CGMSA_COPYFREELY = 0; const int IEC958_AES5_CON_CGMSA_COPYONCE = 1; const int IEC958_AES5_CON_CGMSA_COPYNOMORE = 2; const int IEC958_AES5_CON_CGMSA_COPYNEVER = 3; const int CEA861_AUDIO_INFOFRAME_DB1CC = 7; const int CEA861_AUDIO_INFOFRAME_DB1CT = 240; const int CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM = 0; const int CEA861_AUDIO_INFOFRAME_DB1CT_IEC60958 = 16; const int CEA861_AUDIO_INFOFRAME_DB1CT_AC3 = 32; const int CEA861_AUDIO_INFOFRAME_DB1CT_MPEG1 = 48; const int CEA861_AUDIO_INFOFRAME_DB1CT_MP3 = 64; const int CEA861_AUDIO_INFOFRAME_DB1CT_MPEG2_MULTICH = 80; const int CEA861_AUDIO_INFOFRAME_DB1CT_AAC = 96; const int CEA861_AUDIO_INFOFRAME_DB1CT_DTS = 112; const int CEA861_AUDIO_INFOFRAME_DB1CT_ATRAC = 128; const int CEA861_AUDIO_INFOFRAME_DB1CT_ONEBIT = 144; const int CEA861_AUDIO_INFOFRAME_DB1CT_DOLBY_DIG_PLUS = 160; const int CEA861_AUDIO_INFOFRAME_DB1CT_DTS_HD = 176; const int CEA861_AUDIO_INFOFRAME_DB1CT_MAT = 192; const int CEA861_AUDIO_INFOFRAME_DB1CT_DST = 208; const int CEA861_AUDIO_INFOFRAME_DB1CT_WMA_PRO = 224; const int CEA861_AUDIO_INFOFRAME_DB2SF = 28; const int CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM = 0; const int CEA861_AUDIO_INFOFRAME_DB2SF_32000 = 4; const int CEA861_AUDIO_INFOFRAME_DB2SF_44100 = 8; const int CEA861_AUDIO_INFOFRAME_DB2SF_48000 = 12; const int CEA861_AUDIO_INFOFRAME_DB2SF_88200 = 16; const int CEA861_AUDIO_INFOFRAME_DB2SF_96000 = 20; const int CEA861_AUDIO_INFOFRAME_DB2SF_176400 = 24; const int CEA861_AUDIO_INFOFRAME_DB2SF_192000 = 28; const int CEA861_AUDIO_INFOFRAME_DB2SS = 3; const int CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM = 0; const int CEA861_AUDIO_INFOFRAME_DB2SS_16BIT = 1; const int CEA861_AUDIO_INFOFRAME_DB2SS_20BIT = 2; const int CEA861_AUDIO_INFOFRAME_DB2SS_24BIT = 3; const int CEA861_AUDIO_INFOFRAME_DB5_DM_INH = 128; const int CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PERMITTED = 0; const int CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED = 128; const int CEA861_AUDIO_INFOFRAME_DB5_LSV = 120; const int MIDI_CHANNELS = 16; const int MIDI_GM_DRUM_CHANNEL = 9; const int MIDI_CMD_NOTE_OFF = 128; const int MIDI_CMD_NOTE_ON = 144; const int MIDI_CMD_NOTE_PRESSURE = 160; const int MIDI_CMD_CONTROL = 176; const int MIDI_CMD_PGM_CHANGE = 192; const int MIDI_CMD_CHANNEL_PRESSURE = 208; const int MIDI_CMD_BENDER = 224; const int MIDI_CMD_COMMON_SYSEX = 240; const int MIDI_CMD_COMMON_MTC_QUARTER = 241; const int MIDI_CMD_COMMON_SONG_POS = 242; const int MIDI_CMD_COMMON_SONG_SELECT = 243; const int MIDI_CMD_COMMON_TUNE_REQUEST = 246; const int MIDI_CMD_COMMON_SYSEX_END = 247; const int MIDI_CMD_COMMON_CLOCK = 248; const int MIDI_CMD_COMMON_START = 250; const int MIDI_CMD_COMMON_CONTINUE = 251; const int MIDI_CMD_COMMON_STOP = 252; const int MIDI_CMD_COMMON_SENSING = 254; const int MIDI_CMD_COMMON_RESET = 255; const int MIDI_CTL_MSB_BANK = 0; const int MIDI_CTL_MSB_MODWHEEL = 1; const int MIDI_CTL_MSB_BREATH = 2; const int MIDI_CTL_MSB_FOOT = 4; const int MIDI_CTL_MSB_PORTAMENTO_TIME = 5; const int MIDI_CTL_MSB_DATA_ENTRY = 6; const int MIDI_CTL_MSB_MAIN_VOLUME = 7; const int MIDI_CTL_MSB_BALANCE = 8; const int MIDI_CTL_MSB_PAN = 10; const int MIDI_CTL_MSB_EXPRESSION = 11; const int MIDI_CTL_MSB_EFFECT1 = 12; const int MIDI_CTL_MSB_EFFECT2 = 13; const int MIDI_CTL_MSB_GENERAL_PURPOSE1 = 16; const int MIDI_CTL_MSB_GENERAL_PURPOSE2 = 17; const int MIDI_CTL_MSB_GENERAL_PURPOSE3 = 18; const int MIDI_CTL_MSB_GENERAL_PURPOSE4 = 19; const int MIDI_CTL_LSB_BANK = 32; const int MIDI_CTL_LSB_MODWHEEL = 33; const int MIDI_CTL_LSB_BREATH = 34; const int MIDI_CTL_LSB_FOOT = 36; const int MIDI_CTL_LSB_PORTAMENTO_TIME = 37; const int MIDI_CTL_LSB_DATA_ENTRY = 38; const int MIDI_CTL_LSB_MAIN_VOLUME = 39; const int MIDI_CTL_LSB_BALANCE = 40; const int MIDI_CTL_LSB_PAN = 42; const int MIDI_CTL_LSB_EXPRESSION = 43; const int MIDI_CTL_LSB_EFFECT1 = 44; const int MIDI_CTL_LSB_EFFECT2 = 45; const int MIDI_CTL_LSB_GENERAL_PURPOSE1 = 48; const int MIDI_CTL_LSB_GENERAL_PURPOSE2 = 49; const int MIDI_CTL_LSB_GENERAL_PURPOSE3 = 50; const int MIDI_CTL_LSB_GENERAL_PURPOSE4 = 51; const int MIDI_CTL_SUSTAIN = 64; const int MIDI_CTL_PORTAMENTO = 65; const int MIDI_CTL_SOSTENUTO = 66; const int MIDI_CTL_SUSTENUTO = 66; const int MIDI_CTL_SOFT_PEDAL = 67; const int MIDI_CTL_LEGATO_FOOTSWITCH = 68; const int MIDI_CTL_HOLD2 = 69; const int MIDI_CTL_SC1_SOUND_VARIATION = 70; const int MIDI_CTL_SC2_TIMBRE = 71; const int MIDI_CTL_SC3_RELEASE_TIME = 72; const int MIDI_CTL_SC4_ATTACK_TIME = 73; const int MIDI_CTL_SC5_BRIGHTNESS = 74; const int MIDI_CTL_SC6 = 75; const int MIDI_CTL_SC7 = 76; const int MIDI_CTL_SC8 = 77; const int MIDI_CTL_SC9 = 78; const int MIDI_CTL_SC10 = 79; const int MIDI_CTL_GENERAL_PURPOSE5 = 80; const int MIDI_CTL_GENERAL_PURPOSE6 = 81; const int MIDI_CTL_GENERAL_PURPOSE7 = 82; const int MIDI_CTL_GENERAL_PURPOSE8 = 83; const int MIDI_CTL_PORTAMENTO_CONTROL = 84; const int MIDI_CTL_E1_REVERB_DEPTH = 91; const int MIDI_CTL_E2_TREMOLO_DEPTH = 92; const int MIDI_CTL_E3_CHORUS_DEPTH = 93; const int MIDI_CTL_E4_DETUNE_DEPTH = 94; const int MIDI_CTL_E5_PHASER_DEPTH = 95; const int MIDI_CTL_DATA_INCREMENT = 96; const int MIDI_CTL_DATA_DECREMENT = 97; const int MIDI_CTL_NONREG_PARM_NUM_LSB = 98; const int MIDI_CTL_NONREG_PARM_NUM_MSB = 99; const int MIDI_CTL_REGIST_PARM_NUM_LSB = 100; const int MIDI_CTL_REGIST_PARM_NUM_MSB = 101; const int MIDI_CTL_ALL_SOUNDS_OFF = 120; const int MIDI_CTL_RESET_CONTROLLERS = 121; const int MIDI_CTL_LOCAL_CONTROL_SWITCH = 122; const int MIDI_CTL_ALL_NOTES_OFF = 123; const int MIDI_CTL_OMNI_OFF = 124; const int MIDI_CTL_OMNI_ON = 125; const int MIDI_CTL_MONO1 = 126; const int MIDI_CTL_MONO2 = 127; const int SND_LIB_MAJOR = 1; const int SND_LIB_MINOR = 2; const int SND_LIB_SUBMINOR = 2; const int SND_LIB_EXTRAVER = 1000000; const int SND_LIB_VERSION = 66050; const String SND_LIB_VERSION_STR = '1.2.2'; const int _TIME_H = 1; const int _BITS_TIME_H = 1; const int CLOCKS_PER_SEC = 1000000; const int CLOCK_REALTIME = 0; const int CLOCK_MONOTONIC = 1; const int CLOCK_PROCESS_CPUTIME_ID = 2; const int CLOCK_THREAD_CPUTIME_ID = 3; const int CLOCK_MONOTONIC_RAW = 4; const int CLOCK_REALTIME_COARSE = 5; const int CLOCK_MONOTONIC_COARSE = 6; const int CLOCK_BOOTTIME = 7; const int CLOCK_REALTIME_ALARM = 8; const int CLOCK_BOOTTIME_ALARM = 9; const int CLOCK_TAI = 11; const int TIMER_ABSTIME = 1; const int __struct_tm_defined = 1; const int __itimerspec_defined = 1; const int TIME_UTC = 1; const int SND_ERROR_BEGIN = 500000; const int SND_ERROR_INCOMPATIBLE_VERSION = 500000; const int SND_ERROR_ALISP_NIL = 500001; const int _STDINT_H = 1; const int _BITS_WCHAR_H = 1; const int __WCHAR_MAX = 2147483647; const int __WCHAR_MIN = -2147483648; const int _BITS_STDINT_UINTN_H = 1; const int INT8_MIN = -128; const int INT16_MIN = -32768; const int INT32_MIN = -2147483648; const int INT64_MIN = -9223372036854775808; const int INT8_MAX = 127; const int INT16_MAX = 32767; const int INT32_MAX = 2147483647; const int INT64_MAX = 9223372036854775807; const int UINT8_MAX = 255; const int UINT16_MAX = 65535; const int UINT32_MAX = 4294967295; const int UINT64_MAX = -1; const int INT_LEAST8_MIN = -128; const int INT_LEAST16_MIN = -32768; const int INT_LEAST32_MIN = -2147483648; const int INT_LEAST64_MIN = -9223372036854775808; const int INT_LEAST8_MAX = 127; const int INT_LEAST16_MAX = 32767; const int INT_LEAST32_MAX = 2147483647; const int INT_LEAST64_MAX = 9223372036854775807; const int UINT_LEAST8_MAX = 255; const int UINT_LEAST16_MAX = 65535; const int UINT_LEAST32_MAX = 4294967295; const int UINT_LEAST64_MAX = -1; const int INT_FAST8_MIN = -128; const int INT_FAST16_MIN = -9223372036854775808; const int INT_FAST32_MIN = -9223372036854775808; const int INT_FAST64_MIN = -9223372036854775808; const int INT_FAST8_MAX = 127; const int INT_FAST16_MAX = 9223372036854775807; const int INT_FAST32_MAX = 9223372036854775807; const int INT_FAST64_MAX = 9223372036854775807; const int UINT_FAST8_MAX = 255; const int UINT_FAST16_MAX = -1; const int UINT_FAST32_MAX = -1; const int UINT_FAST64_MAX = -1; const int INTPTR_MIN = -9223372036854775808; const int INTPTR_MAX = 9223372036854775807; const int UINTPTR_MAX = -1; const int INTMAX_MIN = -9223372036854775808; const int INTMAX_MAX = 9223372036854775807; const int UINTMAX_MAX = -1; const int PTRDIFF_MIN = -9223372036854775808; const int PTRDIFF_MAX = 9223372036854775807; const int SIG_ATOMIC_MIN = -2147483648; const int SIG_ATOMIC_MAX = 2147483647; const int SIZE_MAX = -1; const int WCHAR_MIN = -2147483648; const int WCHAR_MAX = 2147483647; const int WINT_MIN = 0; const int WINT_MAX = 4294967295; const int SND_PCM_NONBLOCK = 1; const int SND_PCM_ASYNC = 2; const int SND_PCM_ABORT = 32768; const int SND_PCM_NO_AUTO_RESAMPLE = 65536; const int SND_PCM_NO_AUTO_CHANNELS = 131072; const int SND_PCM_NO_AUTO_FORMAT = 262144; const int SND_PCM_NO_SOFTVOL = 524288; const int SND_CHMAP_API_VERSION = 65537; const int SND_CHMAP_POSITION_MASK = 65535; const int SND_CHMAP_PHASE_INVERSE = 65536; const int SND_CHMAP_DRIVER_SPEC = 131072; const int SND_RAWMIDI_APPEND = 1; const int SND_RAWMIDI_NONBLOCK = 2; const int SND_RAWMIDI_SYNC = 4; const int SND_TIMER_GLOBAL_SYSTEM = 0; const int SND_TIMER_GLOBAL_RTC = 1; const int SND_TIMER_GLOBAL_HPET = 2; const int SND_TIMER_GLOBAL_HRTIMER = 3; const int SND_TIMER_OPEN_NONBLOCK = 1; const int SND_TIMER_OPEN_TREAD = 2; const int SND_HWDEP_OPEN_READ = 0; const int SND_HWDEP_OPEN_WRITE = 1; const int SND_HWDEP_OPEN_DUPLEX = 2; const int SND_HWDEP_OPEN_NONBLOCK = 2048; const int SND_CTL_EVENT_MASK_REMOVE = 4294967295; const int SND_CTL_EVENT_MASK_VALUE = 1; const int SND_CTL_EVENT_MASK_INFO = 2; const int SND_CTL_EVENT_MASK_ADD = 4; const int SND_CTL_EVENT_MASK_TLV = 8; const String SND_CTL_NAME_NONE = ''; const String SND_CTL_NAME_PLAYBACK = 'Playback '; const String SND_CTL_NAME_CAPTURE = 'Capture '; const String SND_CTL_NAME_IEC958_NONE = ''; const String SND_CTL_NAME_IEC958_SWITCH = 'Switch'; const String SND_CTL_NAME_IEC958_VOLUME = 'Volume'; const String SND_CTL_NAME_IEC958_DEFAULT = 'Default'; const String SND_CTL_NAME_IEC958_MASK = 'Mask'; const String SND_CTL_NAME_IEC958_CON_MASK = 'Con Mask'; const String SND_CTL_NAME_IEC958_PRO_MASK = 'Pro Mask'; const String SND_CTL_NAME_IEC958_PCM_STREAM = 'PCM Stream'; const int SND_CTL_POWER_MASK = 65280; const int SND_CTL_POWER_D0 = 0; const int SND_CTL_POWER_D1 = 256; const int SND_CTL_POWER_D2 = 512; const int SND_CTL_POWER_D3 = 768; const int SND_CTL_POWER_D3hot = 768; const int SND_CTL_POWER_D3cold = 769; const int SND_CTL_TLVT_CONTAINER = 0; const int SND_CTL_TLVT_DB_SCALE = 1; const int SND_CTL_TLVT_DB_LINEAR = 2; const int SND_CTL_TLVT_DB_RANGE = 3; const int SND_CTL_TLVT_DB_MINMAX = 4; const int SND_CTL_TLVT_DB_MINMAX_MUTE = 5; const int SND_CTL_TLV_DB_GAIN_MUTE = -9999999; const int SND_CTL_TLVT_CHMAP_FIXED = 257; const int SND_CTL_TLVT_CHMAP_VAR = 258; const int SND_CTL_TLVT_CHMAP_PAIRED = 259; const int SND_CTL_NONBLOCK = 1; const int SND_CTL_ASYNC = 2; const int SND_CTL_READONLY = 4; const int SND_SCTL_NOFREE = 1; const int SND_SEQ_TIME_STAMP_TICK = 0; const int SND_SEQ_TIME_STAMP_REAL = 1; const int SND_SEQ_TIME_STAMP_MASK = 1; const int SND_SEQ_TIME_MODE_ABS = 0; const int SND_SEQ_TIME_MODE_REL = 2; const int SND_SEQ_TIME_MODE_MASK = 2; const int SND_SEQ_EVENT_LENGTH_FIXED = 0; const int SND_SEQ_EVENT_LENGTH_VARIABLE = 4; const int SND_SEQ_EVENT_LENGTH_VARUSR = 8; const int SND_SEQ_EVENT_LENGTH_MASK = 12; const int SND_SEQ_PRIORITY_NORMAL = 0; const int SND_SEQ_PRIORITY_HIGH = 16; const int SND_SEQ_PRIORITY_MASK = 16; const int SND_SEQ_OPEN_OUTPUT = 1; const int SND_SEQ_OPEN_INPUT = 2; const int SND_SEQ_OPEN_DUPLEX = 3; const int SND_SEQ_NONBLOCK = 1; const int SND_SEQ_ADDRESS_UNKNOWN = 253; const int SND_SEQ_ADDRESS_SUBSCRIBERS = 254; const int SND_SEQ_ADDRESS_BROADCAST = 255; const int SND_SEQ_CLIENT_SYSTEM = 0; const int SND_SEQ_PORT_SYSTEM_TIMER = 0; const int SND_SEQ_PORT_SYSTEM_ANNOUNCE = 1; const int SND_SEQ_PORT_CAP_READ = 1; const int SND_SEQ_PORT_CAP_WRITE = 2; const int SND_SEQ_PORT_CAP_SYNC_READ = 4; const int SND_SEQ_PORT_CAP_SYNC_WRITE = 8; const int SND_SEQ_PORT_CAP_DUPLEX = 16; const int SND_SEQ_PORT_CAP_SUBS_READ = 32; const int SND_SEQ_PORT_CAP_SUBS_WRITE = 64; const int SND_SEQ_PORT_CAP_NO_EXPORT = 128; const int SND_SEQ_PORT_TYPE_SPECIFIC = 1; const int SND_SEQ_PORT_TYPE_MIDI_GENERIC = 2; const int SND_SEQ_PORT_TYPE_MIDI_GM = 4; const int SND_SEQ_PORT_TYPE_MIDI_GS = 8; const int SND_SEQ_PORT_TYPE_MIDI_XG = 16; const int SND_SEQ_PORT_TYPE_MIDI_MT32 = 32; const int SND_SEQ_PORT_TYPE_MIDI_GM2 = 64; const int SND_SEQ_PORT_TYPE_SYNTH = 1024; const int SND_SEQ_PORT_TYPE_DIRECT_SAMPLE = 2048; const int SND_SEQ_PORT_TYPE_SAMPLE = 4096; const int SND_SEQ_PORT_TYPE_HARDWARE = 65536; const int SND_SEQ_PORT_TYPE_SOFTWARE = 131072; const int SND_SEQ_PORT_TYPE_SYNTHESIZER = 262144; const int SND_SEQ_PORT_TYPE_PORT = 524288; const int SND_SEQ_PORT_TYPE_APPLICATION = 1048576; const int SND_SEQ_QUEUE_DIRECT = 253; const int SND_SEQ_REMOVE_INPUT = 1; const int SND_SEQ_REMOVE_OUTPUT = 2; const int SND_SEQ_REMOVE_DEST = 4; const int SND_SEQ_REMOVE_DEST_CHANNEL = 8; const int SND_SEQ_REMOVE_TIME_BEFORE = 16; const int SND_SEQ_REMOVE_TIME_AFTER = 32; const int SND_SEQ_REMOVE_TIME_TICK = 64; const int SND_SEQ_REMOVE_EVENT_TYPE = 128; const int SND_SEQ_REMOVE_IGNORE_OFF = 256; const int SND_SEQ_REMOVE_TAG_MATCH = 512; typedef _c_access = ffi.Int32 Function( ffi.Pointer __name, ffi.Int32 __type, ); typedef _dart_access = int Function( ffi.Pointer __name, int __type, ); typedef _c_faccessat = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __file, ffi.Int32 __type, ffi.Int32 __flag, ); typedef _dart_faccessat = int Function( int __fd, ffi.Pointer __file, int __type, int __flag, ); typedef _c_lseek = ffi.Int64 Function( ffi.Int32 __fd, ffi.Int64 __offset, ffi.Int32 __whence, ); typedef _dart_lseek = int Function( int __fd, int __offset, int __whence, ); typedef _c_close = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_close = int Function( int __fd, ); typedef _c_read = ffi.Int64 Function( ffi.Int32 __fd, ffi.Pointer __buf, ffi.Uint64 __nbytes, ); typedef _dart_read = int Function( int __fd, ffi.Pointer __buf, int __nbytes, ); typedef _c_write = ffi.Int64 Function( ffi.Int32 __fd, ffi.Pointer __buf, ffi.Uint64 __n, ); typedef _dart_write = int Function( int __fd, ffi.Pointer __buf, int __n, ); typedef _c_pread = ffi.Int64 Function( ffi.Int32 __fd, ffi.Pointer __buf, ffi.Uint64 __nbytes, ffi.Int64 __offset, ); typedef _dart_pread = int Function( int __fd, ffi.Pointer __buf, int __nbytes, int __offset, ); typedef _c_pwrite = ffi.Int64 Function( ffi.Int32 __fd, ffi.Pointer __buf, ffi.Uint64 __n, ffi.Int64 __offset, ); typedef _dart_pwrite = int Function( int __fd, ffi.Pointer __buf, int __n, int __offset, ); typedef _c_pipe = ffi.Int32 Function( ffi.Pointer __pipedes, ); typedef _dart_pipe = int Function( ffi.Pointer __pipedes, ); typedef _c_alarm = ffi.Uint32 Function( ffi.Uint32 __seconds, ); typedef _dart_alarm = int Function( int __seconds, ); typedef _c_sleep = ffi.Uint32 Function( ffi.Uint32 __seconds, ); typedef _dart_sleep = int Function( int __seconds, ); typedef _c_ualarm = ffi.Uint32 Function( ffi.Uint32 __value, ffi.Uint32 __interval, ); typedef _dart_ualarm = int Function( int __value, int __interval, ); typedef _c_usleep = ffi.Int32 Function( ffi.Uint32 __useconds, ); typedef _dart_usleep = int Function( int __useconds, ); typedef _c_pause = ffi.Int32 Function(); typedef _dart_pause = int Function(); typedef _c_chown = ffi.Int32 Function( ffi.Pointer __file, ffi.Uint32 __owner, ffi.Uint32 __group, ); typedef _dart_chown = int Function( ffi.Pointer __file, int __owner, int __group, ); typedef _c_fchown = ffi.Int32 Function( ffi.Int32 __fd, ffi.Uint32 __owner, ffi.Uint32 __group, ); typedef _dart_fchown = int Function( int __fd, int __owner, int __group, ); typedef _c_lchown = ffi.Int32 Function( ffi.Pointer __file, ffi.Uint32 __owner, ffi.Uint32 __group, ); typedef _dart_lchown = int Function( ffi.Pointer __file, int __owner, int __group, ); typedef _c_fchownat = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __file, ffi.Uint32 __owner, ffi.Uint32 __group, ffi.Int32 __flag, ); typedef _dart_fchownat = int Function( int __fd, ffi.Pointer __file, int __owner, int __group, int __flag, ); typedef _c_chdir = ffi.Int32 Function( ffi.Pointer __path, ); typedef _dart_chdir = int Function( ffi.Pointer __path, ); typedef _c_fchdir = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_fchdir = int Function( int __fd, ); typedef _c_getcwd = ffi.Pointer Function( ffi.Pointer __buf, ffi.Uint64 __size, ); typedef _dart_getcwd = ffi.Pointer Function( ffi.Pointer __buf, int __size, ); typedef _c_getwd = ffi.Pointer Function( ffi.Pointer __buf, ); typedef _dart_getwd = ffi.Pointer Function( ffi.Pointer __buf, ); typedef _c_dup = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_dup = int Function( int __fd, ); typedef _c_dup2 = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int32 __fd2, ); typedef _dart_dup2 = int Function( int __fd, int __fd2, ); typedef _c_execve = ffi.Int32 Function( ffi.Pointer __path, ffi.Pointer> __argv, ffi.Pointer> __envp, ); typedef _dart_execve = int Function( ffi.Pointer __path, ffi.Pointer> __argv, ffi.Pointer> __envp, ); typedef _c_fexecve = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer> __argv, ffi.Pointer> __envp, ); typedef _dart_fexecve = int Function( int __fd, ffi.Pointer> __argv, ffi.Pointer> __envp, ); typedef _c_execv = ffi.Int32 Function( ffi.Pointer __path, ffi.Pointer> __argv, ); typedef _dart_execv = int Function( ffi.Pointer __path, ffi.Pointer> __argv, ); typedef _c_execle = ffi.Int32 Function( ffi.Pointer __path, ffi.Pointer __arg, ); typedef _dart_execle = int Function( ffi.Pointer __path, ffi.Pointer __arg, ); typedef _c_execl = ffi.Int32 Function( ffi.Pointer __path, ffi.Pointer __arg, ); typedef _dart_execl = int Function( ffi.Pointer __path, ffi.Pointer __arg, ); typedef _c_execvp = ffi.Int32 Function( ffi.Pointer __file, ffi.Pointer> __argv, ); typedef _dart_execvp = int Function( ffi.Pointer __file, ffi.Pointer> __argv, ); typedef _c_execlp = ffi.Int32 Function( ffi.Pointer __file, ffi.Pointer __arg, ); typedef _dart_execlp = int Function( ffi.Pointer __file, ffi.Pointer __arg, ); typedef _c_nice = ffi.Int32 Function( ffi.Int32 __inc, ); typedef _dart_nice = int Function( int __inc, ); typedef _c__exit = ffi.Void Function( ffi.Int32 __status, ); typedef _dart__exit = void Function( int __status, ); typedef _c_pathconf = ffi.Int64 Function( ffi.Pointer __path, ffi.Int32 __name, ); typedef _dart_pathconf = int Function( ffi.Pointer __path, int __name, ); typedef _c_fpathconf = ffi.Int64 Function( ffi.Int32 __fd, ffi.Int32 __name, ); typedef _dart_fpathconf = int Function( int __fd, int __name, ); typedef _c_sysconf = ffi.Int64 Function( ffi.Int32 __name, ); typedef _dart_sysconf = int Function( int __name, ); typedef _c_confstr = ffi.Uint64 Function( ffi.Int32 __name, ffi.Pointer __buf, ffi.Uint64 __len, ); typedef _dart_confstr = int Function( int __name, ffi.Pointer __buf, int __len, ); typedef _c_getpid = ffi.Int32 Function(); typedef _dart_getpid = int Function(); typedef _c_getppid = ffi.Int32 Function(); typedef _dart_getppid = int Function(); typedef _c_getpgrp = ffi.Int32 Function(); typedef _dart_getpgrp = int Function(); typedef _c___getpgid = ffi.Int32 Function( ffi.Int32 __pid, ); typedef _dart___getpgid = int Function( int __pid, ); typedef _c_getpgid = ffi.Int32 Function( ffi.Int32 __pid, ); typedef _dart_getpgid = int Function( int __pid, ); typedef _c_setpgid = ffi.Int32 Function( ffi.Int32 __pid, ffi.Int32 __pgid, ); typedef _dart_setpgid = int Function( int __pid, int __pgid, ); typedef _c_setpgrp = ffi.Int32 Function(); typedef _dart_setpgrp = int Function(); typedef _c_setsid = ffi.Int32 Function(); typedef _dart_setsid = int Function(); typedef _c_getsid = ffi.Int32 Function( ffi.Int32 __pid, ); typedef _dart_getsid = int Function( int __pid, ); typedef _c_getuid = ffi.Uint32 Function(); typedef _dart_getuid = int Function(); typedef _c_geteuid = ffi.Uint32 Function(); typedef _dart_geteuid = int Function(); typedef _c_getgid = ffi.Uint32 Function(); typedef _dart_getgid = int Function(); typedef _c_getegid = ffi.Uint32 Function(); typedef _dart_getegid = int Function(); typedef _c_getgroups = ffi.Int32 Function( ffi.Int32 __size, ffi.Pointer __list, ); typedef _dart_getgroups = int Function( int __size, ffi.Pointer __list, ); typedef _c_setuid = ffi.Int32 Function( ffi.Uint32 __uid, ); typedef _dart_setuid = int Function( int __uid, ); typedef _c_setreuid = ffi.Int32 Function( ffi.Uint32 __ruid, ffi.Uint32 __euid, ); typedef _dart_setreuid = int Function( int __ruid, int __euid, ); typedef _c_seteuid = ffi.Int32 Function( ffi.Uint32 __uid, ); typedef _dart_seteuid = int Function( int __uid, ); typedef _c_setgid = ffi.Int32 Function( ffi.Uint32 __gid, ); typedef _dart_setgid = int Function( int __gid, ); typedef _c_setregid = ffi.Int32 Function( ffi.Uint32 __rgid, ffi.Uint32 __egid, ); typedef _dart_setregid = int Function( int __rgid, int __egid, ); typedef _c_setegid = ffi.Int32 Function( ffi.Uint32 __gid, ); typedef _dart_setegid = int Function( int __gid, ); typedef _c_fork = ffi.Int32 Function(); typedef _dart_fork = int Function(); typedef _c_vfork = ffi.Int32 Function(); typedef _dart_vfork = int Function(); typedef _c_ttyname = ffi.Pointer Function( ffi.Int32 __fd, ); typedef _dart_ttyname = ffi.Pointer Function( int __fd, ); typedef _c_ttyname_r = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __buf, ffi.Uint64 __buflen, ); typedef _dart_ttyname_r = int Function( int __fd, ffi.Pointer __buf, int __buflen, ); typedef _c_isatty = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_isatty = int Function( int __fd, ); typedef _c_ttyslot = ffi.Int32 Function(); typedef _dart_ttyslot = int Function(); typedef _c_link = ffi.Int32 Function( ffi.Pointer __from, ffi.Pointer __to, ); typedef _dart_link = int Function( ffi.Pointer __from, ffi.Pointer __to, ); typedef _c_linkat = ffi.Int32 Function( ffi.Int32 __fromfd, ffi.Pointer __from, ffi.Int32 __tofd, ffi.Pointer __to, ffi.Int32 __flags, ); typedef _dart_linkat = int Function( int __fromfd, ffi.Pointer __from, int __tofd, ffi.Pointer __to, int __flags, ); typedef _c_symlink = ffi.Int32 Function( ffi.Pointer __from, ffi.Pointer __to, ); typedef _dart_symlink = int Function( ffi.Pointer __from, ffi.Pointer __to, ); typedef _c_readlink = ffi.Int64 Function( ffi.Pointer __path, ffi.Pointer __buf, ffi.Uint64 __len, ); typedef _dart_readlink = int Function( ffi.Pointer __path, ffi.Pointer __buf, int __len, ); typedef _c_symlinkat = ffi.Int32 Function( ffi.Pointer __from, ffi.Int32 __tofd, ffi.Pointer __to, ); typedef _dart_symlinkat = int Function( ffi.Pointer __from, int __tofd, ffi.Pointer __to, ); typedef _c_readlinkat = ffi.Int64 Function( ffi.Int32 __fd, ffi.Pointer __path, ffi.Pointer __buf, ffi.Uint64 __len, ); typedef _dart_readlinkat = int Function( int __fd, ffi.Pointer __path, ffi.Pointer __buf, int __len, ); typedef _c_unlink = ffi.Int32 Function( ffi.Pointer __name, ); typedef _dart_unlink = int Function( ffi.Pointer __name, ); typedef _c_unlinkat = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __name, ffi.Int32 __flag, ); typedef _dart_unlinkat = int Function( int __fd, ffi.Pointer __name, int __flag, ); typedef _c_rmdir = ffi.Int32 Function( ffi.Pointer __path, ); typedef _dart_rmdir = int Function( ffi.Pointer __path, ); typedef _c_tcgetpgrp = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_tcgetpgrp = int Function( int __fd, ); typedef _c_tcsetpgrp = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int32 __pgrp_id, ); typedef _dart_tcsetpgrp = int Function( int __fd, int __pgrp_id, ); typedef _c_getlogin = ffi.Pointer Function(); typedef _dart_getlogin = ffi.Pointer Function(); typedef _c_getlogin_r = ffi.Int32 Function( ffi.Pointer __name, ffi.Uint64 __name_len, ); typedef _dart_getlogin_r = int Function( ffi.Pointer __name, int __name_len, ); typedef _c_setlogin = ffi.Int32 Function( ffi.Pointer __name, ); typedef _dart_setlogin = int Function( ffi.Pointer __name, ); typedef _c_getopt = ffi.Int32 Function( ffi.Int32 ___argc, ffi.Pointer> ___argv, ffi.Pointer __shortopts, ); typedef _dart_getopt = int Function( int ___argc, ffi.Pointer> ___argv, ffi.Pointer __shortopts, ); typedef _c_gethostname = ffi.Int32 Function( ffi.Pointer __name, ffi.Uint64 __len, ); typedef _dart_gethostname = int Function( ffi.Pointer __name, int __len, ); typedef _c_sethostname = ffi.Int32 Function( ffi.Pointer __name, ffi.Uint64 __len, ); typedef _dart_sethostname = int Function( ffi.Pointer __name, int __len, ); typedef _c_sethostid = ffi.Int32 Function( ffi.Int64 __id, ); typedef _dart_sethostid = int Function( int __id, ); typedef _c_getdomainname = ffi.Int32 Function( ffi.Pointer __name, ffi.Uint64 __len, ); typedef _dart_getdomainname = int Function( ffi.Pointer __name, int __len, ); typedef _c_setdomainname = ffi.Int32 Function( ffi.Pointer __name, ffi.Uint64 __len, ); typedef _dart_setdomainname = int Function( ffi.Pointer __name, int __len, ); typedef _c_vhangup = ffi.Int32 Function(); typedef _dart_vhangup = int Function(); typedef _c_revoke = ffi.Int32 Function( ffi.Pointer __file, ); typedef _dart_revoke = int Function( ffi.Pointer __file, ); typedef _c_profil = ffi.Int32 Function( ffi.Pointer __sample_buffer, ffi.Uint64 __size, ffi.Uint64 __offset, ffi.Uint32 __scale, ); typedef _dart_profil = int Function( ffi.Pointer __sample_buffer, int __size, int __offset, int __scale, ); typedef _c_acct = ffi.Int32 Function( ffi.Pointer __name, ); typedef _dart_acct = int Function( ffi.Pointer __name, ); typedef _c_getusershell = ffi.Pointer Function(); typedef _dart_getusershell = ffi.Pointer Function(); typedef _c_endusershell = ffi.Void Function(); typedef _dart_endusershell = void Function(); typedef _c_setusershell = ffi.Void Function(); typedef _dart_setusershell = void Function(); typedef _c_daemon = ffi.Int32 Function( ffi.Int32 __nochdir, ffi.Int32 __noclose, ); typedef _dart_daemon = int Function( int __nochdir, int __noclose, ); typedef _c_chroot = ffi.Int32 Function( ffi.Pointer __path, ); typedef _dart_chroot = int Function( ffi.Pointer __path, ); typedef _c_getpass = ffi.Pointer Function( ffi.Pointer __prompt, ); typedef _dart_getpass = ffi.Pointer Function( ffi.Pointer __prompt, ); typedef _c_fsync = ffi.Int32 Function( ffi.Int32 __fd, ); typedef _dart_fsync = int Function( int __fd, ); typedef _c_gethostid = ffi.Int64 Function(); typedef _dart_gethostid = int Function(); typedef _c_sync_1 = ffi.Void Function(); typedef _dart_sync_1 = void Function(); typedef _c_getpagesize = ffi.Int32 Function(); typedef _dart_getpagesize = int Function(); typedef _c_getdtablesize = ffi.Int32 Function(); typedef _dart_getdtablesize = int Function(); typedef _c_truncate = ffi.Int32 Function( ffi.Pointer __file, ffi.Int64 __length, ); typedef _dart_truncate = int Function( ffi.Pointer __file, int __length, ); typedef _c_ftruncate = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int64 __length, ); typedef _dart_ftruncate = int Function( int __fd, int __length, ); typedef _c_brk = ffi.Int32 Function( ffi.Pointer __addr, ); typedef _dart_brk = int Function( ffi.Pointer __addr, ); typedef _c_sbrk = ffi.Pointer Function( ffi.IntPtr __delta, ); typedef _dart_sbrk = ffi.Pointer Function( int __delta, ); typedef _c_syscall = ffi.Int64 Function( ffi.Int64 __sysno, ); typedef _dart_syscall = int Function( int __sysno, ); typedef _c_lockf = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int32 __cmd, ffi.Int64 __len, ); typedef _dart_lockf = int Function( int __fd, int __cmd, int __len, ); typedef _c_fdatasync = ffi.Int32 Function( ffi.Int32 __fildes, ); typedef _dart_fdatasync = int Function( int __fildes, ); typedef _c_crypt = ffi.Pointer Function( ffi.Pointer __key, ffi.Pointer __salt, ); typedef _dart_crypt = ffi.Pointer Function( ffi.Pointer __key, ffi.Pointer __salt, ); typedef _c_getentropy = ffi.Int32 Function( ffi.Pointer __buffer, ffi.Uint64 __length, ); typedef _dart_getentropy = int Function( ffi.Pointer __buffer, int __length, ); typedef _c_remove = ffi.Int32 Function( ffi.Pointer __filename, ); typedef _dart_remove = int Function( ffi.Pointer __filename, ); typedef _c_rename = ffi.Int32 Function( ffi.Pointer __old, ffi.Pointer __new, ); typedef _dart_rename = int Function( ffi.Pointer __old, ffi.Pointer __new, ); typedef _c_renameat = ffi.Int32 Function( ffi.Int32 __oldfd, ffi.Pointer __old, ffi.Int32 __newfd, ffi.Pointer __new, ); typedef _dart_renameat = int Function( int __oldfd, ffi.Pointer __old, int __newfd, ffi.Pointer __new, ); typedef _c_tmpfile = ffi.Pointer Function(); typedef _dart_tmpfile = ffi.Pointer Function(); typedef _c_tmpnam = ffi.Pointer Function( ffi.Pointer __s, ); typedef _dart_tmpnam = ffi.Pointer Function( ffi.Pointer __s, ); typedef _c_tmpnam_r = ffi.Pointer Function( ffi.Pointer __s, ); typedef _dart_tmpnam_r = ffi.Pointer Function( ffi.Pointer __s, ); typedef _c_tempnam = ffi.Pointer Function( ffi.Pointer __dir, ffi.Pointer __pfx, ); typedef _dart_tempnam = ffi.Pointer Function( ffi.Pointer __dir, ffi.Pointer __pfx, ); typedef _c_fclose = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fclose = int Function( ffi.Pointer __stream, ); typedef _c_fflush = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fflush = int Function( ffi.Pointer __stream, ); typedef _c_fflush_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fflush_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_fopen = ffi.Pointer Function( ffi.Pointer __filename, ffi.Pointer __modes, ); typedef _dart_fopen = ffi.Pointer Function( ffi.Pointer __filename, ffi.Pointer __modes, ); typedef _c_freopen = ffi.Pointer Function( ffi.Pointer __filename, ffi.Pointer __modes, ffi.Pointer __stream, ); typedef _dart_freopen = ffi.Pointer Function( ffi.Pointer __filename, ffi.Pointer __modes, ffi.Pointer __stream, ); typedef _c_fdopen = ffi.Pointer Function( ffi.Int32 __fd, ffi.Pointer __modes, ); typedef _dart_fdopen = ffi.Pointer Function( int __fd, ffi.Pointer __modes, ); typedef _c_fmemopen = ffi.Pointer Function( ffi.Pointer __s, ffi.Uint64 __len, ffi.Pointer __modes, ); typedef _dart_fmemopen = ffi.Pointer Function( ffi.Pointer __s, int __len, ffi.Pointer __modes, ); typedef _c_open_memstream = ffi.Pointer Function( ffi.Pointer> __bufloc, ffi.Pointer __sizeloc, ); typedef _dart_open_memstream = ffi.Pointer Function( ffi.Pointer> __bufloc, ffi.Pointer __sizeloc, ); typedef _c_setbuf = ffi.Void Function( ffi.Pointer __stream, ffi.Pointer __buf, ); typedef _dart_setbuf = void Function( ffi.Pointer __stream, ffi.Pointer __buf, ); typedef _c_setvbuf = ffi.Int32 Function( ffi.Pointer __stream, ffi.Pointer __buf, ffi.Int32 __modes, ffi.Uint64 __n, ); typedef _dart_setvbuf = int Function( ffi.Pointer __stream, ffi.Pointer __buf, int __modes, int __n, ); typedef _c_setbuffer = ffi.Void Function( ffi.Pointer __stream, ffi.Pointer __buf, ffi.Uint64 __size, ); typedef _dart_setbuffer = void Function( ffi.Pointer __stream, ffi.Pointer __buf, int __size, ); typedef _c_setlinebuf = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_setlinebuf = void Function( ffi.Pointer __stream, ); typedef _c_fprintf = ffi.Int32 Function( ffi.Pointer __stream, ffi.Pointer __format, ); typedef _dart_fprintf = int Function( ffi.Pointer __stream, ffi.Pointer __format, ); typedef _c_printf = ffi.Int32 Function( ffi.Pointer __format, ); typedef _dart_printf = int Function( ffi.Pointer __format, ); typedef _c_sprintf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ); typedef _dart_sprintf = int Function( ffi.Pointer __s, ffi.Pointer __format, ); typedef _c_vfprintf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vfprintf = int Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_vprintf = ffi.Int32 Function( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vprintf = int Function( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_vsprintf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vsprintf = int Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_snprintf = ffi.Int32 Function( ffi.Pointer __s, ffi.Uint64 __maxlen, ffi.Pointer __format, ); typedef _dart_snprintf = int Function( ffi.Pointer __s, int __maxlen, ffi.Pointer __format, ); typedef _c_vsnprintf = ffi.Int32 Function( ffi.Pointer __s, ffi.Uint64 __maxlen, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vsnprintf = int Function( ffi.Pointer __s, int __maxlen, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_vdprintf = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __fmt, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vdprintf = int Function( int __fd, ffi.Pointer __fmt, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_dprintf = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __fmt, ); typedef _dart_dprintf = int Function( int __fd, ffi.Pointer __fmt, ); typedef _c_fscanf = ffi.Int32 Function( ffi.Pointer __stream, ffi.Pointer __format, ); typedef _dart_fscanf = int Function( ffi.Pointer __stream, ffi.Pointer __format, ); typedef _c_scanf = ffi.Int32 Function( ffi.Pointer __format, ); typedef _dart_scanf = int Function( ffi.Pointer __format, ); typedef _c_sscanf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ); typedef _dart_sscanf = int Function( ffi.Pointer __s, ffi.Pointer __format, ); typedef _c_vfscanf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vfscanf = int Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_vscanf = ffi.Int32 Function( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vscanf = int Function( ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_vsscanf = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _dart_vsscanf = int Function( ffi.Pointer __s, ffi.Pointer __format, ffi.Pointer<_va_list_tag_> __arg, ); typedef _c_fgetc = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fgetc = int Function( ffi.Pointer __stream, ); typedef _c_getc = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_getc = int Function( ffi.Pointer __stream, ); typedef _c_getchar = ffi.Int32 Function(); typedef _dart_getchar = int Function(); typedef _c_getc_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_getc_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_getchar_unlocked = ffi.Int32 Function(); typedef _dart_getchar_unlocked = int Function(); typedef _c_fgetc_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fgetc_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_fputc = ffi.Int32 Function( ffi.Int32 __c, ffi.Pointer __stream, ); typedef _dart_fputc = int Function( int __c, ffi.Pointer __stream, ); typedef _c_putc = ffi.Int32 Function( ffi.Int32 __c, ffi.Pointer __stream, ); typedef _dart_putc = int Function( int __c, ffi.Pointer __stream, ); typedef _c_putchar = ffi.Int32 Function( ffi.Int32 __c, ); typedef _dart_putchar = int Function( int __c, ); typedef _c_fputc_unlocked = ffi.Int32 Function( ffi.Int32 __c, ffi.Pointer __stream, ); typedef _dart_fputc_unlocked = int Function( int __c, ffi.Pointer __stream, ); typedef _c_putc_unlocked = ffi.Int32 Function( ffi.Int32 __c, ffi.Pointer __stream, ); typedef _dart_putc_unlocked = int Function( int __c, ffi.Pointer __stream, ); typedef _c_putchar_unlocked = ffi.Int32 Function( ffi.Int32 __c, ); typedef _dart_putchar_unlocked = int Function( int __c, ); typedef _c_getw = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_getw = int Function( ffi.Pointer __stream, ); typedef _c_putw = ffi.Int32 Function( ffi.Int32 __w, ffi.Pointer __stream, ); typedef _dart_putw = int Function( int __w, ffi.Pointer __stream, ); typedef _c_fgets = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __n, ffi.Pointer __stream, ); typedef _dart_fgets = ffi.Pointer Function( ffi.Pointer __s, int __n, ffi.Pointer __stream, ); typedef _c___getdelim = ffi.Int64 Function( ffi.Pointer> __lineptr, ffi.Pointer __n, ffi.Int32 __delimiter, ffi.Pointer __stream, ); typedef _dart___getdelim = int Function( ffi.Pointer> __lineptr, ffi.Pointer __n, int __delimiter, ffi.Pointer __stream, ); typedef _c_getdelim = ffi.Int64 Function( ffi.Pointer> __lineptr, ffi.Pointer __n, ffi.Int32 __delimiter, ffi.Pointer __stream, ); typedef _dart_getdelim = int Function( ffi.Pointer> __lineptr, ffi.Pointer __n, int __delimiter, ffi.Pointer __stream, ); typedef _c_getline = ffi.Int64 Function( ffi.Pointer> __lineptr, ffi.Pointer __n, ffi.Pointer __stream, ); typedef _dart_getline = int Function( ffi.Pointer> __lineptr, ffi.Pointer __n, ffi.Pointer __stream, ); typedef _c_fputs = ffi.Int32 Function( ffi.Pointer __s, ffi.Pointer __stream, ); typedef _dart_fputs = int Function( ffi.Pointer __s, ffi.Pointer __stream, ); typedef _c_puts = ffi.Int32 Function( ffi.Pointer __s, ); typedef _dart_puts = int Function( ffi.Pointer __s, ); typedef _c_ungetc = ffi.Int32 Function( ffi.Int32 __c, ffi.Pointer __stream, ); typedef _dart_ungetc = int Function( int __c, ffi.Pointer __stream, ); typedef _c_fread = ffi.Uint64 Function( ffi.Pointer __ptr, ffi.Uint64 __size, ffi.Uint64 __n, ffi.Pointer __stream, ); typedef _dart_fread = int Function( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ); typedef _c_fwrite = ffi.Uint64 Function( ffi.Pointer __ptr, ffi.Uint64 __size, ffi.Uint64 __n, ffi.Pointer __s, ); typedef _dart_fwrite = int Function( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __s, ); typedef _c_fread_unlocked = ffi.Uint64 Function( ffi.Pointer __ptr, ffi.Uint64 __size, ffi.Uint64 __n, ffi.Pointer __stream, ); typedef _dart_fread_unlocked = int Function( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ); typedef _c_fwrite_unlocked = ffi.Uint64 Function( ffi.Pointer __ptr, ffi.Uint64 __size, ffi.Uint64 __n, ffi.Pointer __stream, ); typedef _dart_fwrite_unlocked = int Function( ffi.Pointer __ptr, int __size, int __n, ffi.Pointer __stream, ); typedef _c_fseek = ffi.Int32 Function( ffi.Pointer __stream, ffi.Int64 __off, ffi.Int32 __whence, ); typedef _dart_fseek = int Function( ffi.Pointer __stream, int __off, int __whence, ); typedef _c_ftell = ffi.Int64 Function( ffi.Pointer __stream, ); typedef _dart_ftell = int Function( ffi.Pointer __stream, ); typedef _c_rewind = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_rewind = void Function( ffi.Pointer __stream, ); typedef _c_fseeko = ffi.Int32 Function( ffi.Pointer __stream, ffi.Int64 __off, ffi.Int32 __whence, ); typedef _dart_fseeko = int Function( ffi.Pointer __stream, int __off, int __whence, ); typedef _c_ftello = ffi.Int64 Function( ffi.Pointer __stream, ); typedef _dart_ftello = int Function( ffi.Pointer __stream, ); typedef _c_fgetpos = ffi.Int32 Function( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ); typedef _dart_fgetpos = int Function( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ); typedef _c_fsetpos = ffi.Int32 Function( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ); typedef _dart_fsetpos = int Function( ffi.Pointer __stream, ffi.Pointer<_fpos_t_> __pos, ); typedef _c_clearerr = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_clearerr = void Function( ffi.Pointer __stream, ); typedef _c_feof = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_feof = int Function( ffi.Pointer __stream, ); typedef _c_ferror = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_ferror = int Function( ffi.Pointer __stream, ); typedef _c_clearerr_unlocked = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_clearerr_unlocked = void Function( ffi.Pointer __stream, ); typedef _c_feof_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_feof_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_ferror_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_ferror_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_perror = ffi.Void Function( ffi.Pointer __s, ); typedef _dart_perror = void Function( ffi.Pointer __s, ); typedef _c_fileno = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fileno = int Function( ffi.Pointer __stream, ); typedef _c_fileno_unlocked = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_fileno_unlocked = int Function( ffi.Pointer __stream, ); typedef _c_popen = ffi.Pointer Function( ffi.Pointer __command, ffi.Pointer __modes, ); typedef _dart_popen = ffi.Pointer Function( ffi.Pointer __command, ffi.Pointer __modes, ); typedef _c_pclose = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_pclose = int Function( ffi.Pointer __stream, ); typedef _c_ctermid = ffi.Pointer Function( ffi.Pointer __s, ); typedef _dart_ctermid = ffi.Pointer Function( ffi.Pointer __s, ); typedef _c_flockfile = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_flockfile = void Function( ffi.Pointer __stream, ); typedef _c_ftrylockfile = ffi.Int32 Function( ffi.Pointer __stream, ); typedef _dart_ftrylockfile = int Function( ffi.Pointer __stream, ); typedef _c_funlockfile = ffi.Void Function( ffi.Pointer __stream, ); typedef _dart_funlockfile = void Function( ffi.Pointer __stream, ); typedef _c___uflow = ffi.Int32 Function( ffi.Pointer arg0, ); typedef _dart___uflow = int Function( ffi.Pointer arg0, ); typedef _c___overflow = ffi.Int32 Function( ffi.Pointer arg0, ffi.Int32 arg1, ); typedef _dart___overflow = int Function( ffi.Pointer arg0, int arg1, ); typedef _c___ctype_get_mb_cur_max = ffi.Uint64 Function(); typedef _dart___ctype_get_mb_cur_max = int Function(); typedef _c_atof = ffi.Double Function( ffi.Pointer __nptr, ); typedef _dart_atof = double Function( ffi.Pointer __nptr, ); typedef _c_atoi = ffi.Int32 Function( ffi.Pointer __nptr, ); typedef _dart_atoi = int Function( ffi.Pointer __nptr, ); typedef _c_atol = ffi.Int64 Function( ffi.Pointer __nptr, ); typedef _dart_atol = int Function( ffi.Pointer __nptr, ); typedef _c_atoll = ffi.Int64 Function( ffi.Pointer __nptr, ); typedef _dart_atoll = int Function( ffi.Pointer __nptr, ); typedef _c_strtod = ffi.Double Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ); typedef _dart_strtod = double Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ); typedef _c_strtof = ffi.Float Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ); typedef _dart_strtof = double Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ); typedef _c_strtol = ffi.Int64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtol = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_strtoul = ffi.Uint64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtoul = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_strtoq = ffi.Int64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtoq = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_strtouq = ffi.Uint64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtouq = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_strtoll = ffi.Int64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtoll = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_strtoull = ffi.Uint64 Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, ffi.Int32 __base, ); typedef _dart_strtoull = int Function( ffi.Pointer __nptr, ffi.Pointer> __endptr, int __base, ); typedef _c_l64a = ffi.Pointer Function( ffi.Int64 __n, ); typedef _dart_l64a = ffi.Pointer Function( int __n, ); typedef _c_a64l = ffi.Int64 Function( ffi.Pointer __s, ); typedef _dart_a64l = int Function( ffi.Pointer __s, ); typedef _c_select = ffi.Int32 Function( ffi.Int32 __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ); typedef _dart_select = int Function( int __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ); typedef _c_pselect = ffi.Int32 Function( ffi.Int32 __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ffi.Pointer<_sigset_t_> __sigmask, ); typedef _dart_pselect = int Function( int __nfds, ffi.Pointer __readfds, ffi.Pointer __writefds, ffi.Pointer __exceptfds, ffi.Pointer __timeout, ffi.Pointer<_sigset_t_> __sigmask, ); typedef _c_random = ffi.Int64 Function(); typedef _dart_random = int Function(); typedef _c_srandom = ffi.Void Function( ffi.Uint32 __seed, ); typedef _dart_srandom = void Function( int __seed, ); typedef _c_initstate = ffi.Pointer Function( ffi.Uint32 __seed, ffi.Pointer __statebuf, ffi.Uint64 __statelen, ); typedef _dart_initstate = ffi.Pointer Function( int __seed, ffi.Pointer __statebuf, int __statelen, ); typedef _c_setstate = ffi.Pointer Function( ffi.Pointer __statebuf, ); typedef _dart_setstate = ffi.Pointer Function( ffi.Pointer __statebuf, ); typedef _c_random_r = ffi.Int32 Function( ffi.Pointer __buf, ffi.Pointer __result, ); typedef _dart_random_r = int Function( ffi.Pointer __buf, ffi.Pointer __result, ); typedef _c_srandom_r = ffi.Int32 Function( ffi.Uint32 __seed, ffi.Pointer __buf, ); typedef _dart_srandom_r = int Function( int __seed, ffi.Pointer __buf, ); typedef _c_initstate_r = ffi.Int32 Function( ffi.Uint32 __seed, ffi.Pointer __statebuf, ffi.Uint64 __statelen, ffi.Pointer __buf, ); typedef _dart_initstate_r = int Function( int __seed, ffi.Pointer __statebuf, int __statelen, ffi.Pointer __buf, ); typedef _c_setstate_r = ffi.Int32 Function( ffi.Pointer __statebuf, ffi.Pointer __buf, ); typedef _dart_setstate_r = int Function( ffi.Pointer __statebuf, ffi.Pointer __buf, ); typedef _c_rand = ffi.Int32 Function(); typedef _dart_rand = int Function(); typedef _c_srand = ffi.Void Function( ffi.Uint32 __seed, ); typedef _dart_srand = void Function( int __seed, ); typedef _c_rand_r = ffi.Int32 Function( ffi.Pointer __seed, ); typedef _dart_rand_r = int Function( ffi.Pointer __seed, ); typedef _c_drand48 = ffi.Double Function(); typedef _dart_drand48 = double Function(); typedef _c_erand48 = ffi.Double Function( ffi.Pointer __xsubi, ); typedef _dart_erand48 = double Function( ffi.Pointer __xsubi, ); typedef _c_lrand48 = ffi.Int64 Function(); typedef _dart_lrand48 = int Function(); typedef _c_nrand48 = ffi.Int64 Function( ffi.Pointer __xsubi, ); typedef _dart_nrand48 = int Function( ffi.Pointer __xsubi, ); typedef _c_mrand48 = ffi.Int64 Function(); typedef _dart_mrand48 = int Function(); typedef _c_jrand48 = ffi.Int64 Function( ffi.Pointer __xsubi, ); typedef _dart_jrand48 = int Function( ffi.Pointer __xsubi, ); typedef _c_srand48 = ffi.Void Function( ffi.Int64 __seedval, ); typedef _dart_srand48 = void Function( int __seedval, ); typedef _c_seed48 = ffi.Pointer Function( ffi.Pointer __seed16v, ); typedef _dart_seed48 = ffi.Pointer Function( ffi.Pointer __seed16v, ); typedef _c_lcong48 = ffi.Void Function( ffi.Pointer __param, ); typedef _dart_lcong48 = void Function( ffi.Pointer __param, ); typedef _c_drand48_r = ffi.Int32 Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_drand48_r = int Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_erand48_r = ffi.Int32 Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_erand48_r = int Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_lrand48_r = ffi.Int32 Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_lrand48_r = int Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_nrand48_r = ffi.Int32 Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_nrand48_r = int Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_mrand48_r = ffi.Int32 Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_mrand48_r = int Function( ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_jrand48_r = ffi.Int32 Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _dart_jrand48_r = int Function( ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ); typedef _c_srand48_r = ffi.Int32 Function( ffi.Int64 __seedval, ffi.Pointer __buffer, ); typedef _dart_srand48_r = int Function( int __seedval, ffi.Pointer __buffer, ); typedef _c_seed48_r = ffi.Int32 Function( ffi.Pointer __seed16v, ffi.Pointer __buffer, ); typedef _dart_seed48_r = int Function( ffi.Pointer __seed16v, ffi.Pointer __buffer, ); typedef _c_lcong48_r = ffi.Int32 Function( ffi.Pointer __param, ffi.Pointer __buffer, ); typedef _dart_lcong48_r = int Function( ffi.Pointer __param, ffi.Pointer __buffer, ); typedef _c_malloc = ffi.Pointer Function( ffi.Uint64 __size, ); typedef _dart_malloc = ffi.Pointer Function( int __size, ); typedef _c_calloc = ffi.Pointer Function( ffi.Uint64 __nmemb, ffi.Uint64 __size, ); typedef _dart_calloc = ffi.Pointer Function( int __nmemb, int __size, ); typedef _c_realloc = ffi.Pointer Function( ffi.Pointer __ptr, ffi.Uint64 __size, ); typedef _dart_realloc = ffi.Pointer Function( ffi.Pointer __ptr, int __size, ); typedef _c_reallocarray = ffi.Pointer Function( ffi.Pointer __ptr, ffi.Uint64 __nmemb, ffi.Uint64 __size, ); typedef _dart_reallocarray = ffi.Pointer Function( ffi.Pointer __ptr, int __nmemb, int __size, ); typedef _c_free = ffi.Void Function( ffi.Pointer __ptr, ); typedef _dart_free = void Function( ffi.Pointer __ptr, ); typedef _c_alloca = ffi.Pointer Function( ffi.Uint64 __size, ); typedef _dart_alloca = ffi.Pointer Function( int __size, ); typedef _c_valloc = ffi.Pointer Function( ffi.Uint64 __size, ); typedef _dart_valloc = ffi.Pointer Function( int __size, ); typedef _c_posix_memalign = ffi.Int32 Function( ffi.Pointer> __memptr, ffi.Uint64 __alignment, ffi.Uint64 __size, ); typedef _dart_posix_memalign = int Function( ffi.Pointer> __memptr, int __alignment, int __size, ); typedef _c_aligned_alloc = ffi.Pointer Function( ffi.Uint64 __alignment, ffi.Uint64 __size, ); typedef _dart_aligned_alloc = ffi.Pointer Function( int __alignment, int __size, ); typedef _c_abort = ffi.Void Function(); typedef _dart_abort = void Function(); typedef _typedefC_1 = ffi.Void Function(); typedef _c_atexit = ffi.Int32 Function( ffi.Pointer> __func, ); typedef _dart_atexit = int Function( ffi.Pointer> __func, ); typedef _typedefC_2 = ffi.Void Function(); typedef _c_at_quick_exit = ffi.Int32 Function( ffi.Pointer> __func, ); typedef _dart_at_quick_exit = int Function( ffi.Pointer> __func, ); typedef _typedefC_3 = ffi.Void Function( ffi.Int32, ffi.Pointer, ); typedef _c_on_exit = ffi.Int32 Function( ffi.Pointer> __func, ffi.Pointer __arg, ); typedef _dart_on_exit = int Function( ffi.Pointer> __func, ffi.Pointer __arg, ); typedef _c_exit = ffi.Void Function( ffi.Int32 __status, ); typedef _dart_exit = void Function( int __status, ); typedef _c_quick_exit = ffi.Void Function( ffi.Int32 __status, ); typedef _dart_quick_exit = void Function( int __status, ); typedef _c__Exit = ffi.Void Function( ffi.Int32 __status, ); typedef _dart__Exit = void Function( int __status, ); typedef _c_getenv = ffi.Pointer Function( ffi.Pointer __name, ); typedef _dart_getenv = ffi.Pointer Function( ffi.Pointer __name, ); typedef _c_putenv = ffi.Int32 Function( ffi.Pointer __string, ); typedef _dart_putenv = int Function( ffi.Pointer __string, ); typedef _c_setenv = ffi.Int32 Function( ffi.Pointer __name, ffi.Pointer __value, ffi.Int32 __replace, ); typedef _dart_setenv = int Function( ffi.Pointer __name, ffi.Pointer __value, int __replace, ); typedef _c_unsetenv = ffi.Int32 Function( ffi.Pointer __name, ); typedef _dart_unsetenv = int Function( ffi.Pointer __name, ); typedef _c_clearenv = ffi.Int32 Function(); typedef _dart_clearenv = int Function(); typedef _c_mktemp = ffi.Pointer Function( ffi.Pointer __template, ); typedef _dart_mktemp = ffi.Pointer Function( ffi.Pointer __template, ); typedef _c_mkstemp = ffi.Int32 Function( ffi.Pointer __template, ); typedef _dart_mkstemp = int Function( ffi.Pointer __template, ); typedef _c_mkstemps = ffi.Int32 Function( ffi.Pointer __template, ffi.Int32 __suffixlen, ); typedef _dart_mkstemps = int Function( ffi.Pointer __template, int __suffixlen, ); typedef _c_mkdtemp = ffi.Pointer Function( ffi.Pointer __template, ); typedef _dart_mkdtemp = ffi.Pointer Function( ffi.Pointer __template, ); typedef _c_system = ffi.Int32 Function( ffi.Pointer __command, ); typedef _dart_system = int Function( ffi.Pointer __command, ); typedef _c_realpath = ffi.Pointer Function( ffi.Pointer __name, ffi.Pointer __resolved, ); typedef _dart_realpath = ffi.Pointer Function( ffi.Pointer __name, ffi.Pointer __resolved, ); typedef __compar_fn_t = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); typedef _c_bsearch = ffi.Pointer Function( ffi.Pointer __key, ffi.Pointer __base, ffi.Uint64 __nmemb, ffi.Uint64 __size, ffi.Pointer> __compar, ); typedef _dart_bsearch = ffi.Pointer Function( ffi.Pointer __key, ffi.Pointer __base, int __nmemb, int __size, ffi.Pointer> __compar, ); typedef _c_qsort = ffi.Void Function( ffi.Pointer __base, ffi.Uint64 __nmemb, ffi.Uint64 __size, ffi.Pointer> __compar, ); typedef _dart_qsort = void Function( ffi.Pointer __base, int __nmemb, int __size, ffi.Pointer> __compar, ); typedef _c_abs = ffi.Int32 Function( ffi.Int32 __x, ); typedef _dart_abs = int Function( int __x, ); typedef _c_labs = ffi.Int64 Function( ffi.Int64 __x, ); typedef _dart_labs = int Function( int __x, ); typedef _c_llabs = ffi.Int64 Function( ffi.Int64 __x, ); typedef _dart_llabs = int Function( int __x, ); typedef _c_div = div_t Function( ffi.Int32 __numer, ffi.Int32 __denom, ); typedef _dart_div = div_t Function( int __numer, int __denom, ); typedef _c_ldiv = ldiv_t Function( ffi.Int64 __numer, ffi.Int64 __denom, ); typedef _dart_ldiv = ldiv_t Function( int __numer, int __denom, ); typedef _c_lldiv = lldiv_t Function( ffi.Int64 __numer, ffi.Int64 __denom, ); typedef _dart_lldiv = lldiv_t Function( int __numer, int __denom, ); typedef _c_ecvt = ffi.Pointer Function( ffi.Double __value, ffi.Int32 __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ); typedef _dart_ecvt = ffi.Pointer Function( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ); typedef _c_fcvt = ffi.Pointer Function( ffi.Double __value, ffi.Int32 __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ); typedef _dart_fcvt = ffi.Pointer Function( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ); typedef _c_gcvt = ffi.Pointer Function( ffi.Double __value, ffi.Int32 __ndigit, ffi.Pointer __buf, ); typedef _dart_gcvt = ffi.Pointer Function( double __value, int __ndigit, ffi.Pointer __buf, ); typedef _c_ecvt_r = ffi.Int32 Function( ffi.Double __value, ffi.Int32 __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, ffi.Uint64 __len, ); typedef _dart_ecvt_r = int Function( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, int __len, ); typedef _c_fcvt_r = ffi.Int32 Function( ffi.Double __value, ffi.Int32 __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, ffi.Uint64 __len, ); typedef _dart_fcvt_r = int Function( double __value, int __ndigit, ffi.Pointer __decpt, ffi.Pointer __sign, ffi.Pointer __buf, int __len, ); typedef _c_mblen = ffi.Int32 Function( ffi.Pointer __s, ffi.Uint64 __n, ); typedef _dart_mblen = int Function( ffi.Pointer __s, int __n, ); typedef _c_mbtowc = ffi.Int32 Function( ffi.Pointer __pwc, ffi.Pointer __s, ffi.Uint64 __n, ); typedef _dart_mbtowc = int Function( ffi.Pointer __pwc, ffi.Pointer __s, int __n, ); typedef _c_wctomb = ffi.Int32 Function( ffi.Pointer __s, ffi.Int32 __wchar, ); typedef _dart_wctomb = int Function( ffi.Pointer __s, int __wchar, ); typedef _c_mbstowcs = ffi.Uint64 Function( ffi.Pointer __pwcs, ffi.Pointer __s, ffi.Uint64 __n, ); typedef _dart_mbstowcs = int Function( ffi.Pointer __pwcs, ffi.Pointer __s, int __n, ); typedef _c_wcstombs = ffi.Uint64 Function( ffi.Pointer __s, ffi.Pointer __pwcs, ffi.Uint64 __n, ); typedef _dart_wcstombs = int Function( ffi.Pointer __s, ffi.Pointer __pwcs, int __n, ); typedef _c_rpmatch = ffi.Int32 Function( ffi.Pointer __response, ); typedef _dart_rpmatch = int Function( ffi.Pointer __response, ); typedef _c_getsubopt = ffi.Int32 Function( ffi.Pointer> __optionp, ffi.Pointer> __tokens, ffi.Pointer> __valuep, ); typedef _dart_getsubopt = int Function( ffi.Pointer> __optionp, ffi.Pointer> __tokens, ffi.Pointer> __valuep, ); typedef _c_getloadavg = ffi.Int32 Function( ffi.Pointer __loadavg, ffi.Int32 __nelem, ); typedef _dart_getloadavg = int Function( ffi.Pointer __loadavg, int __nelem, ); typedef _c_memcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_memcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_memmove = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_memmove = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_memccpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Int32 __c, ffi.Uint64 __n, ); typedef _dart_memccpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __c, int __n, ); typedef _c_memset = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ffi.Uint64 __n, ); typedef _dart_memset = ffi.Pointer Function( ffi.Pointer __s, int __c, int __n, ); typedef _c_memcmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Uint64 __n, ); typedef _dart_memcmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ); typedef _c_memchr = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ffi.Uint64 __n, ); typedef _dart_memchr = ffi.Pointer Function( ffi.Pointer __s, int __c, int __n, ); typedef _c_strcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _dart_strcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _c_strncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_strncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_strcat = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _dart_strcat = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _c_strncat = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_strncat = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_strcmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _dart_strcmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _c_strncmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Uint64 __n, ); typedef _dart_strncmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ); typedef _c_strcoll = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _dart_strcoll = int Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _c_strxfrm = ffi.Uint64 Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_strxfrm = int Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_strcoll_l = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __l, ); typedef _dart_strcoll_l = int Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __l, ); typedef _c_strxfrm_l = ffi.Uint64 Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ffi.Pointer<_locale_struct_> __l, ); typedef _dart_strxfrm_l = int Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ffi.Pointer<_locale_struct_> __l, ); typedef _c_strdup = ffi.Pointer Function( ffi.Pointer __s, ); typedef _dart_strdup = ffi.Pointer Function( ffi.Pointer __s, ); typedef _c_strndup = ffi.Pointer Function( ffi.Pointer __string, ffi.Uint64 __n, ); typedef _dart_strndup = ffi.Pointer Function( ffi.Pointer __string, int __n, ); typedef _c_strchr = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ); typedef _dart_strchr = ffi.Pointer Function( ffi.Pointer __s, int __c, ); typedef _c_strrchr = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ); typedef _dart_strrchr = ffi.Pointer Function( ffi.Pointer __s, int __c, ); typedef _c_strcspn = ffi.Uint64 Function( ffi.Pointer __s, ffi.Pointer __reject, ); typedef _dart_strcspn = int Function( ffi.Pointer __s, ffi.Pointer __reject, ); typedef _c_strspn = ffi.Uint64 Function( ffi.Pointer __s, ffi.Pointer __accept, ); typedef _dart_strspn = int Function( ffi.Pointer __s, ffi.Pointer __accept, ); typedef _c_strpbrk = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __accept, ); typedef _dart_strpbrk = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __accept, ); typedef _c_strstr = ffi.Pointer Function( ffi.Pointer __haystack, ffi.Pointer __needle, ); typedef _dart_strstr = ffi.Pointer Function( ffi.Pointer __haystack, ffi.Pointer __needle, ); typedef _c_strtok = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ); typedef _dart_strtok = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ); typedef _c___strtok_r = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ); typedef _dart___strtok_r = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ); typedef _c_strtok_r = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ); typedef _dart_strtok_r = ffi.Pointer Function( ffi.Pointer __s, ffi.Pointer __delim, ffi.Pointer> __save_ptr, ); typedef _c_strlen = ffi.Uint64 Function( ffi.Pointer __s, ); typedef _dart_strlen = int Function( ffi.Pointer __s, ); typedef _c_strnlen = ffi.Uint64 Function( ffi.Pointer __string, ffi.Uint64 __maxlen, ); typedef _dart_strnlen = int Function( ffi.Pointer __string, int __maxlen, ); typedef _c_strerror = ffi.Pointer Function( ffi.Int32 __errnum, ); typedef _dart_strerror = ffi.Pointer Function( int __errnum, ); typedef _c_strerror_r = ffi.Int32 Function( ffi.Int32 __errnum, ffi.Pointer __buf, ffi.Uint64 __buflen, ); typedef _dart_strerror_r = int Function( int __errnum, ffi.Pointer __buf, int __buflen, ); typedef _c_strerror_l = ffi.Pointer Function( ffi.Int32 __errnum, ffi.Pointer<_locale_struct_> __l, ); typedef _dart_strerror_l = ffi.Pointer Function( int __errnum, ffi.Pointer<_locale_struct_> __l, ); typedef _c_bcmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Uint64 __n, ); typedef _dart_bcmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ); typedef _c_bcopy = ffi.Void Function( ffi.Pointer __src, ffi.Pointer __dest, ffi.Uint64 __n, ); typedef _dart_bcopy = void Function( ffi.Pointer __src, ffi.Pointer __dest, int __n, ); typedef _c_bzero = ffi.Void Function( ffi.Pointer __s, ffi.Uint64 __n, ); typedef _dart_bzero = void Function( ffi.Pointer __s, int __n, ); typedef _c_index = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ); typedef _dart_index = ffi.Pointer Function( ffi.Pointer __s, int __c, ); typedef _c_rindex = ffi.Pointer Function( ffi.Pointer __s, ffi.Int32 __c, ); typedef _dart_rindex = ffi.Pointer Function( ffi.Pointer __s, int __c, ); typedef _c_ffs = ffi.Int32 Function( ffi.Int32 __i, ); typedef _dart_ffs = int Function( int __i, ); typedef _c_ffsl = ffi.Int32 Function( ffi.Int64 __l, ); typedef _dart_ffsl = int Function( int __l, ); typedef _c_ffsll = ffi.Int32 Function( ffi.Int64 __ll, ); typedef _dart_ffsll = int Function( int __ll, ); typedef _c_strcasecmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _dart_strcasecmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, ); typedef _c_strncasecmp = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Uint64 __n, ); typedef _dart_strncasecmp = int Function( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ); typedef _c_strcasecmp_l = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __loc, ); typedef _dart_strcasecmp_l = int Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Pointer<_locale_struct_> __loc, ); typedef _c_strncasecmp_l = ffi.Int32 Function( ffi.Pointer __s1, ffi.Pointer __s2, ffi.Uint64 __n, ffi.Pointer<_locale_struct_> __loc, ); typedef _dart_strncasecmp_l = int Function( ffi.Pointer __s1, ffi.Pointer __s2, int __n, ffi.Pointer<_locale_struct_> __loc, ); typedef _c_explicit_bzero = ffi.Void Function( ffi.Pointer __s, ffi.Uint64 __n, ); typedef _dart_explicit_bzero = void Function( ffi.Pointer __s, int __n, ); typedef _c_strsep = ffi.Pointer Function( ffi.Pointer> __stringp, ffi.Pointer __delim, ); typedef _dart_strsep = ffi.Pointer Function( ffi.Pointer> __stringp, ffi.Pointer __delim, ); typedef _c_strsignal = ffi.Pointer Function( ffi.Int32 __sig, ); typedef _dart_strsignal = ffi.Pointer Function( int __sig, ); typedef _c___stpcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _dart___stpcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _c_stpcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _dart_stpcpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ); typedef _c___stpncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart___stpncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_stpncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, ffi.Uint64 __n, ); typedef _dart_stpncpy = ffi.Pointer Function( ffi.Pointer __dest, ffi.Pointer __src, int __n, ); typedef _c_fcntl = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int32 __cmd, ); typedef _dart_fcntl = int Function( int __fd, int __cmd, ); typedef _c_open = ffi.Int32 Function( ffi.Pointer __file, ffi.Int32 __oflag, ); typedef _dart_open = int Function( ffi.Pointer __file, int __oflag, ); typedef _c_openat = ffi.Int32 Function( ffi.Int32 __fd, ffi.Pointer __file, ffi.Int32 __oflag, ); typedef _dart_openat = int Function( int __fd, ffi.Pointer __file, int __oflag, ); typedef _c_creat = ffi.Int32 Function( ffi.Pointer __file, ffi.Uint32 __mode, ); typedef _dart_creat = int Function( ffi.Pointer __file, int __mode, ); typedef _c_posix_fadvise = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int64 __offset, ffi.Int64 __len, ffi.Int32 __advise, ); typedef _dart_posix_fadvise = int Function( int __fd, int __offset, int __len, int __advise, ); typedef _c_posix_fallocate = ffi.Int32 Function( ffi.Int32 __fd, ffi.Int64 __offset, ffi.Int64 __len, ); typedef _dart_posix_fallocate = int Function( int __fd, int __offset, int __len, ); typedef _c___assert_fail = ffi.Void Function( ffi.Pointer __assertion, ffi.Pointer __file, ffi.Uint32 __line, ffi.Pointer __function, ); typedef _dart___assert_fail = void Function( ffi.Pointer __assertion, ffi.Pointer __file, int __line, ffi.Pointer __function, ); typedef _c___assert_perror_fail = ffi.Void Function( ffi.Int32 __errnum, ffi.Pointer __file, ffi.Uint32 __line, ffi.Pointer __function, ); typedef _dart___assert_perror_fail = void Function( int __errnum, ffi.Pointer __file, int __line, ffi.Pointer __function, ); typedef _c___assert = ffi.Void Function( ffi.Pointer __assertion, ffi.Pointer __file, ffi.Int32 __line, ); typedef _dart___assert = void Function( ffi.Pointer __assertion, ffi.Pointer __file, int __line, ); typedef _c_poll = ffi.Int32 Function( ffi.Pointer __fds, ffi.Uint64 __nfds, ffi.Int32 __timeout, ); typedef _dart_poll = int Function( ffi.Pointer __fds, int __nfds, int __timeout, ); typedef _c___errno_location = ffi.Pointer Function(); typedef _dart___errno_location = ffi.Pointer Function(); typedef _c_clock = ffi.Int64 Function(); typedef _dart_clock = int Function(); typedef _c_time = ffi.Int64 Function( ffi.Pointer __timer, ); typedef _dart_time = int Function( ffi.Pointer __timer, ); typedef _c_difftime = ffi.Double Function( ffi.Int64 __time1, ffi.Int64 __time0, ); typedef _dart_difftime = double Function( int __time1, int __time0, ); typedef _c_mktime = ffi.Int64 Function( ffi.Pointer __tp, ); typedef _dart_mktime = int Function( ffi.Pointer __tp, ); typedef _c_strftime = ffi.Uint64 Function( ffi.Pointer __s, ffi.Uint64 __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ); typedef _dart_strftime = int Function( ffi.Pointer __s, int __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ); typedef _c_strftime_l = ffi.Uint64 Function( ffi.Pointer __s, ffi.Uint64 __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ffi.Pointer<_locale_struct_> __loc, ); typedef _dart_strftime_l = int Function( ffi.Pointer __s, int __maxsize, ffi.Pointer __format, ffi.Pointer __tp, ffi.Pointer<_locale_struct_> __loc, ); typedef _c_gmtime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _dart_gmtime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _c_localtime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _dart_localtime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _c_gmtime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __tp, ); typedef _dart_gmtime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __tp, ); typedef _c_localtime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __tp, ); typedef _dart_localtime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __tp, ); typedef _c_asctime = ffi.Pointer Function( ffi.Pointer __tp, ); typedef _dart_asctime = ffi.Pointer Function( ffi.Pointer __tp, ); typedef _c_ctime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _dart_ctime = ffi.Pointer Function( ffi.Pointer __timer, ); typedef _c_asctime_r = ffi.Pointer Function( ffi.Pointer __tp, ffi.Pointer __buf, ); typedef _dart_asctime_r = ffi.Pointer Function( ffi.Pointer __tp, ffi.Pointer __buf, ); typedef _c_ctime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __buf, ); typedef _dart_ctime_r = ffi.Pointer Function( ffi.Pointer __timer, ffi.Pointer __buf, ); typedef _c_tzset = ffi.Void Function(); typedef _dart_tzset = void Function(); typedef _c_timegm = ffi.Int64 Function( ffi.Pointer __tp, ); typedef _dart_timegm = int Function( ffi.Pointer __tp, ); typedef _c_timelocal = ffi.Int64 Function( ffi.Pointer __tp, ); typedef _dart_timelocal = int Function( ffi.Pointer __tp, ); typedef _c_dysize = ffi.Int32 Function( ffi.Int32 __year, ); typedef _dart_dysize = int Function( int __year, ); typedef _c_nanosleep = ffi.Int32 Function( ffi.Pointer __requested_time, ffi.Pointer __remaining, ); typedef _dart_nanosleep = int Function( ffi.Pointer __requested_time, ffi.Pointer __remaining, ); typedef _c_clock_getres = ffi.Int32 Function( ffi.Int32 __clock_id, ffi.Pointer __res, ); typedef _dart_clock_getres = int Function( int __clock_id, ffi.Pointer __res, ); typedef _c_clock_gettime = ffi.Int32 Function( ffi.Int32 __clock_id, ffi.Pointer __tp, ); typedef _dart_clock_gettime = int Function( int __clock_id, ffi.Pointer __tp, ); typedef _c_clock_settime = ffi.Int32 Function( ffi.Int32 __clock_id, ffi.Pointer __tp, ); typedef _dart_clock_settime = int Function( int __clock_id, ffi.Pointer __tp, ); typedef _c_clock_nanosleep = ffi.Int32 Function( ffi.Int32 __clock_id, ffi.Int32 __flags, ffi.Pointer __req, ffi.Pointer __rem, ); typedef _dart_clock_nanosleep = int Function( int __clock_id, int __flags, ffi.Pointer __req, ffi.Pointer __rem, ); typedef _c_clock_getcpuclockid = ffi.Int32 Function( ffi.Int32 __pid, ffi.Pointer __clock_id, ); typedef _dart_clock_getcpuclockid = int Function( int __pid, ffi.Pointer __clock_id, ); typedef _c_timer_create = ffi.Int32 Function( ffi.Int32 __clock_id, ffi.Pointer __evp, ffi.Pointer> __timerid, ); typedef _dart_timer_create = int Function( int __clock_id, ffi.Pointer __evp, ffi.Pointer> __timerid, ); typedef _c_timer_delete = ffi.Int32 Function( ffi.Pointer __timerid, ); typedef _dart_timer_delete = int Function( ffi.Pointer __timerid, ); typedef _c_timer_settime = ffi.Int32 Function( ffi.Pointer __timerid, ffi.Int32 __flags, ffi.Pointer __value, ffi.Pointer __ovalue, ); typedef _dart_timer_settime = int Function( ffi.Pointer __timerid, int __flags, ffi.Pointer __value, ffi.Pointer __ovalue, ); typedef _c_timer_gettime = ffi.Int32 Function( ffi.Pointer __timerid, ffi.Pointer __value, ); typedef _dart_timer_gettime = int Function( ffi.Pointer __timerid, ffi.Pointer __value, ); typedef _c_timer_getoverrun = ffi.Int32 Function( ffi.Pointer __timerid, ); typedef _dart_timer_getoverrun = int Function( ffi.Pointer __timerid, ); typedef _c_timespec_get = ffi.Int32 Function( ffi.Pointer __ts, ffi.Int32 __base, ); typedef _dart_timespec_get = int Function( ffi.Pointer __ts, int __base, ); typedef _c_snd_asoundlib_version = ffi.Pointer Function(); typedef _dart_snd_asoundlib_version = ffi.Pointer Function(); typedef _c_snd_dlopen = ffi.Pointer Function( ffi.Pointer file, ffi.Int32 mode, ffi.Pointer errbuf, ffi.Uint64 errbuflen, ); typedef _dart_snd_dlopen = ffi.Pointer Function( ffi.Pointer file, int mode, ffi.Pointer errbuf, int errbuflen, ); typedef _c_snd_dlsym = ffi.Pointer Function( ffi.Pointer handle, ffi.Pointer name, ffi.Pointer version, ); typedef _dart_snd_dlsym = ffi.Pointer Function( ffi.Pointer handle, ffi.Pointer name, ffi.Pointer version, ); typedef _c_snd_dlclose = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_dlclose = int Function( ffi.Pointer handle, ); typedef snd_async_callback_t = ffi.Void Function( ffi.Pointer, ); typedef _c_snd_async_add_handler = ffi.Int32 Function( ffi.Pointer> handler, ffi.Int32 fd, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _dart_snd_async_add_handler = int Function( ffi.Pointer> handler, int fd, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _c_snd_async_del_handler = ffi.Int32 Function( ffi.Pointer handler, ); typedef _dart_snd_async_del_handler = int Function( ffi.Pointer handler, ); typedef _c_snd_async_handler_get_fd = ffi.Int32 Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_fd = int Function( ffi.Pointer handler, ); typedef _c_snd_async_handler_get_signo = ffi.Int32 Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_signo = int Function( ffi.Pointer handler, ); typedef _c_snd_async_handler_get_callback_private = ffi.Pointer Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_callback_private = ffi.Pointer Function( ffi.Pointer handler, ); typedef _c_snd_shm_area_create = ffi.Pointer Function( ffi.Int32 shmid, ffi.Pointer ptr, ); typedef _dart_snd_shm_area_create = ffi.Pointer Function( int shmid, ffi.Pointer ptr, ); typedef _c_snd_shm_area_share = ffi.Pointer Function( ffi.Pointer area, ); typedef _dart_snd_shm_area_share = ffi.Pointer Function( ffi.Pointer area, ); typedef _c_snd_shm_area_destroy = ffi.Int32 Function( ffi.Pointer area, ); typedef _dart_snd_shm_area_destroy = int Function( ffi.Pointer area, ); typedef _c_snd_user_file = ffi.Int32 Function( ffi.Pointer file, ffi.Pointer> result, ); typedef _dart_snd_user_file = int Function( ffi.Pointer file, ffi.Pointer> result, ); typedef _c_snd_input_stdio_open = ffi.Int32 Function( ffi.Pointer> inputp, ffi.Pointer file, ffi.Pointer mode, ); typedef _dart_snd_input_stdio_open = int Function( ffi.Pointer> inputp, ffi.Pointer file, ffi.Pointer mode, ); typedef _c_snd_input_stdio_attach = ffi.Int32 Function( ffi.Pointer> inputp, ffi.Pointer fp, ffi.Int32 _close, ); typedef _dart_snd_input_stdio_attach = int Function( ffi.Pointer> inputp, ffi.Pointer fp, int _close, ); typedef _c_snd_input_buffer_open = ffi.Int32 Function( ffi.Pointer> inputp, ffi.Pointer buffer, ffi.Int64 size, ); typedef _dart_snd_input_buffer_open = int Function( ffi.Pointer> inputp, ffi.Pointer buffer, int size, ); typedef _c_snd_input_close = ffi.Int32 Function( ffi.Pointer input, ); typedef _dart_snd_input_close = int Function( ffi.Pointer input, ); typedef _c_snd_input_scanf = ffi.Int32 Function( ffi.Pointer input, ffi.Pointer format, ); typedef _dart_snd_input_scanf = int Function( ffi.Pointer input, ffi.Pointer format, ); typedef _c_snd_input_gets = ffi.Pointer Function( ffi.Pointer input, ffi.Pointer str, ffi.Uint64 size, ); typedef _dart_snd_input_gets = ffi.Pointer Function( ffi.Pointer input, ffi.Pointer str, int size, ); typedef _c_snd_input_getc = ffi.Int32 Function( ffi.Pointer input, ); typedef _dart_snd_input_getc = int Function( ffi.Pointer input, ); typedef _c_snd_input_ungetc = ffi.Int32 Function( ffi.Pointer input, ffi.Int32 c, ); typedef _dart_snd_input_ungetc = int Function( ffi.Pointer input, int c, ); typedef _c_snd_output_stdio_open = ffi.Int32 Function( ffi.Pointer> outputp, ffi.Pointer file, ffi.Pointer mode, ); typedef _dart_snd_output_stdio_open = int Function( ffi.Pointer> outputp, ffi.Pointer file, ffi.Pointer mode, ); typedef _c_snd_output_stdio_attach = ffi.Int32 Function( ffi.Pointer> outputp, ffi.Pointer fp, ffi.Int32 _close, ); typedef _dart_snd_output_stdio_attach = int Function( ffi.Pointer> outputp, ffi.Pointer fp, int _close, ); typedef _c_snd_output_buffer_open = ffi.Int32 Function( ffi.Pointer> outputp, ); typedef _dart_snd_output_buffer_open = int Function( ffi.Pointer> outputp, ); typedef _c_snd_output_buffer_string = ffi.Uint64 Function( ffi.Pointer output, ffi.Pointer> buf, ); typedef _dart_snd_output_buffer_string = int Function( ffi.Pointer output, ffi.Pointer> buf, ); typedef _c_snd_output_close = ffi.Int32 Function( ffi.Pointer output, ); typedef _dart_snd_output_close = int Function( ffi.Pointer output, ); typedef _c_snd_output_printf = ffi.Int32 Function( ffi.Pointer output, ffi.Pointer format, ); typedef _dart_snd_output_printf = int Function( ffi.Pointer output, ffi.Pointer format, ); typedef _c_snd_output_vprintf = ffi.Int32 Function( ffi.Pointer output, ffi.Pointer format, ffi.Pointer<_va_list_tag_> args, ); typedef _dart_snd_output_vprintf = int Function( ffi.Pointer output, ffi.Pointer format, ffi.Pointer<_va_list_tag_> args, ); typedef _c_snd_output_puts = ffi.Int32 Function( ffi.Pointer output, ffi.Pointer str, ); typedef _dart_snd_output_puts = int Function( ffi.Pointer output, ffi.Pointer str, ); typedef _c_snd_output_putc = ffi.Int32 Function( ffi.Pointer output, ffi.Int32 c, ); typedef _dart_snd_output_putc = int Function( ffi.Pointer output, int c, ); typedef _c_snd_output_flush = ffi.Int32 Function( ffi.Pointer output, ); typedef _dart_snd_output_flush = int Function( ffi.Pointer output, ); typedef _c_snd_strerror = ffi.Pointer Function( ffi.Int32 errnum, ); typedef _dart_snd_strerror = ffi.Pointer Function( int errnum, ); typedef snd_lib_error_handler_t = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer, ffi.Int32, ffi.Pointer, ); typedef _c_snd_lib_error_set_handler = ffi.Int32 Function( ffi.Pointer> handler, ); typedef _dart_snd_lib_error_set_handler = int Function( ffi.Pointer> handler, ); typedef snd_local_error_handler_t = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer, ffi.Int32, ffi.Pointer, ffi.Pointer<_va_list_tag_>, ); typedef _c_snd_lib_error_set_local = ffi.Pointer> Function( ffi.Pointer> func, ); typedef _dart_snd_lib_error_set_local = ffi.Pointer> Function( ffi.Pointer> func, ); typedef _c_snd_config_topdir = ffi.Pointer Function(); typedef _dart_snd_config_topdir = ffi.Pointer Function(); typedef _c_snd_config_top = ffi.Int32 Function( ffi.Pointer> config, ); typedef _dart_snd_config_top = int Function( ffi.Pointer> config, ); typedef _c_snd_config_load = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer in_1, ); typedef _dart_snd_config_load = int Function( ffi.Pointer config, ffi.Pointer in_1, ); typedef _c_snd_config_load_override = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer in_1, ); typedef _dart_snd_config_load_override = int Function( ffi.Pointer config, ffi.Pointer in_1, ); typedef _c_snd_config_save = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer out, ); typedef _dart_snd_config_save = int Function( ffi.Pointer config, ffi.Pointer out, ); typedef _c_snd_config_update = ffi.Int32 Function(); typedef _dart_snd_config_update = int Function(); typedef _c_snd_config_update_r = ffi.Int32 Function( ffi.Pointer> top, ffi.Pointer> update, ffi.Pointer path, ); typedef _dart_snd_config_update_r = int Function( ffi.Pointer> top, ffi.Pointer> update, ffi.Pointer path, ); typedef _c_snd_config_update_free = ffi.Int32 Function( ffi.Pointer update, ); typedef _dart_snd_config_update_free = int Function( ffi.Pointer update, ); typedef _c_snd_config_update_free_global = ffi.Int32 Function(); typedef _dart_snd_config_update_free_global = int Function(); typedef _c_snd_config_update_ref = ffi.Int32 Function( ffi.Pointer> top, ); typedef _dart_snd_config_update_ref = int Function( ffi.Pointer> top, ); typedef _c_snd_config_ref = ffi.Void Function( ffi.Pointer top, ); typedef _dart_snd_config_ref = void Function( ffi.Pointer top, ); typedef _c_snd_config_unref = ffi.Void Function( ffi.Pointer top, ); typedef _dart_snd_config_unref = void Function( ffi.Pointer top, ); typedef _c_snd_config_search = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer key, ffi.Pointer> result, ); typedef _dart_snd_config_search = int Function( ffi.Pointer config, ffi.Pointer key, ffi.Pointer> result, ); typedef _c_snd_config_searchv = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer> result, ); typedef _dart_snd_config_searchv = int Function( ffi.Pointer config, ffi.Pointer> result, ); typedef _c_snd_config_search_definition = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer base, ffi.Pointer key, ffi.Pointer> result, ); typedef _dart_snd_config_search_definition = int Function( ffi.Pointer config, ffi.Pointer base, ffi.Pointer key, ffi.Pointer> result, ); typedef _c_snd_config_expand = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer root, ffi.Pointer args, ffi.Pointer private_data, ffi.Pointer> result, ); typedef _dart_snd_config_expand = int Function( ffi.Pointer config, ffi.Pointer root, ffi.Pointer args, ffi.Pointer private_data, ffi.Pointer> result, ); typedef _c_snd_config_evaluate = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer root, ffi.Pointer private_data, ffi.Pointer> result, ); typedef _dart_snd_config_evaluate = int Function( ffi.Pointer config, ffi.Pointer root, ffi.Pointer private_data, ffi.Pointer> result, ); typedef _c_snd_config_add = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer child, ); typedef _dart_snd_config_add = int Function( ffi.Pointer config, ffi.Pointer child, ); typedef _c_snd_config_add_before = ffi.Int32 Function( ffi.Pointer before, ffi.Pointer child, ); typedef _dart_snd_config_add_before = int Function( ffi.Pointer before, ffi.Pointer child, ); typedef _c_snd_config_add_after = ffi.Int32 Function( ffi.Pointer after, ffi.Pointer child, ); typedef _dart_snd_config_add_after = int Function( ffi.Pointer after, ffi.Pointer child, ); typedef _c_snd_config_remove = ffi.Int32 Function( ffi.Pointer config, ); typedef _dart_snd_config_remove = int Function( ffi.Pointer config, ); typedef _c_snd_config_delete = ffi.Int32 Function( ffi.Pointer config, ); typedef _dart_snd_config_delete = int Function( ffi.Pointer config, ); typedef _c_snd_config_delete_compound_members = ffi.Int32 Function( ffi.Pointer config, ); typedef _dart_snd_config_delete_compound_members = int Function( ffi.Pointer config, ); typedef _c_snd_config_copy = ffi.Int32 Function( ffi.Pointer> dst, ffi.Pointer src, ); typedef _dart_snd_config_copy = int Function( ffi.Pointer> dst, ffi.Pointer src, ); typedef _c_snd_config_make = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Int32 type, ); typedef _dart_snd_config_make = int Function( ffi.Pointer> config, ffi.Pointer key, int type, ); typedef _c_snd_config_make_integer = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _dart_snd_config_make_integer = int Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _c_snd_config_make_integer64 = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _dart_snd_config_make_integer64 = int Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _c_snd_config_make_real = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _dart_snd_config_make_real = int Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _c_snd_config_make_string = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _dart_snd_config_make_string = int Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _c_snd_config_make_pointer = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _dart_snd_config_make_pointer = int Function( ffi.Pointer> config, ffi.Pointer key, ); typedef _c_snd_config_make_compound = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Int32 join, ); typedef _dart_snd_config_make_compound = int Function( ffi.Pointer> config, ffi.Pointer key, int join, ); typedef _c_snd_config_imake_integer = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Int64 value, ); typedef _dart_snd_config_imake_integer = int Function( ffi.Pointer> config, ffi.Pointer key, int value, ); typedef _c_snd_config_imake_integer64 = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Int64 value, ); typedef _dart_snd_config_imake_integer64 = int Function( ffi.Pointer> config, ffi.Pointer key, int value, ); typedef _c_snd_config_imake_real = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Double value, ); typedef _dart_snd_config_imake_real = int Function( ffi.Pointer> config, ffi.Pointer key, double value, ); typedef _c_snd_config_imake_string = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ); typedef _dart_snd_config_imake_string = int Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ); typedef _c_snd_config_imake_safe_string = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ); typedef _dart_snd_config_imake_safe_string = int Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ascii, ); typedef _c_snd_config_imake_pointer = ffi.Int32 Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ptr, ); typedef _dart_snd_config_imake_pointer = int Function( ffi.Pointer> config, ffi.Pointer key, ffi.Pointer ptr, ); typedef _c_snd_config_get_type = ffi.Int32 Function( ffi.Pointer config, ); typedef _dart_snd_config_get_type = int Function( ffi.Pointer config, ); typedef _c_snd_config_is_array = ffi.Int32 Function( ffi.Pointer config, ); typedef _dart_snd_config_is_array = int Function( ffi.Pointer config, ); typedef _c_snd_config_set_id = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer id, ); typedef _dart_snd_config_set_id = int Function( ffi.Pointer config, ffi.Pointer id, ); typedef _c_snd_config_set_integer = ffi.Int32 Function( ffi.Pointer config, ffi.Int64 value, ); typedef _dart_snd_config_set_integer = int Function( ffi.Pointer config, int value, ); typedef _c_snd_config_set_integer64 = ffi.Int32 Function( ffi.Pointer config, ffi.Int64 value, ); typedef _dart_snd_config_set_integer64 = int Function( ffi.Pointer config, int value, ); typedef _c_snd_config_set_real = ffi.Int32 Function( ffi.Pointer config, ffi.Double value, ); typedef _dart_snd_config_set_real = int Function( ffi.Pointer config, double value, ); typedef _c_snd_config_set_string = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer value, ); typedef _dart_snd_config_set_string = int Function( ffi.Pointer config, ffi.Pointer value, ); typedef _c_snd_config_set_ascii = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer ascii, ); typedef _dart_snd_config_set_ascii = int Function( ffi.Pointer config, ffi.Pointer ascii, ); typedef _c_snd_config_set_pointer = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer ptr, ); typedef _dart_snd_config_set_pointer = int Function( ffi.Pointer config, ffi.Pointer ptr, ); typedef _c_snd_config_get_id = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _dart_snd_config_get_id = int Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _c_snd_config_get_integer = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer value, ); typedef _dart_snd_config_get_integer = int Function( ffi.Pointer config, ffi.Pointer value, ); typedef _c_snd_config_get_integer64 = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer value, ); typedef _dart_snd_config_get_integer64 = int Function( ffi.Pointer config, ffi.Pointer value, ); typedef _c_snd_config_get_real = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer value, ); typedef _dart_snd_config_get_real = int Function( ffi.Pointer config, ffi.Pointer value, ); typedef _c_snd_config_get_ireal = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer value, ); typedef _dart_snd_config_get_ireal = int Function( ffi.Pointer config, ffi.Pointer value, ); typedef _c_snd_config_get_string = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _dart_snd_config_get_string = int Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _c_snd_config_get_ascii = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _dart_snd_config_get_ascii = int Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _c_snd_config_get_pointer = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _dart_snd_config_get_pointer = int Function( ffi.Pointer config, ffi.Pointer> value, ); typedef _c_snd_config_test_id = ffi.Int32 Function( ffi.Pointer config, ffi.Pointer id, ); typedef _dart_snd_config_test_id = int Function( ffi.Pointer config, ffi.Pointer id, ); typedef _c_snd_config_iterator_first = ffi.Pointer Function( ffi.Pointer node, ); typedef _dart_snd_config_iterator_first = ffi.Pointer Function( ffi.Pointer node, ); typedef _c_snd_config_iterator_next = ffi.Pointer Function( ffi.Pointer iterator, ); typedef _dart_snd_config_iterator_next = ffi.Pointer Function( ffi.Pointer iterator, ); typedef _c_snd_config_iterator_end = ffi.Pointer Function( ffi.Pointer node, ); typedef _dart_snd_config_iterator_end = ffi.Pointer Function( ffi.Pointer node, ); typedef _c_snd_config_iterator_entry = ffi.Pointer Function( ffi.Pointer iterator, ); typedef _dart_snd_config_iterator_entry = ffi.Pointer Function( ffi.Pointer iterator, ); typedef _c_snd_config_get_bool_ascii = ffi.Int32 Function( ffi.Pointer ascii, ); typedef _dart_snd_config_get_bool_ascii = int Function( ffi.Pointer ascii, ); typedef _c_snd_config_get_bool = ffi.Int32 Function( ffi.Pointer conf, ); typedef _dart_snd_config_get_bool = int Function( ffi.Pointer conf, ); typedef _c_snd_config_get_ctl_iface_ascii = ffi.Int32 Function( ffi.Pointer ascii, ); typedef _dart_snd_config_get_ctl_iface_ascii = int Function( ffi.Pointer ascii, ); typedef _c_snd_config_get_ctl_iface = ffi.Int32 Function( ffi.Pointer conf, ); typedef _dart_snd_config_get_ctl_iface = int Function( ffi.Pointer conf, ); typedef _c_snd_names_list = ffi.Int32 Function( ffi.Pointer iface, ffi.Pointer> list, ); typedef _dart_snd_names_list = int Function( ffi.Pointer iface, ffi.Pointer> list, ); typedef _c_snd_names_list_free = ffi.Void Function( ffi.Pointer list, ); typedef _dart_snd_names_list_free = void Function( ffi.Pointer list, ); typedef _c_snd_pcm_open = ffi.Int32 Function( ffi.Pointer> pcm, ffi.Pointer name, ffi.Int32 stream, ffi.Int32 mode, ); typedef _dart_snd_pcm_open = int Function( ffi.Pointer> pcm, ffi.Pointer name, int stream, int mode, ); typedef _c_snd_pcm_open_lconf = ffi.Int32 Function( ffi.Pointer> pcm, ffi.Pointer name, ffi.Int32 stream, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_pcm_open_lconf = int Function( ffi.Pointer> pcm, ffi.Pointer name, int stream, int mode, ffi.Pointer lconf, ); typedef _c_snd_pcm_open_fallback = ffi.Int32 Function( ffi.Pointer> pcm, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, ffi.Int32 stream, ffi.Int32 mode, ); typedef _dart_snd_pcm_open_fallback = int Function( ffi.Pointer> pcm, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, int stream, int mode, ); typedef _c_snd_pcm_close = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_close = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_name = ffi.Pointer Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_name = ffi.Pointer Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_type = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_type = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_stream = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_stream = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_poll_descriptors_count = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_poll_descriptors = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_pcm_poll_descriptors = int Function( ffi.Pointer pcm, ffi.Pointer pfds, int space, ); typedef _c_snd_pcm_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_pcm_poll_descriptors_revents = int Function( ffi.Pointer pcm, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_pcm_nonblock = ffi.Int32 Function( ffi.Pointer pcm, ffi.Int32 nonblock, ); typedef _dart_snd_pcm_nonblock = int Function( ffi.Pointer pcm, int nonblock, ); typedef _c_snd_async_add_pcm_handler = ffi.Int32 Function( ffi.Pointer> handler, ffi.Pointer pcm, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _dart_snd_async_add_pcm_handler = int Function( ffi.Pointer> handler, ffi.Pointer pcm, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _c_snd_async_handler_get_pcm = ffi.Pointer Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_pcm = ffi.Pointer Function( ffi.Pointer handler, ); typedef _c_snd_pcm_info = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer info, ); typedef _dart_snd_pcm_info = int Function( ffi.Pointer pcm, ffi.Pointer info, ); typedef _c_snd_pcm_hw_params_current = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_current = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_hw_params = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_hw_free = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_hw_free = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_sw_params_current = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_sw_params_current = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_sw_params = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_sw_params = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_prepare = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_prepare = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_reset = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_reset = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_status = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer status, ); typedef _dart_snd_pcm_status = int Function( ffi.Pointer pcm, ffi.Pointer status, ); typedef _c_snd_pcm_start = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_start = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_drop = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_drop = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_drain = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_drain = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_pause = ffi.Int32 Function( ffi.Pointer pcm, ffi.Int32 enable, ); typedef _dart_snd_pcm_pause = int Function( ffi.Pointer pcm, int enable, ); typedef _c_snd_pcm_state = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_state = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_hwsync = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_hwsync = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_delay = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer delayp, ); typedef _dart_snd_pcm_delay = int Function( ffi.Pointer pcm, ffi.Pointer delayp, ); typedef _c_snd_pcm_resume = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_resume = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_htimestamp = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer avail, ffi.Pointer tstamp, ); typedef _dart_snd_pcm_htimestamp = int Function( ffi.Pointer pcm, ffi.Pointer avail, ffi.Pointer tstamp, ); typedef _c_snd_pcm_avail = ffi.Int64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_avail = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_avail_update = ffi.Int64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_avail_update = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_avail_delay = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer availp, ffi.Pointer delayp, ); typedef _dart_snd_pcm_avail_delay = int Function( ffi.Pointer pcm, ffi.Pointer availp, ffi.Pointer delayp, ); typedef _c_snd_pcm_rewindable = ffi.Int64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_rewindable = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_rewind = ffi.Int64 Function( ffi.Pointer pcm, ffi.Uint64 frames, ); typedef _dart_snd_pcm_rewind = int Function( ffi.Pointer pcm, int frames, ); typedef _c_snd_pcm_forwardable = ffi.Int64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_forwardable = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_forward = ffi.Int64 Function( ffi.Pointer pcm, ffi.Uint64 frames, ); typedef _dart_snd_pcm_forward = int Function( ffi.Pointer pcm, int frames, ); typedef _c_snd_pcm_writei = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_pcm_writei = int Function( ffi.Pointer pcm, ffi.Pointer buffer, int size, ); typedef _c_snd_pcm_readi = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_pcm_readi = int Function( ffi.Pointer pcm, ffi.Pointer buffer, int size, ); typedef _c_snd_pcm_writen = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer> bufs, ffi.Uint64 size, ); typedef _dart_snd_pcm_writen = int Function( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ); typedef _c_snd_pcm_readn = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer> bufs, ffi.Uint64 size, ); typedef _dart_snd_pcm_readn = int Function( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ); typedef _c_snd_pcm_wait = ffi.Int32 Function( ffi.Pointer pcm, ffi.Int32 timeout, ); typedef _dart_snd_pcm_wait = int Function( ffi.Pointer pcm, int timeout, ); typedef _c_snd_pcm_link = ffi.Int32 Function( ffi.Pointer pcm1, ffi.Pointer pcm2, ); typedef _dart_snd_pcm_link = int Function( ffi.Pointer pcm1, ffi.Pointer pcm2, ); typedef _c_snd_pcm_unlink = ffi.Int32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_unlink = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_query_chmaps = ffi.Pointer> Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_query_chmaps = ffi.Pointer> Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_query_chmaps_from_hw = ffi.Pointer> Function( ffi.Int32 card, ffi.Int32 dev, ffi.Int32 subdev, ffi.Int32 stream, ); typedef _dart_snd_pcm_query_chmaps_from_hw = ffi.Pointer> Function( int card, int dev, int subdev, int stream, ); typedef _c_snd_pcm_free_chmaps = ffi.Void Function( ffi.Pointer> maps, ); typedef _dart_snd_pcm_free_chmaps = void Function( ffi.Pointer> maps, ); typedef _c_snd_pcm_get_chmap = ffi.Pointer Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_get_chmap = ffi.Pointer Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_set_chmap = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer map, ); typedef _dart_snd_pcm_set_chmap = int Function( ffi.Pointer pcm, ffi.Pointer map, ); typedef _c_snd_pcm_chmap_type_name = ffi.Pointer Function( ffi.Int32 val, ); typedef _dart_snd_pcm_chmap_type_name = ffi.Pointer Function( int val, ); typedef _c_snd_pcm_chmap_name = ffi.Pointer Function( ffi.Int32 val, ); typedef _dart_snd_pcm_chmap_name = ffi.Pointer Function( int val, ); typedef _c_snd_pcm_chmap_long_name = ffi.Pointer Function( ffi.Int32 val, ); typedef _dart_snd_pcm_chmap_long_name = ffi.Pointer Function( int val, ); typedef _c_snd_pcm_chmap_print = ffi.Int32 Function( ffi.Pointer map, ffi.Uint64 maxlen, ffi.Pointer buf, ); typedef _dart_snd_pcm_chmap_print = int Function( ffi.Pointer map, int maxlen, ffi.Pointer buf, ); typedef _c_snd_pcm_chmap_from_string = ffi.Uint32 Function( ffi.Pointer str, ); typedef _dart_snd_pcm_chmap_from_string = int Function( ffi.Pointer str, ); typedef _c_snd_pcm_chmap_parse_string = ffi.Pointer Function( ffi.Pointer str, ); typedef _dart_snd_pcm_chmap_parse_string = ffi.Pointer Function( ffi.Pointer str, ); typedef _c_snd_pcm_recover = ffi.Int32 Function( ffi.Pointer pcm, ffi.Int32 err, ffi.Int32 silent, ); typedef _dart_snd_pcm_recover = int Function( ffi.Pointer pcm, int err, int silent, ); typedef _c_snd_pcm_set_params = ffi.Int32 Function( ffi.Pointer pcm, ffi.Int32 format, ffi.Int32 access, ffi.Uint32 channels, ffi.Uint32 rate, ffi.Int32 soft_resample, ffi.Uint32 latency, ); typedef _dart_snd_pcm_set_params = int Function( ffi.Pointer pcm, int format, int access, int channels, int rate, int soft_resample, int latency, ); typedef _c_snd_pcm_get_params = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer buffer_size, ffi.Pointer period_size, ); typedef _dart_snd_pcm_get_params = int Function( ffi.Pointer pcm, ffi.Pointer buffer_size, ffi.Pointer period_size, ); typedef _c_snd_pcm_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_info_sizeof = int Function(); typedef _c_snd_pcm_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_info_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_stream = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_stream = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_card = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_card = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_subdevice_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_subdevice_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_class = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_class = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_subclass = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_subclass = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_subdevices_count = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_subdevices_count = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_get_subdevices_avail = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_info_get_subdevices_avail = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_info_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_pcm_info_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_pcm_info_set_subdevice = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_pcm_info_set_subdevice = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_pcm_info_set_stream = ffi.Void Function( ffi.Pointer obj, ffi.Int32 val, ); typedef _dart_snd_pcm_info_set_stream = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_pcm_hw_params_any = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_any = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_mmap_sample_resolution = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_mmap_sample_resolution = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_double = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_double = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_batch = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_batch = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_block_transfer = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_block_transfer = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_monotonic = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_monotonic = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_overrange = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_overrange = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_pause = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_pause = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_resume = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_resume = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_half_duplex = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_half_duplex = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_is_joint_duplex = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_is_joint_duplex = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_sync_start = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_sync_start = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_can_disable_period_wakeup = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_can_disable_period_wakeup = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_supports_audio_wallclock_ts = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_supports_audio_wallclock_ts = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_supports_audio_ts_type = ffi.Int32 Function( ffi.Pointer params, ffi.Int32 type, ); typedef _dart_snd_pcm_hw_params_supports_audio_ts_type = int Function( ffi.Pointer params, int type, ); typedef _c_snd_pcm_hw_params_get_rate_numden = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer rate_num, ffi.Pointer rate_den, ); typedef _dart_snd_pcm_hw_params_get_rate_numden = int Function( ffi.Pointer params, ffi.Pointer rate_num, ffi.Pointer rate_den, ); typedef _c_snd_pcm_hw_params_get_sbits = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_get_sbits = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_get_fifo_size = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_get_fifo_size = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_hw_params_sizeof = int Function(); typedef _c_snd_pcm_hw_params_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_hw_params_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_hw_params_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_hw_params_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_hw_params_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_hw_params_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_hw_params_get_access = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer _access, ); typedef _dart_snd_pcm_hw_params_get_access = int Function( ffi.Pointer params, ffi.Pointer _access, ); typedef _c_snd_pcm_hw_params_test_access = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 _access, ); typedef _dart_snd_pcm_hw_params_test_access = int Function( ffi.Pointer pcm, ffi.Pointer params, int _access, ); typedef _c_snd_pcm_hw_params_set_access = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 _access, ); typedef _dart_snd_pcm_hw_params_set_access = int Function( ffi.Pointer pcm, ffi.Pointer params, int _access, ); typedef _c_snd_pcm_hw_params_set_access_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ); typedef _dart_snd_pcm_hw_params_set_access_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ); typedef _c_snd_pcm_hw_params_set_access_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ); typedef _dart_snd_pcm_hw_params_set_access_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer _access, ); typedef _c_snd_pcm_hw_params_set_access_mask = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_set_access_mask = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_access_mask = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_get_access_mask = int Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_format = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_format = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_test_format = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_hw_params_test_format = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_format = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_hw_params_set_format = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_format_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ); typedef _dart_snd_pcm_hw_params_set_format_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ); typedef _c_snd_pcm_hw_params_set_format_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ); typedef _dart_snd_pcm_hw_params_set_format_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer format, ); typedef _c_snd_pcm_hw_params_set_format_mask = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_set_format_mask = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_format_mask = ffi.Void Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_get_format_mask = void Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_subformat = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer subformat, ); typedef _dart_snd_pcm_hw_params_get_subformat = int Function( ffi.Pointer params, ffi.Pointer subformat, ); typedef _c_snd_pcm_hw_params_test_subformat = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 subformat, ); typedef _dart_snd_pcm_hw_params_test_subformat = int Function( ffi.Pointer pcm, ffi.Pointer params, int subformat, ); typedef _c_snd_pcm_hw_params_set_subformat = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 subformat, ); typedef _dart_snd_pcm_hw_params_set_subformat = int Function( ffi.Pointer pcm, ffi.Pointer params, int subformat, ); typedef _c_snd_pcm_hw_params_set_subformat_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ); typedef _dart_snd_pcm_hw_params_set_subformat_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ); typedef _c_snd_pcm_hw_params_set_subformat_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ); typedef _dart_snd_pcm_hw_params_set_subformat_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer subformat, ); typedef _c_snd_pcm_hw_params_set_subformat_mask = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_set_subformat_mask = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_subformat_mask = ffi.Void Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _dart_snd_pcm_hw_params_get_subformat_mask = void Function( ffi.Pointer params, ffi.Pointer mask, ); typedef _c_snd_pcm_hw_params_get_channels = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_channels = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_channels_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_channels_min = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_channels_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_channels_max = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_test_channels = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_hw_params_test_channels = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_channels = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_hw_params_set_channels = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_channels_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_channels_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_channels_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_channels_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_channels_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_pcm_hw_params_set_channels_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_pcm_hw_params_set_channels_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_channels_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_channels_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_channels_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_channels_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_channels_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_rate = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_rate = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_rate_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_rate_min = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_rate_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_rate_max = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_rate = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_rate = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_rate = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_rate = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_rate_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_rate_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_rate_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_rate_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_rate_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_rate_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_rate_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_rate_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_rate_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_rate_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_rate_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_rate_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_rate_resample = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_hw_params_set_rate_resample = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_get_rate_resample = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_rate_resample = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_export_buffer = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_hw_params_set_export_buffer = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_get_export_buffer = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_export_buffer = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_period_wakeup = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_hw_params_set_period_wakeup = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_get_period_wakeup = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_period_wakeup = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_period_time = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_time = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_period_time_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_time_min = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_period_time_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_time_max = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_period_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_period_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_period_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_period_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_period_time_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_time_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_time_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_time_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_time_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_period_time_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_period_time_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_time_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_time_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_time_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_time_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_time_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_period_size = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_size = int Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_period_size_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_size_min = int Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_period_size_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_period_size_max = int Function( ffi.Pointer params, ffi.Pointer frames, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_period_size = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_period_size = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_period_size = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_period_size = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_period_size_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_size_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_size_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_size_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_size_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_period_size_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_period_size_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_size_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_size_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_size_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_size_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_period_size_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_period_size_integer = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_set_period_size_integer = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_get_periods = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_periods = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_periods_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_periods_min = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_periods_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_periods_max = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_periods = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_periods = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_periods = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_periods = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_periods_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_periods_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_periods_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_periods_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_periods_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_periods_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_periods_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_periods_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_periods_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_periods_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_periods_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_periods_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_periods_integer = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _dart_snd_pcm_hw_params_set_periods_integer = int Function( ffi.Pointer pcm, ffi.Pointer params, ); typedef _c_snd_pcm_hw_params_get_buffer_time = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_buffer_time = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_buffer_time_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_buffer_time_min = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_buffer_time_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_buffer_time_max = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_buffer_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_buffer_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_buffer_time_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_buffer_time_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_buffer_size = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_buffer_size = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_buffer_size_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_buffer_size_min = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_buffer_size_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_buffer_size_max = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_test_buffer_size = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_hw_params_test_buffer_size = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_buffer_size = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_hw_params_set_buffer_size_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_buffer_size_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_buffer_size_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_pcm_hw_params_set_buffer_size_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_buffer_size_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_set_buffer_size_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_set_buffer_size_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_min_align = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_hw_params_get_min_align = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_sw_params_sizeof = int Function(); typedef _c_snd_pcm_sw_params_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_sw_params_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_sw_params_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_sw_params_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_sw_params_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_sw_params_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_sw_params_get_boundary = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_boundary = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_tstamp_mode = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_sw_params_set_tstamp_mode = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_tstamp_mode = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_tstamp_mode = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_tstamp_type = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_sw_params_set_tstamp_type = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_tstamp_type = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_tstamp_type = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_avail_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_avail_min = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_avail_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_avail_min = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_period_event = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_sw_params_set_period_event = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_period_event = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_period_event = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_start_threshold = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_start_threshold = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_start_threshold = ffi.Int32 Function( ffi.Pointer paramsm, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_start_threshold = int Function( ffi.Pointer paramsm, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_stop_threshold = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_stop_threshold = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_stop_threshold = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_stop_threshold = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_silence_threshold = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_silence_threshold = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_silence_threshold = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_silence_threshold = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_silence_size = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_silence_size = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_silence_size = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_silence_size = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_access_mask_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_access_mask_sizeof = int Function(); typedef _c_snd_pcm_access_mask_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_access_mask_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_access_mask_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_access_mask_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_access_mask_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_access_mask_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_access_mask_none = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_access_mask_none = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_access_mask_any = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_access_mask_any = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_access_mask_test = ffi.Int32 Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_access_mask_test = int Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_access_mask_empty = ffi.Int32 Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_access_mask_empty = int Function( ffi.Pointer mask, ); typedef _c_snd_pcm_access_mask_set = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_access_mask_set = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_access_mask_reset = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_access_mask_reset = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_format_mask_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_format_mask_sizeof = int Function(); typedef _c_snd_pcm_format_mask_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_format_mask_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_format_mask_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_format_mask_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_format_mask_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_format_mask_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_format_mask_none = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_format_mask_none = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_format_mask_any = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_format_mask_any = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_format_mask_test = ffi.Int32 Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_format_mask_test = int Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_format_mask_empty = ffi.Int32 Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_format_mask_empty = int Function( ffi.Pointer mask, ); typedef _c_snd_pcm_format_mask_set = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_format_mask_set = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_format_mask_reset = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_format_mask_reset = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_subformat_mask_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_subformat_mask_sizeof = int Function(); typedef _c_snd_pcm_subformat_mask_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_subformat_mask_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_subformat_mask_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_subformat_mask_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_subformat_mask_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_subformat_mask_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_subformat_mask_none = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_subformat_mask_none = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_subformat_mask_any = ffi.Void Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_subformat_mask_any = void Function( ffi.Pointer mask, ); typedef _c_snd_pcm_subformat_mask_test = ffi.Int32 Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_subformat_mask_test = int Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_subformat_mask_empty = ffi.Int32 Function( ffi.Pointer mask, ); typedef _dart_snd_pcm_subformat_mask_empty = int Function( ffi.Pointer mask, ); typedef _c_snd_pcm_subformat_mask_set = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_subformat_mask_set = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_subformat_mask_reset = ffi.Void Function( ffi.Pointer mask, ffi.Int32 val, ); typedef _dart_snd_pcm_subformat_mask_reset = void Function( ffi.Pointer mask, int val, ); typedef _c_snd_pcm_status_sizeof = ffi.Uint64 Function(); typedef _dart_snd_pcm_status_sizeof = int Function(); typedef _c_snd_pcm_status_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_status_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_status_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_free = void Function( ffi.Pointer obj, ); typedef _c_snd_pcm_status_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_pcm_status_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_pcm_status_get_state = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_get_state = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_status_get_trigger_tstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_trigger_tstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_trigger_htstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_trigger_htstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_tstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_tstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_htstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_htstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_audio_htstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_audio_htstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_driver_htstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_pcm_status_get_driver_htstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_pcm_status_get_audio_htstamp_report = ffi.Void Function( ffi.Pointer obj, ffi.Pointer audio_tstamp_report, ); typedef _dart_snd_pcm_status_get_audio_htstamp_report = void Function( ffi.Pointer obj, ffi.Pointer audio_tstamp_report, ); typedef _c_snd_pcm_status_set_audio_htstamp_config = ffi.Void Function( ffi.Pointer obj, ffi.Pointer audio_tstamp_config, ); typedef _dart_snd_pcm_status_set_audio_htstamp_config = void Function( ffi.Pointer obj, ffi.Pointer audio_tstamp_config, ); typedef _c_snd_pcm_status_get_delay = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_get_delay = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_status_get_avail = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_get_avail = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_status_get_avail_max = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_get_avail_max = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_status_get_overrange = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_pcm_status_get_overrange = int Function( ffi.Pointer obj, ); typedef _c_snd_pcm_type_name = ffi.Pointer Function( ffi.Int32 type, ); typedef _dart_snd_pcm_type_name = ffi.Pointer Function( int type, ); typedef _c_snd_pcm_stream_name = ffi.Pointer Function( ffi.Int32 stream, ); typedef _dart_snd_pcm_stream_name = ffi.Pointer Function( int stream, ); typedef _c_snd_pcm_access_name = ffi.Pointer Function( ffi.Int32 _access, ); typedef _dart_snd_pcm_access_name = ffi.Pointer Function( int _access, ); typedef _c_snd_pcm_format_name = ffi.Pointer Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_name = ffi.Pointer Function( int format, ); typedef _c_snd_pcm_format_description = ffi.Pointer Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_description = ffi.Pointer Function( int format, ); typedef _c_snd_pcm_subformat_name = ffi.Pointer Function( ffi.Int32 subformat, ); typedef _dart_snd_pcm_subformat_name = ffi.Pointer Function( int subformat, ); typedef _c_snd_pcm_subformat_description = ffi.Pointer Function( ffi.Int32 subformat, ); typedef _dart_snd_pcm_subformat_description = ffi.Pointer Function( int subformat, ); typedef _c_snd_pcm_format_value = ffi.Int32 Function( ffi.Pointer name, ); typedef _dart_snd_pcm_format_value = int Function( ffi.Pointer name, ); typedef _c_snd_pcm_tstamp_mode_name = ffi.Pointer Function( ffi.Int32 mode, ); typedef _dart_snd_pcm_tstamp_mode_name = ffi.Pointer Function( int mode, ); typedef _c_snd_pcm_state_name = ffi.Pointer Function( ffi.Int32 state, ); typedef _dart_snd_pcm_state_name = ffi.Pointer Function( int state, ); typedef _c_snd_pcm_dump = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _dart_snd_pcm_dump = int Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _c_snd_pcm_dump_hw_setup = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _dart_snd_pcm_dump_hw_setup = int Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _c_snd_pcm_dump_sw_setup = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _dart_snd_pcm_dump_sw_setup = int Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _c_snd_pcm_dump_setup = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _dart_snd_pcm_dump_setup = int Function( ffi.Pointer pcm, ffi.Pointer out, ); typedef _c_snd_pcm_hw_params_dump = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer out, ); typedef _dart_snd_pcm_hw_params_dump = int Function( ffi.Pointer params, ffi.Pointer out, ); typedef _c_snd_pcm_sw_params_dump = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer out, ); typedef _dart_snd_pcm_sw_params_dump = int Function( ffi.Pointer params, ffi.Pointer out, ); typedef _c_snd_pcm_status_dump = ffi.Int32 Function( ffi.Pointer status, ffi.Pointer out, ); typedef _dart_snd_pcm_status_dump = int Function( ffi.Pointer status, ffi.Pointer out, ); typedef _c_snd_pcm_mmap_begin = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer> areas, ffi.Pointer offset, ffi.Pointer frames, ); typedef _dart_snd_pcm_mmap_begin = int Function( ffi.Pointer pcm, ffi.Pointer> areas, ffi.Pointer offset, ffi.Pointer frames, ); typedef _c_snd_pcm_mmap_commit = ffi.Int64 Function( ffi.Pointer pcm, ffi.Uint64 offset, ffi.Uint64 frames, ); typedef _dart_snd_pcm_mmap_commit = int Function( ffi.Pointer pcm, int offset, int frames, ); typedef _c_snd_pcm_mmap_writei = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_pcm_mmap_writei = int Function( ffi.Pointer pcm, ffi.Pointer buffer, int size, ); typedef _c_snd_pcm_mmap_readi = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_pcm_mmap_readi = int Function( ffi.Pointer pcm, ffi.Pointer buffer, int size, ); typedef _c_snd_pcm_mmap_writen = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer> bufs, ffi.Uint64 size, ); typedef _dart_snd_pcm_mmap_writen = int Function( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ); typedef _c_snd_pcm_mmap_readn = ffi.Int64 Function( ffi.Pointer pcm, ffi.Pointer> bufs, ffi.Uint64 size, ); typedef _dart_snd_pcm_mmap_readn = int Function( ffi.Pointer pcm, ffi.Pointer> bufs, int size, ); typedef _c_snd_pcm_format_signed = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_signed = int Function( int format, ); typedef _c_snd_pcm_format_unsigned = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_unsigned = int Function( int format, ); typedef _c_snd_pcm_format_linear = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_linear = int Function( int format, ); typedef _c_snd_pcm_format_float = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_float = int Function( int format, ); typedef _c_snd_pcm_format_little_endian = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_little_endian = int Function( int format, ); typedef _c_snd_pcm_format_big_endian = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_big_endian = int Function( int format, ); typedef _c_snd_pcm_format_cpu_endian = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_cpu_endian = int Function( int format, ); typedef _c_snd_pcm_format_width = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_width = int Function( int format, ); typedef _c_snd_pcm_format_physical_width = ffi.Int32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_physical_width = int Function( int format, ); typedef _c_snd_pcm_build_linear_format = ffi.Int32 Function( ffi.Int32 width, ffi.Int32 pwidth, ffi.Int32 unsignd, ffi.Int32 big_endian, ); typedef _dart_snd_pcm_build_linear_format = int Function( int width, int pwidth, int unsignd, int big_endian, ); typedef _c_snd_pcm_format_size = ffi.Int64 Function( ffi.Int32 format, ffi.Uint64 samples, ); typedef _dart_snd_pcm_format_size = int Function( int format, int samples, ); typedef _c_snd_pcm_format_silence = ffi.Uint8 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_silence = int Function( int format, ); typedef _c_snd_pcm_format_silence_16 = ffi.Uint16 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_silence_16 = int Function( int format, ); typedef _c_snd_pcm_format_silence_32 = ffi.Uint32 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_silence_32 = int Function( int format, ); typedef _c_snd_pcm_format_silence_64 = ffi.Uint64 Function( ffi.Int32 format, ); typedef _dart_snd_pcm_format_silence_64 = int Function( int format, ); typedef _c_snd_pcm_format_set_silence = ffi.Int32 Function( ffi.Int32 format, ffi.Pointer buf, ffi.Uint32 samples, ); typedef _dart_snd_pcm_format_set_silence = int Function( int format, ffi.Pointer buf, int samples, ); typedef _c_snd_pcm_bytes_to_frames = ffi.Int64 Function( ffi.Pointer pcm, ffi.Int64 bytes, ); typedef _dart_snd_pcm_bytes_to_frames = int Function( ffi.Pointer pcm, int bytes, ); typedef _c_snd_pcm_frames_to_bytes = ffi.Int64 Function( ffi.Pointer pcm, ffi.Int64 frames, ); typedef _dart_snd_pcm_frames_to_bytes = int Function( ffi.Pointer pcm, int frames, ); typedef _c_snd_pcm_bytes_to_samples = ffi.Int64 Function( ffi.Pointer pcm, ffi.Int64 bytes, ); typedef _dart_snd_pcm_bytes_to_samples = int Function( ffi.Pointer pcm, int bytes, ); typedef _c_snd_pcm_samples_to_bytes = ffi.Int64 Function( ffi.Pointer pcm, ffi.Int64 samples, ); typedef _dart_snd_pcm_samples_to_bytes = int Function( ffi.Pointer pcm, int samples, ); typedef _c_snd_pcm_area_silence = ffi.Int32 Function( ffi.Pointer dst_channel, ffi.Uint64 dst_offset, ffi.Uint32 samples, ffi.Int32 format, ); typedef _dart_snd_pcm_area_silence = int Function( ffi.Pointer dst_channel, int dst_offset, int samples, int format, ); typedef _c_snd_pcm_areas_silence = ffi.Int32 Function( ffi.Pointer dst_channels, ffi.Uint64 dst_offset, ffi.Uint32 channels, ffi.Uint64 frames, ffi.Int32 format, ); typedef _dart_snd_pcm_areas_silence = int Function( ffi.Pointer dst_channels, int dst_offset, int channels, int frames, int format, ); typedef _c_snd_pcm_area_copy = ffi.Int32 Function( ffi.Pointer dst_channel, ffi.Uint64 dst_offset, ffi.Pointer src_channel, ffi.Uint64 src_offset, ffi.Uint32 samples, ffi.Int32 format, ); typedef _dart_snd_pcm_area_copy = int Function( ffi.Pointer dst_channel, int dst_offset, ffi.Pointer src_channel, int src_offset, int samples, int format, ); typedef _c_snd_pcm_areas_copy = ffi.Int32 Function( ffi.Pointer dst_channels, ffi.Uint64 dst_offset, ffi.Pointer src_channels, ffi.Uint64 src_offset, ffi.Uint32 channels, ffi.Uint64 frames, ffi.Int32 format, ); typedef _dart_snd_pcm_areas_copy = int Function( ffi.Pointer dst_channels, int dst_offset, ffi.Pointer src_channels, int src_offset, int channels, int frames, int format, ); typedef _c_snd_pcm_areas_copy_wrap = ffi.Int32 Function( ffi.Pointer dst_channels, ffi.Uint64 dst_offset, ffi.Uint64 dst_size, ffi.Pointer src_channels, ffi.Uint64 src_offset, ffi.Uint64 src_size, ffi.Uint32 channels, ffi.Uint64 frames, ffi.Int32 format, ); typedef _dart_snd_pcm_areas_copy_wrap = int Function( ffi.Pointer dst_channels, int dst_offset, int dst_size, ffi.Pointer src_channels, int src_offset, int src_size, int channels, int frames, int format, ); typedef _c_snd_pcm_hook_get_pcm = ffi.Pointer Function( ffi.Pointer hook, ); typedef _dart_snd_pcm_hook_get_pcm = ffi.Pointer Function( ffi.Pointer hook, ); typedef _c_snd_pcm_hook_get_private = ffi.Pointer Function( ffi.Pointer hook, ); typedef _dart_snd_pcm_hook_get_private = ffi.Pointer Function( ffi.Pointer hook, ); typedef _c_snd_pcm_hook_set_private = ffi.Void Function( ffi.Pointer hook, ffi.Pointer private_data, ); typedef _dart_snd_pcm_hook_set_private = void Function( ffi.Pointer hook, ffi.Pointer private_data, ); typedef snd_pcm_hook_func_t = ffi.Int32 Function( ffi.Pointer, ); typedef _c_snd_pcm_hook_add = ffi.Int32 Function( ffi.Pointer> hookp, ffi.Pointer pcm, ffi.Int32 type, ffi.Pointer> func, ffi.Pointer private_data, ); typedef _dart_snd_pcm_hook_add = int Function( ffi.Pointer> hookp, ffi.Pointer pcm, int type, ffi.Pointer> func, ffi.Pointer private_data, ); typedef _c_snd_pcm_hook_remove = ffi.Int32 Function( ffi.Pointer hook, ); typedef _dart_snd_pcm_hook_remove = int Function( ffi.Pointer hook, ); typedef _c_snd_pcm_meter_get_bufsize = ffi.Uint64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_meter_get_bufsize = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_meter_get_channels = ffi.Uint32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_meter_get_channels = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_meter_get_rate = ffi.Uint32 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_meter_get_rate = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_meter_get_now = ffi.Uint64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_meter_get_now = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_meter_get_boundary = ffi.Uint64 Function( ffi.Pointer pcm, ); typedef _dart_snd_pcm_meter_get_boundary = int Function( ffi.Pointer pcm, ); typedef _c_snd_pcm_meter_add_scope = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer scope, ); typedef _dart_snd_pcm_meter_add_scope = int Function( ffi.Pointer pcm, ffi.Pointer scope, ); typedef _c_snd_pcm_meter_search_scope = ffi.Pointer Function( ffi.Pointer pcm, ffi.Pointer name, ); typedef _dart_snd_pcm_meter_search_scope = ffi.Pointer Function( ffi.Pointer pcm, ffi.Pointer name, ); typedef _c_snd_pcm_scope_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_pcm_scope_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_pcm_scope_set_ops = ffi.Void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _dart_snd_pcm_scope_set_ops = void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _c_snd_pcm_scope_set_name = ffi.Void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _dart_snd_pcm_scope_set_name = void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _c_snd_pcm_scope_get_name = ffi.Pointer Function( ffi.Pointer scope, ); typedef _dart_snd_pcm_scope_get_name = ffi.Pointer Function( ffi.Pointer scope, ); typedef _c_snd_pcm_scope_get_callback_private = ffi.Pointer Function( ffi.Pointer scope, ); typedef _dart_snd_pcm_scope_get_callback_private = ffi.Pointer Function( ffi.Pointer scope, ); typedef _c_snd_pcm_scope_set_callback_private = ffi.Void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _dart_snd_pcm_scope_set_callback_private = void Function( ffi.Pointer scope, ffi.Pointer val, ); typedef _c_snd_pcm_scope_s16_open = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer name, ffi.Pointer> scopep, ); typedef _dart_snd_pcm_scope_s16_open = int Function( ffi.Pointer pcm, ffi.Pointer name, ffi.Pointer> scopep, ); typedef _c_snd_pcm_scope_s16_get_channel_buffer = ffi.Pointer Function( ffi.Pointer scope, ffi.Uint32 channel, ); typedef _dart_snd_pcm_scope_s16_get_channel_buffer = ffi.Pointer Function( ffi.Pointer scope, int channel, ); typedef _c_snd_spcm_init = ffi.Int32 Function( ffi.Pointer pcm, ffi.Uint32 rate, ffi.Uint32 channels, ffi.Int32 format, ffi.Int32 subformat, ffi.Int32 latency, ffi.Int32 _access, ffi.Int32 xrun_type, ); typedef _dart_snd_spcm_init = int Function( ffi.Pointer pcm, int rate, int channels, int format, int subformat, int latency, int _access, int xrun_type, ); typedef _c_snd_spcm_init_duplex = ffi.Int32 Function( ffi.Pointer playback_pcm, ffi.Pointer capture_pcm, ffi.Uint32 rate, ffi.Uint32 channels, ffi.Int32 format, ffi.Int32 subformat, ffi.Int32 latency, ffi.Int32 _access, ffi.Int32 xrun_type, ffi.Int32 duplex_type, ); typedef _dart_snd_spcm_init_duplex = int Function( ffi.Pointer playback_pcm, ffi.Pointer capture_pcm, int rate, int channels, int format, int subformat, int latency, int _access, int xrun_type, int duplex_type, ); typedef _c_snd_spcm_init_get_params = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer rate, ffi.Pointer buffer_size, ffi.Pointer period_size, ); typedef _dart_snd_spcm_init_get_params = int Function( ffi.Pointer pcm, ffi.Pointer rate, ffi.Pointer buffer_size, ffi.Pointer period_size, ); typedef _c_snd_pcm_start_mode_name = ffi.Pointer Function( ffi.Int32 mode, ); typedef _dart_snd_pcm_start_mode_name = ffi.Pointer Function( int mode, ); typedef _c_snd_pcm_xrun_mode_name = ffi.Pointer Function( ffi.Int32 mode, ); typedef _dart_snd_pcm_xrun_mode_name = ffi.Pointer Function( int mode, ); typedef _c_snd_pcm_sw_params_set_start_mode = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_sw_params_set_start_mode = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_start_mode = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_sw_params_get_start_mode = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_sw_params_set_xrun_mode = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_pcm_sw_params_set_xrun_mode = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_xrun_mode = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_pcm_sw_params_get_xrun_mode = int Function( ffi.Pointer params, ); typedef _c_snd_pcm_sw_params_set_xfer_align = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_pcm_sw_params_set_xfer_align = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_xfer_align = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_xfer_align = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_sw_params_set_sleep_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ); typedef _dart_snd_pcm_sw_params_set_sleep_min = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, ); typedef _c_snd_pcm_sw_params_get_sleep_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ); typedef _dart_snd_pcm_sw_params_get_sleep_min = int Function( ffi.Pointer params, ffi.Pointer val, ); typedef _c_snd_pcm_hw_params_get_tick_time = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_tick_time = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_tick_time_min = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_tick_time_min = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_get_tick_time_max = ffi.Int32 Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_get_tick_time_max = int Function( ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_test_tick_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_test_tick_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_tick_time = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Uint32 val, ffi.Int32 dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time = int Function( ffi.Pointer pcm, ffi.Pointer params, int val, int dir, ); typedef _c_snd_pcm_hw_params_set_tick_time_min = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_min = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_tick_time_max = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_max = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_tick_time_minmax = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_minmax = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer min, ffi.Pointer mindir, ffi.Pointer max, ffi.Pointer maxdir, ); typedef _c_snd_pcm_hw_params_set_tick_time_near = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_near = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_tick_time_first = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_first = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_pcm_hw_params_set_tick_time_last = ffi.Int32 Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _dart_snd_pcm_hw_params_set_tick_time_last = int Function( ffi.Pointer pcm, ffi.Pointer params, ffi.Pointer val, ffi.Pointer dir, ); typedef _c_snd_rawmidi_open = ffi.Int32 Function( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_rawmidi_open = int Function( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, int mode, ); typedef _c_snd_rawmidi_open_lconf = ffi.Int32 Function( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_rawmidi_open_lconf = int Function( ffi.Pointer> in_rmidi, ffi.Pointer> out_rmidi, ffi.Pointer name, int mode, ffi.Pointer lconf, ); typedef _c_snd_rawmidi_close = ffi.Int32 Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_close = int Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_poll_descriptors_count = int Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_poll_descriptors = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_rawmidi_poll_descriptors = int Function( ffi.Pointer rmidi, ffi.Pointer pfds, int space, ); typedef _c_snd_rawmidi_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer rawmidi, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revent, ); typedef _dart_snd_rawmidi_poll_descriptors_revents = int Function( ffi.Pointer rawmidi, ffi.Pointer pfds, int nfds, ffi.Pointer revent, ); typedef _c_snd_rawmidi_nonblock = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Int32 nonblock, ); typedef _dart_snd_rawmidi_nonblock = int Function( ffi.Pointer rmidi, int nonblock, ); typedef _c_snd_rawmidi_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_rawmidi_info_sizeof = int Function(); typedef _c_snd_rawmidi_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_rawmidi_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_rawmidi_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_rawmidi_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_rawmidi_info_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_stream = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_stream = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_card = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_card = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_flags = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_flags = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_subdevice_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_subdevice_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_subdevices_count = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_subdevices_count = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_get_subdevices_avail = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_info_get_subdevices_avail = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_info_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_rawmidi_info_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_rawmidi_info_set_subdevice = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_rawmidi_info_set_subdevice = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_rawmidi_info_set_stream = ffi.Void Function( ffi.Pointer obj, ffi.Int32 val, ); typedef _dart_snd_rawmidi_info_set_stream = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_rawmidi_info = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer info, ); typedef _dart_snd_rawmidi_info = int Function( ffi.Pointer rmidi, ffi.Pointer info, ); typedef _c_snd_rawmidi_params_sizeof = ffi.Uint64 Function(); typedef _dart_snd_rawmidi_params_sizeof = int Function(); typedef _c_snd_rawmidi_params_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_rawmidi_params_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_rawmidi_params_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_params_free = void Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_params_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_rawmidi_params_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_rawmidi_params_set_buffer_size = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_rawmidi_params_set_buffer_size = int Function( ffi.Pointer rmidi, ffi.Pointer params, int val, ); typedef _c_snd_rawmidi_params_get_buffer_size = ffi.Uint64 Function( ffi.Pointer params, ); typedef _dart_snd_rawmidi_params_get_buffer_size = int Function( ffi.Pointer params, ); typedef _c_snd_rawmidi_params_set_avail_min = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer params, ffi.Uint64 val, ); typedef _dart_snd_rawmidi_params_set_avail_min = int Function( ffi.Pointer rmidi, ffi.Pointer params, int val, ); typedef _c_snd_rawmidi_params_get_avail_min = ffi.Uint64 Function( ffi.Pointer params, ); typedef _dart_snd_rawmidi_params_get_avail_min = int Function( ffi.Pointer params, ); typedef _c_snd_rawmidi_params_set_no_active_sensing = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer params, ffi.Int32 val, ); typedef _dart_snd_rawmidi_params_set_no_active_sensing = int Function( ffi.Pointer rmidi, ffi.Pointer params, int val, ); typedef _c_snd_rawmidi_params_get_no_active_sensing = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_rawmidi_params_get_no_active_sensing = int Function( ffi.Pointer params, ); typedef _c_snd_rawmidi_params = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer params, ); typedef _dart_snd_rawmidi_params = int Function( ffi.Pointer rmidi, ffi.Pointer params, ); typedef _c_snd_rawmidi_params_current = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer params, ); typedef _dart_snd_rawmidi_params_current = int Function( ffi.Pointer rmidi, ffi.Pointer params, ); typedef _c_snd_rawmidi_status_sizeof = ffi.Uint64 Function(); typedef _dart_snd_rawmidi_status_sizeof = int Function(); typedef _c_snd_rawmidi_status_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_rawmidi_status_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_rawmidi_status_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_status_free = void Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_status_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_rawmidi_status_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_rawmidi_status_get_tstamp = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_rawmidi_status_get_tstamp = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_rawmidi_status_get_avail = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_status_get_avail = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_status_get_xruns = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_rawmidi_status_get_xruns = int Function( ffi.Pointer obj, ); typedef _c_snd_rawmidi_status = ffi.Int32 Function( ffi.Pointer rmidi, ffi.Pointer status, ); typedef _dart_snd_rawmidi_status = int Function( ffi.Pointer rmidi, ffi.Pointer status, ); typedef _c_snd_rawmidi_drain = ffi.Int32 Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_drain = int Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_drop = ffi.Int32 Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_drop = int Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_write = ffi.Int64 Function( ffi.Pointer rmidi, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_rawmidi_write = int Function( ffi.Pointer rmidi, ffi.Pointer buffer, int size, ); typedef _c_snd_rawmidi_read = ffi.Int64 Function( ffi.Pointer rmidi, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_rawmidi_read = int Function( ffi.Pointer rmidi, ffi.Pointer buffer, int size, ); typedef _c_snd_rawmidi_name = ffi.Pointer Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_name = ffi.Pointer Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_type = ffi.Int32 Function( ffi.Pointer rmidi, ); typedef _dart_snd_rawmidi_type = int Function( ffi.Pointer rmidi, ); typedef _c_snd_rawmidi_stream = ffi.Int32 Function( ffi.Pointer rawmidi, ); typedef _dart_snd_rawmidi_stream = int Function( ffi.Pointer rawmidi, ); typedef _c_snd_timer_query_open = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_timer_query_open = int Function( ffi.Pointer> handle, ffi.Pointer name, int mode, ); typedef _c_snd_timer_query_open_lconf = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_timer_query_open_lconf = int Function( ffi.Pointer> handle, ffi.Pointer name, int mode, ffi.Pointer lconf, ); typedef _c_snd_timer_query_close = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_query_close = int Function( ffi.Pointer handle, ); typedef _c_snd_timer_query_next_device = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer tid, ); typedef _dart_snd_timer_query_next_device = int Function( ffi.Pointer handle, ffi.Pointer tid, ); typedef _c_snd_timer_query_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_timer_query_info = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_timer_query_params = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer params, ); typedef _dart_snd_timer_query_params = int Function( ffi.Pointer handle, ffi.Pointer params, ); typedef _c_snd_timer_query_status = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer status, ); typedef _dart_snd_timer_query_status = int Function( ffi.Pointer handle, ffi.Pointer status, ); typedef _c_snd_timer_open = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_timer_open = int Function( ffi.Pointer> handle, ffi.Pointer name, int mode, ); typedef _c_snd_timer_open_lconf = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_timer_open_lconf = int Function( ffi.Pointer> handle, ffi.Pointer name, int mode, ffi.Pointer lconf, ); typedef _c_snd_timer_close = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_close = int Function( ffi.Pointer handle, ); typedef _c_snd_async_add_timer_handler = ffi.Int32 Function( ffi.Pointer> handler, ffi.Pointer timer, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _dart_snd_async_add_timer_handler = int Function( ffi.Pointer> handler, ffi.Pointer timer, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _c_snd_async_handler_get_timer = ffi.Pointer Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_timer = ffi.Pointer Function( ffi.Pointer handler, ); typedef _c_snd_timer_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_poll_descriptors_count = int Function( ffi.Pointer handle, ); typedef _c_snd_timer_poll_descriptors = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_timer_poll_descriptors = int Function( ffi.Pointer handle, ffi.Pointer pfds, int space, ); typedef _c_snd_timer_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer timer, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_timer_poll_descriptors_revents = int Function( ffi.Pointer timer, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_timer_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer timer, ); typedef _dart_snd_timer_info = int Function( ffi.Pointer handle, ffi.Pointer timer, ); typedef _c_snd_timer_params = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer params, ); typedef _dart_snd_timer_params = int Function( ffi.Pointer handle, ffi.Pointer params, ); typedef _c_snd_timer_status = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer status, ); typedef _dart_snd_timer_status = int Function( ffi.Pointer handle, ffi.Pointer status, ); typedef _c_snd_timer_start = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_start = int Function( ffi.Pointer handle, ); typedef _c_snd_timer_stop = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_stop = int Function( ffi.Pointer handle, ); typedef _c_snd_timer_continue = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_timer_continue = int Function( ffi.Pointer handle, ); typedef _c_snd_timer_read = ffi.Int64 Function( ffi.Pointer handle, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_timer_read = int Function( ffi.Pointer handle, ffi.Pointer buffer, int size, ); typedef _c_snd_timer_id_sizeof = ffi.Uint64 Function(); typedef _dart_snd_timer_id_sizeof = int Function(); typedef _c_snd_timer_id_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_timer_id_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_timer_id_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_timer_id_free = void Function( ffi.Pointer obj, ); typedef _c_snd_timer_id_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_timer_id_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_timer_id_set_class = ffi.Void Function( ffi.Pointer id, ffi.Int32 dev_class, ); typedef _dart_snd_timer_id_set_class = void Function( ffi.Pointer id, int dev_class, ); typedef _c_snd_timer_id_get_class = ffi.Int32 Function( ffi.Pointer id, ); typedef _dart_snd_timer_id_get_class = int Function( ffi.Pointer id, ); typedef _c_snd_timer_id_set_sclass = ffi.Void Function( ffi.Pointer id, ffi.Int32 dev_sclass, ); typedef _dart_snd_timer_id_set_sclass = void Function( ffi.Pointer id, int dev_sclass, ); typedef _c_snd_timer_id_get_sclass = ffi.Int32 Function( ffi.Pointer id, ); typedef _dart_snd_timer_id_get_sclass = int Function( ffi.Pointer id, ); typedef _c_snd_timer_id_set_card = ffi.Void Function( ffi.Pointer id, ffi.Int32 card, ); typedef _dart_snd_timer_id_set_card = void Function( ffi.Pointer id, int card, ); typedef _c_snd_timer_id_get_card = ffi.Int32 Function( ffi.Pointer id, ); typedef _dart_snd_timer_id_get_card = int Function( ffi.Pointer id, ); typedef _c_snd_timer_id_set_device = ffi.Void Function( ffi.Pointer id, ffi.Int32 device, ); typedef _dart_snd_timer_id_set_device = void Function( ffi.Pointer id, int device, ); typedef _c_snd_timer_id_get_device = ffi.Int32 Function( ffi.Pointer id, ); typedef _dart_snd_timer_id_get_device = int Function( ffi.Pointer id, ); typedef _c_snd_timer_id_set_subdevice = ffi.Void Function( ffi.Pointer id, ffi.Int32 subdevice, ); typedef _dart_snd_timer_id_set_subdevice = void Function( ffi.Pointer id, int subdevice, ); typedef _c_snd_timer_id_get_subdevice = ffi.Int32 Function( ffi.Pointer id, ); typedef _dart_snd_timer_id_get_subdevice = int Function( ffi.Pointer id, ); typedef _c_snd_timer_ginfo_sizeof = ffi.Uint64 Function(); typedef _dart_snd_timer_ginfo_sizeof = int Function(); typedef _c_snd_timer_ginfo_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_timer_ginfo_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_timer_ginfo_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_free = void Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_timer_ginfo_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_timer_ginfo_set_tid = ffi.Int32 Function( ffi.Pointer obj, ffi.Pointer tid, ); typedef _dart_snd_timer_ginfo_set_tid = int Function( ffi.Pointer obj, ffi.Pointer tid, ); typedef _c_snd_timer_ginfo_get_tid = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_tid = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_flags = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_flags = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_card = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_card = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_resolution = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_resolution = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_resolution_min = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_resolution_min = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_resolution_max = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_resolution_max = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_ginfo_get_clients = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_timer_ginfo_get_clients = int Function( ffi.Pointer obj, ); typedef _c_snd_timer_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_timer_info_sizeof = int Function(); typedef _c_snd_timer_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_timer_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_timer_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_timer_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_timer_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_timer_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_timer_info_is_slave = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_is_slave = int Function( ffi.Pointer info, ); typedef _c_snd_timer_info_get_card = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_get_card = int Function( ffi.Pointer info, ); typedef _c_snd_timer_info_get_id = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_get_id = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_timer_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_timer_info_get_resolution = ffi.Int64 Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_get_resolution = int Function( ffi.Pointer info, ); typedef _c_snd_timer_params_sizeof = ffi.Uint64 Function(); typedef _dart_snd_timer_params_sizeof = int Function(); typedef _c_snd_timer_params_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_timer_params_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_timer_params_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_timer_params_free = void Function( ffi.Pointer obj, ); typedef _c_snd_timer_params_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_timer_params_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_timer_params_set_auto_start = ffi.Int32 Function( ffi.Pointer params, ffi.Int32 auto_start, ); typedef _dart_snd_timer_params_set_auto_start = int Function( ffi.Pointer params, int auto_start, ); typedef _c_snd_timer_params_get_auto_start = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_auto_start = int Function( ffi.Pointer params, ); typedef _c_snd_timer_params_set_exclusive = ffi.Int32 Function( ffi.Pointer params, ffi.Int32 exclusive, ); typedef _dart_snd_timer_params_set_exclusive = int Function( ffi.Pointer params, int exclusive, ); typedef _c_snd_timer_params_get_exclusive = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_exclusive = int Function( ffi.Pointer params, ); typedef _c_snd_timer_params_set_early_event = ffi.Int32 Function( ffi.Pointer params, ffi.Int32 early_event, ); typedef _dart_snd_timer_params_set_early_event = int Function( ffi.Pointer params, int early_event, ); typedef _c_snd_timer_params_get_early_event = ffi.Int32 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_early_event = int Function( ffi.Pointer params, ); typedef _c_snd_timer_params_set_ticks = ffi.Void Function( ffi.Pointer params, ffi.Int64 ticks, ); typedef _dart_snd_timer_params_set_ticks = void Function( ffi.Pointer params, int ticks, ); typedef _c_snd_timer_params_get_ticks = ffi.Int64 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_ticks = int Function( ffi.Pointer params, ); typedef _c_snd_timer_params_set_queue_size = ffi.Void Function( ffi.Pointer params, ffi.Int64 queue_size, ); typedef _dart_snd_timer_params_set_queue_size = void Function( ffi.Pointer params, int queue_size, ); typedef _c_snd_timer_params_get_queue_size = ffi.Int64 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_queue_size = int Function( ffi.Pointer params, ); typedef _c_snd_timer_params_set_filter = ffi.Void Function( ffi.Pointer params, ffi.Uint32 filter, ); typedef _dart_snd_timer_params_set_filter = void Function( ffi.Pointer params, int filter, ); typedef _c_snd_timer_params_get_filter = ffi.Uint32 Function( ffi.Pointer params, ); typedef _dart_snd_timer_params_get_filter = int Function( ffi.Pointer params, ); typedef _c_snd_timer_status_sizeof = ffi.Uint64 Function(); typedef _dart_snd_timer_status_sizeof = int Function(); typedef _c_snd_timer_status_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_timer_status_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_timer_status_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_timer_status_free = void Function( ffi.Pointer obj, ); typedef _c_snd_timer_status_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_timer_status_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_timer_status_get_timestamp = timespec Function( ffi.Pointer status, ); typedef _dart_snd_timer_status_get_timestamp = timespec Function( ffi.Pointer status, ); typedef _c_snd_timer_status_get_resolution = ffi.Int64 Function( ffi.Pointer status, ); typedef _dart_snd_timer_status_get_resolution = int Function( ffi.Pointer status, ); typedef _c_snd_timer_status_get_lost = ffi.Int64 Function( ffi.Pointer status, ); typedef _dart_snd_timer_status_get_lost = int Function( ffi.Pointer status, ); typedef _c_snd_timer_status_get_overrun = ffi.Int64 Function( ffi.Pointer status, ); typedef _dart_snd_timer_status_get_overrun = int Function( ffi.Pointer status, ); typedef _c_snd_timer_status_get_queue = ffi.Int64 Function( ffi.Pointer status, ); typedef _dart_snd_timer_status_get_queue = int Function( ffi.Pointer status, ); typedef _c_snd_timer_info_get_ticks = ffi.Int64 Function( ffi.Pointer info, ); typedef _dart_snd_timer_info_get_ticks = int Function( ffi.Pointer info, ); typedef _c_snd_hwdep_open = ffi.Int32 Function( ffi.Pointer> hwdep, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_hwdep_open = int Function( ffi.Pointer> hwdep, ffi.Pointer name, int mode, ); typedef _c_snd_hwdep_close = ffi.Int32 Function( ffi.Pointer hwdep, ); typedef _dart_snd_hwdep_close = int Function( ffi.Pointer hwdep, ); typedef _c_snd_hwdep_poll_descriptors = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_hwdep_poll_descriptors = int Function( ffi.Pointer hwdep, ffi.Pointer pfds, int space, ); typedef _c_snd_hwdep_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer hwdep, ); typedef _dart_snd_hwdep_poll_descriptors_count = int Function( ffi.Pointer hwdep, ); typedef _c_snd_hwdep_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_hwdep_poll_descriptors_revents = int Function( ffi.Pointer hwdep, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_hwdep_nonblock = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Int32 nonblock, ); typedef _dart_snd_hwdep_nonblock = int Function( ffi.Pointer hwdep, int nonblock, ); typedef _c_snd_hwdep_info = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Pointer info, ); typedef _dart_snd_hwdep_info = int Function( ffi.Pointer hwdep, ffi.Pointer info, ); typedef _c_snd_hwdep_dsp_status = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Pointer status, ); typedef _dart_snd_hwdep_dsp_status = int Function( ffi.Pointer hwdep, ffi.Pointer status, ); typedef _c_snd_hwdep_dsp_load = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Pointer block, ); typedef _dart_snd_hwdep_dsp_load = int Function( ffi.Pointer hwdep, ffi.Pointer block, ); typedef _c_snd_hwdep_ioctl = ffi.Int32 Function( ffi.Pointer hwdep, ffi.Uint32 request, ffi.Pointer arg, ); typedef _dart_snd_hwdep_ioctl = int Function( ffi.Pointer hwdep, int request, ffi.Pointer arg, ); typedef _c_snd_hwdep_write = ffi.Int64 Function( ffi.Pointer hwdep, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_hwdep_write = int Function( ffi.Pointer hwdep, ffi.Pointer buffer, int size, ); typedef _c_snd_hwdep_read = ffi.Int64 Function( ffi.Pointer hwdep, ffi.Pointer buffer, ffi.Uint64 size, ); typedef _dart_snd_hwdep_read = int Function( ffi.Pointer hwdep, ffi.Pointer buffer, int size, ); typedef _c_snd_hwdep_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_hwdep_info_sizeof = int Function(); typedef _c_snd_hwdep_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_hwdep_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_hwdep_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_hwdep_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_hwdep_info_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_get_card = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_get_card = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_get_iface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_info_get_iface = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_info_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_hwdep_info_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_hwdep_dsp_status_sizeof = ffi.Uint64 Function(); typedef _dart_snd_hwdep_dsp_status_sizeof = int Function(); typedef _c_snd_hwdep_dsp_status_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_hwdep_dsp_status_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_hwdep_dsp_status_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_free = void Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_status_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_hwdep_dsp_status_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_hwdep_dsp_status_get_version = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_get_version = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_status_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_status_get_num_dsps = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_get_num_dsps = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_status_get_dsp_loaded = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_get_dsp_loaded = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_status_get_chip_ready = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_status_get_chip_ready = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_sizeof = ffi.Uint64 Function(); typedef _dart_snd_hwdep_dsp_image_sizeof = int Function(); typedef _c_snd_hwdep_dsp_image_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_hwdep_dsp_image_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_hwdep_dsp_image_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_image_free = void Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_hwdep_dsp_image_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_hwdep_dsp_image_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_image_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_image_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_get_image = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_image_get_image = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_get_length = ffi.Uint64 Function( ffi.Pointer obj, ); typedef _dart_snd_hwdep_dsp_image_get_length = int Function( ffi.Pointer obj, ); typedef _c_snd_hwdep_dsp_image_set_index = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 _index, ); typedef _dart_snd_hwdep_dsp_image_set_index = void Function( ffi.Pointer obj, int _index, ); typedef _c_snd_hwdep_dsp_image_set_name = ffi.Void Function( ffi.Pointer obj, ffi.Pointer name, ); typedef _dart_snd_hwdep_dsp_image_set_name = void Function( ffi.Pointer obj, ffi.Pointer name, ); typedef _c_snd_hwdep_dsp_image_set_image = ffi.Void Function( ffi.Pointer obj, ffi.Pointer buffer, ); typedef _dart_snd_hwdep_dsp_image_set_image = void Function( ffi.Pointer obj, ffi.Pointer buffer, ); typedef _c_snd_hwdep_dsp_image_set_length = ffi.Void Function( ffi.Pointer obj, ffi.Uint64 length, ); typedef _dart_snd_hwdep_dsp_image_set_length = void Function( ffi.Pointer obj, int length, ); typedef _c_snd_card_load = ffi.Int32 Function( ffi.Int32 card, ); typedef _dart_snd_card_load = int Function( int card, ); typedef _c_snd_card_next = ffi.Int32 Function( ffi.Pointer card, ); typedef _dart_snd_card_next = int Function( ffi.Pointer card, ); typedef _c_snd_card_get_index = ffi.Int32 Function( ffi.Pointer name, ); typedef _dart_snd_card_get_index = int Function( ffi.Pointer name, ); typedef _c_snd_card_get_name = ffi.Int32 Function( ffi.Int32 card, ffi.Pointer> name, ); typedef _dart_snd_card_get_name = int Function( int card, ffi.Pointer> name, ); typedef _c_snd_card_get_longname = ffi.Int32 Function( ffi.Int32 card, ffi.Pointer> name, ); typedef _dart_snd_card_get_longname = int Function( int card, ffi.Pointer> name, ); typedef _c_snd_device_name_hint = ffi.Int32 Function( ffi.Int32 card, ffi.Pointer iface, ffi.Pointer>> hints, ); typedef _dart_snd_device_name_hint = int Function( int card, ffi.Pointer iface, ffi.Pointer>> hints, ); typedef _c_snd_device_name_free_hint = ffi.Int32 Function( ffi.Pointer> hints, ); typedef _dart_snd_device_name_free_hint = int Function( ffi.Pointer> hints, ); typedef _c_snd_device_name_get_hint = ffi.Pointer Function( ffi.Pointer hint, ffi.Pointer id, ); typedef _dart_snd_device_name_get_hint = ffi.Pointer Function( ffi.Pointer hint, ffi.Pointer id, ); typedef _c_snd_ctl_open = ffi.Int32 Function( ffi.Pointer> ctl, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_ctl_open = int Function( ffi.Pointer> ctl, ffi.Pointer name, int mode, ); typedef _c_snd_ctl_open_lconf = ffi.Int32 Function( ffi.Pointer> ctl, ffi.Pointer name, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_ctl_open_lconf = int Function( ffi.Pointer> ctl, ffi.Pointer name, int mode, ffi.Pointer lconf, ); typedef _c_snd_ctl_open_fallback = ffi.Int32 Function( ffi.Pointer> ctl, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, ffi.Int32 mode, ); typedef _dart_snd_ctl_open_fallback = int Function( ffi.Pointer> ctl, ffi.Pointer root, ffi.Pointer name, ffi.Pointer orig_name, int mode, ); typedef _c_snd_ctl_close = ffi.Int32 Function( ffi.Pointer ctl, ); typedef _dart_snd_ctl_close = int Function( ffi.Pointer ctl, ); typedef _c_snd_ctl_nonblock = ffi.Int32 Function( ffi.Pointer ctl, ffi.Int32 nonblock, ); typedef _dart_snd_ctl_nonblock = int Function( ffi.Pointer ctl, int nonblock, ); typedef _c_snd_async_add_ctl_handler = ffi.Int32 Function( ffi.Pointer> handler, ffi.Pointer ctl, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _dart_snd_async_add_ctl_handler = int Function( ffi.Pointer> handler, ffi.Pointer ctl, ffi.Pointer> callback, ffi.Pointer private_data, ); typedef _c_snd_async_handler_get_ctl = ffi.Pointer Function( ffi.Pointer handler, ); typedef _dart_snd_async_handler_get_ctl = ffi.Pointer Function( ffi.Pointer handler, ); typedef _c_snd_ctl_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer ctl, ); typedef _dart_snd_ctl_poll_descriptors_count = int Function( ffi.Pointer ctl, ); typedef _c_snd_ctl_poll_descriptors = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_ctl_poll_descriptors = int Function( ffi.Pointer ctl, ffi.Pointer pfds, int space, ); typedef _c_snd_ctl_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_ctl_poll_descriptors_revents = int Function( ffi.Pointer ctl, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_ctl_subscribe_events = ffi.Int32 Function( ffi.Pointer ctl, ffi.Int32 subscribe, ); typedef _dart_snd_ctl_subscribe_events = int Function( ffi.Pointer ctl, int subscribe, ); typedef _c_snd_ctl_card_info = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _dart_snd_ctl_card_info = int Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _c_snd_ctl_elem_list = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer list, ); typedef _dart_snd_ctl_elem_list = int Function( ffi.Pointer ctl, ffi.Pointer list, ); typedef _c_snd_ctl_elem_info = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _dart_snd_ctl_elem_info = int Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _c_snd_ctl_elem_read = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer data, ); typedef _dart_snd_ctl_elem_read = int Function( ffi.Pointer ctl, ffi.Pointer data, ); typedef _c_snd_ctl_elem_write = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer data, ); typedef _dart_snd_ctl_elem_write = int Function( ffi.Pointer ctl, ffi.Pointer data, ); typedef _c_snd_ctl_elem_lock = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _dart_snd_ctl_elem_lock = int Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _c_snd_ctl_elem_unlock = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _dart_snd_ctl_elem_unlock = int Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _c_snd_ctl_elem_tlv_read = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ffi.Uint32 tlv_size, ); typedef _dart_snd_ctl_elem_tlv_read = int Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, int tlv_size, ); typedef _c_snd_ctl_elem_tlv_write = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ); typedef _dart_snd_ctl_elem_tlv_write = int Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ); typedef _c_snd_ctl_elem_tlv_command = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ); typedef _dart_snd_ctl_elem_tlv_command = int Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer tlv, ); typedef _c_snd_ctl_hwdep_next_device = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _dart_snd_ctl_hwdep_next_device = int Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _c_snd_ctl_hwdep_info = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _dart_snd_ctl_hwdep_info = int Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _c_snd_ctl_pcm_next_device = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _dart_snd_ctl_pcm_next_device = int Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _c_snd_ctl_pcm_info = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _dart_snd_ctl_pcm_info = int Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _c_snd_ctl_pcm_prefer_subdevice = ffi.Int32 Function( ffi.Pointer ctl, ffi.Int32 subdev, ); typedef _dart_snd_ctl_pcm_prefer_subdevice = int Function( ffi.Pointer ctl, int subdev, ); typedef _c_snd_ctl_rawmidi_next_device = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _dart_snd_ctl_rawmidi_next_device = int Function( ffi.Pointer ctl, ffi.Pointer device, ); typedef _c_snd_ctl_rawmidi_info = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _dart_snd_ctl_rawmidi_info = int Function( ffi.Pointer ctl, ffi.Pointer info, ); typedef _c_snd_ctl_rawmidi_prefer_subdevice = ffi.Int32 Function( ffi.Pointer ctl, ffi.Int32 subdev, ); typedef _dart_snd_ctl_rawmidi_prefer_subdevice = int Function( ffi.Pointer ctl, int subdev, ); typedef _c_snd_ctl_set_power_state = ffi.Int32 Function( ffi.Pointer ctl, ffi.Uint32 state, ); typedef _dart_snd_ctl_set_power_state = int Function( ffi.Pointer ctl, int state, ); typedef _c_snd_ctl_get_power_state = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer state, ); typedef _dart_snd_ctl_get_power_state = int Function( ffi.Pointer ctl, ffi.Pointer state, ); typedef _c_snd_ctl_read = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer event, ); typedef _dart_snd_ctl_read = int Function( ffi.Pointer ctl, ffi.Pointer event, ); typedef _c_snd_ctl_wait = ffi.Int32 Function( ffi.Pointer ctl, ffi.Int32 timeout, ); typedef _dart_snd_ctl_wait = int Function( ffi.Pointer ctl, int timeout, ); typedef _c_snd_ctl_name = ffi.Pointer Function( ffi.Pointer ctl, ); typedef _dart_snd_ctl_name = ffi.Pointer Function( ffi.Pointer ctl, ); typedef _c_snd_ctl_type = ffi.Int32 Function( ffi.Pointer ctl, ); typedef _dart_snd_ctl_type = int Function( ffi.Pointer ctl, ); typedef _c_snd_ctl_elem_type_name = ffi.Pointer Function( ffi.Int32 type, ); typedef _dart_snd_ctl_elem_type_name = ffi.Pointer Function( int type, ); typedef _c_snd_ctl_elem_iface_name = ffi.Pointer Function( ffi.Int32 iface, ); typedef _dart_snd_ctl_elem_iface_name = ffi.Pointer Function( int iface, ); typedef _c_snd_ctl_event_type_name = ffi.Pointer Function( ffi.Int32 type, ); typedef _dart_snd_ctl_event_type_name = ffi.Pointer Function( int type, ); typedef _c_snd_ctl_event_elem_get_mask = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_mask = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_numid = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_event_elem_get_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_event_elem_get_interface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_interface = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_elem_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_elem_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_alloc_space = ffi.Int32 Function( ffi.Pointer obj, ffi.Uint32 entries, ); typedef _dart_snd_ctl_elem_list_alloc_space = int Function( ffi.Pointer obj, int entries, ); typedef _c_snd_ctl_elem_list_free_space = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_list_free_space = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_ascii_elem_id_get = ffi.Pointer Function( ffi.Pointer id, ); typedef _dart_snd_ctl_ascii_elem_id_get = ffi.Pointer Function( ffi.Pointer id, ); typedef _c_snd_ctl_ascii_elem_id_parse = ffi.Int32 Function( ffi.Pointer dst, ffi.Pointer str, ); typedef _dart_snd_ctl_ascii_elem_id_parse = int Function( ffi.Pointer dst, ffi.Pointer str, ); typedef _c_snd_ctl_ascii_value_parse = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer dst, ffi.Pointer info, ffi.Pointer value, ); typedef _dart_snd_ctl_ascii_value_parse = int Function( ffi.Pointer handle, ffi.Pointer dst, ffi.Pointer info, ffi.Pointer value, ); typedef _c_snd_ctl_elem_id_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_elem_id_sizeof = int Function(); typedef _c_snd_ctl_elem_id_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_elem_id_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_elem_id_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_elem_id_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_elem_id_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_numid = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_get_interface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_interface = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_id_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_id_set_numid = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_id_set_numid = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_id_set_interface = ffi.Void Function( ffi.Pointer obj, ffi.Int32 val, ); typedef _dart_snd_ctl_elem_id_set_interface = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_id_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_id_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_id_set_subdevice = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_id_set_subdevice = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_id_set_name = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_ctl_elem_id_set_name = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_ctl_elem_id_set_index = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_id_set_index = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_card_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_card_info_sizeof = int Function(); typedef _c_snd_ctl_card_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_card_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_card_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_card_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_card_info_get_card = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_card = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_id = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_driver = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_driver = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_longname = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_longname = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_mixername = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_mixername = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_card_info_get_components = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_card_info_get_components = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_event_sizeof = int Function(); typedef _c_snd_ctl_event_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_event_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_event_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_event_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_event_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_event_get_type = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_event_get_type = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_elem_list_sizeof = int Function(); typedef _c_snd_ctl_elem_list_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_elem_list_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_elem_list_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_list_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_list_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_elem_list_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_elem_list_set_offset = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_list_set_offset = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_list_get_used = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_list_get_used = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_get_count = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_list_get_count = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_list_get_id = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_list_get_id = void Function( ffi.Pointer obj, int idx, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_list_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_numid = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_list_get_interface = ffi.Int32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_interface = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_list_get_device = ffi.Uint32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_device = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_list_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_subdevice = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_list_get_name = ffi.Pointer Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_name = ffi.Pointer Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_list_get_index = ffi.Uint32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_list_get_index = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_elem_info_sizeof = int Function(); typedef _c_snd_ctl_elem_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_elem_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_elem_info_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_elem_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_elem_info_get_type = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_type = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_readable = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_readable = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_writable = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_writable = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_volatile = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_volatile = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_inactive = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_inactive = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_locked = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_locked = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_tlv_readable = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_tlv_readable = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_tlv_writable = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_tlv_writable = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_tlv_commandable = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_tlv_commandable = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_owner = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_owner = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_is_user = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_is_user = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_owner = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_owner = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_count = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_count = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_min = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_min = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_max = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_max = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_step = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_step = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_min64 = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_min64 = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_max64 = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_max64 = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_step64 = ffi.Int64 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_step64 = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_items = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_items = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_set_item = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_info_set_item = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_info_get_item_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_item_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_dimensions = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_dimensions = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_dimension = ffi.Int32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_info_get_dimension = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_info_set_dimension = ffi.Int32 Function( ffi.Pointer info, ffi.Pointer dimension, ); typedef _dart_snd_ctl_elem_info_set_dimension = int Function( ffi.Pointer info, ffi.Pointer dimension, ); typedef _c_snd_ctl_elem_info_get_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_info_get_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_info_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_numid = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_interface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_interface = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_info_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_info_set_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_info_set_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_info_set_numid = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_info_set_numid = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_info_set_interface = ffi.Void Function( ffi.Pointer obj, ffi.Int32 val, ); typedef _dart_snd_ctl_elem_info_set_interface = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_info_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_info_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_info_set_subdevice = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_info_set_subdevice = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_info_set_name = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_ctl_elem_info_set_name = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_ctl_elem_info_set_index = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_info_set_index = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_add_integer_elem_set = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ffi.Uint32 element_count, ffi.Uint32 member_count, ffi.Int64 min, ffi.Int64 max, ffi.Int64 step, ); typedef _dart_snd_ctl_add_integer_elem_set = int Function( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int min, int max, int step, ); typedef _c_snd_ctl_add_integer64_elem_set = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ffi.Uint32 element_count, ffi.Uint32 member_count, ffi.Int64 min, ffi.Int64 max, ffi.Int64 step, ); typedef _dart_snd_ctl_add_integer64_elem_set = int Function( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int min, int max, int step, ); typedef _c_snd_ctl_add_boolean_elem_set = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ffi.Uint32 element_count, ffi.Uint32 member_count, ); typedef _dart_snd_ctl_add_boolean_elem_set = int Function( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, ); typedef _c_snd_ctl_add_enumerated_elem_set = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ffi.Uint32 element_count, ffi.Uint32 member_count, ffi.Uint32 items, ffi.Pointer> labels, ); typedef _dart_snd_ctl_add_enumerated_elem_set = int Function( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, int items, ffi.Pointer> labels, ); typedef _c_snd_ctl_add_bytes_elem_set = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer info, ffi.Uint32 element_count, ffi.Uint32 member_count, ); typedef _dart_snd_ctl_add_bytes_elem_set = int Function( ffi.Pointer ctl, ffi.Pointer info, int element_count, int member_count, ); typedef _c_snd_ctl_elem_add_integer = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Uint32 count, ffi.Int64 imin, ffi.Int64 imax, ffi.Int64 istep, ); typedef _dart_snd_ctl_elem_add_integer = int Function( ffi.Pointer ctl, ffi.Pointer id, int count, int imin, int imax, int istep, ); typedef _c_snd_ctl_elem_add_integer64 = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Uint32 count, ffi.Int64 imin, ffi.Int64 imax, ffi.Int64 istep, ); typedef _dart_snd_ctl_elem_add_integer64 = int Function( ffi.Pointer ctl, ffi.Pointer id, int count, int imin, int imax, int istep, ); typedef _c_snd_ctl_elem_add_boolean = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Uint32 count, ); typedef _dart_snd_ctl_elem_add_boolean = int Function( ffi.Pointer ctl, ffi.Pointer id, int count, ); typedef _c_snd_ctl_elem_add_enumerated = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Uint32 count, ffi.Uint32 items, ffi.Pointer> names, ); typedef _dart_snd_ctl_elem_add_enumerated = int Function( ffi.Pointer ctl, ffi.Pointer id, int count, int items, ffi.Pointer> names, ); typedef _c_snd_ctl_elem_add_iec958 = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _dart_snd_ctl_elem_add_iec958 = int Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _c_snd_ctl_elem_remove = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _dart_snd_ctl_elem_remove = int Function( ffi.Pointer ctl, ffi.Pointer id, ); typedef _c_snd_ctl_elem_value_sizeof = ffi.Uint64 Function(); typedef _dart_snd_ctl_elem_value_sizeof = int Function(); typedef _c_snd_ctl_elem_value_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_ctl_elem_value_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_ctl_elem_value_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_free = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_clear = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_clear = void Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_ctl_elem_value_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_ctl_elem_value_compare = ffi.Int32 Function( ffi.Pointer left, ffi.Pointer right, ); typedef _dart_snd_ctl_elem_value_compare = int Function( ffi.Pointer left, ffi.Pointer right, ); typedef _c_snd_ctl_elem_value_get_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_value_get_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_value_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_numid = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_interface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_interface = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_set_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_value_set_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_value_set_numid = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_value_set_numid = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_value_set_interface = ffi.Void Function( ffi.Pointer obj, ffi.Int32 val, ); typedef _dart_snd_ctl_elem_value_set_interface = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_value_set_device = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_value_set_device = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_value_set_subdevice = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_value_set_subdevice = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_value_set_name = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_ctl_elem_value_set_name = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_ctl_elem_value_set_index = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_value_set_index = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_ctl_elem_value_get_boolean = ffi.Int32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_value_get_boolean = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_value_get_integer = ffi.Int64 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_value_get_integer = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_value_get_integer64 = ffi.Int64 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_value_get_integer64 = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_value_get_enumerated = ffi.Uint32 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_value_get_enumerated = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_value_get_byte = ffi.Uint8 Function( ffi.Pointer obj, ffi.Uint32 idx, ); typedef _dart_snd_ctl_elem_value_get_byte = int Function( ffi.Pointer obj, int idx, ); typedef _c_snd_ctl_elem_value_set_boolean = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Int64 val, ); typedef _dart_snd_ctl_elem_value_set_boolean = void Function( ffi.Pointer obj, int idx, int val, ); typedef _c_snd_ctl_elem_value_set_integer = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Int64 val, ); typedef _dart_snd_ctl_elem_value_set_integer = void Function( ffi.Pointer obj, int idx, int val, ); typedef _c_snd_ctl_elem_value_set_integer64 = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Int64 val, ); typedef _dart_snd_ctl_elem_value_set_integer64 = void Function( ffi.Pointer obj, int idx, int val, ); typedef _c_snd_ctl_elem_value_set_enumerated = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Uint32 val, ); typedef _dart_snd_ctl_elem_value_set_enumerated = void Function( ffi.Pointer obj, int idx, int val, ); typedef _c_snd_ctl_elem_value_set_byte = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 idx, ffi.Uint8 val, ); typedef _dart_snd_ctl_elem_value_set_byte = void Function( ffi.Pointer obj, int idx, int val, ); typedef _c_snd_ctl_elem_set_bytes = ffi.Void Function( ffi.Pointer obj, ffi.Pointer data, ffi.Uint64 size, ); typedef _dart_snd_ctl_elem_set_bytes = void Function( ffi.Pointer obj, ffi.Pointer data, int size, ); typedef _c_snd_ctl_elem_value_get_bytes = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_ctl_elem_value_get_bytes = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_ctl_elem_value_get_iec958 = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_value_get_iec958 = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_ctl_elem_value_set_iec958 = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_ctl_elem_value_set_iec958 = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_tlv_parse_dB_info = ffi.Int32 Function( ffi.Pointer tlv, ffi.Uint32 tlv_size, ffi.Pointer> db_tlvp, ); typedef _dart_snd_tlv_parse_dB_info = int Function( ffi.Pointer tlv, int tlv_size, ffi.Pointer> db_tlvp, ); typedef _c_snd_tlv_get_dB_range = ffi.Int32 Function( ffi.Pointer tlv, ffi.Int64 rangemin, ffi.Int64 rangemax, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_tlv_get_dB_range = int Function( ffi.Pointer tlv, int rangemin, int rangemax, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_tlv_convert_to_dB = ffi.Int32 Function( ffi.Pointer tlv, ffi.Int64 rangemin, ffi.Int64 rangemax, ffi.Int64 volume, ffi.Pointer db_gain, ); typedef _dart_snd_tlv_convert_to_dB = int Function( ffi.Pointer tlv, int rangemin, int rangemax, int volume, ffi.Pointer db_gain, ); typedef _c_snd_tlv_convert_from_dB = ffi.Int32 Function( ffi.Pointer tlv, ffi.Int64 rangemin, ffi.Int64 rangemax, ffi.Int64 db_gain, ffi.Pointer value, ffi.Int32 xdir, ); typedef _dart_snd_tlv_convert_from_dB = int Function( ffi.Pointer tlv, int rangemin, int rangemax, int db_gain, ffi.Pointer value, int xdir, ); typedef _c_snd_ctl_get_dB_range = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_ctl_get_dB_range = int Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_ctl_convert_to_dB = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Int64 volume, ffi.Pointer db_gain, ); typedef _dart_snd_ctl_convert_to_dB = int Function( ffi.Pointer ctl, ffi.Pointer id, int volume, ffi.Pointer db_gain, ); typedef _c_snd_ctl_convert_from_dB = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer id, ffi.Int64 db_gain, ffi.Pointer value, ffi.Int32 xdir, ); typedef _dart_snd_ctl_convert_from_dB = int Function( ffi.Pointer ctl, ffi.Pointer id, int db_gain, ffi.Pointer value, int xdir, ); typedef _c_snd_hctl_compare_fast = ffi.Int32 Function( ffi.Pointer c1, ffi.Pointer c2, ); typedef _dart_snd_hctl_compare_fast = int Function( ffi.Pointer c1, ffi.Pointer c2, ); typedef _c_snd_hctl_open = ffi.Int32 Function( ffi.Pointer> hctl, ffi.Pointer name, ffi.Int32 mode, ); typedef _dart_snd_hctl_open = int Function( ffi.Pointer> hctl, ffi.Pointer name, int mode, ); typedef _c_snd_hctl_open_ctl = ffi.Int32 Function( ffi.Pointer> hctlp, ffi.Pointer ctl, ); typedef _dart_snd_hctl_open_ctl = int Function( ffi.Pointer> hctlp, ffi.Pointer ctl, ); typedef _c_snd_hctl_close = ffi.Int32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_close = int Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_nonblock = ffi.Int32 Function( ffi.Pointer hctl, ffi.Int32 nonblock, ); typedef _dart_snd_hctl_nonblock = int Function( ffi.Pointer hctl, int nonblock, ); typedef _c_snd_hctl_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_poll_descriptors_count = int Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_poll_descriptors = ffi.Int32 Function( ffi.Pointer hctl, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_hctl_poll_descriptors = int Function( ffi.Pointer hctl, ffi.Pointer pfds, int space, ); typedef _c_snd_hctl_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer ctl, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_hctl_poll_descriptors_revents = int Function( ffi.Pointer ctl, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_hctl_get_count = ffi.Uint32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_get_count = int Function( ffi.Pointer hctl, ); typedef snd_hctl_compare_t = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); typedef _c_snd_hctl_set_compare = ffi.Int32 Function( ffi.Pointer hctl, ffi.Pointer> hsort, ); typedef _dart_snd_hctl_set_compare = int Function( ffi.Pointer hctl, ffi.Pointer> hsort, ); typedef _c_snd_hctl_first_elem = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_first_elem = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_last_elem = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_last_elem = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_find_elem = ffi.Pointer Function( ffi.Pointer hctl, ffi.Pointer id, ); typedef _dart_snd_hctl_find_elem = ffi.Pointer Function( ffi.Pointer hctl, ffi.Pointer id, ); typedef snd_hctl_callback_t = ffi.Int32 Function( ffi.Pointer, ffi.Uint32, ffi.Pointer, ); typedef _c_snd_hctl_set_callback = ffi.Void Function( ffi.Pointer hctl, ffi.Pointer> callback, ); typedef _dart_snd_hctl_set_callback = void Function( ffi.Pointer hctl, ffi.Pointer> callback, ); typedef _c_snd_hctl_set_callback_private = ffi.Void Function( ffi.Pointer hctl, ffi.Pointer data, ); typedef _dart_snd_hctl_set_callback_private = void Function( ffi.Pointer hctl, ffi.Pointer data, ); typedef _c_snd_hctl_get_callback_private = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_get_callback_private = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_load = ffi.Int32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_load = int Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_free = ffi.Int32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_free = int Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_handle_events = ffi.Int32 Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_handle_events = int Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_name = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_name = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_wait = ffi.Int32 Function( ffi.Pointer hctl, ffi.Int32 timeout, ); typedef _dart_snd_hctl_wait = int Function( ffi.Pointer hctl, int timeout, ); typedef _c_snd_hctl_ctl = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _dart_snd_hctl_ctl = ffi.Pointer Function( ffi.Pointer hctl, ); typedef _c_snd_hctl_elem_next = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_hctl_elem_next = ffi.Pointer Function( ffi.Pointer elem, ); typedef _c_snd_hctl_elem_prev = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_hctl_elem_prev = ffi.Pointer Function( ffi.Pointer elem, ); typedef _c_snd_hctl_elem_info = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer info, ); typedef _dart_snd_hctl_elem_info = int Function( ffi.Pointer elem, ffi.Pointer info, ); typedef _c_snd_hctl_elem_read = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer value, ); typedef _dart_snd_hctl_elem_read = int Function( ffi.Pointer elem, ffi.Pointer value, ); typedef _c_snd_hctl_elem_write = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer value, ); typedef _dart_snd_hctl_elem_write = int Function( ffi.Pointer elem, ffi.Pointer value, ); typedef _c_snd_hctl_elem_tlv_read = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer tlv, ffi.Uint32 tlv_size, ); typedef _dart_snd_hctl_elem_tlv_read = int Function( ffi.Pointer elem, ffi.Pointer tlv, int tlv_size, ); typedef _c_snd_hctl_elem_tlv_write = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer tlv, ); typedef _dart_snd_hctl_elem_tlv_write = int Function( ffi.Pointer elem, ffi.Pointer tlv, ); typedef _c_snd_hctl_elem_tlv_command = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer tlv, ); typedef _dart_snd_hctl_elem_tlv_command = int Function( ffi.Pointer elem, ffi.Pointer tlv, ); typedef _c_snd_hctl_elem_get_hctl = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_hctl_elem_get_hctl = ffi.Pointer Function( ffi.Pointer elem, ); typedef _c_snd_hctl_elem_get_id = ffi.Void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _dart_snd_hctl_elem_get_id = void Function( ffi.Pointer obj, ffi.Pointer ptr, ); typedef _c_snd_hctl_elem_get_numid = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_numid = int Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_get_interface = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_interface = int Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_get_device = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_device = int Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_get_subdevice = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_subdevice = int Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_index = int Function( ffi.Pointer obj, ); typedef snd_hctl_elem_callback_t = ffi.Int32 Function( ffi.Pointer, ffi.Uint32, ); typedef _c_snd_hctl_elem_set_callback = ffi.Void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _dart_snd_hctl_elem_set_callback = void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _c_snd_hctl_elem_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_hctl_elem_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_hctl_elem_set_callback_private = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_hctl_elem_set_callback_private = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_sctl_build = ffi.Int32 Function( ffi.Pointer> ctl, ffi.Pointer handle, ffi.Pointer config, ffi.Pointer private_data, ffi.Int32 mode, ); typedef _dart_snd_sctl_build = int Function( ffi.Pointer> ctl, ffi.Pointer handle, ffi.Pointer config, ffi.Pointer private_data, int mode, ); typedef _c_snd_sctl_free = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_sctl_free = int Function( ffi.Pointer handle, ); typedef _c_snd_sctl_install = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_sctl_install = int Function( ffi.Pointer handle, ); typedef _c_snd_sctl_remove = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_sctl_remove = int Function( ffi.Pointer handle, ); typedef _c_snd_mixer_open = ffi.Int32 Function( ffi.Pointer> mixer, ffi.Int32 mode, ); typedef _dart_snd_mixer_open = int Function( ffi.Pointer> mixer, int mode, ); typedef _c_snd_mixer_close = ffi.Int32 Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_close = int Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_first_elem = ffi.Pointer Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_first_elem = ffi.Pointer Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_last_elem = ffi.Pointer Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_last_elem = ffi.Pointer Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_handle_events = ffi.Int32 Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_handle_events = int Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_attach = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer name, ); typedef _dart_snd_mixer_attach = int Function( ffi.Pointer mixer, ffi.Pointer name, ); typedef _c_snd_mixer_attach_hctl = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer hctl, ); typedef _dart_snd_mixer_attach_hctl = int Function( ffi.Pointer mixer, ffi.Pointer hctl, ); typedef _c_snd_mixer_detach = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer name, ); typedef _dart_snd_mixer_detach = int Function( ffi.Pointer mixer, ffi.Pointer name, ); typedef _c_snd_mixer_detach_hctl = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer hctl, ); typedef _dart_snd_mixer_detach_hctl = int Function( ffi.Pointer mixer, ffi.Pointer hctl, ); typedef _c_snd_mixer_get_hctl = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer name, ffi.Pointer> hctl, ); typedef _dart_snd_mixer_get_hctl = int Function( ffi.Pointer mixer, ffi.Pointer name, ffi.Pointer> hctl, ); typedef _c_snd_mixer_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_poll_descriptors_count = int Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_poll_descriptors = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer pfds, ffi.Uint32 space, ); typedef _dart_snd_mixer_poll_descriptors = int Function( ffi.Pointer mixer, ffi.Pointer pfds, int space, ); typedef _c_snd_mixer_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_mixer_poll_descriptors_revents = int Function( ffi.Pointer mixer, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_mixer_load = ffi.Int32 Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_load = int Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_free = ffi.Void Function( ffi.Pointer mixer, ); typedef _dart_snd_mixer_free = void Function( ffi.Pointer mixer, ); typedef _c_snd_mixer_wait = ffi.Int32 Function( ffi.Pointer mixer, ffi.Int32 timeout, ); typedef _dart_snd_mixer_wait = int Function( ffi.Pointer mixer, int timeout, ); typedef snd_mixer_compare_t = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); typedef _c_snd_mixer_set_compare = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer> msort, ); typedef _dart_snd_mixer_set_compare = int Function( ffi.Pointer mixer, ffi.Pointer> msort, ); typedef snd_mixer_callback_t = ffi.Int32 Function( ffi.Pointer, ffi.Uint32, ffi.Pointer, ); typedef _c_snd_mixer_set_callback = ffi.Void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _dart_snd_mixer_set_callback = void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _c_snd_mixer_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_mixer_set_callback_private = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_mixer_set_callback_private = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_mixer_get_count = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_get_count = int Function( ffi.Pointer obj, ); typedef _c_snd_mixer_class_unregister = ffi.Int32 Function( ffi.Pointer clss, ); typedef _dart_snd_mixer_class_unregister = int Function( ffi.Pointer clss, ); typedef _c_snd_mixer_elem_next = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_next = ffi.Pointer Function( ffi.Pointer elem, ); typedef _c_snd_mixer_elem_prev = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_prev = ffi.Pointer Function( ffi.Pointer elem, ); typedef snd_mixer_elem_callback_t = ffi.Int32 Function( ffi.Pointer, ffi.Uint32, ); typedef _c_snd_mixer_elem_set_callback = ffi.Void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _dart_snd_mixer_elem_set_callback = void Function( ffi.Pointer obj, ffi.Pointer> val, ); typedef _c_snd_mixer_elem_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_elem_get_callback_private = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_mixer_elem_set_callback_private = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_mixer_elem_set_callback_private = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_mixer_elem_get_type = ffi.Int32 Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_elem_get_type = int Function( ffi.Pointer obj, ); typedef _c_snd_mixer_class_register = ffi.Int32 Function( ffi.Pointer class_, ffi.Pointer mixer, ); typedef _dart_snd_mixer_class_register = int Function( ffi.Pointer class_, ffi.Pointer mixer, ); typedef _typedefC_11 = ffi.Void Function( ffi.Pointer, ); typedef _c_snd_mixer_elem_new = ffi.Int32 Function( ffi.Pointer> elem, ffi.Int32 type, ffi.Int32 compare_weight, ffi.Pointer private_data, ffi.Pointer> private_free, ); typedef _dart_snd_mixer_elem_new = int Function( ffi.Pointer> elem, int type, int compare_weight, ffi.Pointer private_data, ffi.Pointer> private_free, ); typedef _c_snd_mixer_elem_add = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer class_, ); typedef _dart_snd_mixer_elem_add = int Function( ffi.Pointer elem, ffi.Pointer class_, ); typedef _c_snd_mixer_elem_remove = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_remove = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_elem_free = ffi.Void Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_free = void Function( ffi.Pointer elem, ); typedef _c_snd_mixer_elem_info = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_info = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_elem_value = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_elem_value = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_elem_attach = ffi.Int32 Function( ffi.Pointer melem, ffi.Pointer helem, ); typedef _dart_snd_mixer_elem_attach = int Function( ffi.Pointer melem, ffi.Pointer helem, ); typedef _c_snd_mixer_elem_detach = ffi.Int32 Function( ffi.Pointer melem, ffi.Pointer helem, ); typedef _dart_snd_mixer_elem_detach = int Function( ffi.Pointer melem, ffi.Pointer helem, ); typedef _c_snd_mixer_elem_empty = ffi.Int32 Function( ffi.Pointer melem, ); typedef _dart_snd_mixer_elem_empty = int Function( ffi.Pointer melem, ); typedef _c_snd_mixer_elem_get_private = ffi.Pointer Function( ffi.Pointer melem, ); typedef _dart_snd_mixer_elem_get_private = ffi.Pointer Function( ffi.Pointer melem, ); typedef _c_snd_mixer_class_sizeof = ffi.Uint64 Function(); typedef _dart_snd_mixer_class_sizeof = int Function(); typedef _c_snd_mixer_class_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_mixer_class_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_mixer_class_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_class_free = void Function( ffi.Pointer obj, ); typedef _c_snd_mixer_class_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_mixer_class_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_mixer_class_get_mixer = ffi.Pointer Function( ffi.Pointer class_, ); typedef _dart_snd_mixer_class_get_mixer = ffi.Pointer Function( ffi.Pointer class_, ); typedef snd_mixer_event_t = ffi.Int32 Function( ffi.Pointer, ffi.Uint32, ffi.Pointer, ffi.Pointer, ); typedef _c_snd_mixer_class_get_event = ffi.Pointer> Function( ffi.Pointer class_, ); typedef _dart_snd_mixer_class_get_event = ffi.Pointer> Function( ffi.Pointer class_, ); typedef _c_snd_mixer_class_get_private = ffi.Pointer Function( ffi.Pointer class_, ); typedef _dart_snd_mixer_class_get_private = ffi.Pointer Function( ffi.Pointer class_, ); typedef _c_snd_mixer_class_get_compare = ffi.Pointer> Function( ffi.Pointer class_, ); typedef _dart_snd_mixer_class_get_compare = ffi.Pointer> Function( ffi.Pointer class_, ); typedef _c_snd_mixer_class_set_event = ffi.Int32 Function( ffi.Pointer class_, ffi.Pointer> event, ); typedef _dart_snd_mixer_class_set_event = int Function( ffi.Pointer class_, ffi.Pointer> event, ); typedef _c_snd_mixer_class_set_private = ffi.Int32 Function( ffi.Pointer class_, ffi.Pointer private_data, ); typedef _dart_snd_mixer_class_set_private = int Function( ffi.Pointer class_, ffi.Pointer private_data, ); typedef _typedefC_12 = ffi.Void Function( ffi.Pointer, ); typedef _c_snd_mixer_class_set_private_free = ffi.Int32 Function( ffi.Pointer class_, ffi.Pointer> private_free, ); typedef _dart_snd_mixer_class_set_private_free = int Function( ffi.Pointer class_, ffi.Pointer> private_free, ); typedef _c_snd_mixer_class_set_compare = ffi.Int32 Function( ffi.Pointer class_, ffi.Pointer> compare, ); typedef _dart_snd_mixer_class_set_compare = int Function( ffi.Pointer class_, ffi.Pointer> compare, ); typedef _c_snd_mixer_selem_channel_name = ffi.Pointer Function( ffi.Int32 channel, ); typedef _dart_snd_mixer_selem_channel_name = ffi.Pointer Function( int channel, ); typedef _c_snd_mixer_selem_register = ffi.Int32 Function( ffi.Pointer mixer, ffi.Pointer options, ffi.Pointer> classp, ); typedef _dart_snd_mixer_selem_register = int Function( ffi.Pointer mixer, ffi.Pointer options, ffi.Pointer> classp, ); typedef _c_snd_mixer_selem_get_id = ffi.Void Function( ffi.Pointer element, ffi.Pointer id, ); typedef _dart_snd_mixer_selem_get_id = void Function( ffi.Pointer element, ffi.Pointer id, ); typedef _c_snd_mixer_selem_get_name = ffi.Pointer Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_get_name = ffi.Pointer Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_get_index = ffi.Uint32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_get_index = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_find_selem = ffi.Pointer Function( ffi.Pointer mixer, ffi.Pointer id, ); typedef _dart_snd_mixer_find_selem = ffi.Pointer Function( ffi.Pointer mixer, ffi.Pointer id, ); typedef _c_snd_mixer_selem_is_active = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_active = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_is_playback_mono = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_playback_mono = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_playback_channel = ffi.Int32 Function( ffi.Pointer obj, ffi.Int32 channel, ); typedef _dart_snd_mixer_selem_has_playback_channel = int Function( ffi.Pointer obj, int channel, ); typedef _c_snd_mixer_selem_is_capture_mono = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_capture_mono = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_channel = ffi.Int32 Function( ffi.Pointer obj, ffi.Int32 channel, ); typedef _dart_snd_mixer_selem_has_capture_channel = int Function( ffi.Pointer obj, int channel, ); typedef _c_snd_mixer_selem_get_capture_group = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_get_capture_group = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_common_volume = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_common_volume = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_playback_volume = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_playback_volume = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_playback_volume_joined = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_playback_volume_joined = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_volume = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_capture_volume = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_volume_joined = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_capture_volume_joined = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_common_switch = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_common_switch = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_playback_switch = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_playback_switch = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_playback_switch_joined = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_playback_switch_joined = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_switch = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_capture_switch = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_switch_joined = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_capture_switch_joined = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_has_capture_switch_exclusive = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_has_capture_switch_exclusive = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_ask_playback_vol_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ffi.Pointer dBvalue, ); typedef _dart_snd_mixer_selem_ask_playback_vol_dB = int Function( ffi.Pointer elem, int value, ffi.Pointer dBvalue, ); typedef _c_snd_mixer_selem_ask_capture_vol_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ffi.Pointer dBvalue, ); typedef _dart_snd_mixer_selem_ask_capture_vol_dB = int Function( ffi.Pointer elem, int value, ffi.Pointer dBvalue, ); typedef _c_snd_mixer_selem_ask_playback_dB_vol = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 dBvalue, ffi.Int32 dir, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_ask_playback_dB_vol = int Function( ffi.Pointer elem, int dBvalue, int dir, ffi.Pointer value, ); typedef _c_snd_mixer_selem_ask_capture_dB_vol = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 dBvalue, ffi.Int32 dir, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_ask_capture_dB_vol = int Function( ffi.Pointer elem, int dBvalue, int dir, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_playback_volume = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_playback_volume = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_capture_volume = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_capture_volume = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_playback_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_playback_dB = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_capture_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_capture_dB = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_playback_switch = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_playback_switch = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_get_capture_switch = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer value, ); typedef _dart_snd_mixer_selem_get_capture_switch = int Function( ffi.Pointer elem, int channel, ffi.Pointer value, ); typedef _c_snd_mixer_selem_set_playback_volume = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int64 value, ); typedef _dart_snd_mixer_selem_set_playback_volume = int Function( ffi.Pointer elem, int channel, int value, ); typedef _c_snd_mixer_selem_set_capture_volume = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int64 value, ); typedef _dart_snd_mixer_selem_set_capture_volume = int Function( ffi.Pointer elem, int channel, int value, ); typedef _c_snd_mixer_selem_set_playback_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int64 value, ffi.Int32 dir, ); typedef _dart_snd_mixer_selem_set_playback_dB = int Function( ffi.Pointer elem, int channel, int value, int dir, ); typedef _c_snd_mixer_selem_set_capture_dB = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int64 value, ffi.Int32 dir, ); typedef _dart_snd_mixer_selem_set_capture_dB = int Function( ffi.Pointer elem, int channel, int value, int dir, ); typedef _c_snd_mixer_selem_set_playback_volume_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ); typedef _dart_snd_mixer_selem_set_playback_volume_all = int Function( ffi.Pointer elem, int value, ); typedef _c_snd_mixer_selem_set_capture_volume_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ); typedef _dart_snd_mixer_selem_set_capture_volume_all = int Function( ffi.Pointer elem, int value, ); typedef _c_snd_mixer_selem_set_playback_dB_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ffi.Int32 dir, ); typedef _dart_snd_mixer_selem_set_playback_dB_all = int Function( ffi.Pointer elem, int value, int dir, ); typedef _c_snd_mixer_selem_set_capture_dB_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 value, ffi.Int32 dir, ); typedef _dart_snd_mixer_selem_set_capture_dB_all = int Function( ffi.Pointer elem, int value, int dir, ); typedef _c_snd_mixer_selem_set_playback_switch = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int32 value, ); typedef _dart_snd_mixer_selem_set_playback_switch = int Function( ffi.Pointer elem, int channel, int value, ); typedef _c_snd_mixer_selem_set_capture_switch = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Int32 value, ); typedef _dart_snd_mixer_selem_set_capture_switch = int Function( ffi.Pointer elem, int channel, int value, ); typedef _c_snd_mixer_selem_set_playback_switch_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 value, ); typedef _dart_snd_mixer_selem_set_playback_switch_all = int Function( ffi.Pointer elem, int value, ); typedef _c_snd_mixer_selem_set_capture_switch_all = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 value, ); typedef _dart_snd_mixer_selem_set_capture_switch_all = int Function( ffi.Pointer elem, int value, ); typedef _c_snd_mixer_selem_get_playback_volume_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_mixer_selem_get_playback_volume_range = int Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_mixer_selem_get_playback_dB_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_mixer_selem_get_playback_dB_range = int Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_mixer_selem_set_playback_volume_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 min, ffi.Int64 max, ); typedef _dart_snd_mixer_selem_set_playback_volume_range = int Function( ffi.Pointer elem, int min, int max, ); typedef _c_snd_mixer_selem_get_capture_volume_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_mixer_selem_get_capture_volume_range = int Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_mixer_selem_get_capture_dB_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _dart_snd_mixer_selem_get_capture_dB_range = int Function( ffi.Pointer elem, ffi.Pointer min, ffi.Pointer max, ); typedef _c_snd_mixer_selem_set_capture_volume_range = ffi.Int32 Function( ffi.Pointer elem, ffi.Int64 min, ffi.Int64 max, ); typedef _dart_snd_mixer_selem_set_capture_volume_range = int Function( ffi.Pointer elem, int min, int max, ); typedef _c_snd_mixer_selem_is_enumerated = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_enumerated = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_is_enum_playback = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_enum_playback = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_is_enum_capture = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_is_enum_capture = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_get_enum_items = ffi.Int32 Function( ffi.Pointer elem, ); typedef _dart_snd_mixer_selem_get_enum_items = int Function( ffi.Pointer elem, ); typedef _c_snd_mixer_selem_get_enum_item_name = ffi.Int32 Function( ffi.Pointer elem, ffi.Uint32 idx, ffi.Uint64 maxlen, ffi.Pointer str, ); typedef _dart_snd_mixer_selem_get_enum_item_name = int Function( ffi.Pointer elem, int idx, int maxlen, ffi.Pointer str, ); typedef _c_snd_mixer_selem_get_enum_item = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Pointer idxp, ); typedef _dart_snd_mixer_selem_get_enum_item = int Function( ffi.Pointer elem, int channel, ffi.Pointer idxp, ); typedef _c_snd_mixer_selem_set_enum_item = ffi.Int32 Function( ffi.Pointer elem, ffi.Int32 channel, ffi.Uint32 idx, ); typedef _dart_snd_mixer_selem_set_enum_item = int Function( ffi.Pointer elem, int channel, int idx, ); typedef _c_snd_mixer_selem_id_sizeof = ffi.Uint64 Function(); typedef _dart_snd_mixer_selem_id_sizeof = int Function(); typedef _c_snd_mixer_selem_id_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_mixer_selem_id_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_mixer_selem_id_free = ffi.Void Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_selem_id_free = void Function( ffi.Pointer obj, ); typedef _c_snd_mixer_selem_id_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_mixer_selem_id_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_mixer_selem_id_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_selem_id_get_name = ffi.Pointer Function( ffi.Pointer obj, ); typedef _c_snd_mixer_selem_id_get_index = ffi.Uint32 Function( ffi.Pointer obj, ); typedef _dart_snd_mixer_selem_id_get_index = int Function( ffi.Pointer obj, ); typedef _c_snd_mixer_selem_id_set_name = ffi.Void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _dart_snd_mixer_selem_id_set_name = void Function( ffi.Pointer obj, ffi.Pointer val, ); typedef _c_snd_mixer_selem_id_set_index = ffi.Void Function( ffi.Pointer obj, ffi.Uint32 val, ); typedef _dart_snd_mixer_selem_id_set_index = void Function( ffi.Pointer obj, int val, ); typedef _c_snd_mixer_selem_id_parse = ffi.Int32 Function( ffi.Pointer dst, ffi.Pointer str, ); typedef _dart_snd_mixer_selem_id_parse = int Function( ffi.Pointer dst, ffi.Pointer str, ); typedef _c_snd_seq_open = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 streams, ffi.Int32 mode, ); typedef _dart_snd_seq_open = int Function( ffi.Pointer> handle, ffi.Pointer name, int streams, int mode, ); typedef _c_snd_seq_open_lconf = ffi.Int32 Function( ffi.Pointer> handle, ffi.Pointer name, ffi.Int32 streams, ffi.Int32 mode, ffi.Pointer lconf, ); typedef _dart_snd_seq_open_lconf = int Function( ffi.Pointer> handle, ffi.Pointer name, int streams, int mode, ffi.Pointer lconf, ); typedef _c_snd_seq_name = ffi.Pointer Function( ffi.Pointer seq, ); typedef _dart_snd_seq_name = ffi.Pointer Function( ffi.Pointer seq, ); typedef _c_snd_seq_type = ffi.Int32 Function( ffi.Pointer seq, ); typedef _dart_snd_seq_type = int Function( ffi.Pointer seq, ); typedef _c_snd_seq_close = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_close = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_poll_descriptors_count = ffi.Int32 Function( ffi.Pointer handle, ffi.Int16 events, ); typedef _dart_snd_seq_poll_descriptors_count = int Function( ffi.Pointer handle, int events, ); typedef _c_snd_seq_poll_descriptors = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer pfds, ffi.Uint32 space, ffi.Int16 events, ); typedef _dart_snd_seq_poll_descriptors = int Function( ffi.Pointer handle, ffi.Pointer pfds, int space, int events, ); typedef _c_snd_seq_poll_descriptors_revents = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer pfds, ffi.Uint32 nfds, ffi.Pointer revents, ); typedef _dart_snd_seq_poll_descriptors_revents = int Function( ffi.Pointer seq, ffi.Pointer pfds, int nfds, ffi.Pointer revents, ); typedef _c_snd_seq_nonblock = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 nonblock, ); typedef _dart_snd_seq_nonblock = int Function( ffi.Pointer handle, int nonblock, ); typedef _c_snd_seq_client_id = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_client_id = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_get_output_buffer_size = ffi.Uint64 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_get_output_buffer_size = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_get_input_buffer_size = ffi.Uint64 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_get_input_buffer_size = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_set_output_buffer_size = ffi.Int32 Function( ffi.Pointer handle, ffi.Uint64 size, ); typedef _dart_snd_seq_set_output_buffer_size = int Function( ffi.Pointer handle, int size, ); typedef _c_snd_seq_set_input_buffer_size = ffi.Int32 Function( ffi.Pointer handle, ffi.Uint64 size, ); typedef _dart_snd_seq_set_input_buffer_size = int Function( ffi.Pointer handle, int size, ); typedef _c_snd_seq_system_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_system_info_sizeof = int Function(); typedef _c_snd_seq_system_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_system_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_system_info_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_system_info_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_system_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_system_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_system_info_get_queues = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_queues = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info_get_clients = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_clients = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info_get_ports = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_ports = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info_get_channels = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_channels = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info_get_cur_clients = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_cur_clients = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info_get_cur_queues = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_system_info_get_cur_queues = int Function( ffi.Pointer info, ); typedef _c_snd_seq_system_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_system_info = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_client_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_client_info_sizeof = int Function(); typedef _c_snd_seq_client_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_client_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_client_info_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_client_info_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_client_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_client_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_client_info_get_client = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_client = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_type = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_type = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_broadcast_filter = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_broadcast_filter = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_error_bounce = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_error_bounce = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_card = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_card = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_pid = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_pid = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_event_filter = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_event_filter = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_num_ports = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_num_ports = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_get_event_lost = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_get_event_lost = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_set_client = ffi.Void Function( ffi.Pointer info, ffi.Int32 client, ); typedef _dart_snd_seq_client_info_set_client = void Function( ffi.Pointer info, int client, ); typedef _c_snd_seq_client_info_set_name = ffi.Void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _dart_snd_seq_client_info_set_name = void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _c_snd_seq_client_info_set_broadcast_filter = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_client_info_set_broadcast_filter = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_client_info_set_error_bounce = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_client_info_set_error_bounce = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_client_info_set_event_filter = ffi.Void Function( ffi.Pointer info, ffi.Pointer filter, ); typedef _dart_snd_seq_client_info_set_event_filter = void Function( ffi.Pointer info, ffi.Pointer filter, ); typedef _c_snd_seq_client_info_event_filter_clear = ffi.Void Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_info_event_filter_clear = void Function( ffi.Pointer info, ); typedef _c_snd_seq_client_info_event_filter_add = ffi.Void Function( ffi.Pointer info, ffi.Int32 event_type, ); typedef _dart_snd_seq_client_info_event_filter_add = void Function( ffi.Pointer info, int event_type, ); typedef _c_snd_seq_client_info_event_filter_del = ffi.Void Function( ffi.Pointer info, ffi.Int32 event_type, ); typedef _dart_snd_seq_client_info_event_filter_del = void Function( ffi.Pointer info, int event_type, ); typedef _c_snd_seq_client_info_event_filter_check = ffi.Int32 Function( ffi.Pointer info, ffi.Int32 event_type, ); typedef _dart_snd_seq_client_info_event_filter_check = int Function( ffi.Pointer info, int event_type, ); typedef _c_snd_seq_get_client_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_get_client_info = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_get_any_client_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 client, ffi.Pointer info, ); typedef _dart_snd_seq_get_any_client_info = int Function( ffi.Pointer handle, int client, ffi.Pointer info, ); typedef _c_snd_seq_set_client_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_set_client_info = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_query_next_client = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_query_next_client = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_client_pool_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_client_pool_sizeof = int Function(); typedef _c_snd_seq_client_pool_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_client_pool_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_client_pool_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_client_pool_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_client_pool_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_client_pool_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_client_pool_get_client = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_client = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_get_output_pool = ffi.Uint64 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_output_pool = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_get_input_pool = ffi.Uint64 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_input_pool = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_get_output_room = ffi.Uint64 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_output_room = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_get_output_free = ffi.Uint64 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_output_free = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_get_input_free = ffi.Uint64 Function( ffi.Pointer info, ); typedef _dart_snd_seq_client_pool_get_input_free = int Function( ffi.Pointer info, ); typedef _c_snd_seq_client_pool_set_output_pool = ffi.Void Function( ffi.Pointer info, ffi.Uint64 size, ); typedef _dart_snd_seq_client_pool_set_output_pool = void Function( ffi.Pointer info, int size, ); typedef _c_snd_seq_client_pool_set_input_pool = ffi.Void Function( ffi.Pointer info, ffi.Uint64 size, ); typedef _dart_snd_seq_client_pool_set_input_pool = void Function( ffi.Pointer info, int size, ); typedef _c_snd_seq_client_pool_set_output_room = ffi.Void Function( ffi.Pointer info, ffi.Uint64 size, ); typedef _dart_snd_seq_client_pool_set_output_room = void Function( ffi.Pointer info, int size, ); typedef _c_snd_seq_get_client_pool = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_get_client_pool = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_set_client_pool = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_set_client_pool = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_port_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_port_info_sizeof = int Function(); typedef _c_snd_seq_port_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_port_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_port_info_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_port_info_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_port_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_port_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_port_info_get_client = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_client = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_port = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_port = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_addr = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_addr = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_capability = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_capability = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_type = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_type = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_midi_channels = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_midi_channels = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_midi_voices = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_midi_voices = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_synth_voices = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_synth_voices = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_read_use = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_read_use = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_write_use = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_write_use = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_port_specified = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_port_specified = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_timestamping = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_timestamping = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_timestamp_real = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_timestamp_real = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_get_timestamp_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_info_get_timestamp_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_info_set_client = ffi.Void Function( ffi.Pointer info, ffi.Int32 client, ); typedef _dart_snd_seq_port_info_set_client = void Function( ffi.Pointer info, int client, ); typedef _c_snd_seq_port_info_set_port = ffi.Void Function( ffi.Pointer info, ffi.Int32 port, ); typedef _dart_snd_seq_port_info_set_port = void Function( ffi.Pointer info, int port, ); typedef _c_snd_seq_port_info_set_addr = ffi.Void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _dart_snd_seq_port_info_set_addr = void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _c_snd_seq_port_info_set_name = ffi.Void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _dart_snd_seq_port_info_set_name = void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _c_snd_seq_port_info_set_capability = ffi.Void Function( ffi.Pointer info, ffi.Uint32 capability, ); typedef _dart_snd_seq_port_info_set_capability = void Function( ffi.Pointer info, int capability, ); typedef _c_snd_seq_port_info_set_type = ffi.Void Function( ffi.Pointer info, ffi.Uint32 type, ); typedef _dart_snd_seq_port_info_set_type = void Function( ffi.Pointer info, int type, ); typedef _c_snd_seq_port_info_set_midi_channels = ffi.Void Function( ffi.Pointer info, ffi.Int32 channels, ); typedef _dart_snd_seq_port_info_set_midi_channels = void Function( ffi.Pointer info, int channels, ); typedef _c_snd_seq_port_info_set_midi_voices = ffi.Void Function( ffi.Pointer info, ffi.Int32 voices, ); typedef _dart_snd_seq_port_info_set_midi_voices = void Function( ffi.Pointer info, int voices, ); typedef _c_snd_seq_port_info_set_synth_voices = ffi.Void Function( ffi.Pointer info, ffi.Int32 voices, ); typedef _dart_snd_seq_port_info_set_synth_voices = void Function( ffi.Pointer info, int voices, ); typedef _c_snd_seq_port_info_set_port_specified = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_port_info_set_port_specified = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_port_info_set_timestamping = ffi.Void Function( ffi.Pointer info, ffi.Int32 enable, ); typedef _dart_snd_seq_port_info_set_timestamping = void Function( ffi.Pointer info, int enable, ); typedef _c_snd_seq_port_info_set_timestamp_real = ffi.Void Function( ffi.Pointer info, ffi.Int32 realtime, ); typedef _dart_snd_seq_port_info_set_timestamp_real = void Function( ffi.Pointer info, int realtime, ); typedef _c_snd_seq_port_info_set_timestamp_queue = ffi.Void Function( ffi.Pointer info, ffi.Int32 queue, ); typedef _dart_snd_seq_port_info_set_timestamp_queue = void Function( ffi.Pointer info, int queue, ); typedef _c_snd_seq_create_port = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_create_port = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_delete_port = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 port, ); typedef _dart_snd_seq_delete_port = int Function( ffi.Pointer handle, int port, ); typedef _c_snd_seq_get_port_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 port, ffi.Pointer info, ); typedef _dart_snd_seq_get_port_info = int Function( ffi.Pointer handle, int port, ffi.Pointer info, ); typedef _c_snd_seq_get_any_port_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 client, ffi.Int32 port, ffi.Pointer info, ); typedef _dart_snd_seq_get_any_port_info = int Function( ffi.Pointer handle, int client, int port, ffi.Pointer info, ); typedef _c_snd_seq_set_port_info = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 port, ffi.Pointer info, ); typedef _dart_snd_seq_set_port_info = int Function( ffi.Pointer handle, int port, ffi.Pointer info, ); typedef _c_snd_seq_query_next_port = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_query_next_port = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_port_subscribe_sizeof = int Function(); typedef _c_snd_seq_port_subscribe_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_port_subscribe_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_port_subscribe_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_port_subscribe_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_port_subscribe_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_port_subscribe_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_port_subscribe_get_sender = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_sender = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_get_dest = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_dest = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_get_exclusive = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_exclusive = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_get_time_update = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_time_update = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_get_time_real = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_port_subscribe_get_time_real = int Function( ffi.Pointer info, ); typedef _c_snd_seq_port_subscribe_set_sender = ffi.Void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _dart_snd_seq_port_subscribe_set_sender = void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _c_snd_seq_port_subscribe_set_dest = ffi.Void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _dart_snd_seq_port_subscribe_set_dest = void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _c_snd_seq_port_subscribe_set_queue = ffi.Void Function( ffi.Pointer info, ffi.Int32 q, ); typedef _dart_snd_seq_port_subscribe_set_queue = void Function( ffi.Pointer info, int q, ); typedef _c_snd_seq_port_subscribe_set_exclusive = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_port_subscribe_set_exclusive = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_port_subscribe_set_time_update = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_port_subscribe_set_time_update = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_port_subscribe_set_time_real = ffi.Void Function( ffi.Pointer info, ffi.Int32 val, ); typedef _dart_snd_seq_port_subscribe_set_time_real = void Function( ffi.Pointer info, int val, ); typedef _c_snd_seq_get_port_subscription = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _dart_snd_seq_get_port_subscription = int Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _c_snd_seq_subscribe_port = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _dart_snd_seq_subscribe_port = int Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _c_snd_seq_unsubscribe_port = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _dart_snd_seq_unsubscribe_port = int Function( ffi.Pointer handle, ffi.Pointer sub, ); typedef _c_snd_seq_query_subscribe_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_query_subscribe_sizeof = int Function(); typedef _c_snd_seq_query_subscribe_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_query_subscribe_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_query_subscribe_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_query_subscribe_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_query_subscribe_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_query_subscribe_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_query_subscribe_get_client = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_client = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_port = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_port = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_root = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_root = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_type = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_type = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_index = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_index = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_num_subs = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_num_subs = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_addr = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_addr = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_exclusive = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_exclusive = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_time_update = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_time_update = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_get_time_real = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_query_subscribe_get_time_real = int Function( ffi.Pointer info, ); typedef _c_snd_seq_query_subscribe_set_client = ffi.Void Function( ffi.Pointer info, ffi.Int32 client, ); typedef _dart_snd_seq_query_subscribe_set_client = void Function( ffi.Pointer info, int client, ); typedef _c_snd_seq_query_subscribe_set_port = ffi.Void Function( ffi.Pointer info, ffi.Int32 port, ); typedef _dart_snd_seq_query_subscribe_set_port = void Function( ffi.Pointer info, int port, ); typedef _c_snd_seq_query_subscribe_set_root = ffi.Void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _dart_snd_seq_query_subscribe_set_root = void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _c_snd_seq_query_subscribe_set_type = ffi.Void Function( ffi.Pointer info, ffi.Int32 type, ); typedef _dart_snd_seq_query_subscribe_set_type = void Function( ffi.Pointer info, int type, ); typedef _c_snd_seq_query_subscribe_set_index = ffi.Void Function( ffi.Pointer info, ffi.Int32 _index, ); typedef _dart_snd_seq_query_subscribe_set_index = void Function( ffi.Pointer info, int _index, ); typedef _c_snd_seq_query_port_subscribers = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer subs, ); typedef _dart_snd_seq_query_port_subscribers = int Function( ffi.Pointer seq, ffi.Pointer subs, ); typedef _c_snd_seq_queue_info_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_queue_info_sizeof = int Function(); typedef _c_snd_seq_queue_info_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_queue_info_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_queue_info_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_queue_info_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_queue_info_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_queue_info_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_queue_info_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_info_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_info_get_name = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_info_get_owner = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_info_get_owner = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_info_get_locked = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_info_get_locked = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_info_get_flags = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_info_get_flags = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_info_set_name = ffi.Void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _dart_snd_seq_queue_info_set_name = void Function( ffi.Pointer info, ffi.Pointer name, ); typedef _c_snd_seq_queue_info_set_owner = ffi.Void Function( ffi.Pointer info, ffi.Int32 owner, ); typedef _dart_snd_seq_queue_info_set_owner = void Function( ffi.Pointer info, int owner, ); typedef _c_snd_seq_queue_info_set_locked = ffi.Void Function( ffi.Pointer info, ffi.Int32 locked, ); typedef _dart_snd_seq_queue_info_set_locked = void Function( ffi.Pointer info, int locked, ); typedef _c_snd_seq_queue_info_set_flags = ffi.Void Function( ffi.Pointer info, ffi.Uint32 flags, ); typedef _dart_snd_seq_queue_info_set_flags = void Function( ffi.Pointer info, int flags, ); typedef _c_snd_seq_create_queue = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer info, ); typedef _dart_snd_seq_create_queue = int Function( ffi.Pointer seq, ffi.Pointer info, ); typedef _c_snd_seq_alloc_named_queue = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _dart_snd_seq_alloc_named_queue = int Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _c_snd_seq_alloc_queue = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_alloc_queue = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_free_queue = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ); typedef _dart_snd_seq_free_queue = int Function( ffi.Pointer handle, int q, ); typedef _c_snd_seq_get_queue_info = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 q, ffi.Pointer info, ); typedef _dart_snd_seq_get_queue_info = int Function( ffi.Pointer seq, int q, ffi.Pointer info, ); typedef _c_snd_seq_set_queue_info = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 q, ffi.Pointer info, ); typedef _dart_snd_seq_set_queue_info = int Function( ffi.Pointer seq, int q, ffi.Pointer info, ); typedef _c_snd_seq_query_named_queue = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _dart_snd_seq_query_named_queue = int Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _c_snd_seq_get_queue_usage = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ); typedef _dart_snd_seq_get_queue_usage = int Function( ffi.Pointer handle, int q, ); typedef _c_snd_seq_set_queue_usage = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Int32 used, ); typedef _dart_snd_seq_set_queue_usage = int Function( ffi.Pointer handle, int q, int used, ); typedef _c_snd_seq_queue_status_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_queue_status_sizeof = int Function(); typedef _c_snd_seq_queue_status_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_queue_status_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_queue_status_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_queue_status_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_queue_status_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_queue_status_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_queue_status_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_status_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_status_get_events = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_status_get_events = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_status_get_tick_time = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_status_get_tick_time = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_status_get_real_time = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_status_get_real_time = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_status_get_status = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_status_get_status = int Function( ffi.Pointer info, ); typedef _c_snd_seq_get_queue_status = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Pointer status, ); typedef _dart_snd_seq_get_queue_status = int Function( ffi.Pointer handle, int q, ffi.Pointer status, ); typedef _c_snd_seq_queue_tempo_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_queue_tempo_sizeof = int Function(); typedef _c_snd_seq_queue_tempo_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_queue_tempo_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_queue_tempo_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_queue_tempo_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_queue_tempo_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_queue_tempo_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_queue_tempo_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_tempo_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_tempo_get_tempo = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_tempo_get_tempo = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_tempo_get_ppq = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_tempo_get_ppq = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_tempo_get_skew = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_tempo_get_skew = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_tempo_get_skew_base = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_tempo_get_skew_base = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_tempo_set_tempo = ffi.Void Function( ffi.Pointer info, ffi.Uint32 tempo, ); typedef _dart_snd_seq_queue_tempo_set_tempo = void Function( ffi.Pointer info, int tempo, ); typedef _c_snd_seq_queue_tempo_set_ppq = ffi.Void Function( ffi.Pointer info, ffi.Int32 ppq, ); typedef _dart_snd_seq_queue_tempo_set_ppq = void Function( ffi.Pointer info, int ppq, ); typedef _c_snd_seq_queue_tempo_set_skew = ffi.Void Function( ffi.Pointer info, ffi.Uint32 skew, ); typedef _dart_snd_seq_queue_tempo_set_skew = void Function( ffi.Pointer info, int skew, ); typedef _c_snd_seq_queue_tempo_set_skew_base = ffi.Void Function( ffi.Pointer info, ffi.Uint32 base, ); typedef _dart_snd_seq_queue_tempo_set_skew_base = void Function( ffi.Pointer info, int base, ); typedef _c_snd_seq_get_queue_tempo = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Pointer tempo, ); typedef _dart_snd_seq_get_queue_tempo = int Function( ffi.Pointer handle, int q, ffi.Pointer tempo, ); typedef _c_snd_seq_set_queue_tempo = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Pointer tempo, ); typedef _dart_snd_seq_set_queue_tempo = int Function( ffi.Pointer handle, int q, ffi.Pointer tempo, ); typedef _c_snd_seq_queue_timer_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_queue_timer_sizeof = int Function(); typedef _c_snd_seq_queue_timer_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_queue_timer_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_queue_timer_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_queue_timer_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_queue_timer_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_queue_timer_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_queue_timer_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_timer_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_timer_get_type = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_timer_get_type = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_timer_get_id = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_timer_get_id = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_timer_get_resolution = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_queue_timer_get_resolution = int Function( ffi.Pointer info, ); typedef _c_snd_seq_queue_timer_set_type = ffi.Void Function( ffi.Pointer info, ffi.Int32 type, ); typedef _dart_snd_seq_queue_timer_set_type = void Function( ffi.Pointer info, int type, ); typedef _c_snd_seq_queue_timer_set_id = ffi.Void Function( ffi.Pointer info, ffi.Pointer id, ); typedef _dart_snd_seq_queue_timer_set_id = void Function( ffi.Pointer info, ffi.Pointer id, ); typedef _c_snd_seq_queue_timer_set_resolution = ffi.Void Function( ffi.Pointer info, ffi.Uint32 resolution, ); typedef _dart_snd_seq_queue_timer_set_resolution = void Function( ffi.Pointer info, int resolution, ); typedef _c_snd_seq_get_queue_timer = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Pointer timer, ); typedef _dart_snd_seq_get_queue_timer = int Function( ffi.Pointer handle, int q, ffi.Pointer timer, ); typedef _c_snd_seq_set_queue_timer = ffi.Int32 Function( ffi.Pointer handle, ffi.Int32 q, ffi.Pointer timer, ); typedef _dart_snd_seq_set_queue_timer = int Function( ffi.Pointer handle, int q, ffi.Pointer timer, ); typedef _c_snd_seq_free_event = ffi.Int32 Function( ffi.Pointer ev, ); typedef _dart_snd_seq_free_event = int Function( ffi.Pointer ev, ); typedef _c_snd_seq_event_length = ffi.Int64 Function( ffi.Pointer ev, ); typedef _dart_snd_seq_event_length = int Function( ffi.Pointer ev, ); typedef _c_snd_seq_event_output = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _dart_snd_seq_event_output = int Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _c_snd_seq_event_output_buffer = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _dart_snd_seq_event_output_buffer = int Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _c_snd_seq_event_output_direct = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _dart_snd_seq_event_output_direct = int Function( ffi.Pointer handle, ffi.Pointer ev, ); typedef _c_snd_seq_event_input = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer> ev, ); typedef _dart_snd_seq_event_input = int Function( ffi.Pointer handle, ffi.Pointer> ev, ); typedef _c_snd_seq_event_input_pending = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 fetch_sequencer, ); typedef _dart_snd_seq_event_input_pending = int Function( ffi.Pointer seq, int fetch_sequencer, ); typedef _c_snd_seq_drain_output = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_drain_output = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_event_output_pending = ffi.Int32 Function( ffi.Pointer seq, ); typedef _dart_snd_seq_event_output_pending = int Function( ffi.Pointer seq, ); typedef _c_snd_seq_extract_output = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer> ev, ); typedef _dart_snd_seq_extract_output = int Function( ffi.Pointer handle, ffi.Pointer> ev, ); typedef _c_snd_seq_drop_output = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_drop_output = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_drop_output_buffer = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_drop_output_buffer = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_drop_input = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_drop_input = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_drop_input_buffer = ffi.Int32 Function( ffi.Pointer handle, ); typedef _dart_snd_seq_drop_input_buffer = int Function( ffi.Pointer handle, ); typedef _c_snd_seq_remove_events_sizeof = ffi.Uint64 Function(); typedef _dart_snd_seq_remove_events_sizeof = int Function(); typedef _c_snd_seq_remove_events_malloc = ffi.Int32 Function( ffi.Pointer> ptr, ); typedef _dart_snd_seq_remove_events_malloc = int Function( ffi.Pointer> ptr, ); typedef _c_snd_seq_remove_events_free = ffi.Void Function( ffi.Pointer ptr, ); typedef _dart_snd_seq_remove_events_free = void Function( ffi.Pointer ptr, ); typedef _c_snd_seq_remove_events_copy = ffi.Void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _dart_snd_seq_remove_events_copy = void Function( ffi.Pointer dst, ffi.Pointer src, ); typedef _c_snd_seq_remove_events_get_condition = ffi.Uint32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_condition = int Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_get_queue = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_queue = int Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_get_dest = ffi.Pointer Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_dest = ffi.Pointer Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_get_channel = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_channel = int Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_get_event_type = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_event_type = int Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_get_tag = ffi.Int32 Function( ffi.Pointer info, ); typedef _dart_snd_seq_remove_events_get_tag = int Function( ffi.Pointer info, ); typedef _c_snd_seq_remove_events_set_condition = ffi.Void Function( ffi.Pointer info, ffi.Uint32 flags, ); typedef _dart_snd_seq_remove_events_set_condition = void Function( ffi.Pointer info, int flags, ); typedef _c_snd_seq_remove_events_set_queue = ffi.Void Function( ffi.Pointer info, ffi.Int32 queue, ); typedef _dart_snd_seq_remove_events_set_queue = void Function( ffi.Pointer info, int queue, ); typedef _c_snd_seq_remove_events_set_dest = ffi.Void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _dart_snd_seq_remove_events_set_dest = void Function( ffi.Pointer info, ffi.Pointer addr, ); typedef _c_snd_seq_remove_events_set_channel = ffi.Void Function( ffi.Pointer info, ffi.Int32 channel, ); typedef _dart_snd_seq_remove_events_set_channel = void Function( ffi.Pointer info, int channel, ); typedef _c_snd_seq_remove_events_set_event_type = ffi.Void Function( ffi.Pointer info, ffi.Int32 type, ); typedef _dart_snd_seq_remove_events_set_event_type = void Function( ffi.Pointer info, int type, ); typedef _c_snd_seq_remove_events_set_tag = ffi.Void Function( ffi.Pointer info, ffi.Int32 tag, ); typedef _dart_snd_seq_remove_events_set_tag = void Function( ffi.Pointer info, int tag, ); typedef _c_snd_seq_remove_events = ffi.Int32 Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _dart_snd_seq_remove_events = int Function( ffi.Pointer handle, ffi.Pointer info, ); typedef _c_snd_seq_set_bit = ffi.Void Function( ffi.Int32 nr, ffi.Pointer array, ); typedef _dart_snd_seq_set_bit = void Function( int nr, ffi.Pointer array, ); typedef _c_snd_seq_unset_bit = ffi.Void Function( ffi.Int32 nr, ffi.Pointer array, ); typedef _dart_snd_seq_unset_bit = void Function( int nr, ffi.Pointer array, ); typedef _c_snd_seq_change_bit = ffi.Int32 Function( ffi.Int32 nr, ffi.Pointer array, ); typedef _dart_snd_seq_change_bit = int Function( int nr, ffi.Pointer array, ); typedef _c_snd_seq_get_bit = ffi.Int32 Function( ffi.Int32 nr, ffi.Pointer array, ); typedef _dart_snd_seq_get_bit = int Function( int nr, ffi.Pointer array, ); typedef _c_snd_seq_control_queue = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 q, ffi.Int32 type, ffi.Int32 value, ffi.Pointer ev, ); typedef _dart_snd_seq_control_queue = int Function( ffi.Pointer seq, int q, int type, int value, ffi.Pointer ev, ); typedef _c_snd_seq_create_simple_port = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer name, ffi.Uint32 caps, ffi.Uint32 type, ); typedef _dart_snd_seq_create_simple_port = int Function( ffi.Pointer seq, ffi.Pointer name, int caps, int type, ); typedef _c_snd_seq_delete_simple_port = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 port, ); typedef _dart_snd_seq_delete_simple_port = int Function( ffi.Pointer seq, int port, ); typedef _c_snd_seq_connect_from = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 my_port, ffi.Int32 src_client, ffi.Int32 src_port, ); typedef _dart_snd_seq_connect_from = int Function( ffi.Pointer seq, int my_port, int src_client, int src_port, ); typedef _c_snd_seq_connect_to = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 my_port, ffi.Int32 dest_client, ffi.Int32 dest_port, ); typedef _dart_snd_seq_connect_to = int Function( ffi.Pointer seq, int my_port, int dest_client, int dest_port, ); typedef _c_snd_seq_disconnect_from = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 my_port, ffi.Int32 src_client, ffi.Int32 src_port, ); typedef _dart_snd_seq_disconnect_from = int Function( ffi.Pointer seq, int my_port, int src_client, int src_port, ); typedef _c_snd_seq_disconnect_to = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 my_port, ffi.Int32 dest_client, ffi.Int32 dest_port, ); typedef _dart_snd_seq_disconnect_to = int Function( ffi.Pointer seq, int my_port, int dest_client, int dest_port, ); typedef _c_snd_seq_set_client_name = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _dart_snd_seq_set_client_name = int Function( ffi.Pointer seq, ffi.Pointer name, ); typedef _c_snd_seq_set_client_event_filter = ffi.Int32 Function( ffi.Pointer seq, ffi.Int32 event_type, ); typedef _dart_snd_seq_set_client_event_filter = int Function( ffi.Pointer seq, int event_type, ); typedef _c_snd_seq_set_client_pool_output = ffi.Int32 Function( ffi.Pointer seq, ffi.Uint64 size, ); typedef _dart_snd_seq_set_client_pool_output = int Function( ffi.Pointer seq, int size, ); typedef _c_snd_seq_set_client_pool_output_room = ffi.Int32 Function( ffi.Pointer seq, ffi.Uint64 size, ); typedef _dart_snd_seq_set_client_pool_output_room = int Function( ffi.Pointer seq, int size, ); typedef _c_snd_seq_set_client_pool_input = ffi.Int32 Function( ffi.Pointer seq, ffi.Uint64 size, ); typedef _dart_snd_seq_set_client_pool_input = int Function( ffi.Pointer seq, int size, ); typedef _c_snd_seq_sync_output_queue = ffi.Int32 Function( ffi.Pointer seq, ); typedef _dart_snd_seq_sync_output_queue = int Function( ffi.Pointer seq, ); typedef _c_snd_seq_parse_address = ffi.Int32 Function( ffi.Pointer seq, ffi.Pointer addr, ffi.Pointer str, ); typedef _dart_snd_seq_parse_address = int Function( ffi.Pointer seq, ffi.Pointer addr, ffi.Pointer str, ); typedef _c_snd_seq_reset_pool_output = ffi.Int32 Function( ffi.Pointer seq, ); typedef _dart_snd_seq_reset_pool_output = int Function( ffi.Pointer seq, ); typedef _c_snd_seq_reset_pool_input = ffi.Int32 Function( ffi.Pointer seq, ); typedef _dart_snd_seq_reset_pool_input = int Function( ffi.Pointer seq, ); typedef _c_snd_midi_event_new = ffi.Int32 Function( ffi.Uint64 bufsize, ffi.Pointer> rdev, ); typedef _dart_snd_midi_event_new = int Function( int bufsize, ffi.Pointer> rdev, ); typedef _c_snd_midi_event_resize_buffer = ffi.Int32 Function( ffi.Pointer dev, ffi.Uint64 bufsize, ); typedef _dart_snd_midi_event_resize_buffer = int Function( ffi.Pointer dev, int bufsize, ); typedef _c_snd_midi_event_free = ffi.Void Function( ffi.Pointer dev, ); typedef _dart_snd_midi_event_free = void Function( ffi.Pointer dev, ); typedef _c_snd_midi_event_init = ffi.Void Function( ffi.Pointer dev, ); typedef _dart_snd_midi_event_init = void Function( ffi.Pointer dev, ); typedef _c_snd_midi_event_reset_encode = ffi.Void Function( ffi.Pointer dev, ); typedef _dart_snd_midi_event_reset_encode = void Function( ffi.Pointer dev, ); typedef _c_snd_midi_event_reset_decode = ffi.Void Function( ffi.Pointer dev, ); typedef _dart_snd_midi_event_reset_decode = void Function( ffi.Pointer dev, ); typedef _c_snd_midi_event_no_status = ffi.Void Function( ffi.Pointer dev, ffi.Int32 on_1, ); typedef _dart_snd_midi_event_no_status = void Function( ffi.Pointer dev, int on_1, ); typedef _c_snd_midi_event_encode = ffi.Int64 Function( ffi.Pointer dev, ffi.Pointer buf, ffi.Int64 count, ffi.Pointer ev, ); typedef _dart_snd_midi_event_encode = int Function( ffi.Pointer dev, ffi.Pointer buf, int count, ffi.Pointer ev, ); typedef _c_snd_midi_event_encode_byte = ffi.Int32 Function( ffi.Pointer dev, ffi.Int32 c, ffi.Pointer ev, ); typedef _dart_snd_midi_event_encode_byte = int Function( ffi.Pointer dev, int c, ffi.Pointer ev, ); typedef _c_snd_midi_event_decode = ffi.Int64 Function( ffi.Pointer dev, ffi.Pointer buf, ffi.Int64 count, ffi.Pointer ev, ); typedef _dart_snd_midi_event_decode = int Function( ffi.Pointer dev, ffi.Pointer buf, int count, ffi.Pointer ev, ); typedef _typedefC_4 = ffi.Int32 Function( ffi.Pointer, ); typedef _typedefC_5 = ffi.Void Function( ffi.Pointer, ); typedef _typedefC_6 = ffi.Void Function( ffi.Pointer, ); typedef _typedefC_7 = ffi.Void Function( ffi.Pointer, ); typedef _typedefC_8 = ffi.Void Function( ffi.Pointer, ); typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ); typedef _typedefC_10 = ffi.Void Function( ffi.Pointer, ); ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/lib/flutter_midi_command_linux.dart ================================================ import 'dart:async'; import 'package:ffi/ffi.dart'; import 'dart:ffi'; import 'dart:isolate'; import 'dart:typed_data'; import 'package:tuple/tuple.dart'; import 'package:flutter_midi_command_platform_interface/flutter_midi_command_platform_interface.dart'; import 'alsa_generated_bindings.dart' as a; final alsa = a.ALSA(DynamicLibrary.open("libasound.so.2")); final int SND_RAWMIDI_STREAM_INPUT = 1; final int SND_RAWMIDI_STREAM_OUTPUT = 0; int lengthOfMessageType(int type) { int midiType = type & 0xF0; switch (type) { case 0xF6: case 0xF8: case 0xFA: case 0xFB: case 0xFC: case 0xFF: case 0xFE: return 1; case 0xF1: case 0xF3: return 2; default: break; } switch (midiType) { case 0xC0: case 0xD0: return 2; case 0xF2: case 0x80: case 0x90: case 0xA0: case 0xB0: case 0xE0: return 3; default: break; } return 0; } void _rxIsolate(Tuple2 args) { final sendPort = args.item1; final Pointer inPort = Pointer.fromAddress(args.item2); print("start isolate $sendPort, $inPort, ${args.item2}"); int status = 0; int msgLength = 0; Pointer buffer = calloc(); List rxBuffer = []; while (true) { if (inPort == null) { print("no inport"); break; } if ((status = alsa.snd_rawmidi_read(inPort, buffer.cast(), 1)) < 0) { print("Problem reading MIDI input:${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}"); } else { // print("byte ${buffer.value}"); if (rxBuffer.length == 0) { msgLength = lengthOfMessageType(buffer.value); } rxBuffer.add(buffer.value); if (rxBuffer.length == msgLength) { // print("send buffer $rxBuffer $msgLength"); sendPort.send(Uint8List.fromList(rxBuffer)); rxBuffer.clear(); } } } } class LinuxMidiDevice extends MidiDevice { Pointer>? outPort; Pointer>? inPort; StreamController _rxStreamCtrl; Isolate? _isolate; ReceivePort? errorPort; ReceivePort? receivePort; Pointer ctl; int cardId; int deviceId; LinuxMidiDevice(this.ctl, this.cardId, this.deviceId, String name, String type, this._rxStreamCtrl) : super("hw:$cardId,$deviceId", name, type, false) { // Fetch device info Pointer> info = calloc>(); alsa.snd_rawmidi_info_malloc(info); alsa.snd_rawmidi_info_set_device(info.value, deviceId); int status = alsa.snd_ctl_rawmidi_info(ctl, info.value); if (status < 0) { print('error: cannot get device info.value ${alsa.snd_strerror(status).cast().toDartString()}'); return; } // Get input ports alsa.snd_rawmidi_info_set_stream(info.value, SND_RAWMIDI_STREAM_INPUT); status = alsa.snd_ctl_rawmidi_info(ctl, info.value); int inCount = alsa.snd_rawmidi_info_get_subdevices_count(info.value); for (var i = 0; i < inCount; i++) { if (alsa.snd_rawmidi_info_get_subdevice(info.value) < 0) { print("error: snd_rawmidi_info_get_subdevice in [$i] $status ${alsa.snd_rawmidi_info_get_subdevice_name(info.value).cast().toDartString()}"); } else { inputPorts.add(MidiPort(i, MidiPortType.IN)); } } // Get output ports alsa.snd_rawmidi_info_set_stream(info.value, SND_RAWMIDI_STREAM_OUTPUT); status = alsa.snd_ctl_rawmidi_info(ctl, info.value); int outCount = alsa.snd_rawmidi_info_get_subdevices_count(info.value); for (var i = 0; i < outCount; i++) { if (alsa.snd_rawmidi_info_get_subdevice(info.value) < 0) { print("error: snd_rawmidi_info_get_subdevice out [$i] $status ${alsa.snd_rawmidi_info_get_subdevice_name(info.value).cast().toDartString()}"); } else { outputPorts.add(MidiPort(i, MidiPortType.OUT)); } } calloc.free(info); } Future connect() async { outPort = calloc>(); inPort = calloc>(); Pointer name = "hw:$cardId,$deviceId,0".toNativeUtf8().cast(); print("open out port ${FlutterMidiCommandLinux.stringFromNative(name)}"); int status = 0; if ((status = alsa.snd_rawmidi_open(inPort!, outPort!, name, a.SND_RAWMIDI_SYNC)) < 0) { print('error: cannot open card number $cardId ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}'); return false; } connected = true; errorPort = new ReceivePort(); receivePort = ReceivePort(); _isolate = await Isolate.spawn(_rxIsolate, Tuple2(receivePort!.sendPort, inPort!.value.address), onError: errorPort!.sendPort).catchError((err, stackTrace) { print("Could not launch RX isolate. $err\nStackTrace: $stackTrace"); }); errorPort?.listen((message) { print('isolate error message $message'); }); receivePort?.listen((data) { // print("rx data $data $_rxStreamCtrl ${_rxStreamCtrl.sink}"); var packet = MidiPacket(data, DateTime.now().millisecondsSinceEpoch, this); _rxStreamCtrl.add(packet); }); return true; } send(Pointer buffer, int length) { if (outPort != null) { final voidBuffer = buffer.cast(); int status; if ((status = alsa.snd_rawmidi_write(outPort!.value, voidBuffer, length)) < 0) { print('failed to write ${alsa.snd_strerror(status).cast().toDartString()}'); } } else { print('outport is null'); } } disconnect() { receivePort?.close(); errorPort?.close(); _isolate?.kill(priority: Isolate.immediate); _isolate = null; int status = 0; if (outPort != null) { if ((status = alsa.snd_rawmidi_drain(outPort!.value)) < 0) { print('error: cannot drain out port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}'); } if ((status = alsa.snd_rawmidi_close(outPort!.value)) < 0) { print('error: cannot close out port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}'); } } if (inPort != null) { if ((status = alsa.snd_rawmidi_drain(inPort!.value)) < 0) { print('error: cannot drain in port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}'); } if ((status = alsa.snd_rawmidi_close(inPort!.value)) < 0) { print('error: cannot close in port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}'); } } connected = false; } } class FlutterMidiCommandLinux extends MidiCommandPlatform { StreamController _rxStreamController = StreamController.broadcast(); late Stream _rxStream; StreamController _setupStreamController = StreamController.broadcast(); late Stream _setupStream; Map _connectedDevices = Map(); /// A constructor that allows tests to override the window object used by the plugin. FlutterMidiCommandLinux() { _setupStream = _setupStreamController.stream; _rxStream = _rxStreamController.stream; } static String stringFromNative(Pointer pointer) { return pointer.cast().toDartString(); } /// The linux implementation of [MidiCommandPlatform] /// /// This class implements the `package:flutter_midi_command_platform_interface` functionality for linux static void registerWith() { print("register FlutterMidiCommandLinux"); MidiCommandPlatform.instance = FlutterMidiCommandLinux(); } @override Future> get devices async { return Future.value(_printCardList()); } List? _printCardList() { int status; var card = calloc(); card.elementAt(0).value = -1; // Pointer> longname = calloc>(); Pointer> shortname = calloc>(); List devices = []; if ((status = alsa.snd_card_next(card)) < 0) { print('error: cannot determine card number $card ${stringFromNative(alsa.snd_strerror(status))}'); return null; } // print('status $status'); if (card.value < 0) { print('error: no sound cards found'); return null; } while (card.value >= 0) { Pointer name = "hw:${card.value}".toNativeUtf8().cast(); Pointer> ctl = calloc>(); Pointer device = calloc(); device.elementAt(0).value = -1; // print("card ${card.value}"); if ((status = alsa.snd_card_get_name(card.value, shortname)) < 0) { print('error: cannot determine card shortname $card ${stringFromNative(alsa.snd_strerror(status))}'); continue; } status = alsa.snd_ctl_open(ctl, name, 0); // print("status after ctl_open $status ctl $ctl ctl.value ${ctl.value}"); if (status < 0) { print('error: cannot open control for card number $card ${stringFromNative(alsa.snd_strerror(status))}'); continue; } do { status = alsa.snd_ctl_rawmidi_next_device(ctl.value, device); // print("status $status device.value ${device.value}"); if (status < 0) { print('error: cannot determine device number ${device.value} ${stringFromNative(alsa.snd_strerror(status))}'); break; } if (device.value >= 0) { var deviceId = "hw:${card.value},${device.value}"; if (!_connectedDevices.containsKey(deviceId)) { // print("add unconnected device with id $deviceId"); devices.add(LinuxMidiDevice(ctl.value, card.value, device.value, stringFromNative(shortname.value), "native", _rxStreamController)); } } } while (device.value > 0); if ((status = alsa.snd_card_next(card)) < 0) { print('error: cannot determine card number $card ${stringFromNative(alsa.snd_strerror(status))}'); break; } calloc.free(name); calloc.free(ctl); calloc.free(device); } // Add all connected devices devices.addAll(_connectedDevices.values); return devices; } /// Starts scanning for BLE MIDI devices. /// /// Found devices will be included in the list returned by [devices]. Future startScanningForBluetoothDevices() async {} /// Stops scanning for BLE MIDI devices. void stopScanningForBluetoothDevices() {} /// Connects to the device. @override void connectToDevice(MidiDevice device, {List? ports}) { print('connect to $device'); var linuxDevice = device as LinuxMidiDevice; linuxDevice.connect().then((success) { if (success) { _connectedDevices[device.id] = device; _setupStreamController.add("deviceConnected"); } else { print("failed to connect $linuxDevice"); } }); } /// Disconnects from the device. @override void disconnectDevice(MidiDevice device, {bool remove = true}) { if (_connectedDevices.containsKey(device.id)) { var linuxDevice = device as LinuxMidiDevice; linuxDevice.disconnect(); if (remove) { _connectedDevices.remove(device.id); _setupStreamController.add("deviceDisconnected"); } } } @override void teardown() { _connectedDevices.values.forEach((device) { disconnectDevice(device, remove: false); }); _connectedDevices.clear(); _setupStreamController.add("deviceDisconnected"); } /// Sends data to the currently connected device.wmidi hardware driver name /// /// Data is an UInt8List of individual MIDI command bytes. @override void sendData(Uint8List data, {int? timestamp, String? deviceId}) { // print("send $data through buffer"); final buffer = calloc(data.lengthInBytes); for (var i = 0; i < data.length; i++) { buffer[i] = data[i]; } _connectedDevices.values.forEach((device) { // print("send to $device"); device.send(buffer, data.length); }); calloc.free(buffer); } /// Stream firing events whenever a midi package is received. /// /// The event contains the raw bytes contained in the MIDI package. @override Stream? get onMidiDataReceived { return _rxStream; } /// Stream firing events whenever a change in the MIDI setup occurs. /// /// For example, when a new BLE devices is discovered. @override Stream? get onMidiSetupChanged { return _setupStream; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/CMakeLists.txt ================================================ cmake_minimum_required(VERSION 3.10) set(PROJECT_NAME "flutter_midi_command_linux") project(${PROJECT_NAME} LANGUAGES CXX) set(PLUGIN_NAME "${PROJECT_NAME}_plugin") add_library(${PLUGIN_NAME} SHARED "${PLUGIN_NAME}.cc" ) apply_standard_settings(${PLUGIN_NAME}) set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) # List of absolute paths to libraries that should be bundled with the plugin set(flutter_midi_command_linux_bundled_libraries "" PARENT_SCOPE ) ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/flutter/generated_plugin_registrant.cc ================================================ // // Generated file. Do not edit. // #include "generated_plugin_registrant.h" void fl_register_plugins(FlPluginRegistry* registry) { } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/flutter/generated_plugin_registrant.h ================================================ // // Generated file. Do not edit. // #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ #include // Registers Flutter plugins. void fl_register_plugins(FlPluginRegistry* registry); #endif // GENERATED_PLUGIN_REGISTRANT_ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/flutter/generated_plugins.cmake ================================================ # # Generated file, do not edit. # list(APPEND FLUTTER_PLUGIN_LIST ) set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/flutter_midi_command_linux_plugin.cc ================================================ #include "include/flutter_midi_command_linux/flutter_midi_command_linux_plugin.h" #include #include #include #define FLUTTER_MIDI_COMMAND_LINUX_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), flutter_midi_command_linux_plugin_get_type(), \ FlutterMidiCommandLinuxPlugin)) struct _FlutterMidiCommandLinuxPlugin { GObject parent_instance; FlPluginRegistrar* registrar; // Connection to Flutter engine. FlMethodChannel* channel; FIEventChannel* rxChannel; FIEventChannel* setupChannel; }; G_DEFINE_TYPE(FlutterMidiCommandLinuxPlugin, flutter_midi_command_linux_plugin, g_object_get_type()) // Called when a method call is received from Flutter. static void flutter_midi_command_linux_plugin_handle_method_call( FlutterMidiCommandLinuxPlugin* self, FlMethodCall* method_call) { g_autoptr(FlMethodResponse) response = nullptr; const gchar* method = fl_method_call_get_name(method_call); if (strcmp(method, "getPlatformVersion") == 0) { struct utsname uname_data = {}; uname(&uname_data); g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); g_autoptr(FlValue) result = fl_value_new_string(version); response = FL_METHOD_RESPONSE(fl_method_success_response_new(result)); } else { response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); } fl_method_call_respond(method_call, response, nullptr); } static void flutter_midi_command_linux_plugin_dispose(GObject* object) { G_OBJECT_CLASS(flutter_midi_command_linux_plugin_parent_class)->dispose(object); } static void flutter_midi_command_linux_plugin_class_init(FlutterMidiCommandLinuxPluginClass* klass) { G_OBJECT_CLASS(klass)->dispose = flutter_midi_command_linux_plugin_dispose; } static void flutter_midi_command_linux_plugin_init(FlutterMidiCommandLinuxPlugin* self) {} static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, gpointer user_data) { FlutterMidiCommandLinuxPlugin* plugin = FLUTTER_MIDI_COMMAND_LINUX_PLUGIN(user_data); flutter_midi_command_linux_plugin_handle_method_call(plugin, method_call); } void flutter_midi_command_linux_plugin_register_with_registrar(FlPluginRegistrar* registrar) { FlutterMidiCommandLinuxPlugin* plugin = FLUTTER_MIDI_COMMAND_LINUX_PLUGIN( g_object_new(flutter_midi_command_linux_plugin_get_type(), nullptr)); g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); g_autoptr(FlMethodChannel) channel = fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), "plugins.invisiblewrench.com/flutter_midi_command", FL_METHOD_CODEC(codec)); fl_method_channel_set_method_call_handler(channel, method_call_cb, g_object_ref(plugin), g_object_unref); g_autoptr(FlMethodChannel) channel = fl_event_channel_new(fl_plugin_registrar_get_messenger(registrar), "plugins.invisiblewrench.com/flutter_midi_command/rx_channel", FL_METHOD_CODEC(codec)); g_autoptr(FlMethodChannel) channel = fl_event_channel_new(fl_plugin_registrar_get_messenger(registrar), "plugins.invisiblewrench.com/flutter_midi_command/setup_channel", FL_METHOD_CODEC(codec)); g_object_unref(plugin); } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/linux/include/flutter_midi_command_linux/flutter_midi_command_linux_plugin.h ================================================ #ifndef FLUTTER_PLUGIN_FLUTTER_MIDI_COMMAND_LINUX_PLUGIN_H_ #define FLUTTER_PLUGIN_FLUTTER_MIDI_COMMAND_LINUX_PLUGIN_H_ #include G_BEGIN_DECLS #ifdef FLUTTER_PLUGIN_IMPL #define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) #else #define FLUTTER_PLUGIN_EXPORT #endif typedef struct _FlutterMidiCommandLinuxPlugin FlutterMidiCommandLinuxPlugin; typedef struct { GObjectClass parent_class; } FlutterMidiCommandLinuxPluginClass; FLUTTER_PLUGIN_EXPORT GType flutter_midi_command_linux_plugin_get_type(); FLUTTER_PLUGIN_EXPORT void flutter_midi_command_linux_plugin_register_with_registrar( FlPluginRegistrar* registrar); G_END_DECLS #endif // FLUTTER_PLUGIN_FLUTTER_MIDI_COMMAND_LINUX_PLUGIN_H_ ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/pubspec.yaml ================================================ name: flutter_midi_command_linux description: FlutterMidiCommand for Linux. version: 0.1.3 homepage: https://github.com/InvisibleWrench/FlutterMidiCommand publish_to: none environment: sdk: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" dependencies: flutter: sdk: flutter flutter_midi_command_platform_interface: path: ../flutter_midi_command_platform_interface-0.3.3 ffi: ">=1.1.2 <3.0.0" tuple: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter ffigen: ^2.4.0 flutter: plugin: implements: flutter_midi_command platforms: linux: dartPluginClass: FlutterMidiCommandLinux pluginClass: none ffigen: name: 'ALSA' output: 'lib/alsa_generated_bindings.dart' headers: entry-points: - '/usr/include/alsa/asoundlib.h' compiler-opts: '-I/usr/lib/llvm-11/include/ -L/usr/lib/llvm-11/lib/ -I/usr/local/opt/llvm/include/ -Wno-nullability-completeness' structs: rename: '_(.*)': '$1_' member-rename: '.*': '_(.*)': '$1_' ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_linux-0.1.3/test/flutter_midi_command_linux_test.dart ================================================ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { const MethodChannel channel = MethodChannel('flutter_midi_command_linux'); TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { channel.setMockMethodCallHandler((MethodCall methodCall) async { return '42'; }); }); tearDown(() { channel.setMockMethodCallHandler(null); }); } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/.gitignore ================================================ .packages pubspec.lock .dart_tool ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/CHANGELOG.md ================================================ ## 0.3.3 - Fixed device connection value on Android ## 0.3.2 - Fixed null warning ## 0.3.1 - Aligned midi ports ## 0.3.0 - Null safety ## 0.2.1 - Removed print. ## 0.2.0 - Initial release. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/LICENSE ================================================ Copyright 2020 InvisibleWrench. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/README.md ================================================ # flutter_midi_command The interface for A Flutter plugin for sending and receiving MIDI messages between Flutter and physical and virtual MIDI devices. Wraps CoreMIDI and android.media.midi in a thin dart/flutter layer. Works with USB and BLE MIDI connections on Android, and USB, network(session) and BLE MIDI connections on iOS. ## Getting Started This plugin is build using Swift and Kotlin on the native side, so make sure your project supports this. Import flutter_midi_command `import 'package:flutter_midi_command/flutter_midi_command.dart';` - Get a list of available MIDI devices by calling `MidiCommand().devices` which returns a list of `MidiDevice` - Start scanning for BLE MIDI devices by calling `MidiCommand().startScanningForBluetoothDevices()` - Connect to a specific `MidiDevice` by calling `MidiCommand.connectToDevice(selectedDevice)` - Stop scanning for BLE MIDI devices by calling `MidiCommand().stopScanningForBluetoothDevices()` - Disconnect from the current device by calling `MidiCommand.disconnectDevice()` - Listen for updates in the MIDI setup by subscribing to `MidiCommand().onMidiSetupChanged` - Listen for incoming MIDI messages on from the current device by subscribing to `MidiCommand().onMidiDataReceived`, after which the listener will recieve inbound MIDI messages as an UInt8List of variable length. - Send a MIDI message by calling `MidiCommand.sendData(data)`, where data is an UInt8List of bytes following the MIDI spec. - Or use the various `MidiCommand` subtypes to send PC, CC, NoteOn and NoteOff messsages. See example folder for how to use. For help getting started with Flutter, view our online [documentation](https://flutter.io/). For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package). ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/lib/flutter_midi_command_platform_interface.dart ================================================ import 'dart:async'; import 'dart:typed_data'; import 'package:flutter_midi_command_platform_interface/midi_device.dart'; import 'package:flutter_midi_command_platform_interface/midi_packet.dart'; import 'package:flutter_midi_command_platform_interface/midi_port.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'method_channel_midi_command.dart'; export 'package:flutter_midi_command_platform_interface/midi_device.dart'; export 'package:flutter_midi_command_platform_interface/midi_packet.dart'; export 'package:flutter_midi_command_platform_interface/midi_port.dart'; abstract class MidiCommandPlatform extends PlatformInterface { /// Constructs a MidiCommandPlatform. MidiCommandPlatform() : super(token: _token); static final Object _token = Object(); static MidiCommandPlatform _instance = MethodChannelMidiCommand(); /// The default instance of [MidiCommandPlatform] to use. /// /// Defaults to [MethodChannelMidiCommand]. static MidiCommandPlatform get instance => _instance; /// Platform-specific plugins should set this with their own platform-specific /// class that extends [MidiCommandPlatform] when they register themselves. static set instance(MidiCommandPlatform instance) { PlatformInterface.verifyToken(instance, _token); _instance = instance; } /// Returns a list of found MIDI devices. Future?> get devices async { throw UnimplementedError('get devices has not been implemented.'); } /// Starts scanning for BLE MIDI devices. /// /// Found devices will be included in the list returned by [devices]. Future startScanningForBluetoothDevices() async { throw UnimplementedError('startScanningForBluetoothDevices() has not been implemented.'); } /// Stops scanning for BLE MIDI devices. void stopScanningForBluetoothDevices() { throw UnimplementedError('stopScanningForBluetoothDevices() has not been implemented.'); } /// Connects to the device. void connectToDevice(MidiDevice device, {List? ports}) { throw UnimplementedError('connectToDevice() has not been implemented.'); } /// Disconnects from the device. void disconnectDevice(MidiDevice device) { throw UnimplementedError('disconnectDevice() has not been implemented.'); } /// Disconnects from all devices. void teardown() { throw UnimplementedError('teardown() has not been implemented.'); } /// Sends data to the currently connected device. /// /// Data is an UInt8List of individual MIDI command bytes. void sendData(Uint8List data, {int? timestamp, String? deviceId}) { throw UnimplementedError('sendData() has not been implemented.'); } Stream? get onMidiDataReceived { throw UnimplementedError('get onMidiDataReceived has not been implemented.'); } /// Stream firing events whenever a change in the MIDI setup occurs. /// /// For example, when a new BLE devices is discovered. Stream? get onMidiSetupChanged { throw UnimplementedError('get onMidiSetupChanged has not been implemented.'); } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/lib/method_channel_midi_command.dart ================================================ import 'dart:async'; import 'package:flutter/services.dart'; import 'flutter_midi_command_platform_interface.dart'; const MethodChannel _methodChannel = MethodChannel('plugins.invisiblewrench.com/flutter_midi_command'); const EventChannel _rxChannel = EventChannel('plugins.invisiblewrench.com/flutter_midi_command/rx_channel'); const EventChannel _setupChannel = EventChannel( 'plugins.invisiblewrench.com/flutter_midi_command/setup_channel'); /// An implementation of [MidiCommandPlatform] that uses method channels. class MethodChannelMidiCommand extends MidiCommandPlatform { Stream? _rxStream; Stream? _setupStream; /// Returns a list of found MIDI devices. @override Future?> get devices async { var devs = await _methodChannel.invokeMethod('getDevices'); return devs.map((m) { var map = m.cast(); var dev = MidiDevice(map["id"].toString(), map["name"], map["type"], map["connected"] == "true"); dev.inputPorts = _portsFromDevice(map["inputs"], MidiPortType.IN); dev.outputPorts = _portsFromDevice(map["outputs"], MidiPortType.OUT); return dev; }).toList(); } List _portsFromDevice(List? portList, MidiPortType type) { if (portList == null) return []; var ports = portList.map((e) { var portMap = (e as Map).cast(); return MidiPort(portMap["id"] as int, type); }); return ports.toList(growable: false); } /// Starts scanning for BLE MIDI devices. /// /// Found devices will be included in the list returned by [devices]. @override Future startScanningForBluetoothDevices() async { try { await _methodChannel.invokeMethod('scanForDevices'); } on PlatformException catch (e) { throw e.message!; } } /// Stops scanning for BLE MIDI devices. @override void stopScanningForBluetoothDevices() { _methodChannel.invokeMethod('stopScanForDevices'); } /// Connects to the device. @override void connectToDevice(MidiDevice device, {List? ports}) { _methodChannel.invokeMethod( 'connectToDevice', {"device": device.toDictionary, "ports": ports}); } /// Disconnects from the device. @override void disconnectDevice(MidiDevice device) { _methodChannel.invokeMethod('disconnectDevice', device.toDictionary); } /// Disconnects from all devices. @override void teardown() { _methodChannel.invokeMethod('teardown'); } /// Sends data to the currently connected device. /// /// Data is an UInt8List of individual MIDI command bytes. @override void sendData(Uint8List data, {int? timestamp, String? deviceId}) { // print("send $data through method channel"); _methodChannel.invokeMethod('sendData', {"data": data, "timestamp": timestamp, "deviceId": deviceId}); } /// Stream firing events whenever a midi package is received. /// /// The event contains the raw bytes contained in the MIDI package. @override Stream? get onMidiDataReceived { // print("get on midi data"); _rxStream ??= _rxChannel.receiveBroadcastStream().map((d) { var dd = d["device"]; // print("device data $dd"); var device = MidiDevice(dd['id'], dd["name"], dd["type"], dd["connected"] ?? true); return MidiPacket(Uint8List.fromList(List.from(d["data"])), d["timestamp"] as int, device); }); return _rxStream; } /// Stream firing events whenever a change in the MIDI setup occurs. /// /// For example, when a new BLE devices is discovered. @override Stream? get onMidiSetupChanged { _setupStream ??= _setupChannel.receiveBroadcastStream().cast(); return _setupStream; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/lib/midi_device.dart ================================================ import 'package:flutter_midi_command_platform_interface/midi_port.dart'; class MidiDevice { String name; String id; String type; List inputPorts = []; List outputPorts = []; bool connected; MidiDevice(this.id, this.name, this.type, this.connected); Map get toDictionary { return { "name": name, "id": id, "type": type, "connected": connected, }; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/lib/midi_packet.dart ================================================ import 'dart:typed_data'; import 'package:flutter_midi_command_platform_interface/flutter_midi_command_platform_interface.dart'; class MidiPacket { int timestamp; Uint8List data; MidiDevice device; MidiPacket(this.data, this.timestamp, this.device); Map get toDictionary { return {"data": data, "timestamp": timestamp, "sender": device.toDictionary}; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/lib/midi_port.dart ================================================ enum MidiPortType { IN, OUT } class MidiPort { MidiPortType type; int id; bool connected = false; MidiPort(this.id, this.type); Map get toDictionary { return {"id": id, "type": type.toString(), "connected": connected}; } } ================================================ FILE: plugins/flutter_midi_command/flutter_midi_command_platform_interface-0.3.3/pubspec.yaml ================================================ name: flutter_midi_command_platform_interface description: A common platform interface for the FlutterMidiCommand plugin. version: 0.3.3 homepage: https://github.com/InvisibleWrench/FlutterMidiCommand environment: sdk: '>=2.12.0 <3.0.0' flutter: ">=1.20.0" dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter ================================================ FILE: plugins/mighty_ble/.gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ migrate_working_dir/ # IntelliJ related *.iml *.ipr *.iws .idea/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter/Dart/Pub related # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. /pubspec.lock **/doc/api/ .dart_tool/ .packages build/ ================================================ FILE: plugins/mighty_ble/.metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled. version: revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 channel: stable project_type: plugin # Tracks metadata for the flutter migrate command migration: platforms: - platform: root create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 - platform: android create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 - platform: ios create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 # User provided section # List of Local paths (relative to this file) that should be # ignored by the migrate tool. # # Files that are not part of the templates will be ignored by default. unmanaged_files: - 'lib/main.dart' - 'ios/Runner.xcodeproj/project.pbxproj' ================================================ FILE: plugins/mighty_ble/CHANGELOG.md ================================================ ## 0.0.1 * TODO: Describe initial release. ================================================ FILE: plugins/mighty_ble/LICENSE ================================================ TODO: Add your license here. ================================================ FILE: plugins/mighty_ble/README.md ================================================ # mighty_ble A new Flutter plugin project. ## Getting Started This project is a starting point for a Flutter [plug-in package](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS. For help getting started with Flutter development, view the [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. ================================================ FILE: plugins/mighty_ble/analysis_options.yaml ================================================ include: package:flutter_lints/flutter.yaml # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options ================================================ FILE: plugins/mighty_ble/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures .cxx ================================================ FILE: plugins/mighty_ble/android/build.gradle ================================================ group 'com.tuntori.mighty_ble' version '1.0' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.1.2' } } rootProject.allprojects { repositories { google() mavenCentral() } } apply plugin: 'com.android.library' android { compileSdkVersion 34 namespace 'com.tuntori.mighty_ble' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 16 } } ================================================ FILE: plugins/mighty_ble/android/settings.gradle ================================================ rootProject.name = 'mighty_ble' ================================================ FILE: plugins/mighty_ble/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/mighty_ble/android/src/main/java/com/tuntori/mighty_ble/BLEManager.java ================================================ package com.tuntori.mighty_ble; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCallback; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothStatusCodes; import android.bluetooth.le.BluetoothLeScanner; import android.bluetooth.le.ScanCallback; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanRecord; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.ParcelUuid; import android.os.Build; import android.util.Log; import java.util.List; import java.util.HashMap; import java.util.Queue; import java.util.UUID; import java.util.LinkedList; public class BLEManager { private static final String TAG = "BLEManager"; // UUIDs for the service and characteristics we are interested in private static final UUID MIDI_SERVICE_UUID = UUID.fromString("03b80e5a-ede8-4b33-a751-6ce34ec4c700"); private static final UUID MIDI_CHARACTERISTIC_UUID = UUID.fromString("7772e5db-3868-4112-a1a9-f2669d106bf3"); // Request code for enabling Bluetooth private static final int REQUEST_ENABLE_BT = 1; //a hashmap containing result from a scan, a pair of mac addr and device private final HashMap mScanResults = new HashMap<>(); //a hashmap containing the connected devices private final HashMap mConnectedDevices = new HashMap<>(); //a hashmap containing the midi characteristics private final HashMap mCharacteristics = new HashMap<>(); private final Queue mWriteQueue = new LinkedList(); private boolean mIsWriting = false; private Context context; private MightyBlePlugin pluginHandler; private BluetoothAdapter mBluetoothAdapter; private BluetoothLeScanner mBluetoothLeScanner; private boolean mScanning = false; public BLEManager(Context context, MightyBlePlugin pluginHandler) { this.context = context; this.pluginHandler = pluginHandler; } public void init() { final BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE); mBluetoothAdapter = bluetoothManager.getAdapter(); // Initialize the Bluetooth LE scanner mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner(); } public boolean isAvailable() { return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); } public void startScan() { if (mScanning) return; mScanning = true; mScanResults.clear(); // Start scanning for devices mBluetoothLeScanner.startScan(mScanCallback); } public void stopScan() { if (!mScanning) return; mScanning = false; mBluetoothLeScanner.stopScan(mScanCallback); } public void connect(String address) { stopScan(); if (mScanResults.containsKey(address)) { BluetoothDevice device = mScanResults.get(address); device.connectGatt(context, false, mGattCallback); } } public void disconnect(String address) { if (mConnectedDevices.containsKey(address)) { BluetoothGatt gatt = mConnectedDevices.get(address); mIsWriting = false; mWriteQueue.clear(); if (gatt != null) { gatt.disconnect(); gatt.close(); } mConnectedDevices.remove(address); mCharacteristics.remove(address); } } public void setNotificationEnabled(String address, boolean enabled) { if (!mConnectedDevices.containsKey(address) || !mCharacteristics.containsKey(address)) { Log.w(TAG, "conn dev " + mConnectedDevices.containsKey(address) + " chars " + mCharacteristics.containsKey(address)); return; } BluetoothGatt gatt = mConnectedDevices.get(address); BluetoothGattCharacteristic characteristic = mCharacteristics.get(address); gatt.setCharacteristicNotification(characteristic, enabled); } public int write(String address, byte[] data) { if (!mConnectedDevices.containsKey(address) || !mCharacteristics.containsKey(address)) { Log.w(TAG, "conn dev " + mConnectedDevices.containsKey(address) + " chars " + mCharacteristics.containsKey(address)); return 0; } synchronized (this) { if (mIsWriting) { mWriteQueue.add(data); return 0; } mIsWriting = true; } BluetoothGatt gatt = mConnectedDevices.get(address); BluetoothGattCharacteristic characteristic = mCharacteristics.get(address); writeNext(gatt, characteristic, data); // if (mConnectedDevices.containsKey(address) && // mCharacteristics.containsKey(address)){ // BluetoothGatt gatt = mConnectedDevices.get(address); // BluetoothGattCharacteristic characteristic = mCharacteristics.get(address); // mWriteQueue.add(data); // writeNext(gatt, characteristic); // } // else { // } return 0; } private int writeNext(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, byte[] value) { // if (mIsWriting || mWriteQueue.isEmpty()) { // if (mWriteQueue.isEmpty()) // Log.d(TAG, "Queue exhausted."); // return 0; // } // mIsWriting = true; // byte[] value = mWriteQueue.poll(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { int success = gatt.writeCharacteristic(characteristic, value, BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE); if (success != BluetoothStatusCodes.SUCCESS) { Log.d(TAG, "writeCharacteristic failed with value " + success); } return 0; } //legacy code (< 33) here characteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE); boolean success = characteristic.setValue(value); if (!success) { Log.d(TAG, "SetValue failed"); return 1; } success = gatt.writeCharacteristic(characteristic); if (!success) { Log.d(TAG, "writeCharacteristic failed"); } return 0; // int errcode = mBluetoothGatt.writeCharacteristic (midiCharacteristic, // data, // BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE); //return errcode; } // Callback for receiving BLE scan results private ScanCallback mScanCallback = new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { Log.d(TAG, "onScanResult: " + result.getDevice().getAddress()); // Check if the device name matches the name of the device we are looking for if (result.getDevice().getName()!=null) { boolean hasMidiService = false; //check if it contains the midi service id ScanRecord scanRecord = result.getScanRecord(); List serviceUuids = scanRecord.getServiceUuids(); // Convert UUID to ParcelUuid ParcelUuid midiParcelUuid = ParcelUuid.fromString(MIDI_SERVICE_UUID.toString()); if (serviceUuids.contains(midiParcelUuid)) { hasMidiService = true; } String address = result.getDevice().getAddress(); //add to result list if (!mScanResults.containsKey(address)) mScanResults.put(address, result.getDevice()); //notify about result pluginHandler.onScanResult(result.getDevice().getName(), address, hasMidiService); } } }; // Callback for receiving GATT events private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { if (newState == BluetoothGatt.STATE_CONNECTED) { Log.d(TAG, "Connected to GATT server."); // Discover services gatt.discoverServices(); } else if (newState == BluetoothGatt.STATE_DISCONNECTED) { Log.d(TAG, "Disconnected from GATT server."); String address = gatt.getDevice().getAddress(); mConnectedDevices.remove(address); if (mCharacteristics.containsKey(address)) mCharacteristics.remove(address); //notify about the disconnect pluginHandler.onDisconnected(address); } } @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { Log.d(TAG, "Services discovered."); // Get the service we are interested in BluetoothGattService service = gatt.getService(MIDI_SERVICE_UUID); if (service != null) { // Get the characteristic we are interested in BluetoothGattCharacteristic characteristic = service.getCharacteristic(MIDI_CHARACTERISTIC_UUID); if (characteristic != null) { // Enable notifications for the characteristic gatt.setCharacteristicNotification(characteristic, true); BluetoothGattDescriptor descriptor = characteristic.getDescriptor( UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { gatt.writeDescriptor(descriptor, BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); } else { descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); gatt.writeDescriptor(descriptor); } //store in connected devices String address = gatt.getDevice().getAddress(); mConnectedDevices.put(address, gatt); mCharacteristics.put(address, characteristic); //notify about the successful connection pluginHandler.onConnected(address); } } } else { Log.w(TAG, "onServicesDiscovered received: " + status); } } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { // We received a notification for the characteristic we are interested in if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { String address = gatt.getDevice().getAddress(); byte[] value = characteristic.getValue(); //Log.d(TAG, "Received notification: " + bytesToHex( value )); pluginHandler.onCharacteristicNotify(address, value); } } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, byte[] value) { // We received a notification for the characteristic we are interested in String address = gatt.getDevice().getAddress(); pluginHandler.onCharacteristicNotify(address, value); } @Override public void onCharacteristicWrite (BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { Log.e(TAG, "Characteristic write " + status); // mIsWriting = false; // writeNext(gatt, characteristic); byte[] message; synchronized (this) { if (mWriteQueue.isEmpty()) { mIsWriting = false; return; } message = mWriteQueue.poll(); } writeNext(gatt, characteristic, message); } }; } ================================================ FILE: plugins/mighty_ble/android/src/main/java/com/tuntori/mighty_ble/MightyBlePlugin.java ================================================ package com.tuntori.mighty_ble; import androidx.annotation.NonNull; import android.content.Context; import android.app.Activity; import android.util.Log; import java.util.HashMap; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; /** MightyBlePlugin */ public class MightyBlePlugin implements FlutterPlugin, MethodCallHandler, ActivityAware { private static final String TAG = "MBLEPlugin"; /// The MethodChannel that will the communication between Flutter and native Android /// /// This local reference serves to register the plugin with the Flutter Engine and unregister it /// when the Flutter Engine is detached from the Activity private MethodChannel channel; private Context context; @NonNull private Activity activity; private BLEManager bleManager; @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { context = flutterPluginBinding.getApplicationContext(); channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "mighty_ble"); channel.setMethodCallHandler(this); bleManager = new BLEManager(context, this); } @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding activityPluginBinding) { activity = activityPluginBinding.getActivity(); } @Override public void onDetachedFromActivityForConfigChanges() { // TODO: the Activity your plugin was attached to was // destroyed to change configuration. // This call will be followed by onReattachedToActivityForConfigChanges(). } @Override public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) { // TODO: your plugin is now attached to a new Activity // after a configuration change. } @Override public void onDetachedFromActivity() { // TODO: your plugin is no longer associated with an Activity. // Clean up references. } @Override public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { if (call.method.equals("getPlatformVersion")) { result.success("Android " + android.os.Build.VERSION.RELEASE); } else if(call.method.equals("initBle")) { bleManager.init(); result.success(null); } else if (call.method.equals("isAvailable")) result.success(bleManager.isAvailable()); else if (call.method.equals("startScan")) { bleManager.startScan(); result.success(null); } else if (call.method.equals("stopScan")) { bleManager.stopScan(); result.success(null); } else if (call.method.equals("connect")) { String address = call.arguments(); bleManager.connect(address); } else if (call.method.equals("disconnect")) { String address = call.arguments(); bleManager.disconnect(address); } else if (call.method.equals("write")) { String address = call.argument("id"); byte[] data = call.argument("value"); Log.i(TAG, "writing: address " + address + " data " + data); int r = bleManager.write(address, data); result.success(r); } else if (call.method.equals("setNotificationEnabled")) { String address = call.argument("id"); boolean enabled = call.argument("enabled"); bleManager.setNotificationEnabled(address, enabled); } else { result.notImplemented(); } } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { channel.setMethodCallHandler(null); } public void onScanResult(String name, String address, boolean hasMidiService) { HashMap resultData = new HashMap<>(); resultData.put("name", name); resultData.put("id", address); resultData.put("hasMidiService", hasMidiService); channel.invokeMethod("onScanResult", resultData); } public void onConnected(String address) { activity.runOnUiThread(() -> { channel.invokeMethod("onConnected", address); }); } public void onDisconnected(String address) { activity.runOnUiThread(() -> { channel.invokeMethod("onDisconnected", address); }); } public void onCharacteristicNotify(String address, byte[] data) { HashMap arguments = new HashMap<>(); arguments.put("id", address); arguments.put("value", data); Log.i(TAG, "Characteristic notify " + address + " data " + data); activity.runOnUiThread(() -> { channel.invokeMethod("onCharacteristicNotify", arguments); }); } } ================================================ FILE: plugins/mighty_ble/ios/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig /Flutter/ephemeral/ /Flutter/flutter_export_environment.sh ================================================ FILE: plugins/mighty_ble/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/mighty_ble/ios/Classes/MightyBlePlugin.h ================================================ #import @interface MightyBlePlugin : NSObject @end ================================================ FILE: plugins/mighty_ble/ios/Classes/MightyBlePlugin.m ================================================ #import "MightyBlePlugin.h" #if __has_include() #import #else // Support project import fallback if the generated compatibility header // is not copied when this plugin is created as a library. // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 #import "mighty_ble-Swift.h" #endif @implementation MightyBlePlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftMightyBlePlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/mighty_ble/ios/Classes/SwiftMightyBlePlugin.swift ================================================ import Flutter import UIKit public class SwiftMightyBlePlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "mighty_ble", binaryMessenger: registrar.messenger()) let instance = SwiftMightyBlePlugin() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { result("iOS " + UIDevice.current.systemVersion) } } ================================================ FILE: plugins/mighty_ble/ios/mighty_ble.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint mighty_ble.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'mighty_ble' s.version = '0.0.1' s.summary = 'A new Flutter plugin project.' s.description = <<-DESC A new Flutter plugin project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' s.platform = :ios, '9.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' end ================================================ FILE: plugins/mighty_ble/lib/mighty_ble.dart ================================================ import 'mighty_ble_platform_interface.dart'; enum DeviceConnectState { connected, disconnected } class ScanResult { String id; String name; bool hasMidiService; ScanResult(this.id, this.name, this.hasMidiService); } class MightyBle { Stream> get scanResults => MightyBlePlatform.instance.scanResults; Stream get scanStatus => MightyBlePlatform.instance.scanStatus; Stream get onConnect => MightyBlePlatform.instance.onConnect; Stream get onDisconnect => MightyBlePlatform.instance.onDisconnect; Future getPlatformVersion() { return MightyBlePlatform.instance.getPlatformVersion(); } Future init() { return MightyBlePlatform.instance.init(); } Future isAvailable() { return MightyBlePlatform.instance.isAvailable(); } Future startScan() { return MightyBlePlatform.instance.startScan(); } Future stopScan() { return MightyBlePlatform.instance.stopScan(); } Future connect(String id) { return MightyBlePlatform.instance.connect(id); } Future disconnect(String id) { return MightyBlePlatform.instance.disconnect(id); } Future setNotificationEnabled(String id, bool enabled) async { return MightyBlePlatform.instance.setNotificationEnabled(id, enabled); } Future writeBle(String id, List byteArray) { return MightyBlePlatform.instance.writeBle(id, byteArray); } void setNotifyCallback( Function(String address, List data) notifyCallback) { MightyBlePlatform.instance.setNotifyCallback(notifyCallback); } } ================================================ FILE: plugins/mighty_ble/lib/mighty_ble_method_channel.dart ================================================ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'mighty_ble.dart'; import 'mighty_ble_platform_interface.dart'; /// An implementation of [MightyBlePlatform] that uses method channels. class MethodChannelMightyBle extends MightyBlePlatform { /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('mighty_ble'); final StreamController> _scanResults = StreamController(); Function(String address, List data)? _notifyCallback; @override Stream> get scanResults => _scanResults.stream; final StreamController _scanStatus = StreamController(); @override Stream get scanStatus => _scanStatus.stream; final StreamController _onConnect = StreamController(); @override Stream get onConnect => _onConnect.stream; final StreamController _onDisconnect = StreamController(); @override Stream get onDisconnect => _onDisconnect.stream; MethodChannelMightyBle() { methodChannel.setMethodCallHandler(methodHandler); // set method handler } @override Future getPlatformVersion() async { final version = await methodChannel.invokeMethod('getPlatformVersion'); return version; } @override Future init() async { await methodChannel.invokeMethod("initBle"); } @override Future isAvailable() async { return await methodChannel.invokeMethod("isAvailable"); } @override Future startScan() async { await methodChannel.invokeMethod("startScan"); _scanStatus.add(true); } @override Future stopScan() async { await methodChannel.invokeMethod("stopScan"); _scanStatus.add(false); } @override Future connect(String id) async { _scanStatus.add(false); await methodChannel.invokeMethod("connect", id); } @override Future disconnect(String id) async { await methodChannel.invokeMethod("disconnect", id); } @override Future setNotificationEnabled(String id, bool enabled) async { var args = {"id": id, "enabled": enabled}; return await methodChannel.invokeMethod("setNotificationEnabled", args); } @override Future writeBle(String id, List byteArray) async { var args = {"id": id, "value": Uint8List.fromList(byteArray)}; return await methodChannel.invokeMethod("write", args); } @override void setNotifyCallback( Function(String address, List data) notifyCallback) { _notifyCallback = notifyCallback; } Future methodHandler(MethodCall call) async { switch (call.method) { case "onScanResult": var result = call.arguments; ScanResult sr = ScanResult(result['id'], result['name'], result['hasMidiService']); //todo: stupid _scanResults.add([sr]); break; case "onConnected": print("Flutter: on connected ${call.arguments}"); _onConnect.add(call.arguments.toString()); break; case "onDisconnected": print("Flutter: on disconnected ${call.arguments}"); _onDisconnect.add(call.arguments.toString()); break; case "onCharacteristicNotify": var result = call.arguments; var id = result['id']; Uint8List value = result['value']; _notifyCallback?.call(id, value.toList()); break; default: print('no method handler for method ${call.method}'); } } } ================================================ FILE: plugins/mighty_ble/lib/mighty_ble_platform_interface.dart ================================================ import 'dart:async'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'mighty_ble.dart'; import 'mighty_ble_method_channel.dart'; abstract class MightyBlePlatform extends PlatformInterface { /// Constructs a MightyBlePlatform. MightyBlePlatform() : super(token: _token); Stream get scanStatus; Stream> get scanResults; Stream get onConnect; Stream get onDisconnect; static final Object _token = Object(); static MightyBlePlatform _instance = MethodChannelMightyBle(); /// The default instance of [MightyBlePlatform] to use. /// /// Defaults to [MethodChannelMightyBle]. static MightyBlePlatform get instance => _instance; /// Platform-specific implementations should set this with their own /// platform-specific class that extends [MightyBlePlatform] when /// they register themselves. static set instance(MightyBlePlatform instance) { PlatformInterface.verifyToken(instance, _token); _instance = instance; } Future getPlatformVersion() { throw UnimplementedError('platformVersion() has not been implemented.'); } Future init() { throw UnimplementedError('platformVersion() has not been implemented.'); } Future isAvailable() { throw UnimplementedError('platformVersion() has not been implemented.'); } Future startScan() { throw UnimplementedError('platformVersion() has not been implemented.'); } Future stopScan() { throw UnimplementedError('platformVersion() has not been implemented.'); } Future connect(String id) { throw UnimplementedError('platformVersion() has not been implemented.'); } Future disconnect(String id) { throw UnimplementedError('platformVersion() has not been implemented.'); } Future setNotificationEnabled(String id, bool enabled) { throw UnimplementedError( 'setNotificationEnabled() has not been implemented.'); } Future writeBle(String id, List byteArray) { throw UnimplementedError('platformVersion() has not been implemented.'); } void setNotifyCallback( Function(String address, List data) notifyCallback) { throw UnimplementedError('platformVersion() has not been implemented.'); } } ================================================ FILE: plugins/mighty_ble/pubspec.yaml ================================================ name: mighty_ble description: A simple BLE plugin to be used with Mightier Amp version: 1.0.0 homepage: environment: sdk: '>=2.18.4 <3.0.0' flutter: ">=2.5.0" dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.0.2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # This section identifies this Flutter project as a plugin project. # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) # which should be registered in the plugin registry. This is required for # using method channels. # The Android 'package' specifies package in which the registered class is. # This is required for using method channels on Android. # The 'ffiPlugin' specifies that native code should be built and bundled. # This is required for using `dart:ffi`. # All these are used by the tooling to maintain consistency when # adding or updating assets for this project. plugin: platforms: android: package: com.tuntori.mighty_ble pluginClass: MightyBlePlugin ios: pluginClass: MightyBlePlugin # To add assets to your plugin package, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # # For details regarding assets in packages, see # https://flutter.dev/assets-and-images/#from-packages # # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware # To add custom fonts to your plugin package, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts in packages, see # https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: plugins/qr_utils-0.1.5/.gitignore ================================================ # Created by https://www.gitignore.io/api/osx,vim,dart,linux,android,windows,flutter,notepadpp,visualstudio,androidstudio # Edit at https://www.gitignore.io/?templates=osx,vim,dart,linux,android,windows,flutter,notepadpp,visualstudio,androidstudio ### Android ### # Built application files *.apk *.ap_ *.aab # Files for the ART/Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ out/ release/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ # Log Files *.log # Android Studio Navigation editor temp files .navigation/ # Android Studio captures folder captures/ # IntelliJ *.iml .idea/workspace.xml .idea/tasks.xml .idea/gradle.xml .idea/assetWizardSettings.xml .idea/dictionaries .idea/libraries # Android Studio 3 in .gitignore file. .idea/caches .idea/modules.xml # Comment next line if keeping position of elements in Navigation Editor is relevant for you .idea/navEditor.xml # Keystore files # Uncomment the following lines if you do not want to check your keystore files in. #*.jks #*.keystore # External native build folder generated in Android Studio 2.2 and later .externalNativeBuild # Google Services (e.g. APIs or Firebase) # google-services.json # Freeline freeline.py freeline/ freeline_project_description.json # fastlane fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output fastlane/readme.md # Version control vcs.xml # lint lint/intermediates/ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ ### Android Patch ### gen-external-apklibs output.json # Replacement of .externalNativeBuild directories introduced # with Android Studio 3.5. .cxx/ ### Dart ### # See https://www.dartlang.org/guides/libraries/private-files # Files and directories created by pub .dart_tool/ .packages # If you're building an application, you may want to check-in your pubspec.lock pubspec.lock # Directory created by dartdoc # If you don't generate documentation locally you can remove this line. doc/api/ # Avoid committing generated Javascript files: *.dart.js *.info.json # Produced by the --dump-info flag. *.js # When generated by dart2js. Don't specify *.js if your # project includes source files written in JavaScript. *.js_ *.js.deps *.js.map ### Flutter ### # Flutter/Dart/Pub related **/doc/api/ .flutter-plugins .flutter-plugins-dependencies .pub-cache/ .pub/ # Android related **/android/**/gradle-wrapper.jar **/android/.gradle **/android/captures/ **/android/gradlew **/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java # iOS/XCode related **/ios/**/*.mode1v3 **/ios/**/*.mode2v3 **/ios/**/*.moved-aside **/ios/**/*.pbxuser **/ios/**/*.perspectivev3 **/ios/**/*sync/ **/ios/**/.sconsign.dblite **/ios/**/.tags* **/ios/**/.vagrant/ **/ios/**/DerivedData/ **/ios/**/Icon? **/ios/**/Pods/ **/ios/**/.symlinks/ **/ios/**/profile **/ios/**/xcuserdata **/ios/.generated/ **/ios/Flutter/App.framework **/ios/Flutter/Flutter.framework **/ios/Flutter/Generated.xcconfig **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ **/ios/ServiceDefinitions.json **/ios/Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !**/ios/**/default.mode1v3 !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages ### Linux ### *~ # temporary files which can be created if a process still has a handle open of a deleted file .fuse_hidden* # KDE directory preferences .directory # Linux trash folder which might appear on any partition or disk .Trash-* # .nfs files are created when an open file is removed but is still being accessed .nfs* ### NotepadPP ### # Notepad++ backups # *.bak ### OSX ### # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk ### Vim ### # Swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] [._]sw[a-p] # Session Session.vim Sessionx.vim # Temporary .netrwhist # Auto-generated tag files tags # Persistent undo [._]*.un~ # Coc configuration directory .vim ### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk ### AndroidStudio ### # Covers files to be ignored for android development using Android Studio. # Built application files # Files for the ART/Dalvik VM # Java class files # Generated files # Gradle files .gradle # Signing files .signing/ # Local configuration file (sdk path, etc) # Proguard folder generated by Eclipse # Log Files # Android Studio /*/build/ /*/local.properties /*/out /*/*/build /*/*/production *.ipr *.swp # Android Patch # External native build folder generated in Android Studio 2.2 and later # NDK obj/ # IntelliJ IDEA *.iws /out/ # User-specific configurations .idea/caches/ .idea/libraries/ .idea/shelf/ .idea/.name .idea/compiler.xml .idea/copyright/profiles_settings.xml .idea/encodings.xml .idea/misc.xml .idea/scopes/scope_settings.xml .idea/vcs.xml .idea/jsLibraryMappings.xml .idea/datasources.xml .idea/dataSources.ids .idea/sqlDataSources.xml .idea/dynamic.xml .idea/uiDesigner.xml # OS-specific files .DS_Store? # Legacy Eclipse project files .classpath .project .cproject .settings/ # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.war *.ear # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) hs_err_pid* ## Plugin-specific files: # mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin atlassian-ide-plugin.xml # Mongo Explorer plugin .idea/mongoSettings.xml # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties ### AndroidStudio Patch ### !/gradle/wrapper/gradle-wrapper.jar ### VisualStudio ### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.rsuser *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Mono auto generated files mono_crash.* # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUnit *.VisualState.xml TestResult.xml nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # Benchmark Results BenchmarkDotNet.Artifacts/ # .NET Core project.lock.json project.fragment.lock.json artifacts/ # StyleCop StyleCopReport.xml # Files built by Visual Studio *_i.c *_p.c *_h.h *.ilk *.obj *.iobj *.pch *.pdb *.ipdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *_wpftmp.csproj *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # Visual Studio Trace Files *.e2e # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # AxoCover is a Code Coverage Tool .axoCover/* !.axoCover/settings.json # Visual Studio code coverage results *.coverage *.coveragexml # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # NuGet Symbol Packages *.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx *.appxbundle *.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !?*.[Cc]ache/ # Others ClientBin/ ~$* *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs # Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm ServiceFabricBackup/ *.rptproj.bak # SQL Server files *.mdf *.ldf *.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings *.rptproj.rsuser *- [Bb]ackup.rdl *- [Bb]ackup ([0-9]).rdl *- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat node_modules/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # CodeRush personal settings .cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Cake - Uncomment if you are using it # tools/** # !tools/packages.config # Tabs Studio *.tss # Telerik's JustMock configuration file *.jmconfig # BizTalk build output *.btp.cs *.btm.cs *.odx.cs *.xsd.cs # OpenCover UI analysis results OpenCover/ # Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log *.binlog # NVidia Nsight GPU debugger configuration file *.nvuser # MFractors (Xamarin productivity tool) working folder .mfractor/ # Local History for Visual Studio .localhistory/ # BeatPulse healthcheck temp database healthchecksdb # Backup folder for Package Reference Convert tool in Visual Studio 2017 MigrationBackup/ # End of https://www.gitignore.io/api/osx,vim,dart,linux,android,windows,flutter,notepadpp,visualstudio,androidstudio ================================================ FILE: plugins/qr_utils-0.1.5/CHANGELOG.md ================================================ ## 0.1.5 * minor changes ## 0.1.4 * README.md updated ## 0.1.3 * QR code cancel handled * README.md updated ## 0.1.2 * QR code cancel handled * README.md updated ## 0.1.1 * README.md updated ## 0.1.0 * Initial Release ================================================ FILE: plugins/qr_utils-0.1.5/LICENSE ================================================ MIT License Copyright (c) 2019 Aeologic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: plugins/qr_utils-0.1.5/README.md ================================================ For help getting started with Flutter, view our online [documentation](https://flutter.io/). [![Pub](https://img.shields.io/badge/Pub-0.1.4-orange.svg?style=flat-square)](https://pub.dartlang.org/packages/qr_utils) # qr_utils A new Flutter QR scanner and generator plugin. This plugin is use for scanning 1D barcode and 2D QR code and generating QR code as well. ### Implementation in Flutter Simply add a dependency to you pubspec.yaml for qr_utils. Then import the package in your dart file with ```dart import 'package:qr_utils/qr_utils.dart'; ``` ### Usages 1. Scan QR ```dart // Scan QR final content = await QrUtils.scanQR; ``` 2. Generate QR ```dart // Generate QR Image image = await QrUtils.generateQR(content); ``` ================================================ FILE: plugins/qr_utils-0.1.5/android/.gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures ================================================ FILE: plugins/qr_utils-0.1.5/android/build.gradle ================================================ group 'com.aeologic.adhoc.qr_utils' version '1.0-SNAPSHOT' buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' } } rootProject.allprojects { repositories { google() jcenter() } } apply plugin: 'com.android.library' android { compileSdkVersion 31 namespace 'com.aeologic.adhoc.qr_utils' defaultConfig { minSdkVersion 16 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' } } dependencies { implementation 'com.karumi:dexter:5.0.0' //implementation 'me.dm7.barcodescanner:zxing:1.9.13' //implementation files('libs/zxing-1.3.jar') implementation 'me.dm7.barcodescanner:zxing:1.9.3' } ================================================ FILE: plugins/qr_utils-0.1.5/android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M ================================================ FILE: plugins/qr_utils-0.1.5/android/settings.gradle ================================================ rootProject.name = 'qr_utils' ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/java/com/aeologic/adhoc/qr_utils/QrUtilsPlugin.java ================================================ package com.aeologic.adhoc.qr_utils; import android.Manifest; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Base64; import android.util.Log; import android.widget.Toast; import androidx.annotation.NonNull; import com.aeologic.adhoc.qr_utils.activity.QRScannerActivity; import com.aeologic.adhoc.qr_utils.utils.Utility; import com.google.zxing.BinaryBitmap; import com.google.zxing.LuminanceSource; import com.google.zxing.MultiFormatReader; import com.google.zxing.Reader; import com.google.zxing.RGBLuminanceSource; import com.google.zxing.common.HybridBinarizer; import com.karumi.dexter.Dexter; import com.karumi.dexter.MultiplePermissionsReport; import com.karumi.dexter.PermissionToken; import com.karumi.dexter.listener.PermissionRequest; import com.karumi.dexter.listener.multi.MultiplePermissionsListener; import java.io.ByteArrayOutputStream; import java.util.List; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; /** * QrUtilsPlugin */ public class QrUtilsPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware { private static final String TAG = QrUtilsPlugin.class.getSimpleName(); private static final String METHOD_CHANNEL = "com.aeologic.adhoc.qr_utils"; private MethodChannel channel; private Activity activity; private Result pendingResult; private int requestID; private static final int REQUEST_SCAN_QR = 0x1000001; @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), METHOD_CHANNEL); channel.setMethodCallHandler(this); } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { if (channel != null) { channel.setMethodCallHandler(null); channel = null; } } @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { activity = binding.getActivity(); binding.addActivityResultListener((requestCode, resultCode, data) -> onActivityResult(requestCode, resultCode, data)); } @Override public void onDetachedFromActivityForConfigChanges() { activity = null; } @Override public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { onAttachedToActivity(binding); } @Override public void onDetachedFromActivity() { activity = null; } @Override public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { this.pendingResult = result; if (call.method.equals("scanQR")) { requestID = REQUEST_SCAN_QR; checkPermission(); } else if (call.method.equals("scanImage")) { byte[] data = call.argument("data"); String qrData = scanQRImage(data); result.success(qrData); } else if (call.method.equals("generateQR")) { String content = call.argument("content"); generateQR(content); } else { result.notImplemented(); } } private void checkPermission() { Dexter.withActivity(activity) .withPermissions(Manifest.permission.CAMERA) .withListener(new MultiplePermissionsListener() { @Override public void onPermissionsChecked(MultiplePermissionsReport report) { if (report.areAllPermissionsGranted()) { if (requestID == REQUEST_SCAN_QR) { scanQR(); } } else { Toast.makeText(activity, activity.getString(R.string.grant_all_permission), Toast.LENGTH_SHORT).show(); } } @Override public void onPermissionRationaleShouldBeShown(List permissions, PermissionToken token) { token.continuePermissionRequest(); } }).check(); } private String scanQRImage(byte[] data) { Bitmap bMap = BitmapFactory.decodeByteArray(data, 0, data.length); String contents = null; int[] intArray = new int[bMap.getWidth() * bMap.getHeight()]; bMap.getPixels(intArray, 0, bMap.getWidth(), 0, 0, bMap.getWidth(), bMap.getHeight()); LuminanceSource source = new RGBLuminanceSource(bMap.getWidth(), bMap.getHeight(), intArray); BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); Reader reader = new MultiFormatReader(); try { com.google.zxing.Result result = reader.decode(bitmap); contents = result.getText(); } catch (Exception e) { Log.e(TAG, "Error decoding QR code", e); } return contents; } private void generateQR(final String content) { new Thread(() -> { try { final Bitmap qrBmp = Utility.generateQRCode(content); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); qrBmp.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); final byte[] byteArray = byteArrayOutputStream.toByteArray(); final String qrBase64 = Base64.encodeToString(byteArray, Base64.DEFAULT); activity.runOnUiThread(() -> pendingResult.success(byteArray)); } catch (Exception e) { activity.runOnUiThread(() -> Toast.makeText(activity, "QR code generation failed.", Toast.LENGTH_SHORT).show()); Log.e(TAG, "Error generating QR code", e); } }).start(); } private void scanQR() { Intent intent = new Intent(activity, QRScannerActivity.class); activity.startActivityForResult(intent, REQUEST_SCAN_QR); } private boolean onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_SCAN_QR) { if (resultCode == Activity.RESULT_OK && data != null) { String content = data.getStringExtra(QRScannerActivity.QR_CONTENT); pendingResult.success(content); } else { pendingResult.success(null); } return true; } return false; } } ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/java/com/aeologic/adhoc/qr_utils/activity/QRScannerActivity.java ================================================ package com.aeologic.adhoc.qr_utils.activity; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.Handler; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.widget.ImageView; import android.widget.Toast; import android.graphics.Color; import com.aeologic.adhoc.qr_utils.R; import com.google.zxing.Result; import me.dm7.barcodescanner.zxing.ZXingScannerView; import static com.aeologic.adhoc.qr_utils.utils.Utility.isDrawablesIdentical; /** * Created by Deepak on 06-Jul-17. */ public class QRScannerActivity extends AppCompatActivity implements View.OnClickListener, ZXingScannerView.ResultHandler { private static final String TAG = QRScannerActivity.class.getSimpleName(); private ZXingScannerView mScannerView; private ViewGroup contentFrame; private ImageView flashImg; public static final String QR_CONTENT = "QR_CONTENT"; @Override public void onCreate(Bundle state) { super.onCreate(state); setContentView(R.layout.activity_qr_scanner); initViews(); /*setupToolbar(); setupStatusBarColor();*/ mScannerView = new ZXingScannerView(this); mScannerView.setLaserEnabled(false); mScannerView.setSquareViewFinder(true); contentFrame.addView(mScannerView); flashImg.setOnClickListener(this); } private void initViews() { contentFrame = findViewById(R.id.content_frame); flashImg = findViewById(R.id.flash_img); } @Override public void onClick(View view) { if (view == flashImg) { if (isDrawablesIdentical(flashImg.getDrawable(), getResources().getDrawable(R.drawable.ic_flash_active))) { flashImg.setImageDrawable(getResources().getDrawable(R.drawable.ic_flash_inactive)); startFlash(false); } else if (isDrawablesIdentical(flashImg.getDrawable(), getResources().getDrawable(R.drawable.ic_flash_inactive))) { flashImg.setImageDrawable(getResources().getDrawable(R.drawable.ic_flash_active)); startFlash(true); } } } private void startFlash(boolean status) { mScannerView.setFlash(status); } private void setupToolbar() { //Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); //setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); setTitle(getString(R.string.qr_scanner)); } private void setupStatusBarColor() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); //window.setStatusBarColor(getResources().getColor(R.color.blueDark)); } } @Override public void onResume() { super.onResume(); mScannerView.setResultHandler(this); mScannerView.startCamera(); } @Override public void onPause() { super.onPause(); mScannerView.stopCamera(); } @Override public void handleResult(Result rawResult) { /*Toast.makeText(this, "Contents = " + rawResult.getText() + ", Format = " + rawResult.getBarcodeFormat().toString(), Toast.LENGTH_SHORT).show();*/ if (rawResult != null) { String qrContent = rawResult.getText(); Log.v("CONTENT", "DATA: " + qrContent); Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { mScannerView.resumeCameraPreview(QRScannerActivity.this); } }, 2000); Intent intent = new Intent(); intent.putExtra(QR_CONTENT, qrContent); setResult(RESULT_OK, intent); finish(); } else { Log.v(TAG,"handleResult(_) => Process Failed"); Toast.makeText(QRScannerActivity.this, getString(R.string.process_failed), Toast.LENGTH_SHORT).show(); goToBack(); } } @Override public void onBackPressed() { goToBack(); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: goToBack(); break; } return true; } private void goToBack() { Intent intent = new Intent(); setResult(RESULT_CANCELED, intent); finish(); } } ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/java/com/aeologic/adhoc/qr_utils/utils/Utility.java ================================================ package com.aeologic.adhoc.qr_utils.utils; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import com.google.zxing.BarcodeFormat; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import java.util.Hashtable; public class Utility { public static Bitmap generateQRCode(String content) throws WriterException { QRCodeWriter writer = new QRCodeWriter(); try { BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, 384, 384); int width = bitMatrix.getWidth(); int height = bitMatrix.getHeight(); Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE); } } return bmp; } catch (WriterException e) { e.printStackTrace(); } return null; } public static boolean isDrawablesIdentical(Drawable drawable1, Drawable drawable2) { Drawable.ConstantState constantState1 = drawable1.getConstantState(); Drawable.ConstantState constantState2 = drawable2.getConstantState(); return (constantState1 != null && constantState2 != null && constantState1.equals(constantState2)) || getBitmap(drawable1).sameAs(getBitmap(drawable2)); } public static Bitmap getBitmap(Drawable drawable) { Bitmap result; if (drawable instanceof BitmapDrawable) { result = ((BitmapDrawable) drawable).getBitmap(); } else { int width = drawable.getIntrinsicWidth(); int height = drawable.getIntrinsicHeight(); // Some drawables have no intrinsic width - e.g. solid colours. if (width <= 0) { width = 1; } if (height <= 0) { height = 1; } result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(result); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); } return result; } } ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/drawable/ic_flash_active.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/drawable/ic_flash_inactive.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/drawable/ic_shape_circle.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/layout/activity_qr_scanner.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/values/colors.xml ================================================ #FFFFFF ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/values/strings.xml ================================================ Process failed QR Scanner Please grant all permissions! ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/values/styles.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/android/src/main/res/xml/provider_paths.xml ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/ios/.gitignore ================================================ .idea/ .vagrant/ .sconsign.dblite .svn/ .DS_Store *.swp profile DerivedData/ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m .generated/ *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 xcuserdata *.moved-aside *.pyc *sync/ Icon? .tags* /Flutter/Generated.xcconfig ================================================ FILE: plugins/qr_utils-0.1.5/ios/Assets/.gitkeep ================================================ ================================================ FILE: plugins/qr_utils-0.1.5/ios/Classes/QrUtilsPlugin.h ================================================ #import @interface QrUtilsPlugin : NSObject @end ================================================ FILE: plugins/qr_utils-0.1.5/ios/Classes/QrUtilsPlugin.m ================================================ #import "QrUtilsPlugin.h" #if __has_include() #import #else // Support project import fallback if the generated compatibility header // is not copied when this plugin is created as a library. // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 #import "qr_utils-Swift.h" #endif @implementation QrUtilsPlugin + (void)registerWithRegistrar:(NSObject*)registrar { [SwiftQrUtilsPlugin registerWithRegistrar:registrar]; } @end ================================================ FILE: plugins/qr_utils-0.1.5/ios/Classes/SwiftQRScanner.swift ================================================ import Flutter import UIKit import AVFoundation enum ScanMode:Int{ case QR case BARCODE case DEFAULT var index: Int { return rawValue } } public class SwiftFlutterBarcodeScannerPlugin: NSObject, ScanBarcodeDelegate { public static var viewController = UIViewController() public static var lineColor:String="#ff6666" public static var cancelButtonText:String="Cancel" public static var isShowFlashIcon:Bool=true var pendingResult:FlutterResult! public static var scanMode = ScanMode.QR.index public static func initScanner() { viewController = (UIApplication.shared.delegate?.window??.rootViewController)! } /// Check for camera availability func checkCameraAvailability()->Bool{ return UIImagePickerController.isSourceTypeAvailable(.camera) } func checkForCameraPermission()->Bool{ return AVCaptureDevice.authorizationStatus(for: .video) == .authorized } public func showScanner(result: @escaping FlutterResult) { pendingResult=result let controller = BarcodeScannerViewController() controller.delegate = self if #available(iOS 13.0, *) { controller.modalPresentationStyle = .fullScreen } if checkCameraAvailability(){ if checkForCameraPermission() { SwiftFlutterBarcodeScannerPlugin.viewController.present(controller , animated: true) { } }else { AVCaptureDevice.requestAccess(for: .video) { success in DispatchQueue.main.async { if success { SwiftFlutterBarcodeScannerPlugin.viewController.present(controller , animated: true) { } } else { let alert = UIAlertController(title: "Action needed", message: "Please grant camera permission to use barcode scanner", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Grant", style: .default, handler: { action in UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!) })) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) SwiftFlutterBarcodeScannerPlugin.viewController.present(alert, animated: true) } } }} }else { showAlertDialog(title: "Unable to proceed", message: "Camera not available") } } public func userDidScanWith(barcode: String){ pendingResult(barcode) } /// Show common alert dialog func showAlertDialog(title:String,message:String){ let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let alertAction = UIAlertAction(title: "Ok", style: .default, handler: nil) alertController.addAction(alertAction) SwiftFlutterBarcodeScannerPlugin.viewController.present(alertController, animated: true, completion: nil) } } protocol ScanBarcodeDelegate { func userDidScanWith(barcode: String) } class BarcodeScannerViewController: UIViewController { private let supportedCodeTypes = [AVMetadataObject.ObjectType.qr] public var delegate: ScanBarcodeDelegate? = nil private var captureSession = AVCaptureSession() private var videoPreviewLayer: AVCaptureVideoPreviewLayer? private var qrCodeFrameView: UIView? private var scanlineRect = CGRect.zero private var scanlineStartY: CGFloat = 0 private var scanlineStopY: CGFloat = 0 private var topBottomMargin: CGFloat = 80 private var scanLine: UIView = UIView() var screenSize = UIScreen.main.bounds private var isOrientationPortrait = true var screenHeight:CGFloat = 0 let captureMetadataOutput = AVCaptureMetadataOutput() private lazy var xCor: CGFloat! = { return self.isOrientationPortrait ? (screenSize.width - (screenSize.width*0.8))/2 : (screenSize.width - (screenSize.width*0.6))/2 }() private lazy var yCor: CGFloat! = { return self.isOrientationPortrait ? (screenSize.height - (screenSize.width*0.8))/2 : (screenSize.height - (screenSize.height*0.8))/2 }() //Bottom view private lazy var bottomView : UIView! = { let view = UIView() view.backgroundColor = UIColor.black view.translatesAutoresizingMaskIntoConstraints = false return view }() /// Create and return flash button private lazy var flashIcon : UIButton! = { let flashButton = UIButton() flashButton.setTitle("Flash",for:.normal) flashButton.translatesAutoresizingMaskIntoConstraints=false flashButton.setImage(UIImage(named: "ic_flash_off", in: Bundle(for: SwiftFlutterBarcodeScannerPlugin.self), compatibleWith: nil),for:.normal) flashButton.addTarget(self, action: #selector(BarcodeScannerViewController.flashButtonClicked), for: .touchUpInside) return flashButton }() /// Create and return switch camera button private lazy var switchCameraButton : UIButton! = { let button = UIButton() button.translatesAutoresizingMaskIntoConstraints = false button.setImage(UIImage(named: "ic_switch_camera", in: Bundle(for: SwiftFlutterBarcodeScannerPlugin.self), compatibleWith: nil),for: .normal) button.addTarget(self, action: #selector(BarcodeScannerViewController.switchCameraButtonClicked), for: .touchUpInside) return button }() /// Create and return cancel button public lazy var cancelButton: UIButton! = { let view = UIButton() view.setTitle(SwiftFlutterBarcodeScannerPlugin.cancelButtonText, for: .normal) view.translatesAutoresizingMaskIntoConstraints = false view.addTarget(self, action: #selector(BarcodeScannerViewController.cancelButtonClicked), for: .touchUpInside) return view }() override public func viewDidLoad() { super.viewDidLoad() self.isOrientationPortrait = isLandscape self.initUIComponents() } override public func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.moveVertically() } override public func viewDidDisappear(_ animated: Bool){ // Stop video capture captureSession.stopRunning() } // Init UI components needed func initUIComponents(){ if isOrientationPortrait { screenHeight = (CGFloat)((SwiftFlutterBarcodeScannerPlugin.scanMode == ScanMode.QR.index) ? (screenSize.width * 0.8) : (screenSize.width * 0.5)) } else { screenHeight = (CGFloat)((SwiftFlutterBarcodeScannerPlugin.scanMode == ScanMode.QR.index) ? (screenSize.height * 0.6) : (screenSize.height * 0.5)) } self.initBarcodeComponents() } // Inititlize components func initBarcodeComponents(){ let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera], mediaType: AVMediaType.video, position: .back) // Get the back-facing camera for capturing videos guard let captureDevice = deviceDiscoverySession.devices.first else { print("Failed to get the camera device") return } do { // Get an instance of the AVCaptureDeviceInput class using the previous device object. let input = try AVCaptureDeviceInput(device: captureDevice) // Set the input device on the capture session. if captureSession.inputs.isEmpty { captureSession.addInput(input) } // Initialize a AVCaptureMetadataOutput object and set it as the output device to the capture session. let captureRectWidth = self.isOrientationPortrait ? (screenSize.width*0.8):(screenSize.height*0.8) captureMetadataOutput.rectOfInterest = CGRect(x: xCor, y: yCor, width: captureRectWidth, height: screenHeight) if captureSession.outputs.isEmpty { captureSession.addOutput(captureMetadataOutput) } // Set delegate and use the default dispatch queue to execute the call back captureMetadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main) captureMetadataOutput.metadataObjectTypes = supportedCodeTypes // captureMetadataOutput.metadataObjectTypes = [AVMetadataObject.ObjectType.qr] } catch { // If any error occurs, simply print it out and don't continue any more. print(error) return } // Initialize the video preview layer and add it as a sublayer to the viewPreview view's layer. videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession) videoPreviewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill videoPreviewLayer?.frame = view.layer.bounds setVideoPreviewOrientation() //videoPreviewLayer?.connection?.videoOrientation = self.isOrientationPortrait ? AVCaptureVideoOrientation.portrait : AVCaptureVideoOrientation.landscapeRight self.drawUIOverlays{ } } func drawUIOverlays(withCompletion processCompletionCallback: () -> Void){ // func drawUIOverlays(){ let overlayPath = UIBezierPath(rect: view.bounds) let transparentPath = UIBezierPath(rect: CGRect(x: xCor, y: yCor, width: self.isOrientationPortrait ? (screenSize.width*0.8) : (screenSize.height*0.8), height: screenHeight)) overlayPath.append(transparentPath) overlayPath.usesEvenOddFillRule = true let fillLayer = CAShapeLayer() fillLayer.path = overlayPath.cgPath fillLayer.fillRule = CAShapeLayerFillRule.evenOdd fillLayer.fillColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5).cgColor videoPreviewLayer?.layoutSublayers() videoPreviewLayer?.layoutIfNeeded() view.layer.addSublayer(videoPreviewLayer!) // Start video capture. captureSession.startRunning() let scanRect = CGRect(x: xCor, y: yCor, width: self.isOrientationPortrait ? (screenSize.width*0.8) : (screenSize.height*0.8), height: screenHeight) let rectOfInterest = videoPreviewLayer?.metadataOutputRectConverted(fromLayerRect: scanRect) if let rOI = rectOfInterest{ captureMetadataOutput.rectOfInterest = rOI } // Initialize QR Code Frame to highlight the QR code qrCodeFrameView = UIView() qrCodeFrameView!.frame = CGRect(x: 0, y: 0, width: self.isOrientationPortrait ? (screenSize.width * 0.8) : (screenSize.height * 0.8), height: screenHeight) if let qrCodeFrameView = qrCodeFrameView { self.view.addSubview(qrCodeFrameView) self.view.bringSubviewToFront(qrCodeFrameView) qrCodeFrameView.layer.insertSublayer(fillLayer, below: videoPreviewLayer!) self.view.bringSubviewToFront(bottomView) self.view.bringSubviewToFront(flashIcon) if(!SwiftFlutterBarcodeScannerPlugin.isShowFlashIcon){ flashIcon.isHidden=true } qrCodeFrameView.layoutIfNeeded() qrCodeFrameView.layoutSubviews() qrCodeFrameView.setNeedsUpdateConstraints() self.view.bringSubviewToFront(cancelButton) self.view.bringSubviewToFront(switchCameraButton) } setConstraintsForControls() self.drawLine() processCompletionCallback() } /// Apply constraints to ui components private func setConstraintsForControls() { self.view.addSubview(bottomView) self.view.addSubview(cancelButton) self.view.addSubview(flashIcon) self.view.addSubview(switchCameraButton) bottomView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant:0).isActive = true bottomView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant:0).isActive = true bottomView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant:0).isActive = true bottomView.heightAnchor.constraint(equalToConstant:self.isOrientationPortrait ? 100.0 : 70.0).isActive=true flashIcon.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true flashIcon.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -10).isActive = true flashIcon.heightAnchor.constraint(equalToConstant: 40.0).isActive = true flashIcon.widthAnchor.constraint(equalToConstant: 40.0).isActive = true cancelButton.translatesAutoresizingMaskIntoConstraints = false cancelButton.widthAnchor.constraint(equalToConstant: 100.0).isActive = true cancelButton.heightAnchor.constraint(equalToConstant: 70.0).isActive = true cancelButton.bottomAnchor.constraint(equalTo:view.bottomAnchor,constant: 0).isActive=true cancelButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant:10).isActive = true switchCameraButton.translatesAutoresizingMaskIntoConstraints = false // A little bit to the right. switchCameraButton.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 10).isActive = true switchCameraButton.heightAnchor.constraint(equalToConstant: 70.0).isActive = true switchCameraButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true } /// Flash button click event listener @IBAction private func flashButtonClicked() { if #available(iOS 10.0, *) { toggleFlash() } else { /// Handle further checks } } private func flashIconOff() { flashIcon.setImage(UIImage(named: "ic_flash_off", in: Bundle(for: SwiftFlutterBarcodeScannerPlugin.self), compatibleWith: nil),for:.normal) } private func flashIconOn() { flashIcon.setImage(UIImage(named: "ic_flash_on", in: Bundle(for: SwiftFlutterBarcodeScannerPlugin.self), compatibleWith: nil),for:.normal) } private func setFlashStatus(device: AVCaptureDevice, mode: AVCaptureDevice.TorchMode) { guard device.hasTorch else { flashIconOff() return } do { try device.lockForConfiguration() if (mode == .off) { device.torchMode = AVCaptureDevice.TorchMode.off flashIconOff() } else { // Treat .auto & .on equally. do { try device.setTorchModeOn(level: 1.0) flashIconOn() } catch { print(error) } } device.unlockForConfiguration() } catch { print(error) } } /// Toggle flash and change flash icon func toggleFlash() { guard let device = getCaptureDeviceFromCurrentSession(session: captureSession) else { flashIconOff() return } do { try device.lockForConfiguration() if (device.torchMode == AVCaptureDevice.TorchMode.off) { setFlashStatus(device: device, mode: .on) } else { setFlashStatus(device: device, mode: .off) } device.unlockForConfiguration() } catch { print(error) } } /// Cancel button click event listener @IBAction private func cancelButtonClicked() { if self.delegate != nil { self.dismiss(animated: true, completion: { self.delegate?.userDidScanWith(barcode: "") }) } } /// Switch camera button click event listener @IBAction private func switchCameraButtonClicked() { // Get the current active input. guard let currentInput = captureSession.inputs.first as? AVCaptureDeviceInput else { return } let newPosition = getInversePosition(position: currentInput.device.position); guard let device = getCaptureDeviceByPosition(position: newPosition) else { return } do { let newInput = try AVCaptureDeviceInput(device: device) // Replace current input with the new one. captureSession.removeInput(currentInput) captureSession.addInput(newInput) // Disable flash by default setFlashStatus(device: device, mode: .off) } catch let error { print(error) return } } private func getCaptureDeviceFromCurrentSession(session: AVCaptureSession) -> AVCaptureDevice? { // Get the current active input. guard let currentInput = captureSession.inputs.first as? AVCaptureDeviceInput else { return nil } return currentInput.device; } private func getCaptureDeviceByPosition(position: AVCaptureDevice.Position) -> AVCaptureDevice? { // List all capture devices let devices = AVCaptureDevice.DiscoverySession(deviceTypes: [ .builtInWideAngleCamera ], mediaType: AVMediaType.video, position: .unspecified).devices for device in devices { if device.position == position { return device } } return nil; } private func getInversePosition(position: AVCaptureDevice.Position) -> AVCaptureDevice.Position { if (position == .back) { return AVCaptureDevice.Position.front; } if (position == .front) { return AVCaptureDevice.Position.back; } // Fall back to camera in the back. return AVCaptureDevice.Position.back; } /// Draw scan line private func drawLine() { self.view.addSubview(scanLine) scanLine.backgroundColor = hexStringToUIColor(hex: SwiftFlutterBarcodeScannerPlugin.lineColor) scanlineRect = CGRect(x: xCor, y: yCor, width:self.isOrientationPortrait ? (screenSize.width*0.8) : (screenSize.height*0.8), height: 2) scanlineStartY = yCor var stopY:CGFloat if SwiftFlutterBarcodeScannerPlugin.scanMode == ScanMode.QR.index { let w = self.isOrientationPortrait ? (screenSize.width*0.8) : (screenSize.height*0.6) stopY = (yCor + w) } else { let w = self.isOrientationPortrait ? (screenSize.width * 0.5) : (screenSize.height * 0.5) stopY = (yCor + w) } scanlineStopY = stopY } /// Animate scan line vertically private func moveVertically() { scanLine.frame = scanlineRect scanLine.center = CGPoint(x: scanLine.center.x, y: scanlineStartY) scanLine.isHidden = false weak var weakSelf = scanLine UIView.animate(withDuration: 2.0, delay: 0.0, options: [.repeat, .autoreverse, .beginFromCurrentState], animations: {() -> Void in weakSelf!.center = CGPoint(x: weakSelf!.center.x, y: self.scanlineStopY) }, completion: nil) } private func updatePreviewLayer(layer: AVCaptureConnection, orientation: AVCaptureVideoOrientation) { layer.videoOrientation = orientation } var isLandscape: Bool { return UIDevice.current.orientation.isValidInterfaceOrientation ? UIDevice.current.orientation.isPortrait : UIApplication.shared.statusBarOrientation.isPortrait } private func launchApp(decodedURL: String) { if presentedViewController != nil { return } if self.delegate != nil { self.dismiss(animated: true, completion: { self.delegate?.userDidScanWith(barcode: decodedURL) }) } } } /// Extension for view controller extension BarcodeScannerViewController: AVCaptureMetadataOutputObjectsDelegate { public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) { // Check if the metadataObjects array is not nil and it contains at least one object. if metadataObjects.count == 0 { qrCodeFrameView?.frame = CGRect.zero return } // Get the metadata object. let metadataObj = metadataObjects[0] as! AVMetadataMachineReadableCodeObject if supportedCodeTypes.contains(metadataObj.type) { // If the found metadata is equal to the QR code metadata (or barcode) then update the status label's text and set the bounds // let barCodeObject = videoPreviewLayer?.transformedMetadataObject(for: metadataObj) //qrCodeFrameView?.frame = barCodeObject!.bounds if metadataObj.stringValue != nil { launchApp(decodedURL: metadataObj.stringValue!) } } } } // Handle auto rotation extension BarcodeScannerViewController{ override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) updateUIAfterRotation() } func updateUIAfterRotation(){ DispatchQueue.main.async { if UIDevice.current.orientation == .portrait || UIDevice.current.orientation == .portraitUpsideDown { self.isOrientationPortrait = true }else{ self.isOrientationPortrait = false } //self.isOrientationPortrait = self.isLandscape self.screenSize = UIScreen.main.bounds if UIDevice.current.orientation == .portrait || UIDevice.current.orientation == .portraitUpsideDown { self.screenHeight = (CGFloat)((SwiftFlutterBarcodeScannerPlugin.scanMode == ScanMode.QR.index) ? (self.screenSize.width * 0.8) : (self.screenSize.width * 0.5)) } else { self.screenHeight = (CGFloat)((SwiftFlutterBarcodeScannerPlugin.scanMode == ScanMode.QR.index) ? (self.screenSize.height * 0.6) : (self.screenSize.height * 0.5)) } self.videoPreviewLayer?.frame = self.view.layer.bounds self.setVideoPreviewOrientation() self.xCor = self.isOrientationPortrait ? (self.screenSize.width - (self.screenSize.width*0.8))/2 : (self.screenSize.width - (self.screenSize.width*0.6))/2 self.yCor = self.isOrientationPortrait ? (self.screenSize.height - (self.screenSize.width*0.8))/2 : (self.screenSize.height - (self.screenSize.height*0.8))/2 self.videoPreviewLayer?.layoutIfNeeded() self.removeAllViews { self.drawUIOverlays{ //self.scanlineRect = CGRect(x: self.xCor, y: self.yCor, width:self.isOrientationPortrait ? (self.screenSize.width*0.8) : (self.screenSize.height*0.8), height: 2) self.scanLine.frame = self.scanlineRect self.scanLine.center = CGPoint(x: self.scanLine.center.x, y: self.scanlineStopY) // self.moveVertically() } } } } // Set video preview orientation func setVideoPreviewOrientation(){ switch(UIDevice.current.orientation){ case .unknown: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait break case .portrait: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait break case .portraitUpsideDown: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portraitUpsideDown break case .landscapeLeft: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.landscapeRight break case .landscapeRight: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.landscapeLeft break case .faceUp: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait break case .faceDown: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait break @unknown default: self.videoPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait break } } /// Remove all subviews from superviews func removeAllViews(withCompletion processCompletionCallback: () -> Void){ for view in self.view.subviews { view.removeFromSuperview() } processCompletionCallback() } } /// Convert hex string to UIColor func hexStringToUIColor (hex:String) -> UIColor { var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() if (cString.hasPrefix("#")) { cString.remove(at: cString.startIndex) } if ((cString.count) != 6 && (cString.count) != 8) { return UIColor.gray } var rgbaValue:UInt32 = 0 if (!Scanner(string: cString).scanHexInt32(&rgbaValue)) { return UIColor.gray } var aValue:CGFloat = 1.0 if ((cString.count) == 8) { aValue = CGFloat((rgbaValue & 0xFF000000) >> 24) / 255.0 } let rValue:CGFloat = CGFloat((rgbaValue & 0x00FF0000) >> 16) / 255.0 let gValue:CGFloat = CGFloat((rgbaValue & 0x0000FF00) >> 8) / 255.0 let bValue:CGFloat = CGFloat(rgbaValue & 0x000000FF) / 255.0 return UIColor( red: rValue, green: gValue, blue: bValue, alpha: aValue ) } ================================================ FILE: plugins/qr_utils-0.1.5/ios/Classes/SwiftQrUtilsPlugin.swift ================================================ import Flutter import UIKit import AVFoundation import MobileCoreServices public class SwiftQrUtilsPlugin: NSObject, FlutterPlugin, UIImagePickerControllerDelegate, UINavigationControllerDelegate { fileprivate var result:FlutterResult? fileprivate var qrcodeImage: CIImage! fileprivate var captureSession = AVCaptureSession() fileprivate var videoPreviewLayer: AVCaptureVideoPreviewLayer? fileprivate var qrCodeFrameView: UIView? var qrScanner: SwiftFlutterBarcodeScannerPlugin? private let supportedCodeTypes = [AVMetadataObject.ObjectType.qr] var controller: FlutterViewController! init(cont: FlutterViewController, messenger: FlutterBinaryMessenger) { self.controller = cont; super.init(); } public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "com.aeologic.adhoc.qr_utils", binaryMessenger: registrar.messenger()) SwiftFlutterBarcodeScannerPlugin.initScanner() let app = UIApplication.shared let controller : FlutterViewController = app.delegate!.window!!.rootViewController as! FlutterViewController; let instance = SwiftQrUtilsPlugin.init(cont: controller, messenger: registrar.messenger()) registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { self.result = result if (call.method == "scanQR") { if #available(iOS 10.0, *) { qrScanner = SwiftFlutterBarcodeScannerPlugin() qrScanner?.showScanner(result: result) } } else if (call.method == "scanImage") { self.openImagePicker() } else if (call.method == "generateQR") { let tempDataDict = call.arguments as? Dictionary let content = tempDataDict!["content"] as! String self.generateQR(text: content) } } public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { guard let image = info[.originalImage] as? UIImage else { return } controller!.dismiss(animated: true) if let features = detectQRCode(image), !features.isEmpty{ for case let row as CIQRCodeFeature in features{ print(row.messageString ?? "scan error") self.result!(row.messageString ?? "") return } } self.result!(nil) } func detectQRCode(_ image: UIImage?) -> [CIFeature]? { if let image = image, let ciImage = CIImage.init(image: image){ var options: [String: Any] let context = CIContext() options = [CIDetectorAccuracy: CIDetectorAccuracyHigh] let qrDetector = CIDetector(ofType: CIDetectorTypeQRCode, context: context, options: options) if ciImage.properties.keys.contains((kCGImagePropertyOrientation as String)){ options = [CIDetectorImageOrientation: ciImage.properties[(kCGImagePropertyOrientation as String)] ?? 1] } else { options = [CIDetectorImageOrientation: 1] } let features = qrDetector?.features(in: ciImage, options: options) return features } return nil } func getDocumentsDirectory() -> URL { let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) return paths[0] } } extension SwiftQrUtilsPlugin { @available(iOS 10.0, *) @available(iOS 10.0, *) func openImagePicker() { let pickerController = UIImagePickerController() pickerController.delegate = self pickerController.allowsEditing = false pickerController.mediaTypes = ["public.image"] pickerController.sourceType = .photoLibrary controller!.present(pickerController, animated: true) } func generateQR(text:String){ if text == "" { return } let data = text.data(using: .isoLatin1, allowLossyConversion: false) let filter = CIFilter(name: "CIQRCodeGenerator") filter!.setValue(data, forKey: "inputMessage") filter!.setValue("Q", forKey: "inputCorrectionLevel") qrcodeImage = filter!.outputImage displayQRCodeImage() } func displayQRCodeImage() { let scaleX = 263 / qrcodeImage.extent.size.width let scaleY = 263 / qrcodeImage.extent.size.height let transformedImage = qrcodeImage.transformed(by: CGAffineTransform(scaleX: scaleX, y: scaleY)) let img:UIImage = convert(cmage: transformedImage) let imageData: Data = img.pngData()! self.result!(imageData) } func convert(cmage:CIImage) -> UIImage { let context:CIContext = CIContext.init(options: nil) let cgImage:CGImage = context.createCGImage(cmage, from: cmage.extent)! let image:UIImage = UIImage.init(cgImage: cgImage) return image } } ================================================ FILE: plugins/qr_utils-0.1.5/ios/qr_utils.podspec ================================================ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'qr_utils' s.version = '0.1.5' s.summary = 'A new Flutter QR scanner and generator plugin. This plugin is use for scanning 1D barcode and 2D QR code and generating QR code as well.' s.description = <<-DESC A new Flutter QR scanner and generator plugin. DESC s.homepage = 'https://www.aeologic.com/' s.license = { :file => '../LICENSE' } s.author = { 'Deepak Nishad' => 'deepak@aeologic.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.resources = 'Assets/*.png' s.dependency 'Flutter' s.ios.deployment_target = '10.0' end ================================================ FILE: plugins/qr_utils-0.1.5/lib/qr_utils.dart ================================================ import 'dart:async'; import 'dart:convert'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; enum PresetQRError { Ok, UnsupportedFormat, WrongDevice, WrongFWVersion } class QrUtils { static const nuxQRPrefix = "nux://MightyAmp:"; static const QRMessages = [ "Imported Successfully", "Error! Unsupported Format!", "Error! This preset is for different amp model!", "Error! This preset is for different firmware version!" ]; static const MethodChannel _channel = MethodChannel('com.aeologic.adhoc.qr_utils'); // Returns Future after scanning QR code static Future get scanQR async { final String? qrContent = await _channel.invokeMethod('scanQR'); return qrContent; } static Future scanImageFromData(List data) async { final String? qrContent = await _channel.invokeMethod('scanImage', {"data": data}); return qrContent; } static Future scanImage() async { final String? qrContent = await _channel.invokeMethod('scanImage'); return qrContent; } // Returns Future after generating QR Image static Future generateQR(String content) async { final Uint8List uInt8list = await _channel.invokeMethod('generateQR', {"content": content}); return imageFromUInt8List(uInt8list); } // Returns Future after generating QR Image static Future generateQRByteArray(String content) async { final Uint8List uInt8list = await _channel.invokeMethod('generateQR', {"content": content}); return uInt8list; } // Returns Image from base64 static Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } // Returns Uint8List from base64 static Uint8List dataFromBase64String(String base64String) { return base64Decode(base64String); } // Returns String from Uint8List static String base64String(Uint8List data) { return base64Encode(data); } // Returns Image from Uint8List static Image imageFromUInt8List(Uint8List data) { return Image.memory(data); } } ================================================ FILE: plugins/qr_utils-0.1.5/pubspec.yaml ================================================ name: qr_utils description: A new Flutter QR scanner and generator plugin. This plugin is use for scanning 1D barcode and 2D QR code and generating QR code as well. version: 0.1.5 #authors: # - Deepak Nishad # - Anurag Bhatt homepage: https://www.aeologic.com/ documentation: https://pub.dev/documentation/qr_utils/latest/ repository: https://github.com/flutter-devs/qr_utils issue_tracker: https://github.com/flutter-devs/qr_utils/issues environment: sdk: ">=2.12.2 <3.0.0" flutter: ">=1.10.0" dependencies: flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter flutter: plugin: platforms: android: package: com.aeologic.adhoc.qr_utils pluginClass: QrUtilsPlugin ios: pluginClass: QrUtilsPlugin ================================================ FILE: pubspec.yaml ================================================ name: mighty_plug_manager description: Custom mighty plug/air managing app # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.18+68 environment: sdk: ">=3.0.0 <=4.0.0" dependencies: flutter: sdk: flutter permission_handler: ^10.2.0 path_provider: ^2.0.10 html: ^0.15.0 just_audio: ^0.9.20 tinycolor2: ^3.0.1 wakelock_plus: ^1.2.10 package_info_plus: ^8.1.3 device_info_plus: ^11.2.1 url_launcher: ^6.3.1 drag_and_drop_lists: path: ./plugins/drag_and_drop_list #modified to include qr scanning from gallery (for android only) #and to make it null safe qr_utils: path: ./plugins/qr_utils-0.1.5 audio_waveform: path: ./plugins/audio_waveform youtube_explode_dart: ^2.0.2 #modified audio_picker to allow multiple file selection #note the ios version does not have the multi file fix #maybe don't show it in ios altogether audio_picker: path: ./plugins/audio_picker file_picker: path: ./plugins/file_picker #modified to work on ios but not tested on_audio_query_forked: ^2.9.1 page_view_indicators: ^2.0.0 uuid: ^3.0.1 marquee_text: ^2.5.0+1 flutter_blue_plus: path: ./plugins/flutter_blue_plus flutter_web_bluetooth: ^0.2.0 mighty_ble: path: ./plugins/mighty_ble # flutter_reactive_ble: ^5.0.3 flutter_midi_command: path: ./plugins/flutter_midi_command/flutter_midi_command-0.3.7 undo: ^1.4.0 flutter_typeahead: ^5.2.0 screenshot: ^3.0.0 share_plus: ^10.1.4 convert: ^3.0.1 pocketbase: ^0.16.0 #webview_flutter: ^4.4.2 #http: ^1.1.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. # cupertino_icons: ^0.1.3 dev_dependencies: flutter_launcher_icons: ^0.11.0 flutter_test: sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^2.0.0 flutter_icons: android: "launcher_icon" ios: false image_path: "assets/icon_big.png" adaptive_icon_background: "#ffffff" adaptive_icon_foreground: "assets/icon_adaptive.png" # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: # assets must be at 2 spaces, the files at 4 assets: - assets/audio/calibration.wav - assets/images/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: fonts: - family: MightierIcons fonts: - asset: assets/fonts/MightierIcons.ttf # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: web/index.html ================================================ mighty_plug_manager ================================================ FILE: web/manifest.json ================================================ { "name": "Mightier Amp", "short_name": "Mightier Amp", "start_url": ".", "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", "description": "A new Flutter project.", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ { "src": "icons/Icon-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "icons/Icon-512.png", "sizes": "512x512", "type": "image/png" }, { "src": "icons/Icon-maskable-192.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { "src": "icons/Icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } ] } ================================================ FILE: windows/.gitignore ================================================ flutter/ephemeral/ # Visual Studio user-specific files. *.suo *.user *.userosscache *.sln.docstates # Visual Studio build-related files. x64/ x86/ # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ ================================================ FILE: windows/CMakeLists.txt ================================================ # Project-level configuration. cmake_minimum_required(VERSION 3.14) project(mighty_plug_manager LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "mighty_plug_manager") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() # Define settings for the Profile build mode. set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ================================================ FILE: windows/flutter/CMakeLists.txt ================================================ # This file controls Flutter-level build steps. It should not be edited. cmake_minimum_required(VERSION 3.14) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") # Configuration provided via flutter tool. include(${EPHEMERAL_DIR}/generated_config.cmake) # TODO: Move the rest of this into files in ephemeral. See # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "flutter_export.h" "flutter_windows.h" "flutter_messenger.h" "flutter_plugin_registrar.h" "flutter_texture_registrar.h" ) list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") add_dependencies(flutter flutter_assemble) # === Wrapper === list(APPEND CPP_WRAPPER_SOURCES_CORE "core_implementations.cc" "standard_codec.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_PLUGIN "plugin_registrar.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_APP "flutter_engine.cc" "flutter_view_controller.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") # Wrapper sources needed for a plugin. add_library(flutter_wrapper_plugin STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ) apply_standard_settings(flutter_wrapper_plugin) set_target_properties(flutter_wrapper_plugin PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(flutter_wrapper_plugin PROPERTIES CXX_VISIBILITY_PRESET hidden) target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) target_include_directories(flutter_wrapper_plugin PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_plugin flutter_assemble) # Wrapper sources needed for the runner. add_library(flutter_wrapper_app STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_APP} ) apply_standard_settings(flutter_wrapper_app) target_link_libraries(flutter_wrapper_app PUBLIC flutter) target_include_directories(flutter_wrapper_app PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_app flutter_assemble) # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ${PHONY_OUTPUT} COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" windows-x64 $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ================================================ FILE: windows/flutter/generated_plugin_registrant.cc ================================================ // // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" #include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); SharePlusWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } ================================================ FILE: windows/flutter/generated_plugin_registrant.h ================================================ // // Generated file. Do not edit. // // clang-format off #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ #include // Registers Flutter plugins. void RegisterPlugins(flutter::PluginRegistry* registry); #endif // GENERATED_PLUGIN_REGISTRANT_ ================================================ FILE: windows/flutter/generated_plugins.cmake ================================================ # # Generated file, do not edit. # list(APPEND FLUTTER_PLUGIN_LIST permission_handler_windows share_plus url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST ) set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) endforeach(ffi_plugin) ================================================ FILE: windows/runner/CMakeLists.txt ================================================ cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer # work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) # Add preprocessor definitions for the build version. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ================================================ FILE: windows/runner/Runner.rc ================================================ // Microsoft Visual C++ generated resource script. // #pragma code_page(65001) #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_APP_ICON ICON "resources\\app_icon.ico" ///////////////////////////////////////////////////////////////////////////// // // Version // #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD #else #define VERSION_AS_NUMBER 1,0,0,0 #endif #if defined(FLUTTER_VERSION) #define VERSION_AS_STRING FLUTTER_VERSION #else #define VERSION_AS_STRING "1.0.0" #endif VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_AS_NUMBER PRODUCTVERSION VERSION_AS_NUMBER FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.tuntori" "\0" VALUE "FileDescription", "mighty_plug_manager" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "mighty_plug_manager" "\0" VALUE "LegalCopyright", "Copyright (C) 2022 com.tuntori. All rights reserved." "\0" VALUE "OriginalFilename", "mighty_plug_manager.exe" "\0" VALUE "ProductName", "mighty_plug_manager" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED ================================================ FILE: windows/runner/flutter_window.cpp ================================================ #include "flutter_window.h" #include #include "flutter/generated_plugin_registrant.h" FlutterWindow::FlutterWindow(const flutter::DartProject& project) : project_(project) {} FlutterWindow::~FlutterWindow() {} bool FlutterWindow::OnCreate() { if (!Win32Window::OnCreate()) { return false; } RECT frame = GetClientArea(); // The size here must match the window dimensions to avoid unnecessary surface // creation / destruction in the startup path. flutter_controller_ = std::make_unique( frame.right - frame.left, frame.bottom - frame.top, project_); // Ensure that basic setup of the controller was successful. if (!flutter_controller_->engine() || !flutter_controller_->view()) { return false; } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); return true; } void FlutterWindow::OnDestroy() { if (flutter_controller_) { flutter_controller_ = nullptr; } Win32Window::OnDestroy(); } LRESULT FlutterWindow::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { // Give Flutter, including plugins, an opportunity to handle window messages. if (flutter_controller_) { std::optional result = flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, lparam); if (result) { return *result; } } switch (message) { case WM_FONTCHANGE: flutter_controller_->engine()->ReloadSystemFonts(); break; } return Win32Window::MessageHandler(hwnd, message, wparam, lparam); } ================================================ FILE: windows/runner/flutter_window.h ================================================ #ifndef RUNNER_FLUTTER_WINDOW_H_ #define RUNNER_FLUTTER_WINDOW_H_ #include #include #include #include "win32_window.h" // A window that does nothing but host a Flutter view. class FlutterWindow : public Win32Window { public: // Creates a new FlutterWindow hosting a Flutter view running |project|. explicit FlutterWindow(const flutter::DartProject& project); virtual ~FlutterWindow(); protected: // Win32Window: bool OnCreate() override; void OnDestroy() override; LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept override; private: // The project to run. flutter::DartProject project_; // The Flutter instance hosted by this window. std::unique_ptr flutter_controller_; }; #endif // RUNNER_FLUTTER_WINDOW_H_ ================================================ FILE: windows/runner/main.cpp ================================================ #include #include #include #include "flutter_window.h" #include "utils.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t *command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { CreateAndAttachConsole(); } // Initialize COM, so that it is available for use in the library and/or // plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); flutter::DartProject project(L"data"); std::vector command_line_arguments = GetCommandLineArguments(); project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); if (!window.CreateAndShow(L"Mightier Amp", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); ::MSG msg; while (::GetMessage(&msg, nullptr, 0, 0)) { ::TranslateMessage(&msg); ::DispatchMessage(&msg); } ::CoUninitialize(); return EXIT_SUCCESS; } ================================================ FILE: windows/runner/resource.h ================================================ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Runner.rc // #define IDI_APP_ICON 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif ================================================ FILE: windows/runner/runner.exe.manifest ================================================ PerMonitorV2 ================================================ FILE: windows/runner/utils.cpp ================================================ #include "utils.h" #include #include #include #include #include void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unused, "CONOUT$", "w", stderr)) { _dup2(_fileno(stdout), 2); } std::ios::sync_with_stdio(); FlutterDesktopResyncOutputStreams(); } } std::vector GetCommandLineArguments() { // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. int argc; wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); if (argv == nullptr) { return std::vector(); } std::vector command_line_arguments; // Skip the first argument as it's the binary name. for (int i = 1; i < argc; i++) { command_line_arguments.push_back(Utf8FromUtf16(argv[i])); } ::LocalFree(argv); return command_line_arguments; } std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr); std::string utf8_string; if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); int converted_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, utf8_string.data(), target_length, nullptr, nullptr); if (converted_length == 0) { return std::string(); } return utf8_string; } ================================================ FILE: windows/runner/utils.h ================================================ #ifndef RUNNER_UTILS_H_ #define RUNNER_UTILS_H_ #include #include // Creates a console for the process, and redirects stdout and stderr to // it for both the runner and the Flutter library. void CreateAndAttachConsole(); // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string // encoded in UTF-8. Returns an empty std::string on failure. std::string Utf8FromUtf16(const wchar_t* utf16_string); // Gets the command line arguments passed in as a std::vector, // encoded in UTF-8. Returns an empty std::vector on failure. std::vector GetCommandLineArguments(); #endif // RUNNER_UTILS_H_ ================================================ FILE: windows/runner/win32_window.cpp ================================================ #include "win32_window.h" #include #include "resource.h" namespace { constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); // Scale helper to convert logical scaler values to physical using passed in // scale factor int Scale(int source, double scale_factor) { return static_cast(source * scale_factor); } // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. // This API is only needed for PerMonitor V1 awareness mode. void EnableFullDpiSupportIfAvailable(HWND hwnd) { HMODULE user32_module = LoadLibraryA("User32.dll"); if (!user32_module) { return; } auto enable_non_client_dpi_scaling = reinterpret_cast( GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); FreeLibrary(user32_module); } } } // namespace // Manages the Win32Window's window class registration. class WindowClassRegistrar { public: ~WindowClassRegistrar() = default; // Returns the singleton registar instance. static WindowClassRegistrar* GetInstance() { if (!instance_) { instance_ = new WindowClassRegistrar(); } return instance_; } // Returns the name of the window class, registering the class if it hasn't // previously been registered. const wchar_t* GetWindowClass(); // Unregisters the window class. Should only be called if there are no // instances of the window. void UnregisterWindowClass(); private: WindowClassRegistrar() = default; static WindowClassRegistrar* instance_; bool class_registered_ = false; }; WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; const wchar_t* WindowClassRegistrar::GetWindowClass() { if (!class_registered_) { WNDCLASS window_class{}; window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); window_class.lpszClassName = kWindowClassName; window_class.style = CS_HREDRAW | CS_VREDRAW; window_class.cbClsExtra = 0; window_class.cbWndExtra = 0; window_class.hInstance = GetModuleHandle(nullptr); window_class.hIcon = LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); window_class.hbrBackground = 0; window_class.lpszMenuName = nullptr; window_class.lpfnWndProc = Win32Window::WndProc; RegisterClass(&window_class); class_registered_ = true; } return kWindowClassName; } void WindowClassRegistrar::UnregisterWindowClass() { UnregisterClass(kWindowClassName, nullptr); class_registered_ = false; } Win32Window::Win32Window() { ++g_active_window_count; } Win32Window::~Win32Window() { --g_active_window_count; Destroy(); } bool Win32Window::CreateAndShow(const std::wstring& title, const Point& origin, const Size& size) { Destroy(); const wchar_t* window_class = WindowClassRegistrar::GetInstance()->GetWindowClass(); const POINT target_point = {static_cast(origin.x), static_cast(origin.y)}; HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); double scale_factor = dpi / 96.0; HWND window = CreateWindow( window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); if (!window) { return false; } return OnCreate(); } // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { if (message == WM_NCCREATE) { auto window_struct = reinterpret_cast(lparam); SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast(window_struct->lpCreateParams)); auto that = static_cast(window_struct->lpCreateParams); EnableFullDpiSupportIfAvailable(window); that->window_handle_ = window; } else if (Win32Window* that = GetThisFromHandle(window)) { return that->MessageHandler(window, message, wparam, lparam); } return DefWindowProc(window, message, wparam, lparam); } LRESULT Win32Window::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { switch (message) { case WM_DESTROY: window_handle_ = nullptr; Destroy(); if (quit_on_close_) { PostQuitMessage(0); } return 0; case WM_DPICHANGED: { auto newRectSize = reinterpret_cast(lparam); LONG newWidth = newRectSize->right - newRectSize->left; LONG newHeight = newRectSize->bottom - newRectSize->top; SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, newHeight, SWP_NOZORDER | SWP_NOACTIVATE); return 0; } case WM_SIZE: { RECT rect = GetClientArea(); if (child_content_ != nullptr) { // Size and position the child window. MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); } return 0; } case WM_ACTIVATE: if (child_content_ != nullptr) { SetFocus(child_content_); } return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); } void Win32Window::Destroy() { OnDestroy(); if (window_handle_) { DestroyWindow(window_handle_); window_handle_ = nullptr; } if (g_active_window_count == 0) { WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); } } Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { return reinterpret_cast( GetWindowLongPtr(window, GWLP_USERDATA)); } void Win32Window::SetChildContent(HWND content) { child_content_ = content; SetParent(content, window_handle_); RECT frame = GetClientArea(); MoveWindow(content, frame.left, frame.top, frame.right - frame.left, frame.bottom - frame.top, true); SetFocus(child_content_); } RECT Win32Window::GetClientArea() { RECT frame; GetClientRect(window_handle_, &frame); return frame; } HWND Win32Window::GetHandle() { return window_handle_; } void Win32Window::SetQuitOnClose(bool quit_on_close) { quit_on_close_ = quit_on_close; } bool Win32Window::OnCreate() { // No-op; provided for subclasses. return true; } void Win32Window::OnDestroy() { // No-op; provided for subclasses. } ================================================ FILE: windows/runner/win32_window.h ================================================ #ifndef RUNNER_WIN32_WINDOW_H_ #define RUNNER_WIN32_WINDOW_H_ #include #include #include #include // A class abstraction for a high DPI-aware Win32 Window. Intended to be // inherited from by classes that wish to specialize with custom // rendering and input handling class Win32Window { public: struct Point { unsigned int x; unsigned int y; Point(unsigned int x, unsigned int y) : x(x), y(y) {} }; struct Size { unsigned int width; unsigned int height; Size(unsigned int width, unsigned int height) : width(width), height(height) {} }; Win32Window(); virtual ~Win32Window(); // Creates and shows a win32 window with |title| and position and size using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a // consistent size to will treat the width height passed in to this function // as logical pixels and scale to appropriate for the default monitor. Returns // true if the window was created successfully. bool CreateAndShow(const std::wstring& title, const Point& origin, const Size& size); // Release OS resources associated with window. void Destroy(); // Inserts |content| into the window tree. void SetChildContent(HWND content); // Returns the backing Window handle to enable clients to set icon and other // window properties. Returns nullptr if the window has been destroyed. HWND GetHandle(); // If true, closing this window will quit the application. void SetQuitOnClose(bool quit_on_close); // Return a RECT representing the bounds of the current client area. RECT GetClientArea(); protected: // Processes and route salient window messages for mouse handling, // size change and DPI. Delegates handling of these to member overloads that // inheriting classes can handle. virtual LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Called when CreateAndShow is called, allowing subclass window-related // setup. Subclasses should return false if setup fails. virtual bool OnCreate(); // Called when Destroy is called. virtual void OnDestroy(); private: friend class WindowClassRegistrar; // OS callback called by message pump. Handles the WM_NCCREATE message which // is passed when the non-client area is being created and enables automatic // non-client DPI scaling so that the non-client area automatically // responsponds to changes in DPI. All other messages are handled by // MessageHandler. static LRESULT CALLBACK WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; bool quit_on_close_ = false; // window handle for top level window. HWND window_handle_ = nullptr; // window handle for hosted content. HWND child_content_ = nullptr; }; #endif // RUNNER_WIN32_WINDOW_H_