Implement creating, deleting and editing of ports

This commit is contained in:
2024-07-03 10:17:29 +02:00
parent 47d9443f48
commit 639527a49a
4 changed files with 258 additions and 20 deletions

View File

@ -3,6 +3,7 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:gomix_flutter/connection_selector.dart';
import 'package:gomix_flutter/edit_port_dialog.dart';
import 'package:gomix_flutter/mixer_state.dart' as mixer;
import 'package:gomix_flutter/mixing_tab.dart';
import 'package:gomix_flutter/ports_tab.dart';
@ -243,7 +244,8 @@ class _GoMixHomeState extends State<GoMixHome> {
mixerState: mixerState,
sendAction: sendAction,
),
const PortsTab(),
PortsTab(
mixerState: mixerState, sendAction: sendAction),
const SettingsTab(),
][currentPageIndex];
}),
@ -275,6 +277,25 @@ class _GoMixHomeState extends State<GoMixHome> {
return const SizedBox();
}),
]),
floatingActionButton: currentPageIndex == 1
? FloatingActionButton(
tooltip: "Create Port",
child: const Icon(Icons.add),
onPressed: () {
mixer.Port newPort = mixer.Port(
uuid: "",
name: "",
properties:
mixer.Properties(backend: "jack", channels: 2),
state:
mixer.State(mute: false, volume: 1, balance: 1),
route: []);
CreatePortDialog()
.show(context, sendAction, newPort, true);
},
)
: null,
);
});
}