public override void BeginPlaying(MHEngine engine) { m_fStreamPlaying = true; if (m_fRunning && m_streamContentRef.IsSet()) { string stream = ""; MHOctetString str = m_streamContentRef.ContentRef; if (str.Size != 0) { stream = str.ToString(); } engine.GetContext().BeginVideo(stream, m_nComponentTag); } }
public override void Activation(MHEngine engine) { if (m_fRunning) { return; } base.Activation(engine); if (m_fStreamPlaying && m_streamContentRef.IsSet()) { string stream = ""; MHOctetString str = m_streamContentRef.ContentRef; if (str.Size != 0) { stream = str.ToString(); } engine.GetContext().BeginVideo(stream, m_nComponentTag); } }
public virtual void SI_GetServiceIndex(MHObjectRef success, MHSequence <MHParameter> args, MHEngine engine) { // Returns an index indicating the service if (args.Size == 2) { MHOctetString str = new MHOctetString(); GetString(args.GetAt(0), str, engine); MHParameter pResInt = args.GetAt(1); // The format of the service is dvb://netID.[transPortID].serviceID // where the IDs are in hex. // or rec://svc/lcn/N where N is the "logical channel number" i.e. the Freeview channel. int nResult = engine.GetContext().GetChannelIndex(str.ToString()); engine.FindObject(pResInt.GetReference()).SetVariableValue(new MHUnion(nResult)); Logging.Log(Logging.MHLogDetail, "Get service index for " + str.Printable() + " - result " + nResult); SetSuccessFlag(success, true, engine); } else { SetSuccessFlag(success, false, engine); } }
// Activation for Audio is defined in the corrigendum public override void Activation(MHEngine engine) { if (m_fRunning) { return; } base.Activation(engine); // Beginning presentation is started by the Stream object. m_fRunning = true; engine.EventTriggered(this, EventIsRunning); if (m_fStreamPlaying && m_streamContentRef.IsSet()) { string stream = ""; MHOctetString str = m_streamContentRef.ContentRef; if (str.Size != 0) { stream = str.ToString(); } engine.GetContext().BeginAudio(stream, m_nComponentTag); } }
// UK MHEG. Interpret the font attributes. protected void InterpretAttributes(MHOctetString attrs, out int style, out int size, out int lineSpace, out int letterSpace) { // Set the defaults. style = 0; size = 0x18; lineSpace = 0x18; letterSpace = 0; if (attrs.Size == 5) // Short form. { style = attrs.GetAt(0); // Only the bottom nibble is significant. size = attrs.GetAt(1); lineSpace = attrs.GetAt(2); // Is this big-endian or little-endian? Assume big. letterSpace = attrs.GetAt(3) * 256 + attrs.GetAt(4); if (letterSpace > 32767) { letterSpace -= 65536; // Signed. } } else // Textual form. { String str = attrs.ToString() + "."; Logging.Assert(str != null); int q = str.IndexOf('.'); // Find the terminating dot if (q != -1) // plain, italic etc. { string type = str.Substring(0, q); str = str.Substring(q + 1); if (type.Equals("italic")) { style = 1; } else if (type.Equals("bold")) { style = 2; } else if (type.Equals("bold-italic")) { style = 3; } // else it's plain. q = str.IndexOf('.'); } if (q != -1) // Size { string s = str.Substring(0, q); str = str.Substring(q + 1); size = Convert.ToInt32(s); if (size == 0) { size = 0x18; } q = str.IndexOf('.'); // Find the next dot. } if (q != -1) // lineSpacing { string ls = str.Substring(0, q); str = str.Substring(q + 1); lineSpace = Convert.ToInt32(ls); if (lineSpace == 0) { size = 0x18; } q = str.IndexOf('.'); // Find the next dot. } if (q != -1) // letter spacing. May be zero or negative { string ls = str.Substring(0, q); letterSpace = Convert.ToInt32(ls); } } }