aboutsummaryrefslogtreecommitdiffstats
path: root/src/MuxElements.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-07 14:50:09 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-07 14:50:09 +0200
commit2773aecdea641ca8a0b362085eba3dc5273e0fa6 (patch)
treeb211a19d18cabecf26da3024167e86c34417b77a /src/MuxElements.cpp
parentb53125dffd58e96ec586c40320827100c039398f (diff)
downloaddabmux-2773aecdea641ca8a0b362085eba3dc5273e0fa6.tar.gz
dabmux-2773aecdea641ca8a0b362085eba3dc5273e0fa6.tar.bz2
dabmux-2773aecdea641ca8a0b362085eba3dc5273e0fa6.zip
Create enum class subchannel_type_t
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r--src/MuxElements.cpp9
1 files changed, 5 insertions, 4 deletions
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<dabSubchannel*>& 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<dabEnsemble> ensemble)
+subchannel_type_t DabService::getType(boost::shared_ptr<dabEnsemble> ensemble)
{
vector<dabSubchannel*>::iterator subchannel;
vector<DabComponent*>::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;