diff options
author | Jirka Novak <j.novak@netsystem.cz> | 2020-12-30 13:28:31 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2021-01-01 12:41:09 +0000 |
commit | cf9ffd3d831b5f68de54d58ea01cbdca50e9a6a5 (patch) | |
tree | eaa84ca29c22f08652c2eeab245b847eea5bb2fc /ui/qt/rtp_analysis_dialog.cpp | |
parent | 5c936174c6980e93673eae4330792576776959c4 (diff) |
All RTP dialogs: Added option to specify count of decimal places
Preferences are extended with advanced settings:
gui.decimal_places1 - 2
gui.decimal_places2 - 4
gui.decimal_places3 - 6
rtp_analysis_dialog, rtp_player_dialog and rtp_stream_dialog uses new settings
for formating numbers. Same information in all dialogs uses same settings.
It solves request #15481.
Note: Other UI dialogs can be adapted later.
Diffstat (limited to 'ui/qt/rtp_analysis_dialog.cpp')
-rw-r--r-- | ui/qt/rtp_analysis_dialog.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index 47ec0862dc..26034e5725 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -140,10 +140,10 @@ public: setText(packet_col_, QString::number(frame_num_)); setText(sequence_col_, QString::number(sequence_num_)); - setText(delta_col_, QString::number(delta_, 'f', 2)); - setText(jitter_col_, QString::number(jitter_, 'f', 2)); - setText(skew_col_, QString::number(skew_, 'f', 2)); - setText(bandwidth_col_, QString::number(bandwidth_, 'f', 2)); + setText(delta_col_, QString::number(delta_, 'f', prefs.gui_decimal_places3)); + setText(jitter_col_, QString::number(jitter_, 'f', prefs.gui_decimal_places3)); + setText(skew_col_, QString::number(skew_, 'f', prefs.gui_decimal_places3)); + setText(bandwidth_col_, QString::number(bandwidth_, 'f', prefs.gui_decimal_places1)); if (marker_) { setText(marker_col_, UTF8_BULLET); } @@ -909,27 +909,27 @@ void RtpAnalysisDialog::updateStatistics() stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>%1</td></tr>") .arg(int_to_qstring(fwd_statinfo_.id.ssrc, 8, 16)); stats_tables += QString("<tr><th align=\"left\">Max Delta</th><td>%1 ms @ %2</td></tr>") - .arg(fwd_statinfo_.rtp_stats.max_delta, 0, 'f', 2) + .arg(fwd_statinfo_.rtp_stats.max_delta, 0, 'f', prefs.gui_decimal_places3) .arg(fwd_statinfo_.rtp_stats.max_nr); stats_tables += QString("<tr><th align=\"left\">Max Jitter</th><td>%1 ms</td></tr>") - .arg(fwd_statinfo_.rtp_stats.max_jitter, 0, 'f', 2); + .arg(fwd_statinfo_.rtp_stats.max_jitter, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">Mean Jitter</th><td>%1 ms</td></tr>") - .arg(fwd_statinfo_.rtp_stats.mean_jitter, 0, 'f', 2); + .arg(fwd_statinfo_.rtp_stats.mean_jitter, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">Max Skew</th><td>%1 ms</td></tr>") - .arg(fwd_statinfo_.rtp_stats.max_skew, 0, 'f', 2); + .arg(fwd_statinfo_.rtp_stats.max_skew, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">RTP Packets</th><td>%1</td></tr>") .arg(f_total_nr); stats_tables += QString("<tr><th align=\"left\">Expected</th><td>%1</td></tr>") .arg(f_expected); stats_tables += QString("<tr><th align=\"left\">Lost</th><td>%1 (%2 %)</td></tr>") - .arg(f_lost).arg(f_perc, 0, 'f', 2); + .arg(f_lost).arg(f_perc, 0, 'f', prefs.gui_decimal_places1); stats_tables += QString("<tr><th align=\"left\">Seq Errs</th><td>%1</td></tr>") .arg(fwd_statinfo_.rtp_stats.sequence); stats_tables += QString("<tr><th align=\"left\">Start at</th><td>%1 s @ %2</td></tr>") .arg(fwd_statinfo_.rtp_stats.start_time / 1000.0, 0, 'f', 6) .arg(fwd_statinfo_.rtp_stats.first_packet_num); stats_tables += QString("<tr><th align=\"left\">Duration</th><td>%1 s</td></tr>") - .arg(f_duration / 1000.0, 0, 'f', 2); + .arg(f_duration / 1000.0, 0, 'f', prefs.gui_decimal_places1); stats_tables += QString("<tr><th align=\"left\">Clock Drift</th><td>%1 ms</td></tr>") .arg(f_duration * (f_clock_drift - 1.0), 0, 'f', 0); stats_tables += QString("<tr><th align=\"left\">Freq Drift</th><td>%1 Hz (%2 %)</td></tr>") // XXX Terminology? @@ -947,27 +947,27 @@ void RtpAnalysisDialog::updateStatistics() stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>%1</td></tr>") .arg(int_to_qstring(rev_statinfo_.id.ssrc, 8, 16)); stats_tables += QString("<tr><th align=\"left\">Max Delta</th><td>%1 ms @ %2</td></tr>") - .arg(rev_statinfo_.rtp_stats.max_delta, 0, 'f', 2) + .arg(rev_statinfo_.rtp_stats.max_delta, 0, 'f', prefs.gui_decimal_places3) .arg(rev_statinfo_.rtp_stats.max_nr); stats_tables += QString("<tr><th align=\"left\">Max Jitter</th><td>%1 ms</td></tr>") - .arg(rev_statinfo_.rtp_stats.max_jitter, 0, 'f', 2); + .arg(rev_statinfo_.rtp_stats.max_jitter, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">Mean Jitter</th><td>%1 ms</td></tr>") - .arg(rev_statinfo_.rtp_stats.mean_jitter, 0, 'f', 2); + .arg(rev_statinfo_.rtp_stats.mean_jitter, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">Max Skew</th><td>%1 ms</td></tr>") - .arg(rev_statinfo_.rtp_stats.max_skew, 0, 'f', 2); + .arg(rev_statinfo_.rtp_stats.max_skew, 0, 'f', prefs.gui_decimal_places3); stats_tables += QString("<tr><th align=\"left\">RTP Packets</th><td>%1</td></tr>") .arg(r_total_nr); stats_tables += QString("<tr><th align=\"left\">Expected</th><td>%1</td></tr>") .arg(r_expected); stats_tables += QString("<tr><th align=\"left\">Lost</th><td>%1 (%2 %)</td></tr>") - .arg(r_lost).arg(r_perc, 0, 'f', 2); + .arg(r_lost).arg(r_perc, 0, 'f', prefs.gui_decimal_places1); stats_tables += QString("<tr><th align=\"left\">Seq Errs</th><td>%1</td></tr>") .arg(rev_statinfo_.rtp_stats.sequence); stats_tables += QString("<tr><th align=\"left\">Start at</th><td>%1 s @ %2</td></tr>") .arg(rev_statinfo_.rtp_stats.start_time / 1000.0, 0, 'f', 6) .arg(rev_statinfo_.rtp_stats.first_packet_num); stats_tables += QString("<tr><th align=\"left\">Duration</th><td>%1 s</td></tr>") - .arg(r_duration / 1000.0, 0, 'f', 2); + .arg(r_duration / 1000.0, 0, 'f', prefs.gui_decimal_places1); stats_tables += QString("<tr><th align=\"left\">Clock Drift</th><td>%1 ms</td></tr>") .arg(r_duration * (r_clock_drift - 1.0), 0, 'f', 0); stats_tables += QString("<tr><th align=\"left\">Freq Drift</th><td>%1 Hz (%2 %)</td></tr>") // XXX Terminology? |