MHIContext Class Reference

Contains various utility functions for interactive television. More...

#include <mhi.h>

Inheritance diagram for MHIContext:
MHContext

List of all members.

Public Member Functions

 MHIContext (InteractiveTV *parent)
virtual ~MHIContext ()
void QueueDSMCCPacket (unsigned char *data, int length, int componentTag, unsigned carouselId, int dataBroadcastId)
void SetNetBootInfo (const unsigned char *data, uint length)
void Restart (int chanid, int sourceid, bool isLive)
 Restart the MHEG engine.
bool OfferKey (QString key)
void UpdateOSD (InteractiveScreen *osdWindow, MythPainter *osdPainter)
 Update the display.
void Reinit (const QRect &display)
 The display area has changed.
void StopEngine (void)
 Stop the MHEG engine if it's running and waits until it has.
virtual bool CheckCarouselObject (QString objectPath)
virtual bool GetCarouselData (QString objectPath, QByteArray &result)
virtual void SetInputRegister (int nReg)
virtual void RequireRedraw (const QRegion &region)
 An area of the screen/image needs to be redrawn.
virtual bool CheckStop (void)
 Check whether we have requested a stop.
void GetInitialStreams (int &audioTag, int &videoTag)
 Get the initial component tags.
virtual MHDLADisplayCreateDynamicLineArt (bool isBoxed, MHRgba lineColour, MHRgba fillColour)
 Creation functions for various visibles.
virtual MHTextDisplayCreateText (void)
virtual MHBitmapDisplayCreateBitmap (bool tiling)
virtual void DrawRect (int xPos, int yPos, int width, int height, MHRgba colour)
 Additional drawing functions.
virtual void DrawBackground (const QRegion &reg)
virtual void DrawVideo (const QRect &videoRect, const QRect &displayRect)
void DrawImage (int x, int y, const QRect &rect, const QImage &image)
virtual int GetChannelIndex (const QString &str)
virtual bool GetServiceInfo (int channelId, int &netId, int &origNetId, int &transportId, int &serviceId)
 Get netId etc from the channel index.
virtual bool TuneTo (int channel, int tuneinfo)
virtual bool BeginAudio (const QString &stream, int tag)
 Begin playing audio from the specified stream.
virtual void StopAudio (void)
 Stop playing audio.
virtual bool BeginVideo (const QString &stream, int tag)
 Begin displaying video from the specified stream.
virtual void StopVideo (void)
 Stop displaying video.
virtual const char * GetReceiverId (void)
virtual const char * GetDSMCCId (void)
void AddToDisplay (const QImage &image, int x, int y)
FT_Face GetFontFace (void)
bool IsFaceLoaded (void)
bool LoadFont (QString name)
bool ImageUpdated (void)
int GetWidth (void)
int GetHeight (void)

Static Public Attributes

static const int StdDisplayWidth = 720
static const int StdDisplayHeight = 576

Protected Member Functions

void run (void)
void ProcessDSMCCQueue (void)
void NetworkBootRequested (void)
void ClearDisplay (void)
void ClearQueue (void)

Protected Attributes

InteractiveTVm_parent
Dsmccm_dsmcc
QMutex m_dsmccLock
MythDeque< DSMCCPacket * > m_dsmccQueue
QMutex m_keyLock
MythDeque< int > m_keyQueue
int m_keyProfile
MHEGm_engine
QMutex m_runLock
QWaitCondition m_engine_wait
bool m_stop
QMutex m_display_lock
bool m_updated
int m_displayWidth
int m_displayHeight
float m_xScale
float m_yScale
list< MHIImageData * > m_display
FT_Face m_face
bool m_face_loaded
MThreadm_engineThread
int m_currentChannel
int m_currentStream
bool m_isLive
int m_currentSource
int m_audioTag
int m_videoTag
QList< int > m_tuneinfo
uint m_lastNbiVersion
vector< unsigned char > m_nbiData
QRect m_videoRect
QRect m_displayRect

Detailed Description

Contains various utility functions for interactive television.

Definition at line 42 of file mhi.h.


Constructor & Destructor Documentation

MHIContext::MHIContext ( InteractiveTV parent  ) 

Definition at line 52 of file mhi.cpp.

MHIContext::~MHIContext (  )  [virtual]

Definition at line 114 of file mhi.cpp.


Member Function Documentation

void MHIContext::QueueDSMCCPacket ( unsigned char *  data,
int  length,
int  componentTag,
unsigned  carouselId,
int  dataBroadcastId 
)

Definition at line 287 of file mhi.cpp.

Referenced by InteractiveTV::ProcessDSMCCSection().

void MHIContext::SetNetBootInfo ( const unsigned char *  data,
uint  length 
)

Definition at line 309 of file mhi.cpp.

Referenced by InteractiveTV::SetNetBootInfo().

void MHIContext::Restart ( int  chanid,
int  sourceid,
bool  isLive 
)

Restart the MHEG engine.

Definition at line 159 of file mhi.cpp.

Referenced by InteractiveTV::Restart().

bool MHIContext::OfferKey ( QString  key  ) 

Definition at line 407 of file mhi.cpp.

Referenced by InteractiveTV::OfferKey().

void MHIContext::UpdateOSD ( InteractiveScreen osdWindow,
MythPainter osdPainter 
)

Update the display.

Definition at line 502 of file mhi.cpp.

Referenced by InteractiveTV::UpdateOSD().

void MHIContext::Reinit ( const QRect &  display  ) 

The display area has changed.

Definition at line 483 of file mhi.cpp.

Referenced by InteractiveTV::Reinit().

void MHIContext::StopEngine ( void   ) 

Stop the MHEG engine if it's running and waits until it has.

Definition at line 142 of file mhi.cpp.

Referenced by Restart(), and ~MHIContext().

bool MHIContext::CheckCarouselObject ( QString  objectPath  )  [virtual]

Implements MHContext.

Definition at line 360 of file mhi.cpp.

bool MHIContext::GetCarouselData ( QString  objectPath,
QByteArray &  result 
) [virtual]

Implements MHContext.

Definition at line 369 of file mhi.cpp.

void MHIContext::SetInputRegister ( int  nReg  )  [virtual]

Implements MHContext.

Definition at line 493 of file mhi.cpp.

void MHIContext::RequireRedraw ( const QRegion &  region  )  [virtual]

An area of the screen/image needs to be redrawn.

Implements MHContext.

Definition at line 545 of file mhi.cpp.

virtual bool MHIContext::CheckStop ( void   )  [inline, virtual]

Check whether we have requested a stop.

Implements MHContext.

Definition at line 86 of file mhi.h.

void MHIContext::GetInitialStreams ( int &  audioTag,
int &  videoTag 
)

Get the initial component tags.

Definition at line 535 of file mhi.cpp.

Referenced by InteractiveTV::GetInitialStreams().

MHDLADisplay * MHIContext::CreateDynamicLineArt ( bool  isBoxed,
MHRgba  lineColour,
MHRgba  fillColour 
) [virtual]

Creation functions for various visibles.

Implements MHContext.

Definition at line 821 of file mhi.cpp.

MHTextDisplay * MHIContext::CreateText ( void   )  [virtual]

Implements MHContext.

Definition at line 828 of file mhi.cpp.

MHBitmapDisplay * MHIContext::CreateBitmap ( bool  tiling  )  [virtual]

Implements MHContext.

Definition at line 834 of file mhi.cpp.

void MHIContext::DrawRect ( int  xPos,
int  yPos,
int  width,
int  height,
MHRgba  colour 
) [virtual]

Additional drawing functions.

Implements MHContext.

Definition at line 840 of file mhi.cpp.

Referenced by MHIDLA::Draw(), and DrawBackground().

void MHIContext::DrawBackground ( const QRegion &  reg  )  [virtual]

Implements MHContext.

Definition at line 910 of file mhi.cpp.

void MHIContext::DrawVideo ( const QRect &  videoRect,
const QRect &  displayRect 
) [virtual]

Implements MHContext.

Definition at line 575 of file mhi.cpp.

void MHIContext::DrawImage ( int  x,
int  y,
const QRect &  rect,
const QImage &  image 
)

Definition at line 869 of file mhi.cpp.

Referenced by MHIBitmap::Draw(), MHIDLA::Draw(), and MHIText::Draw().

int MHIContext::GetChannelIndex ( const QString &  str  )  [virtual]

Implements MHContext.

Definition at line 635 of file mhi.cpp.

Referenced by BeginAudio(), and BeginVideo().

bool MHIContext::GetServiceInfo ( int  channelId,
int &  netId,
int &  origNetId,
int &  transportId,
int &  serviceId 
) [virtual]

Get netId etc from the channel index.

Implements MHContext.

Definition at line 717 of file mhi.cpp.

bool MHIContext::TuneTo ( int  channel,
int  tuneinfo 
) [virtual]

Implements MHContext.

Definition at line 738 of file mhi.cpp.

Referenced by BeginAudio(), and BeginVideo().

bool MHIContext::BeginAudio ( const QString &  stream,
int  tag 
) [virtual]

Begin playing audio from the specified stream.

Implements MHContext.

Definition at line 759 of file mhi.cpp.

void MHIContext::StopAudio ( void   )  [virtual]

Stop playing audio.

Implements MHContext.

Definition at line 786 of file mhi.cpp.

bool MHIContext::BeginVideo ( const QString &  stream,
int  tag 
) [virtual]

Begin displaying video from the specified stream.

Implements MHContext.

Definition at line 792 of file mhi.cpp.

void MHIContext::StopVideo ( void   )  [virtual]

Stop displaying video.

Implements MHContext.

Definition at line 815 of file mhi.cpp.

virtual const char* MHIContext::GetReceiverId ( void   )  [inline, virtual]

Implements MHContext.

Definition at line 121 of file mhi.h.

virtual const char* MHIContext::GetDSMCCId ( void   )  [inline, virtual]

Implements MHContext.

Definition at line 123 of file mhi.h.

void MHIContext::AddToDisplay ( const QImage &  image,
int  x,
int  y 
)

Definition at line 555 of file mhi.cpp.

Referenced by DrawImage(), and DrawRect().

FT_Face MHIContext::GetFontFace ( void   )  [inline]

Definition at line 130 of file mhi.h.

Referenced by MHIText::AddText(), and MHIText::GetBounds().

bool MHIContext::IsFaceLoaded ( void   )  [inline]

Definition at line 131 of file mhi.h.

Referenced by MHIText::AddText(), and MHIText::GetBounds().

bool MHIContext::LoadFont ( QString  name  ) 

Definition at line 84 of file mhi.cpp.

Referenced by MHIContext().

bool MHIContext::ImageUpdated ( void   )  [inline]

Definition at line 133 of file mhi.h.

Referenced by InteractiveTV::ImageHasChanged().

int MHIContext::GetWidth ( void   )  [inline]

Definition at line 137 of file mhi.h.

int MHIContext::GetHeight ( void   )  [inline]

Definition at line 138 of file mhi.h.

void MHIContext::run ( void   )  [protected]

Definition at line 226 of file mhi.cpp.

void MHIContext::ProcessDSMCCQueue ( void   )  [protected]

Definition at line 265 of file mhi.cpp.

Referenced by GetCarouselData(), and run().

void MHIContext::NetworkBootRequested ( void   )  [protected]

Definition at line 334 of file mhi.cpp.

Referenced by run().

void MHIContext::ClearDisplay ( void   )  [protected]

Definition at line 125 of file mhi.cpp.

Referenced by NetworkBootRequested(), RequireRedraw(), Restart(), and ~MHIContext().

void MHIContext::ClearQueue ( void   )  [protected]

Definition at line 133 of file mhi.cpp.

Referenced by Restart(), and ~MHIContext().


Member Data Documentation

const int MHIContext::StdDisplayWidth = 720 [static]

Definition at line 135 of file mhi.h.

Referenced by MHIContext(), Reinit(), and RequireRedraw().

const int MHIContext::StdDisplayHeight = 576 [static]

Definition at line 136 of file mhi.h.

Referenced by MHIContext(), Reinit(), and RequireRedraw().

Definition at line 147 of file mhi.h.

Referenced by BeginAudio(), BeginVideo(), and DrawVideo().

Dsmcc* MHIContext::m_dsmcc [protected]
QMutex MHIContext::m_dsmccLock [protected]

Definition at line 151 of file mhi.h.

Referenced by ClearQueue(), ProcessDSMCCQueue(), and QueueDSMCCPacket().

QMutex MHIContext::m_keyLock [protected]

Definition at line 153 of file mhi.h.

Referenced by OfferKey(), Restart(), run(), and SetInputRegister().

Definition at line 154 of file mhi.h.

Referenced by OfferKey(), Restart(), run(), and SetInputRegister().

int MHIContext::m_keyProfile [protected]

Definition at line 155 of file mhi.h.

Referenced by OfferKey(), and SetInputRegister().

MHEG* MHIContext::m_engine [protected]

Definition at line 157 of file mhi.h.

Referenced by NetworkBootRequested(), RequireRedraw(), Restart(), run(), and ~MHIContext().

QMutex MHIContext::m_runLock [mutable, protected]

Definition at line 159 of file mhi.h.

Referenced by GetCarouselData(), OfferKey(), QueueDSMCCPacket(), run(), SetNetBootInfo(), and StopEngine().

QWaitCondition MHIContext::m_engine_wait [protected]

Definition at line 160 of file mhi.h.

Referenced by GetCarouselData(), OfferKey(), QueueDSMCCPacket(), run(), SetNetBootInfo(), and StopEngine().

bool MHIContext::m_stop [protected]

Definition at line 161 of file mhi.h.

Referenced by CheckStop(), GetCarouselData(), Restart(), run(), and StopEngine().

QMutex MHIContext::m_display_lock [protected]

Definition at line 162 of file mhi.h.

Referenced by AddToDisplay(), DrawVideo(), RequireRedraw(), and UpdateOSD().

Definition at line 163 of file mhi.h.

Referenced by ImageUpdated(), NetworkBootRequested(), RequireRedraw(), Restart(), and UpdateOSD().

int MHIContext::m_displayWidth [protected]

Definition at line 164 of file mhi.h.

Referenced by GetWidth(), MHIContext(), and Reinit().

int MHIContext::m_displayHeight [protected]

Definition at line 165 of file mhi.h.

Referenced by GetHeight(), MHIContext(), and Reinit().

float MHIContext::m_xScale [protected]

Definition at line 166 of file mhi.h.

Referenced by MHIContext(), and Reinit().

float MHIContext::m_yScale [protected]

Definition at line 167 of file mhi.h.

Referenced by MHIContext(), and Reinit().

list<MHIImageData*> MHIContext::m_display [protected]

Definition at line 169 of file mhi.h.

Referenced by AddToDisplay(), ClearDisplay(), DrawVideo(), and UpdateOSD().

FT_Face MHIContext::m_face [protected]

Definition at line 171 of file mhi.h.

Referenced by GetFontFace(), LoadFont(), and ~MHIContext().

Definition at line 172 of file mhi.h.

Referenced by IsFaceLoaded(), MHIContext(), and ~MHIContext().

Definition at line 174 of file mhi.h.

Referenced by Restart(), and StopEngine().

Definition at line 176 of file mhi.h.

Referenced by GetChannelIndex(), and Restart().

int MHIContext::m_currentStream [protected]

Definition at line 177 of file mhi.h.

Referenced by BeginAudio(), BeginVideo(), GetChannelIndex(), and Restart().

Definition at line 178 of file mhi.h.

Referenced by Restart(), and TuneTo().

int MHIContext::m_currentSource [protected]

Definition at line 179 of file mhi.h.

Referenced by GetChannelIndex(), and Restart().

int MHIContext::m_audioTag [protected]

Definition at line 181 of file mhi.h.

Referenced by BeginAudio(), GetInitialStreams(), and Restart().

int MHIContext::m_videoTag [protected]

Definition at line 182 of file mhi.h.

Referenced by BeginVideo(), GetInitialStreams(), and Restart().

QList<int> MHIContext::m_tuneinfo [protected]

Definition at line 183 of file mhi.h.

Referenced by Restart(), and TuneTo().

Definition at line 185 of file mhi.h.

Referenced by NetworkBootRequested(), SetNetBootInfo(), and TuneTo().

vector<unsigned char> MHIContext::m_nbiData [protected]

Definition at line 186 of file mhi.h.

Referenced by NetworkBootRequested(), SetNetBootInfo(), and TuneTo().

QRect MHIContext::m_videoRect [protected]

Definition at line 188 of file mhi.h.

Referenced by DrawVideo(), and Reinit().

QRect MHIContext::m_displayRect [protected]

Definition at line 189 of file mhi.h.

Referenced by AddToDisplay(), DrawVideo(), and Reinit().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:10 2012 for MythTV by  doxygen 1.6.3