Skip to content

Commit

Permalink
Show max replay time
Browse files Browse the repository at this point in the history
  • Loading branch information
BatchDrake committed May 5, 2024
1 parent 0a1c141 commit 073902c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
4 changes: 4 additions & 0 deletions App/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@ Application::onFrequencyChanged(qint64 freq, qint64 lnb)

if (m_mediator->getState() == UIMediator::RUNNING)
TRYSILENT(m_analyzer->setFrequency(freq, lnb));

if (errorsOccurred) {

}
}

void
Expand Down
5 changes: 4 additions & 1 deletion Default/Source/SourceWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,12 @@ SourceWidget::refreshUi()
m_ui->replayTimeProgress->setValue(0);
m_ui->replayTimeProgress->setFormat("Idle");
m_ui->replayTimeProgress->setEnabled(false);
m_ui->maxReplayLabel->setText("N/A");
} else {
auto historyLength = m_sourceInfo.historyLength();
m_ui->maxReplayLabel->setText(SuWidgetsHelpers::formatQuantity(historyLength / SCAST(qreal, m_sourceInfo.getSampleRate()), 3));
m_ui->replayTimeProgress->setEnabled(true);
m_ui->replayTimeProgress->setMaximum(m_sourceInfo.historyLength() >> 10);
m_ui->replayTimeProgress->setMaximum(historyLength >> 10);
}

// History
Expand Down
56 changes: 38 additions & 18 deletions Default/Source/SourceWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>341</width>
<height>447</height>
<height>386</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -386,6 +386,20 @@
<property name="spacing">
<number>3</number>
</property>
<item row="3" column="1">
<widget class="QProgressBar" name="replayTimeProgress">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="allocHistoryCheck">
<property name="text">
<string>Allocate replay history</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="ContextAwareSpinBox" name="allocSizeSpin">
<property name="alignment">
Expand All @@ -405,34 +419,27 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>History allocation</string>
<string>Replay time</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Replay time</string>
<string>History allocation</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QProgressBar" name="replayTimeProgress">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="2">
<widget class="QPushButton" name="replayButton">
<property name="font">
<font>
Expand All @@ -454,10 +461,23 @@ background-color: #16448c;</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="allocHistoryCheck">
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Allocate replay history</string>
<string>Max replay time</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLabel" name="maxReplayLabel">
<property name="text">
<string>N/A</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit 073902c

Please sign in to comment.