class eConnection: public iObject, public Connection
{
-DECLARE_REF(eConnection);
-private:
+ DECLARE_REF(eConnection);
ePtr<iObject> m_owner;
public:
eConnection(iObject *owner, const Connection &conn): Connection(conn), m_owner(owner) { };
SWIG_IGNORE(eActionMap);
class eActionMap: public iObject
{
-DECLARE_REF(eActionMap);
+ DECLARE_REF(eActionMap);
#ifdef SWIG
eActionMap();
~eActionMap();
void operator=(const iObject &);
protected:
virtual ~iObject() { }
+#ifdef SWIG
+ virtual void AddRef()=0;
+ virtual void Release()=0;
+#endif
public:
+#ifndef SWIG
virtual void AddRef()=0;
virtual void Release()=0;
+#endif
};
#ifndef SWIG
#if defined(OBJECT_DEBUG)
extern int object_total_remaining;
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__mips__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__ppc__) || defined(__powerpc__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__i386__) || defined(__x86_64__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#else
#warning use non optimized implementation of refcounting.
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
private: \
void AddRef(); \
void Release();
- class Object
- {
- };
#endif // SWIG
#endif // __base_object_h
ptr->Release();
}
+#ifndef SWIG
T* grabRef() { if (!ptr) return 0; ptr->AddRef(); return ptr; }
T* &ptrref() { assert(!ptr); return ptr; }
+#endif
T* operator->() const { ptrAssert(ptr); return ptr; }
operator T*() const { return this->ptr; }
}
}
+#ifndef SWIG
T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; }
T* &ptrref() { assert(!ptr); return ptr; }
+#endif
T* operator->() const { ptrAssert(ptr); return ptr; }
operator T*() const { return this->ptr; }
};
class eComponentScan: public Object, public iObject
{
-DECLARE_REF(eComponentScan);
-private:
+ DECLARE_REF(eComponentScan);
#ifndef SWIG
void scanEvent(int event);
ePtr<eConnection> m_scan_event_connection;
class eDVBDB: public iDVBChannelList
{
+ DECLARE_REF(eDVBDB);
static eDVBDB *instance;
-DECLARE_REF(eDVBDB);
friend class eDVBDBQuery;
friend class eDVBDBBouquetQuery;
friend class eDVBDBSatellitesQuery;
// we have to add a possibility to invalidate here.
class eDVBDBQueryBase: public iDVBChannelListQuery
{
-DECLARE_REF(eDVBDBQueryBase);
+ DECLARE_REF(eDVBDBQueryBase);
protected:
ePtr<eDVBDB> m_db;
ePtr<eDVBChannelQuery> m_query;
class eDVBAudio: public iObject
{
-DECLARE_REF(eDVBAudio);
+ DECLARE_REF(eDVBAudio);
private:
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux, m_dev, m_is_freezed;
class eDVBVideo: public iObject, public Object
{
-DECLARE_REF(eDVBVideo);
+ DECLARE_REF(eDVBVideo);
private:
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux, m_dev;
class eDVBPCR: public iObject
{
-DECLARE_REF(eDVBPCR);
+ DECLARE_REF(eDVBPCR);
private:
ePtr<eDVBDemux> m_demux;
int m_fd_demux;
class eDVBTText: public iObject
{
-DECLARE_REF(eDVBTText);
+ DECLARE_REF(eDVBTText);
private:
ePtr<eDVBDemux> m_demux;
int m_fd_demux;
class eTSMPEGDecoder: public Object, public iTSMPEGDecoder
{
+ DECLARE_REF(eTSMPEGDecoder);
+private:
static int m_pcm_delay;
static int m_ac3_delay;
static int m_audio_channel;
-DECLARE_REF(eTSMPEGDecoder);
std::string m_radio_pic;
ePtr<eDVBDemux> m_demux;
ePtr<eDVBAudio> m_audio;
class eDVBSectionReader: public iDVBSectionReader, public Object
{
DECLARE_REF(eDVBSectionReader);
-private:
int fd;
Signal1<void, const __u8*> read;
ePtr<eDVBDemux> demux;
class eDVBPESReader: public iDVBPESReader, public Object
{
DECLARE_REF(eDVBPESReader);
-private:
int m_fd;
Signal2<void, const __u8*, int> m_read;
ePtr<eDVBDemux> m_demux;
if (!i->m_inuse && i->m_frontend->getSlotID() == slot_index)
{
// check if another slot linked to this is in use
- eDVBRegisteredFrontend *satpos_depends_to_fe =
- (eDVBRegisteredFrontend*) i->m_frontend->m_data[eDVBFrontend::SATPOS_DEPENDS_PTR];
- if ( (long)satpos_depends_to_fe != -1 )
+ long tmp;
+ i->m_frontend->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, tmp);
+ if ( tmp != -1 )
{
+ eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend *)tmp;
if (satpos_depends_to_fe->m_inuse)
{
eDebug("another satpos depending frontend is in use.. so allocateFrontendByIndex not possible!");
}
else // check linked tuners
{
- eDVBRegisteredFrontend *next =
- (eDVBRegisteredFrontend *) i->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR];
- while ( (long)next != -1 )
+ i->m_frontend->getData(eDVBFrontend::LINKED_NEXT_PTR, tmp);
+ while ( tmp != -1 )
{
+ eDVBRegisteredFrontend *next = (eDVBRegisteredFrontend *) tmp;
if (next->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
err = errAllSourcesBusy;
goto alloc_fe_by_id_not_possible;
}
- next = (eDVBRegisteredFrontend *)next->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR];
+ next->m_frontend->getData(eDVBFrontend::LINKED_NEXT_PTR, tmp);
}
- eDVBRegisteredFrontend *prev = (eDVBRegisteredFrontend *)
- i->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR];
- while ( (long)prev != -1 )
+ i->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
+ while ( tmp != -1 )
{
+ eDVBRegisteredFrontend *prev = (eDVBRegisteredFrontend *) tmp;
if (prev->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
err = errAllSourcesBusy;
goto alloc_fe_by_id_not_possible;
}
- prev = (eDVBRegisteredFrontend *)prev->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR];
+ prev->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
}
}
fe = new eDVBAllocatedFrontend(i);
{
DECLARE_REF(eDVBRegisteredFrontend);
eTimer *disable;
- Signal0<void> stateChanged;
void closeFrontend()
{
if (!m_inuse && m_frontend->closeFrontend()) // frontend busy
disable->start(60000, true); // retry close in 60secs
}
public:
+ Signal0<void> stateChanged;
eDVBRegisteredFrontend(eDVBFrontend *fe, iDVBAdapter *adap)
:disable(new eTimer(eApp)), m_adapter(adap), m_frontend(fe), m_inuse(0)
{
struct eDVBRegisteredDemux
{
-DECLARE_REF(eDVBRegisteredDemux);
+ DECLARE_REF(eDVBRegisteredDemux);
public:
iDVBAdapter *m_adapter;
ePtr<eDVBDemux> m_demux;
class eDVBAllocatedFrontend
{
-DECLARE_REF(eDVBAllocatedFrontend);
+ DECLARE_REF(eDVBAllocatedFrontend);
public:
eDVBAllocatedFrontend(eDVBRegisteredFrontend *fe);
class eDVBAllocatedDemux
{
-DECLARE_REF(eDVBAllocatedDemux);
+ DECLARE_REF(eDVBAllocatedDemux);
public:
eDVBAllocatedDemux(eDVBRegisteredDemux *demux);
class eDVBAdapterLinux: public iDVBAdapter
{
-DECLARE_REF(eDVBAdapterLinux);
+ DECLARE_REF(eDVBAdapterLinux);
public:
eDVBAdapterLinux(int nr);
class eDVBLocalTimeHandler: public Object
{
+ DECLARE_REF(eDVBLocalTimeHandler);
struct channel_data
{
TDT *tdt;
int m_prevChannelState;
};
friend class TDT;
- DECLARE_REF(eDVBLocalTimeHandler)
std::map<iDVBChannel*, channel_data> m_knownChannels;
std::map<eDVBChannelID,int> m_timeOffsetMap;
ePtr<eConnection> m_chanAddedConn;
class eGTable: public iObject, public Object
{
-DECLARE_REF(eGTable);
-private:
+ DECLARE_REF(eGTable);
ePtr<iDVBSectionReader> m_reader;
eDVBTableSpec m_table;
class eDVBFrontend: public iDVBFrontend, public Object
{
+public:
+ enum {
+ CSW, // state of the committed switch
+ UCSW, // state of the uncommitted switch
+ TONEBURST, // current state of toneburst switch
+ NEW_ROTOR_CMD, // prev sent rotor cmd
+ NEW_ROTOR_POS, // new rotor position (not validated)
+ ROTOR_CMD, // completed rotor cmd (finalized)
+ ROTOR_POS, // current rotor position
+ LINKED_PREV_PTR, // prev double linked list (for linked FEs)
+ LINKED_NEXT_PTR, // next double linked list (for linked FEs)
+ SATPOS_DEPENDS_PTR, // pointer to FE with configured rotor (with twin/quattro lnb)
+ FREQ_OFFSET, // current frequency offset
+ CUR_VOLTAGE, // current voltage
+ CUR_TONE, // current continuous tone
+ NUM_DATA_ENTRIES
+ };
+ Signal1<void,iDVBFrontend*> m_stateChanged;
+private:
DECLARE_REF(eDVBFrontend);
bool m_enabled;
int m_type;
int m_secfd;
char m_sec_filename[128];
#endif
-
FRONTENDPARAMETERS parm;
int m_state;
- Signal1<void,iDVBFrontend*> m_stateChanged;
ePtr<iDVBSatelliteEquipmentControl> m_sec;
eSocketNotifier *m_sn;
int m_tuning;
eSecCommandList m_sec_sequence;
- enum {
- CSW, // state of the committed switch
- UCSW, // state of the uncommitted switch
- TONEBURST, // current state of toneburst switch
- NEW_ROTOR_CMD, // prev sent rotor cmd
- NEW_ROTOR_POS, // new rotor position (not validated)
- ROTOR_CMD, // completed rotor cmd (finalized)
- ROTOR_POS, // current rotor position
- LINKED_PREV_PTR, // prev double linked list (for linked FEs)
- LINKED_NEXT_PTR, // next double linked list (for linked FEs)
- SATPOS_DEPENDS_PTR, // pointer to FE with configured rotor (with twin/quattro lnb)
- FREQ_OFFSET, // current frequency offset
- CUR_VOLTAGE, // current voltage
- CUR_TONE, // current continuous tone
- NUM_DATA_ENTRIES
- };
-
long m_data[NUM_DATA_ENTRIES];
int m_idleInputpower[2]; // 13V .. 18V
void timeout();
void tuneLoop(); // called by m_tuneTimer
void setFrontend();
- int readInputpower();
bool setSecSequencePos(int steps);
void setRotorData(int pos, int cmd);
static int PriorityOrder;
eDVBFrontend(int adap, int fe, int &ok);
virtual ~eDVBFrontend();
+ int readInputpower();
RESULT getFrontendType(int &type);
RESULT tune(const iDVBFrontendParameters &where);
RESULT prepare_sat(const eDVBFrontendParametersSatellite &, unsigned int timeout);
class eDVBTransponderList: iDVBChannelList
{
DECLARE_REF(eDVBTransponderList);
-private:
std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> > channels;
public:
virtual RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm)=0;
unsigned char qdar[60*1024]; //60 kB for holding Rass qdar archive
unsigned short crc16, crc;
long part, parts, partcnt;
- enum { RadioTextChanged, RtpTextChanged, RassInteractivePicMaskChanged, RecvRassSlidePic };
unsigned char rass_picture_mask[5]; // 40 bits... (10 * 4 pictures)
void addToPictureMask(int id);
void removeFromPictureMask(int id);
public:
+ enum { RadioTextChanged, RtpTextChanged, RassInteractivePicMaskChanged, RecvRassSlidePic };
eDVBRdsDecoder(iDVBDemux *demux);
~eDVBRdsDecoder();
int start(int pid);
class eDVBScan: public Object, public iObject
{
-DECLARE_REF(eDVBScan);
-private:
+ DECLARE_REF(eDVBScan);
/* chid helper functions: */
/* heuristically determine if onid/tsid is valid */
class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
{
+ DECLARE_REF(eDVBSatelliteEquipmentControl);
public:
enum {
DELAY_AFTER_CONT_TONE=0, // delay after continuous tone change
public:
#ifndef SWIG
eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends);
- DECLARE_REF(eDVBSatelliteEquipmentControl);
RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int tunetimeout);
int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *, int frontend_id);
bool currentLNBValid() { return m_lnbidx > -1 && m_lnbidx < (int)(sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters)); }
class eDVBCISlot: public iObject, public Object
{
friend class eDVBCIInterfaces;
-DECLARE_REF(eDVBCISlot);
-private:
+ DECLARE_REF(eDVBCISlot);
int slotid;
int fd;
eSocketNotifier *notifier;
class eDVBCIInterfaces
{
-DECLARE_REF(eDVBCIInterfaces);
+ DECLARE_REF(eDVBCIInterfaces);
static eDVBCIInterfaces *instance;
-private:
eSmartPtrList<eDVBCISlot> m_slots;
eDVBCISlot *getSlot(int slotid);
PMTHandlerList m_pmt_handlers;
{
DECLARE_REF(eDVBCISession);
static ePtr<eDVBCISession> sessions[SLMS];
- static void deleteSessions(const eDVBCISlot *slot);
static void createSession(eDVBCISlot *slot, const unsigned char *resource_identifier, unsigned char &status, ePtr<eDVBCISession> &ptr);
static void sendSPDU(eDVBCISlot *slot, unsigned char tag,const void *data, int len, unsigned short session_nb, const void *apdu=0,int alen=0);
static void sendOpenSessionResponse(eDVBCISlot *slot,unsigned char session_status, const unsigned char *resource_identifier,unsigned short session_nb);
public:
virtual ~eDVBCISession();
+ static void deleteSessions(const eDVBCISlot *slot);
int poll() { if (action) { action=doAction(); return 1; } return 0; }
enum { stateInCreation, stateBusy, stateInDeletion, stateStarted, statePrivate};
class eTextPara: public iObject
{
-DECLARE_REF(eTextPara);
-private:
- ePtr<Font> current_font, replacement_font;
+ DECLARE_REF(eTextPara);
+ ePtr<Font> current_font, replacement_font;
FT_Face current_face, replacement_face;
int use_kerning;
int previous;
class Font: public iObject
{
-DECLARE_REF(Font);
+ DECLARE_REF(Font);
public:
#ifdef HAVE_FREETYPE2
FTC_ScalerRec scaler;
*/
class gFont: public iObject
{
-DECLARE_REF(gFont);
+ DECLARE_REF(gFont);
public:
std::string family;
/* gRC is the singleton which controls the fifo and dispatches commands */
class gRC: public iObject, public Object
{
-DECLARE_REF(gRC);
-private:
+ DECLARE_REF(gRC);
friend class gPainter;
static gRC *instance;
class gDC: public iObject
{
-DECLARE_REF(gDC);
+ DECLARE_REF(gDC);
protected:
ePtr<gPixmap> m_pixmap;
class eWindowStyleSimple: public eWindowStyle
{
DECLARE_REF(eWindowStyleSimple);
-private:
ePtr<gFont> m_fnt;
gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
class eNavigation: public iObject, public Object
{
DECLARE_REF(eNavigation);
-private:
ePtr<iServiceHandler> m_servicehandler;
ePtr<iPlayableService> m_runningService;
class pNavigation: public iObject, public Object
{
-DECLARE_REF(pNavigation);
+ DECLARE_REF(pNavigation);
public:
PSignal1<void, int> m_event;
PSignal2<void, ePtr<iRecordableService>&, int> m_record_event;
class eHTTPDyn: public eHTTPDataSource
{
DECLARE_REF(eHTTPDyn);
-private:
std::string result;
int wptr, size;
public:
class eHTTPDynPathResolver: public iHTTPPathResolver
{
DECLARE_REF(eHTTPDynPathResolver);
-private:
struct eHTTPDynEntry: public iObject
{
DECLARE_REF(eHTTPDynEntry);
class eHTTPError: public eHTTPDataSource
{
DECLARE_REF(eHTTPError);
-private:
int errcode;
public:
eHTTPError(eHTTPConnection *c, int errcode);
class eServiceFactoryDVD: public iServiceHandler
{
-DECLARE_REF(eServiceFactoryDVD);
+ DECLARE_REF(eServiceFactoryDVD);
public:
eServiceFactoryDVD();
virtual ~eServiceFactoryDVD();
public iServiceInformation, public iSubtitleOutput, public iServiceKeys, public iCueSheet, public eThread, public Object
{
friend class eServiceFactoryDVD;
-DECLARE_REF(eServiceDVD);
+ DECLARE_REF(eServiceDVD);
public:
virtual ~eServiceDVD();
// not implemented (yet)
SWIG_IGNORE(eComponentData);
struct eComponentData
{
-DECLARE_REF(eComponentData);
-#ifndef SWIG
+ friend class eServiceEvent;
+ DECLARE_REF(eComponentData);
uint8_t m_streamContent;
uint8_t m_componentType;
uint8_t m_componentTag;
std::string m_iso639LanguageCode;
std::string m_text;
-#endif
+public:
eComponentData(const eComponentData& d) { *this = d; }
eComponentData() { m_streamContent = m_componentType = m_componentTag = 0; }
int getStreamContent(void) const { return m_streamContent; }
class eServiceCenter: public iServiceHandler
{
-DECLARE_REF(eServiceCenter);
-private:
+ DECLARE_REF(eServiceCenter);
std::map<int,ePtr<iServiceHandler> > handler;
std::map<int,std::list<std::string> > extensions;
static eServiceCenter *instance;
class eDVBServiceList: public iListableService, public iMutableServiceList
{
-DECLARE_REF(eDVBServiceList);
+ DECLARE_REF(eDVBServiceList);
public:
virtual ~eDVBServiceList();
PyObject *getContent(const char* formatstr, bool sorted=false);
public iCueSheet, public iSubtitleOutput, public iAudioDelay,
public iRdsDecoder, public iStreamableService
{
-DECLARE_REF(eDVBServicePlay);
+ DECLARE_REF(eDVBServicePlay);
public:
virtual ~eDVBServicePlay();
public iStreamableService,
public Object
{
-DECLARE_REF(eDVBServiceRecord);
+ DECLARE_REF(eDVBServiceRecord);
public:
RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection);
RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id);
class eServiceFactoryFS: public iServiceHandler
{
-DECLARE_REF(eServiceFactoryFS);
+ DECLARE_REF(eServiceFactoryFS);
public:
eServiceFactoryFS();
virtual ~eServiceFactoryFS();
class eServiceFS: public iListableService
{
-DECLARE_REF(eServiceFS);
-private:
+ DECLARE_REF(eServiceFS);
std::string path;
friend class eServiceFactoryFS;
eServiceFS(const char *path, const char *additional_extensions=0);
class eServiceFactoryMP3: public iServiceHandler
{
-DECLARE_REF(eServiceFactoryMP3);
+ DECLARE_REF(eServiceFactoryMP3);
public:
eServiceFactoryMP3();
virtual ~eServiceFactoryMP3();
class eServiceMP3: public iPlayableService, public iPauseableService,
public iServiceInformation, public iSeekableService, public Object
{
-DECLARE_REF(eServiceMP3);
+ DECLARE_REF(eServiceMP3);
public:
virtual ~eServiceMP3();
class eServiceFactoryXine: public iServiceHandler
{
-DECLARE_REF(eServiceFactoryXine);
+ DECLARE_REF(eServiceFactoryXine);
public:
eServiceFactoryXine();
virtual ~eServiceFactoryXine();
class eServiceXine: public iPlayableService, public iPauseableService,
public iServiceInformation, public iSeekableService, public Object
{
-DECLARE_REF(eServiceXine);
+ DECLARE_REF(eServiceXine);
public:
virtual ~eServiceXine();