Skip to content

Commit 2043baa

Browse files
committed
Change recordingTimeLeftInSeconds to float
1 parent 8456700 commit 2043baa

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ RecordNode::~RecordNode()
8585

8686
void RecordNode::checkDiskSpace()
8787
{
88-
int diskSpaceWarningThreshold = 5; //GB
88+
float diskSpaceWarningThreshold = 5; //GB
8989

9090
File dataDir(dataDirectory);
9191
int64 freeSpace = dataDir.getBytesFreeOnVolume();
@@ -94,7 +94,7 @@ void RecordNode::checkDiskSpace()
9494

9595
if (availableBytes < diskSpaceWarningThreshold && !isRecording)
9696
{
97-
String msg = "Less than " + String(diskSpaceWarningThreshold) + " GB of disk space available in " + String(dataDirectory.getFullPathName());
97+
String msg = "Less than " + String(int(diskSpaceWarningThreshold)) + " GB of disk space available in " + String(dataDirectory.getFullPathName());
9898
msg += ". Recording may fail. Please free up space or change the recording directory.";
9999
AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "WARNING", msg);
100100
}

Source/Processors/RecordNode/RecordNodeEditor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,19 +576,20 @@ void FifoMonitor::timerCallback()
576576
lastUpdateTime = currentTime;
577577
lastFreeSpace = bytesFree;
578578

579-
recordingTimeLeftInSeconds = (int) (bytesFree / dataRate / 1000.0f);
579+
recordingTimeLeftInSeconds = bytesFree / dataRate / 1000.0f;
580580

581581
LOGD("Data rate: ", dataRate, " bytes/ms");
582582

583583
// Stop recording and show warning when less than 5 minutes of disk space left
584-
if (dataRate > 0 && recordingTimeLeftInSeconds < 60*5) {
584+
if (dataRate > 0.0f && recordingTimeLeftInSeconds < (60.0f * 5.0f))
585+
{
585586
CoreServices::setRecordingStatus(false);
586587
String msg = "Recording stopped. Less than 5 minutes of disk space remaining.";
587588
AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "WARNING", msg);
588589
}
589590

590591
String msg = String(bytesFree / pow(2, 30)) + " GB available\n";
591-
msg += String(recordingTimeLeftInSeconds / 60) + " minutes remaining\n";
592+
msg += String(int(recordingTimeLeftInSeconds / 60.0f)) + " minutes remaining\n";
592593
msg += "Data rate: " + String(dataRate * 1000 / pow(2, 20), 2) + " MB/s";
593594
setTooltip(msg);
594595
}

Source/Processors/RecordNode/RecordNodeEditor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private :
101101
float dataRate;
102102
float lastFreeSpace;
103103
float lastUpdateTime;
104-
int recordingTimeLeftInSeconds;
104+
float recordingTimeLeftInSeconds;
105105

106106
};
107107

0 commit comments

Comments
 (0)