7 /** reihenfolge: transport_stream_id, original_network_id, service_id
8 bei services wird die transport_stream_id evtl. ignoriert */
20 #include <lib/system/elock.h>
23 #define MIN(a,b) ((a) < (b) ? (a) : (b))
27 #define MAX(a,b) ((a) > (b) ? (a) : (b))
30 class eTransponderList
;
31 class eServiceReference
;
35 // bitte KEINE operator int() definieren, sonst bringt das ganze nix!
36 struct eTransportStreamID
41 int get() const { return v
; }
42 eTransportStreamID(int i
): v(i
) { }
43 eTransportStreamID(): v(-1) { }
44 bool operator == (const eTransportStreamID
&c
) const { return v
== c
.v
; }
45 bool operator != (const eTransportStreamID
&c
) const { return v
!= c
.v
; }
46 bool operator < (const eTransportStreamID
&c
) const { return v
< c
.v
; }
47 bool operator > (const eTransportStreamID
&c
) const { return v
> c
.v
; }
55 int get() const { return v
; }
56 eServiceID(int i
): v(i
) { }
57 eServiceID(): v(-1) { }
58 bool operator == (const eServiceID
&c
) const { return v
== c
.v
; }
59 bool operator != (const eServiceID
&c
) const { return v
!= c
.v
; }
60 bool operator < (const eServiceID
&c
) const { return v
< c
.v
; }
61 bool operator > (const eServiceID
&c
) const { return v
> c
.v
; }
64 struct eOriginalNetworkID
69 int get() const { return v
; }
70 eOriginalNetworkID(int i
): v(i
) { }
71 eOriginalNetworkID(): v(-1) { }
72 bool operator == (const eOriginalNetworkID
&c
) const { return v
== c
.v
; }
73 bool operator != (const eOriginalNetworkID
&c
) const { return v
!= c
.v
; }
74 bool operator < (const eOriginalNetworkID
&c
) const { return v
< c
.v
; }
75 bool operator > (const eOriginalNetworkID
&c
) const { return v
> c
.v
; }
83 int get() const { return v
; }
84 eDVBNamespace(int i
): v(i
) { }
85 eDVBNamespace(): v(-1) { }
86 bool operator == (const eDVBNamespace
&c
) const { return v
== c
.v
; }
87 bool operator != (const eDVBNamespace
&c
) const { return v
!= c
.v
; }
88 bool operator < (const eDVBNamespace
&c
) const { return v
< c
.v
; }
89 bool operator > (const eDVBNamespace
&c
) const { return v
> c
.v
; }
94 eDVBNamespace dvbnamespace
;
95 eTransportStreamID tsid
;
96 eOriginalNetworkID onid
;
97 bool operator<(const tsref
&c
) const
99 if (dvbnamespace
< c
.dvbnamespace
)
101 else if (dvbnamespace
== c
.dvbnamespace
)
105 else if (onid
== c
.onid
)
111 tsref(eDVBNamespace dvbnamespace
, eTransportStreamID tsid
, eOriginalNetworkID onid
):
112 dvbnamespace(dvbnamespace
), tsid(tsid
), onid(onid
)
119 eTransponderList
&tplist
;
120 // friend struct eTransponder::satellite;
125 int frequency
, symbol_rate
;
127 int inversion
, fec_inner
;
128 void set(const CableDeliverySystemDescriptor
*descriptor
);
129 int tune(eTransponder
*);
130 int isValid() { return valid
; }
131 bool operator == (const cable
&c
) const
133 if (valid
!= c
.valid
)
135 if (frequency
!= c
.frequency
)
137 if (symbol_rate
!= c
.symbol_rate
)
139 if (modulation
!= c
.modulation
)
141 if (inversion
!= c
.inversion
)
143 if (fec_inner
!= c
.fec_inner
)
147 bool operator<(const cable
&c
) const
149 if ( frequency
== c
.frequency
)
151 if ( symbol_rate
== c
.symbol_rate
)
152 return fec_inner
< c
.fec_inner
;
154 return symbol_rate
< c
.symbol_rate
;
156 return frequency
< c
.frequency
;
162 unsigned int frequency
, symbol_rate
;
163 int polarisation
, fec
, inversion
, orbital_position
;
164 void set(const SatelliteDeliverySystemDescriptor
*descriptor
);
165 int tune(eTransponder
*);
166 int isValid() const { return valid
; }
167 inline bool useable( eLNB
* lnb
);
169 bool operator == (const satellite
&c
) const
171 if (valid
!= c
.valid
)
173 // eDebug("frequency %i - %i = %i", frequency, c.frequency, MAXDIFF(frequency,c.frequency) );
174 if ( abs( frequency
-c
.frequency
) > 3000 )
176 // eDebug("symbol_rate -> %i != %i", symbol_rate, c.symbol_rate );
177 if ( abs(symbol_rate
-c
.symbol_rate
) > 4000 )
179 // eDebug("polarisation -> %i != %i", polarisation, c.polarisation );
180 if (polarisation
!= c
.polarisation
)
182 // eDebug("fec -> %i != %i", fec, c.fec );
185 // eDebug("inversion -> %i != %i", inversion, c.inversion );
186 // dont compare inversion when one have AUTO
187 if (inversion
!= 2 && c
.inversion
!= 2 && inversion
!= c
.inversion
)
189 // eDebug("orbital_position -> %i != %i", orbital_position, c.orbital_position);
190 if (abs(orbital_position
- c
.orbital_position
) > 5)
192 // eDebug("Satellite Data is equal");
195 bool operator<(const satellite
&s
) const
197 if ( frequency
== s
.frequency
)
199 if ( symbol_rate
== s
.symbol_rate
)
200 return abs(orbital_position
- s
.orbital_position
) < 6 ? 0
201 : orbital_position
< s
.orbital_position
;
203 return symbol_rate
< s
.symbol_rate
;
205 return frequency
< s
.frequency
;
211 int centre_frequency
, bandwidth
, constellation
, hierarchy_information
, code_rate_hp
, code_rate_lp
, guard_interval
, transmission_mode
, inversion
;
212 void set(const TerrestrialDeliverySystemDescriptor
*descriptor
);
213 int tune(eTransponder
*);
214 int isValid() const { return valid
; }
215 bool operator == (const terrestrial
&t
) const
217 if (valid
!= t
.valid
)
219 if (centre_frequency
!= t
.centre_frequency
)
221 if (bandwidth
!= t
.bandwidth
)
223 if (constellation
!= t
.constellation
)
225 if (hierarchy_information
!= t
.hierarchy_information
)
227 if (code_rate_hp
!= t
.code_rate_hp
)
229 if (code_rate_lp
!= t
.code_rate_lp
)
231 if (guard_interval
!= t
.guard_interval
)
233 if (transmission_mode
!= t
.transmission_mode
)
235 if (inversion
!= 2 && t
.inversion
!= 2 && inversion
!= t
.inversion
)
239 bool operator<(const terrestrial
&t
) const
241 return centre_frequency
< t
.centre_frequency
;
244 eTransponder(eTransponderList
&tplist
, eDVBNamespace dvbnamespace
, eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
);
245 eTransponder(eTransponderList
&tplist
);
246 void setSatellite(SatelliteDeliverySystemDescriptor
*descr
) { satellite
.set(descr
); }
247 void setCable(CableDeliverySystemDescriptor
*descr
) { cable
.set(descr
); }
248 void setTerrestrial(TerrestrialDeliverySystemDescriptor
*descr
) { terrestrial
.set(descr
); }
249 void setSatellite(int frequency
, int symbol_rate
, int polarisation
, int fec
, int orbital_position
, int inversion
);
250 void setCable(int frequency
, int symbol_rate
, int inversion
, int modulation
, int fec_inner
);
251 void setTerrestrial(int centre_frequency
, int bandwidth
, int constellation
, int hierarchy_information
, int code_rate_hp
, int code_rate_lp
, int guard_interval
, int transmission_mode
, int inversion
);
253 eTransponder
&operator=(const eTransponder
&ref
)
256 satellite
=ref
.satellite
;
257 terrestrial
=ref
.terrestrial
;
259 transport_stream_id
=ref
.transport_stream_id
;
260 original_network_id
=ref
.original_network_id
;
261 dvb_namespace
=ref
.dvb_namespace
;
267 eDVBNamespace dvb_namespace
;
268 eTransportStreamID transport_stream_id
;
269 eOriginalNetworkID original_network_id
;
271 static eDVBNamespace
buildNamespace(eOriginalNetworkID onid
, eTransportStreamID tsid
, int orbital_position
, int freq
, int pol
);
275 stateOK
= 1, stateToScan
= 2, stateOnlyFree
= 4, stateError
= 8
284 original_network_id
);
287 bool operator==(const eTransponder
&c
) const
289 // eDebug("onid = %i, c.onid = %i, tsid = %i, c.tsid = %i", original_network_id.get(), transport_stream_id.get(), c.original_network_id.get(), c.transport_stream_id.get() );
290 if ( original_network_id
!= -1 && c
.original_network_id
!= -1 && transport_stream_id
!= -1 && c
.transport_stream_id
!= -1)
292 // eDebug("TSID / ONID Vergleich");
293 return ( original_network_id
== c
.original_network_id
&&
294 transport_stream_id
== c
.transport_stream_id
);
298 if (satellite
.valid
&& c
.satellite
.valid
)
299 return satellite
== c
.satellite
;
300 if (cable
.valid
&& c
.cable
.valid
)
301 return cable
== c
.cable
;
302 if (terrestrial
.valid
&& c
.terrestrial
.valid
)
303 return terrestrial
== c
.terrestrial
;
308 bool operator<(const eTransponder
&c
) const
310 if ((original_network_id
== -1) && (transport_stream_id
== -1))
312 if ((c
.original_network_id
== -1) && (c
.transport_stream_id
== -1))
314 if (satellite
.valid
&& c
.satellite
.valid
)
315 return satellite
< c
.satellite
;
316 if (cable
.valid
&& c
.cable
.valid
)
317 return cable
< c
.cable
;
318 if (terrestrial
.valid
&& c
.terrestrial
.valid
)
319 return terrestrial
< c
.terrestrial
;
325 if (original_network_id
< c
.original_network_id
)
327 else if (original_network_id
== c
.original_network_id
)
328 if (transport_stream_id
< c
.transport_stream_id
)
341 eService(const eString
&service_name
);
344 eString service_name
;
346 int dummy
; // this was no more used spflags
347 // this dummy is for binary compatibility with already existing(compiled)
356 class eServiceDVB
: public eService
360 cacheID-Values are only stored where needed (saves memory...)
361 cachevalues[0] contains length of cachevalues (including cachevalues[0])
364 void makeCache(short maxCacheID
);
369 cVPID
=0, cAPID
, cTPID
, cPCRPID
, cAC3PID
,
370 cVideoType
, /* not used in e1.. but in e2 */
372 cAc3Delay
, /* not used in e1.. but in e2 */
373 cPcmDelay
, /* not used in e1.. but in e2 */
377 please do not simply add any other value to the service cache
378 this breaks binary compatibilty of enigma1 and enigma2 service format
379 (and settings editors)
383 eServiceDVB(eDVBNamespace dvb_namespace
, eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
, const SDTEntry
*sdtentry
, int service_number
=-1);
384 eServiceDVB(eDVBNamespace dvb_namespace
, eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
, eServiceID service_id
, int service_number
=-1);
385 eServiceDVB(eServiceID service_id
, const char *name
);
386 eServiceDVB(const eServiceDVB
&c
);
387 virtual ~eServiceDVB() ;
389 void update(const SDTEntry
*sdtentry
);
391 eDVBNamespace dvb_namespace
;
392 eTransportStreamID transport_stream_id
;
393 eOriginalNetworkID original_network_id
;
394 eServiceID service_id
;
397 eString service_provider
;
399 int service_number
; // nur fuer dvb, gleichzeitig sortierkriterium...
403 dxNoSDT
=1, // don't get SDT
407 dxNewFound
=64 // found in prev scan
412 void set(cacheID c
, short v
);
414 short get(cacheID c
);
418 bool operator<(const eServiceDVB
&c
) const
420 if (original_network_id
< c
.original_network_id
)
422 else if (original_network_id
== c
.original_network_id
)
423 if (service_id
< c
.service_id
)
429 class eServiceReference
432 struct Parental_Compare
434 bool operator()(const eServiceReference
&s1
, const eServiceReference
&s2
) const
436 if ( s1
.path
&& s2
.path
)
437 return s1
.path
< s2
.path
;
442 static std::set
<eServiceReference
,Parental_Compare
> locked
;
443 static bool lockedListChanged
;
445 static void loadLockedList( const char* filename
);
446 static void saveLockedList( const char* filename
);
447 bool isLocked() const { return locked
.find( *this ) != locked
.end(); }
448 void lock() const { locked
.insert( *this );lockedListChanged
=true; }
449 void unlock() const { locked
.erase( *this );lockedListChanged
=true; }
453 idStructure
, // service_id == 0 is root
462 int flags
; // flags will NOT be compared.
465 isDirectory
=1, // SHOULD enter (implies mustDescent)
466 mustDescent
=2, // cannot be played directly - often used with "isDirectory" (implies canDescent)
469 normal services have none of them - they can be fed directly into the "play"-handler.
470 normal directories have both of them set - you cannot play a directory directly and the UI should descent into it.
471 playlists have "mustDescent", but not "isDirectory" - you don't want the user to browse inside the playlist (unless he really wants)
472 services with sub-services have none of them, instead the have the "canDecsent" flag (as all of the above)
474 canDescent
=4, // supports enterDirectory/leaveDirectory
475 flagDirectory
=isDirectory
|mustDescent
|canDescent
,
476 shouldSort
=8, // should be ASCII-sorted according to service_name. great for directories.
477 hasSortKey
=16, // has a sort key in data[3]. not having a sort key implies 0.
478 sort1
=32, // sort key is 1 instead of 0
483 inline int getSortKey() const { return (flags
& hasSortKey
) ? data
[3] : ((flags
& sort1
) ? 1 : 0); }
489 : type(idInvalid
), flags(0)
491 memset(data
, 0, sizeof(data
));
493 eServiceReference(int type
, int flags
)
494 : type(type
), flags(flags
)
496 memset(data
, 0, sizeof(data
));
498 eServiceReference(int type
, int flags
, int data0
)
499 : type(type
), flags(flags
)
501 memset(data
, 0, sizeof(data
));
504 eServiceReference(int type
, int flags
, int data0
, int data1
)
505 : type(type
), flags(flags
)
507 memset(data
, 0, sizeof(data
));
511 eServiceReference(int type
, int flags
, int data0
, int data1
, int data2
)
512 : type(type
), flags(flags
)
514 memset(data
, 0, sizeof(data
));
519 eServiceReference(int type
, int flags
, int data0
, int data1
, int data2
, int data3
)
520 : type(type
), flags(flags
)
522 memset(data
, 0, sizeof(data
));
528 eServiceReference(int type
, int flags
, int data0
, int data1
, int data2
, int data3
, int data4
)
529 : type(type
), flags(flags
)
531 memset(data
, 0, sizeof(data
));
538 eServiceReference(int type
, int flags
, const eString
&path
)
539 : type(type
), flags(flags
), path(path
)
541 memset(data
, 0, sizeof(data
));
543 eServiceReference(const eString
&string
);
544 eString
toString() const;
545 bool operator==(const eServiceReference
&c
) const
549 if ( type
== idDVB
&& !c
.flags
&& !flags
)
550 return (memcmp(data
+1, c
.data
+1, sizeof(int)*7)==0) && (path
== c
.path
);
551 return (memcmp(data
, c
.data
, sizeof(int)*8)==0) && (path
== c
.path
);
553 bool operator!=(const eServiceReference
&c
) const
555 return !(*this == c
);
557 bool operator<(const eServiceReference
&c
) const
565 int r
= type
== idDVB
&& !c
.flags
&& !flags
?
566 memcmp(data
+1, c
.data
+1, sizeof(int)*7) :
567 memcmp(data
, c
.data
, sizeof(int)*8);
571 return path
< c
.path
;
573 operator bool() const
575 return type
!= idInvalid
;
581 friend struct ePlaylistEntry
;
582 std::list
<eServiceReference
> path
;
584 bool operator != ( const eServicePath
& p
) const
586 return p
.path
!= path
;
588 bool operator == ( const eServicePath
&p
) const
590 return p
.path
== path
;
593 eServicePath( const eString
& data
);
594 eServicePath(const eServiceReference
&ref
);
595 void setString( const eString
& data
);
598 void down(const eServiceReference
&ref
);
599 eServiceReference
current() const;
600 eServiceReference
top() const { return current(); }
601 eServiceReference
bottom() const;
605 struct eServiceReferenceDVB
: public eServiceReference
607 int getServiceType() const { return data
[0]; }
608 void setServiceType(int service_type
) { data
[0]=service_type
; }
610 eServiceID
getServiceID() const { return eServiceID(data
[1]); }
611 void setServiceID(eServiceID service_id
) { data
[1]=service_id
.get(); }
613 eTransportStreamID
getTransportStreamID() const { return eTransportStreamID(data
[2]); }
614 void setTransportStreamID(eTransportStreamID transport_stream_id
) { data
[2]=transport_stream_id
.get(); }
616 eOriginalNetworkID
getOriginalNetworkID() const { return eOriginalNetworkID(data
[3]); }
617 void setOriginalNetworkID(eOriginalNetworkID original_network_id
) { data
[3]=original_network_id
.get(); }
619 eDVBNamespace
getDVBNamespace() const { return eDVBNamespace(data
[4]); }
620 void setDVBNamespace(eDVBNamespace dvbnamespace
) { data
[4]=dvbnamespace
.get(); }
622 // I hope this doesn't break anything, but I don't think data[5] is used anywhere else...
623 int getFileLength() const { return data
[5]; }
624 void setFileLength(int filelength
) { data
[5]=filelength
; }
626 eServiceReferenceDVB(eDVBNamespace dvbnamespace
, eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
, eServiceID service_id
, int service_type
)
627 :eServiceReference(eServiceReference::idDVB
, 0)
629 setTransportStreamID(transport_stream_id
);
630 setOriginalNetworkID(original_network_id
);
631 setDVBNamespace(dvbnamespace
);
632 setServiceID(service_id
);
633 setServiceType(service_type
);
636 eServiceReferenceDVB()
645 eString bouquet_name
;
646 std::list
<eServiceReferenceDVB
> list
;
648 inline eBouquet(int bouquet_id
, eString
& bouquet_name
)
649 : bouquet_id(bouquet_id
), bouquet_name(bouquet_name
)
653 void forEachServiceReference(T ob
)
655 for (std::list
<eServiceReferenceDVB
>::iterator it
= list
.begin(); it
!= list
.end(); ++it
)
658 void add(const eServiceReferenceDVB
&);
659 int remove(const eServiceReferenceDVB
&);
660 bool operator == (const eBouquet
&c
) const
662 return bouquet_id
==c
.bouquet_id
;
664 bool operator < (const eBouquet
&c
) const
666 return (bouquet_name
.compare(c
.bouquet_name
));
670 struct eSwitchParameter
672 enum SIG22
{ HILO
=0, ON
=1, OFF
=2 }; // 22 Khz
673 enum VMODE
{ HV
=0, _14V
=1, _18V
=2, _0V
=3 }; // 14/18 V
680 eTransponderList
&tplist
;
681 int orbital_position
;
683 eSwitchParameter switchParams
;
687 eSatellite(eTransponderList
&tplist
, int orbital_position
, eLNB
&lnb
);
690 const eString
&getDescription() const
695 void setDescription(const eString
&description
)
697 this->description
=description
;
700 int getOrbitalPosition() const
702 return orbital_position
;
705 eSwitchParameter
&getSwitchParams()
715 void setLNB( eLNB
* _lnb
)
720 void setOrbitalPosition(int orbital_position
);
722 bool operator<(const eSatellite
&sat
) const
724 return orbital_position
< sat
.orbital_position
;
727 bool operator==(const eSatellite
&sat
) const
729 return orbital_position
== sat
.orbital_position
;
733 struct Orbital_Position_Compare
735 inline bool operator()(const int &i1
, const int &i2
) const
737 return abs(i1
-i2
) < 6 ? false: i1
< i2
;
743 enum { AA
=0, AB
=1, BA
=2, BB
=3, SENDNO
=4 /* and 0xF0 .. 0xFF*/ }; // DiSEqC Parameter
746 enum tDiSEqCMode
{ NONE
=0, V1_0
=1, V1_1
=2, V1_2
=3, SMATV
=4 }; // DiSEqC Mode
747 tDiSEqCMode DiSEqCMode
;
749 enum tMiniDiSEqCParam
{ NO
=0, A
=1, B
=2 };
750 tMiniDiSEqCParam MiniDiSEqCParam
;
752 std::map
< int, int, Orbital_Position_Compare
> RotorTable
; // used for Rotors does not support gotoXX Cmd
753 int DiSEqCRepeats
; // for cascaded switches
754 int FastDiSEqC
; // send no DiSEqC on H/V or Lo/Hi change
755 int SeqRepeat
; // send the complete DiSEqC Sequence twice...
756 int SwapCmds
; // swaps the committed & uncommitted cmd
757 int uncommitted_cmd
; // state of the 4 uncommitted switches..
758 int useGotoXX
; // Rotor Support gotoXX Position ?
759 int useRotorInPower
; // can we use Rotor Input Power to detect Rotor state ?
760 enum { NORTH
, SOUTH
, EAST
, WEST
};
761 int gotoXXLoDirection
; // EAST, WEST
762 int gotoXXLaDirection
; // NORT, SOUTH
763 double gotoXXLongitude
; // Longitude for gotoXX° Function
764 double gotoXXLatitude
; // Latitude for gotoXX° Function
765 void setRotorDefaultOptions(); // set default rotor options
770 unsigned int lof_hi
, lof_lo
, lof_threshold
;
771 int increased_voltage
, relais_12V_out
;
772 ePtrList
<eSatellite
> satellites
;
773 eTransponderList
&tplist
;
776 eLNB(eTransponderList
&tplist
): tplist(tplist
)
778 satellites
.setAutoDelete(true);
780 void setLOFHi(unsigned int lof_hi
) { this->lof_hi
=lof_hi
; }
781 void setLOFLo(unsigned int lof_lo
) { this->lof_lo
=lof_lo
; }
782 void setLOFThreshold(unsigned int lof_threshold
) { this->lof_threshold
=lof_threshold
; }
783 void setIncreasedVoltage( int inc
) { increased_voltage
= inc
; }
784 void set12VOut(int state
) { relais_12V_out
= state
; }
785 unsigned int getLOFHi() const { return lof_hi
; }
786 unsigned int getLOFLo() const { return lof_lo
; }
787 unsigned int getLOFThreshold() const { return lof_threshold
; }
788 int getIncreasedVoltage() const { return increased_voltage
; }
789 int get12VOut() { return relais_12V_out
; }
790 eDiSEqC
& getDiSEqC() { return DiSEqC
; }
791 eSatellite
*addSatellite(int orbital_position
);
792 void deleteSatellite(eSatellite
*satellite
);
793 void addSatellite( eSatellite
*satellite
);
794 void setDefaultOptions();
795 eSatellite
* takeSatellite( eSatellite
*satellite
);
796 bool operator==(const eLNB
& lnb
) { return this == &lnb
; }
797 ePtrList
<eSatellite
> &getSatelliteList() { return satellites
; }
803 bool operator==(const tpPacket
& p
) const
805 // this do only compare the adresses.. to find a tpPacket
806 // in a std::list<tpPacket>.. but it is fast !!
807 return &possibleTransponders
== &p
.possibleTransponders
;
809 bool operator<(const tpPacket
& p
) const
811 return orbital_position
< p
.orbital_position
;
815 int orbital_position
;
816 std::list
<eTransponder
> possibleTransponders
;
823 std::list
<tpPacket
>& getNetworks();
824 std::map
<int,tpPacket
>& getNetworkNameMap();
825 int reloadNetworks();
827 void invalidateNetworks() { networksLoaded
=false; }
831 std::list
<tpPacket
> networks
;
832 std::map
<int, tpPacket
> names
;
833 int addNetwork(tpPacket
&p
, XMLTreeNode
*node
, int type
);
836 class eTransponderList
: public existNetworks
, public Object
839 enum { SDT_SCAN_FREE
, SDT_SCAN
, SDT_SCAN_FINISHED
, PAT_SCAN
};
841 static eTransponderList
* instance
;
842 std::map
<tsref
,eTransponder
> transponders
;
843 std::map
<eServiceReferenceDVB
,eServiceDVB
> services
;
844 std::map
<eServiceReferenceDVB
,eServiceDVB
> subservices
;
845 std::map
<int,eSatellite
*> satellites
;
846 std::list
<eLNB
> lnbs
;
847 std::map
<int,eServiceReferenceDVB
> channel_number
;
849 friend class eSatellite
;
851 eServiceReferenceDVB newService
;
852 ePtrList
<SDTEntry
>::const_iterator curSDTEntry
;
853 ePtrList
<PATEntry
>::const_iterator curPATEntry
;
854 Signal0
<void> *callback
;
855 std::set
<eServiceID
> newServiceIds
;
856 std::set
<eServiceID
> checkedServiceIds
;
860 PMT
*pmt
; // for only free check
861 void leaveService( const eServiceReferenceDVB
& );
864 void leaveTransponder( eTransponder
* );
865 std::map
<tsref
,int> TimeOffsetMap
;
866 void readTimeOffsetData( const char* filename
);
867 void writeTimeOffsetData( const char* filename
);
869 void clearAllServices() { services
.clear(); }
870 void clearAllSubServices() { subservices
.clear(); }
871 void clearAllTransponders() { transponders
.clear(); }
872 void removeService( const eServiceReferenceDVB
& );
873 void removeOrbitalPosition(int orbital_position
);
874 void removeNewFlags(int orbital_position
);
876 static eTransponderList
* getInstance() { return instance
; }
881 writeLNBData(); // write Data to registry
882 /* newServices->save();
883 eServiceInterface::getInstance()->removeRef(newServicesRef);*/
885 if (instance
== this)
892 eTransponder
&createTransponder(eDVBNamespace dvb_namespace
,eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
);
893 eServiceDVB
&createService(const eServiceReferenceDVB
&service
, int service_number
=-1, bool *newService
=0);
894 eServiceDVB
&createSubService(const eServiceReferenceDVB
&service
, bool *newService
=0);
895 void startHandleSDT(const SDT
*sdt
, eDVBNamespace dvb_namespace
, eOriginalNetworkID onid
=-1, eTransportStreamID tsid
=-1, Signal0
<void> *callback
=0, int sdtscanstate
=SDT_SCAN
);
896 void handleSDT(const SDT
*sdt
, eDVBNamespace dvb_namespace
, eOriginalNetworkID onid
=-1, eTransportStreamID tsid
=-1, Signal0
<void> *callback
=0 );
897 Signal1
<void, eTransponder
*> transponder_added
;
898 Signal2
<void, const eServiceReferenceDVB
&, bool> service_found
;
899 Signal1
<void, const eServiceReferenceDVB
&> service_removed
;
901 eTransponder
*searchTransponder(const eTransponder
&);
902 eTransponder
*searchTS(eDVBNamespace dvbnamespace
, eTransportStreamID transport_stream_id
, eOriginalNetworkID original_network_id
);
903 eServiceDVB
*searchService(const eServiceReference
&service
);
904 eServiceDVB
*searchSubService(const eServiceReference
&service
);
905 eServiceReferenceDVB
searchServiceByNumber(int channel_number
);
906 int countServices( eDVBNamespace dvbnamespace
, eTransportStreamID tsid
, eOriginalNetworkID onid
)
909 for ( std::map
<eServiceReferenceDVB
,eServiceDVB
>::iterator
it(services
.begin());
910 it
!= services
.end(); ++it
)
912 if ( it
->first
.getDVBNamespace() == dvbnamespace
&&
913 it
->first
.getTransportStreamID() == tsid
&&
914 it
->first
.getOriginalNetworkID() == onid
)
919 void removeTransponder( const tsref ts
)
921 transponders
.erase(ts
);
925 void forEachService(T ob
)
927 for (std::map
<eServiceReferenceDVB
,eServiceDVB
>::iterator
i(services
.begin()); i
!=services
.end(); ++i
)
931 void forEachSubService(T ob
)
933 for (std::map
<eServiceReferenceDVB
,eServiceDVB
>::iterator
i(subservices
.begin()); i
!=subservices
.end(); ++i
)
937 void forEachServiceReference(T ob
)
939 for (std::map
<eServiceReferenceDVB
,eServiceDVB
>::iterator
i(services
.begin()); i
!=services
.end(); ++i
)
942 template <class T
> void forEachTransponder(T ob
)
944 for (std::map
<tsref
,eTransponder
>::iterator
i(transponders
.begin()); i
!=transponders
.end(); ++i
)
947 template <class T
> void forEachChannel(T ob
)
949 for (std::map
<int,eServiceDVB
*>::iterator
i(channel_number
.begin()); i
!=channel_number
.end(); ++i
)
953 eTransponder
*getFirstTransponder(int state
);
954 eSatellite
*findSatellite(int orbital_position
);
955 std::map
< int, eSatellite
*>::iterator
begin() { return satellites
.begin(); }
956 std::map
< int, eSatellite
*>::iterator
end() { return satellites
.end(); }
957 std::list
<eLNB
>& getLNBs() { return lnbs
; }
960 inline bool eTransponder::satellite::useable( eLNB
* lnb
)
962 // normal tuner can tune frequencys from 950 Mhz to 2150 Mhz
964 if ( frequency
> lnb
->getLOFThreshold() )
966 int diff
= abs(frequency
- lnb
->getLOFHi());
967 if ( diff
> 2250000 || diff
< 850000 )
972 int diff
= abs(frequency
- lnb
->getLOFLo());
973 if ( diff
> 2250000 || diff
< 850000 )