add copy/paste support to the frequency selector

This commit is contained in:
AlexandreRouma
2024-10-16 18:31:14 +02:00
parent 08f3a7d201
commit 1cbc8ec6f5
3 changed files with 164 additions and 2 deletions

19
core/src/utils/hrfreq.h Normal file
View File

@ -0,0 +1,19 @@
#pragma once
#include <string>
namespace hrfreq {
/**
* Convert a frequency to a human-readable string.
* @param freq Frequency in Hz.
* @return Human-readable representation of the frequency.
*/
std::string toString(double freq);
/**
* Convert a human-readable representation of a frequency to a frequency value.
* @param str String containing the human-readable frequency.
* @param freq Value to write the decoded frequency to.
* @return True on success, false otherwise.
*/
bool fromString(const std::string& str, double& freq);
}