Skip to content

Commit

Permalink
Fix #1, #2 and #4
Browse files Browse the repository at this point in the history
Fix stepValue not saved during footswitch cofiguration
Fix numpad not closing when Confirm/Done button on keyboard pressed
Add Midi value on below Midi value off on footswitch configuration
Add missing Midi channel value in footswitch configuration
  • Loading branch information
martirius committed Jan 25, 2022
1 parent a39f0fc commit f597c0b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lib/ui/component/custom_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class _CustomNumberFieldState extends State<CustomNumberField> {
if (interval >= widget.minNumber && interval <= widget.maxNumber) {
widget.onNumberChanged(interval);
}
// close the keyboard on Done pressed
FocusManager.instance.primaryFocus?.unfocus();
},
maxLength: 3,
maxLines: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ class FootswitchEventWidget extends StatelessWidget {
TextStyle(color: AppColors.textColor, fontSize: 14),
),
CustomNumberField(
(interval) => footswitchEvent.copyWith(
stepValue: interval, positiveStep: interval >= 0),
(interval) => onConfigurationChanged(
footswitchEvent.copyWith(
stepValue: interval,
positiveStep: interval >= 0)),
minNumber: -127,
maxNumber: 127,
text: footswitchEvent.stepValue.toString(),
Expand Down Expand Up @@ -239,6 +241,24 @@ class FootswitchEventWidget extends StatelessWidget {
],
),
marginWidget,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Midi Value on:',
style:
TextStyle(color: AppColors.textColor, fontSize: 14),
),
CustomNumberField(
(value) => onConfigurationChanged(
footswitchEvent.copyWith(midiValueOff: value)),
minNumber: 0,
maxNumber: 127,
text: footswitchEvent.midiValueOn.toString(),
)
],
),
marginWidget,
if (showRepeat)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -302,19 +322,36 @@ class FootswitchEventWidget extends StatelessWidget {
],
),
marginWidget,
if (footswitchEvent.eventType != EventType.ON_OFF) ...[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Midi value:',
style: TextStyle(color: AppColors.textColor, fontSize: 14),
),
CustomNumberField(
(value) => onConfigurationChanged(
footswitchEvent.copyWith(midiValueOn: value)),
text: footswitchEvent.midiValueOn.toString()),
],
),
marginWidget,
],
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Midi value:',
'Midi channel:',
style: TextStyle(color: AppColors.textColor, fontSize: 14),
),
CustomNumberField(
(value) => onConfigurationChanged(
footswitchEvent.copyWith(midiValueOn: value)),
text: footswitchEvent.midiValueOn.toString()),
(value) => onConfigurationChanged(
footswitchEvent.copyWith(midiChannel: value)),
text: footswitchEvent.midiChannel.toString(),
)
],
),
)
],
);
}
Expand Down

0 comments on commit f597c0b

Please sign in to comment.