From 2773aecdea641ca8a0b362085eba3dc5273e0fa6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Aug 2015 14:50:09 +0200 Subject: Create enum class subchannel_type_t --- src/MuxElements.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/MuxElements.cpp') diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 3170fe1..6ecee76 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -220,7 +220,7 @@ bool DabComponent::isPacketComponent(vector& subchannels) "for defining packet "); return false; } - if ((*getSubchannel(subchannels, subchId))->type != Packet) { + if ((*getSubchannel(subchannels, subchId))->type != subchannel_type_t::Packet) { return false; } return true; @@ -288,17 +288,18 @@ const string DabComponent::get_parameter(const string& parameter) const } -unsigned char DabService::getType(boost::shared_ptr ensemble) +subchannel_type_t DabService::getType(boost::shared_ptr ensemble) { vector::iterator subchannel; vector::iterator component = getComponent(ensemble->components, id); if (component == ensemble->components.end()) { - return 4; + throw std::runtime_error("No component found for service"); } + subchannel = getSubchannel(ensemble->subchannels, (*component)->subchId); if (subchannel == ensemble->subchannels.end()) { - return 8; + throw std::runtime_error("Could not find subchannel associated with service"); } return (*subchannel)->type; -- cgit v1.2.3