Skip to content

Commit

Permalink
stop record timer enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoCoderMatrix86 committed Jul 11, 2024
1 parent 2680da6 commit 0771053
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
19 changes: 17 additions & 2 deletions AudioCuesheetEditor/Pages/RecordControl.razor
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ along with Foobar. If not, see
@if ((startRecordTimer != null) && (startRecordTimer.Enabled))
{
<div class="BackgroundBlink rounded">
<Heading Size="HeadingSize.Is4" TextAlignment="TextAlignment.Center">@_localizer["Record will start in {0} seconds!", ((startRecordTimer.Interval / 1000) - (DateTime.Now - recordTimerStarted).Seconds)]</Heading>
<Heading Size="HeadingSize.Is4" TextAlignment="TextAlignment.Center">
@_localizer["Record will start in {0} seconds!", ((startRecordTimer.Interval / 1000) - (DateTime.Now - recordTimerStarted).Seconds)]
</Heading>
</div>
<Button Color="Color.Danger" Clicked="StopRecordCountdownTimer" Position="Position.Relative.Start.Is50.Translate.MiddleX">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-stop-btn" viewBox="0 0 16 16">
<path d="M6.5 5A1.5 1.5 0 0 0 5 6.5v3A1.5 1.5 0 0 0 6.5 11h3A1.5 1.5 0 0 0 11 9.5v-3A1.5 1.5 0 0 0 9.5 5h-3z" />
<path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z" />
</svg>
@_localizer["Abort countdown"]
</Button>
}
<Row>
<Column>
Expand Down Expand Up @@ -103,7 +112,7 @@ along with Foobar. If not, see
</Modal>

@code {
//TODO: Allow the user to stop the record countdown
//TODO: Make button for stop aligned to the end and optimize space for the time
Timer updateGUITimer = new Timer(300);
Timer? startRecordTimer;
DateTime recordTimerStarted;
Expand Down Expand Up @@ -276,4 +285,10 @@ along with Foobar. If not, see
await StartRecordCountdownTimer();
}
}

void StopRecordCountdownTimer()
{
startRecordTimer?.Stop();
startRecordTimer = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Cuesheet already contains tracks. Recording is not possible, if tracks are present. Please save your work and start with a clean cuesheet.": "Das Cuesheet enthält bereits Titel. Die Aufnahme ist nicht möglich, wenn bereits Titel vorhanden sind. Bitte speichern Sie ihre Arbeit und starten Sie anschließend mit einem leeren Cuesheet.",
"Start countdown": "Aufnahmecountdown starten",
"Abort": "Abbrechen",
"Seconds till record starts": "Sekunden bis die Aufnahme startet"
"Seconds till record starts": "Sekunden bis die Aufnahme startet",
"Abort countdown": "Aufnahmecountdown abbrechen"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Cuesheet already contains tracks. Recording is not possible, if tracks are present. Please save your work and start with a clean cuesheet.": "Cuesheet already contains tracks. Recording is not possible, if tracks are present. Please save your work and start with a clean cuesheet.",
"Start countdown": "Start countdown",
"Abort": "Abort",
"Seconds till record starts": "Seconds till record starts"
"Seconds till record starts": "Seconds till record starts",
"Abort countdown": "Abort countdown"
}
}

0 comments on commit 0771053

Please sign in to comment.