diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 15:46:54 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 15:46:54 +0100 |
commit | d6923be4bd2e198b4cba161e8040072128bd392c (patch) | |
tree | cf3e74d4685075b4836141c48a71507666074781 /src/MuxElements.h | |
parent | 77d77e5f4d60ed9d1f8346910f42fe2d61122f22 (diff) | |
download | dabmux-d6923be4bd2e198b4cba161e8040072128bd392c.tar.gz dabmux-d6923be4bd2e198b4cba161e8040072128bd392c.tar.bz2 dabmux-d6923be4bd2e198b4cba161e8040072128bd392c.zip |
make DabComponent a class and make its label RC controllable
Diffstat (limited to 'src/MuxElements.h')
-rw-r--r-- | src/MuxElements.h | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/src/MuxElements.h b/src/MuxElements.h index a0ee23a..41037b5 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -86,8 +86,9 @@ class DabLabel }; -struct DabService; -struct dabComponent; +class DabService; +class DabComponent; + struct dabSubchannel; struct dabEnsemble { uint16_t id; @@ -95,7 +96,7 @@ struct dabEnsemble { DabLabel label; uint8_t mode; vector<DabService*> services; - vector<dabComponent*> components; + vector<DabComponent*> components; vector<dabSubchannel*> subchannels; }; @@ -163,20 +164,39 @@ struct dabPacketComponent { }; -struct dabComponent { - DabLabel label; - uint32_t serviceId; - uint8_t subchId; - uint8_t type; - uint8_t SCIdS; - union { - dabAudioComponent audio; - dabDataComponent data; - dabFidcComponent fidc; - dabPacketComponent packet; - }; +class DabComponent : public RemoteControllable +{ + public: + DabComponent(std::string uid) : + RemoteControllable("Component " + uid) + { + RC_ADD_PARAMETER(label, "Label and shortlabel [label,short]"); + } - bool isPacketComponent(vector<dabSubchannel*>& subchannels); + DabLabel label; + uint32_t serviceId; + uint8_t subchId; + uint8_t type; + uint8_t SCIdS; + union { + dabAudioComponent audio; + dabDataComponent data; + dabFidcComponent fidc; + dabPacketComponent packet; + }; + + bool isPacketComponent(vector<dabSubchannel*>& subchannels); + + /* Remote control */ + virtual void set_parameter(string parameter, string value); + + /* Getting a parameter always returns a string. */ + virtual string get_parameter(string parameter); + + + private: + const DabComponent& operator=(const DabComponent& other); + DabComponent(const DabComponent& other); }; @@ -184,7 +204,8 @@ struct dabComponent { class DabService : public RemoteControllable { public: - DabService(std::string uid) : RemoteControllable(uid) + DabService(std::string uid) : + RemoteControllable("Service " + uid) { RC_ADD_PARAMETER(label, "Label and shortlabel [label,short]"); } @@ -195,7 +216,7 @@ class DabService : public RemoteControllable bool program; unsigned char getType(dabEnsemble* ensemble); - unsigned char nbComponent(vector<dabComponent*>& components); + unsigned char nbComponent(vector<DabComponent*>& components); DabLabel label; @@ -213,17 +234,17 @@ class DabService : public RemoteControllable vector<dabSubchannel*>::iterator getSubchannel( vector<dabSubchannel*>& subchannels, int id); -vector<dabComponent*>::iterator getComponent( - vector<dabComponent*>& components, +vector<DabComponent*>::iterator getComponent( + vector<DabComponent*>& components, uint32_t serviceId, - vector<dabComponent*>::iterator current); + vector<DabComponent*>::iterator current); -vector<dabComponent*>::iterator getComponent( - vector<dabComponent*>& components, +vector<DabComponent*>::iterator getComponent( + vector<DabComponent*>& components, uint32_t serviceId); vector<DabService*>::iterator getService( - dabComponent* component, + DabComponent* component, vector<DabService*>& services); unsigned short getSizeCu(dabSubchannel* subchannel); |