1+ import QtCore
2+ import QtQuick.Controls.Universal
13import QtQuick
24import QtQuick.Layouts
3- import QtQuick.Controls 2.15
5+ import QtQuick.Controls
46import Score.UI as UI
57
68ApplicationWindow {
@@ -10,7 +12,13 @@ ApplicationWindow {
1012 height: 600
1113 title: " OSC Spatialization Router"
1214 color: " #1e1e1e"
15+
16+ Settings {
17+ id: appSettings
18+ category: " OSCRouter"
1319
20+ property int listenPort: 18032
21+ }
1422 property var inputDevice: null
1523 property var outputDevices: []
1624 property var addressMappings: new Map ()
@@ -19,8 +27,14 @@ ApplicationWindow {
1927
2028 // Input configuration
2129 Component .onCompleted : {
22- // Create input device for receiving from ControlGRIS
23- createInputDevice ()
30+ // Create input device for receiving from ControlGRIS
31+ createInputDevice ();
32+
33+ restoreSavedSettings ();
34+ }
35+
36+ function restoreSavedSettings () {
37+ inputPortField .text = appSettings .listenPort
2438 }
2539
2640 function createInputDevice () {
@@ -435,14 +449,15 @@ ApplicationWindow {
435449 id: inputPortField
436450 Layout .preferredWidth : Math .min (80 , window .width * 0.1 )
437451 text: " 18032"
438- color: " #ffffff "
452+ color: acceptableInput ? " #fff " : " #f00 "
439453 font .pixelSize : Math .min (12 , window .height * 0.02 )
440454
441455 background: Rectangle {
442456 color: " #3a3a3a"
443457 border .color : parent .focus ? " #5a5a5a" : " #4a4a4a"
444458 radius: 2
445459 }
460+ validator: IntValidator { bottom: 1 ; top: 65535 ; }
446461 }
447462
448463 Button {
@@ -506,7 +521,8 @@ ApplicationWindow {
506521 Layout .preferredWidth : Math .max (100 , Math .min (150 , window .width * 0.15 ))
507522 color: " #ffffff"
508523 font .pixelSize : Math .min (12 , window .height * 0.02 )
509- placeholderText: " Name"
524+ placeholderText: " (Name)"
525+ placeholderTextColor: " #888"
510526
511527 background: Rectangle {
512528 color: " #3a3a3a"
@@ -552,22 +568,23 @@ ApplicationWindow {
552568 currentIndex: 0
553569
554570 background: Rectangle {
571+ y: 3
555572 color: " #3a3a3a"
556573 border .color : parent .focus ? " #5a5a5a" : " #4a4a4a"
557574 radius: 2
575+ height: outputPortField .height
558576 }
559577
560578 contentItem: Label {
561- text: parent .displayText
579+ text: parent .displayText
580+ height: 10
562581 color: " #ffffff"
563582 verticalAlignment: Text .AlignVCenter
564583 leftPadding: 10
565- font .pixelSize : Math . min ( 12 , window . height * 0.02 )
584+ font .pixelSize : 12
566585 }
567-
568586 delegate: ItemDelegate {
569587 width: parent .width
570- height: 30
571588
572589 background: Rectangle {
573590 color: parent .hovered ? " #4a4a4a" : " #3a3a3a"
@@ -580,12 +597,12 @@ ApplicationWindow {
580597 font .pixelSize : Math .min (12 , window .height * 0.02 )
581598 }
582599 }
583-
600+ /*
584601 indicator: Canvas {
585602 x: parent.width - width - 10
586603 y: parent.topPadding + (parent.availableHeight - height) / 2
587604 width: 12
588- height: 8
605+ height: 12
589606 contextType: "2d"
590607
591608 onPaint: {
@@ -597,7 +614,8 @@ ApplicationWindow {
597614 context.fillStyle = "#888888"
598615 context.fill()
599616 }
600- }
617+ }*/
618+
601619 }
602620
603621 Button {
0 commit comments