discstation 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -545,8 +545,10 @@ void drawLoading() {
|
|
|
545
545
|
display.display();
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
// Returns true if this call actually woke a blanked screen - callers use that
|
|
549
|
+
// to swallow the wake press so it doesn't also trigger a menu action.
|
|
550
|
+
bool wakeDisplay() {
|
|
551
|
+
if (!displayBlank || !displayOk) return false;
|
|
550
552
|
display.ssd1306_command(0xAF);
|
|
551
553
|
displayBlank = false;
|
|
552
554
|
switch (uiState) {
|
|
@@ -561,6 +563,7 @@ void wakeDisplay() {
|
|
|
561
563
|
case UI_LOADING: drawLoading(); break;
|
|
562
564
|
case UI_SETUP: drawSetup(); break;
|
|
563
565
|
}
|
|
566
|
+
return true;
|
|
564
567
|
}
|
|
565
568
|
|
|
566
569
|
void drawPlay() {
|
|
@@ -655,6 +658,8 @@ void parseMessage(String msg) {
|
|
|
655
658
|
line1 = msg.substring(5);
|
|
656
659
|
line2 = "Playing disc";
|
|
657
660
|
playVolume = readPercent();
|
|
661
|
+
Out.print("POT:"); // push the knob's current level so playback starts at it
|
|
662
|
+
Out.println(playVolume);
|
|
658
663
|
drawPlay();
|
|
659
664
|
|
|
660
665
|
} else if (msg.startsWith("PLAY_MODE:")) {
|
|
@@ -810,7 +815,7 @@ void setup() {
|
|
|
810
815
|
}
|
|
811
816
|
|
|
812
817
|
void handleSelectPress(bool longPress) {
|
|
813
|
-
wakeDisplay();
|
|
818
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
814
819
|
lastInputTime = millis();
|
|
815
820
|
if (uiState == UI_HOME) {
|
|
816
821
|
if (longPress) {
|
|
@@ -896,7 +901,7 @@ void handleSelectPress(bool longPress) {
|
|
|
896
901
|
}
|
|
897
902
|
|
|
898
903
|
void handleUp(bool longPress) {
|
|
899
|
-
wakeDisplay();
|
|
904
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
900
905
|
lastInputTime = millis();
|
|
901
906
|
if (uiState == UI_HOME) {
|
|
902
907
|
if (homeCount > 0) {
|
|
@@ -933,7 +938,7 @@ void handleUp(bool longPress) {
|
|
|
933
938
|
}
|
|
934
939
|
|
|
935
940
|
void handleDown(bool longPress) {
|
|
936
|
-
wakeDisplay();
|
|
941
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
937
942
|
lastInputTime = millis();
|
|
938
943
|
if (uiState == UI_HOME) {
|
|
939
944
|
if (homeCount > 0) {
|
|
@@ -531,8 +531,10 @@ void drawDisconnected() {
|
|
|
531
531
|
display.display();
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
// Returns true if this call actually woke a blanked screen - callers use that
|
|
535
|
+
// to swallow the wake press so it doesn't also trigger a menu action.
|
|
536
|
+
bool wakeDisplay() {
|
|
537
|
+
if (!displayBlank || !displayOk) return false;
|
|
536
538
|
display.ssd1306_command(0xAF);
|
|
537
539
|
displayBlank = false;
|
|
538
540
|
switch (uiState) {
|
|
@@ -546,6 +548,7 @@ void wakeDisplay() {
|
|
|
546
548
|
case UI_DISCONNECTED: drawDisconnected(); break;
|
|
547
549
|
case UI_SETUP: drawSetup(); break;
|
|
548
550
|
}
|
|
551
|
+
return true;
|
|
549
552
|
}
|
|
550
553
|
|
|
551
554
|
void drawPlay() {
|
|
@@ -640,6 +643,8 @@ void parseMessage(String msg) {
|
|
|
640
643
|
line1 = msg.substring(5);
|
|
641
644
|
line2 = "Playing disc";
|
|
642
645
|
playVolume = readPercent();
|
|
646
|
+
Out.print("POT:"); // push the knob's current level so playback starts at it
|
|
647
|
+
Out.println(playVolume);
|
|
643
648
|
drawPlay();
|
|
644
649
|
|
|
645
650
|
} else if (msg.startsWith("PLAY_MODE:")) {
|
|
@@ -775,7 +780,7 @@ void setup() {
|
|
|
775
780
|
}
|
|
776
781
|
|
|
777
782
|
void handleSelectPress(bool longPress) {
|
|
778
|
-
wakeDisplay();
|
|
783
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
779
784
|
lastInputTime = millis();
|
|
780
785
|
if (uiState == UI_HOME) {
|
|
781
786
|
if (longPress) {
|
|
@@ -865,7 +870,7 @@ void handleSelectPress(bool longPress) {
|
|
|
865
870
|
}
|
|
866
871
|
|
|
867
872
|
void handleUp(bool longPress) {
|
|
868
|
-
wakeDisplay();
|
|
873
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
869
874
|
lastInputTime = millis();
|
|
870
875
|
if (uiState == UI_HOME) {
|
|
871
876
|
if (homeCount > 0) {
|
|
@@ -905,7 +910,7 @@ void handleUp(bool longPress) {
|
|
|
905
910
|
}
|
|
906
911
|
|
|
907
912
|
void handleDown(bool longPress) {
|
|
908
|
-
wakeDisplay();
|
|
913
|
+
if (wakeDisplay()) { lastInputTime = millis(); return; } // wake-only press, swallow the action
|
|
909
914
|
lastInputTime = millis();
|
|
910
915
|
if (uiState == UI_HOME) {
|
|
911
916
|
if (homeCount > 0) {
|