Add preset polish and broadcast metadata (fw 0.8.0).
Ship station reorder, DAB playing ids in presets, RDS PS/RT and DAB DLS in tuner status, Si4684 data-service read, host tests, and UI now-playing lines. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace tuner {
|
||||
@@ -72,7 +73,7 @@ public:
|
||||
* @dname tuneDab
|
||||
* @param freqIndex Ensemble index 0–37.
|
||||
* @return Ok on success, or a TunerError from ITuner.
|
||||
* @pubstate writes lastDabIndex_ on success.
|
||||
* @pubstate writes lastDabIndex_ on success; clears last-played DAB ids.
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
@@ -129,7 +130,7 @@ public:
|
||||
* @param serviceId Selected service identifier.
|
||||
* @param componentId Audio component within the service.
|
||||
* @return Ok on success, or a TunerError from ITuner.
|
||||
* @pubstate delegates to tuner_.
|
||||
* @pubstate delegates to tuner_; caches service/component for status JSON.
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
@@ -168,6 +169,8 @@ private:
|
||||
std::uint8_t lastDabIndex_;
|
||||
core::FrequencyKHz lastFmFrequency_;
|
||||
std::uint8_t volume_;
|
||||
std::optional<std::uint32_t> lastPlayedServiceId_;
|
||||
std::optional<std::uint32_t> lastPlayedComponentId_;
|
||||
};
|
||||
|
||||
} // namespace tuner
|
||||
|
||||
@@ -37,6 +37,10 @@ std::expected<core::TunerStatus, core::TunerError> TunerService::refreshStatus()
|
||||
auto status = tuner_.readStatus();
|
||||
if (status) {
|
||||
volume_ = status->volume;
|
||||
if (status->band == core::TunerBand::Dab) {
|
||||
status->dabPlayingServiceId = lastPlayedServiceId_;
|
||||
status->dabPlayingComponentId = lastPlayedComponentId_;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -48,6 +52,8 @@ std::expected<void, core::TunerError> TunerService::tuneDab(
|
||||
return result;
|
||||
}
|
||||
lastDabIndex_ = freqIndex;
|
||||
lastPlayedServiceId_.reset();
|
||||
lastPlayedComponentId_.reset();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -81,7 +87,12 @@ std::expected<void, core::TunerError> TunerService::playDabService(
|
||||
std::uint32_t serviceId,
|
||||
std::uint32_t componentId)
|
||||
{
|
||||
return tuner_.playDabService(serviceId, componentId);
|
||||
if (auto result = tuner_.playDabService(serviceId, componentId); !result) {
|
||||
return result;
|
||||
}
|
||||
lastPlayedServiceId_ = serviceId;
|
||||
lastPlayedComponentId_ = componentId;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::expected<void, core::TunerError> TunerService::setVolume(std::uint8_t level)
|
||||
|
||||
Reference in New Issue
Block a user