From 5c25499c5e61582f9fbb19e219e951ab13ddb4cd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 19 Feb 2019 12:40:36 +0100 Subject: [PATCH] lib/cdio/Paranoia: add method GetDiscSectorRange() --- src/lib/cdio/Paranoia.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/cdio/Paranoia.hxx b/src/lib/cdio/Paranoia.hxx index 51e9effaa..45d1f6d8c 100644 --- a/src/lib/cdio/Paranoia.hxx +++ b/src/lib/cdio/Paranoia.hxx @@ -82,6 +82,14 @@ public: throw std::runtime_error("Failed to open disc"); } + auto GetDiscSectorRange() const { + auto first = cdio_cddap_disc_firstsector(drv); + auto last = cdio_cddap_disc_lastsector(drv); + if (first < 0 || last < 0) + throw std::runtime_error("Failed to get disc audio sectors"); + return std::make_pair(first, last); + } + gcc_pure bool IsAudioTrack(track_t i) const noexcept { return cdio_cddap_track_audiop(drv, i);