next up previous
Next: Interaction within a Scene Up: Multimedia and Hypermedia Information Previous: MHEG-5 overview

MHEG Programming Principles

MHEG-5 provides suitable abstractions for managing active, autonomous, and reusable entities (since it adopts an object-oriented approach).

A class is specified by three kinds of properties:

The most significant classes of MHEG-5 are now breifly described:

Root
-- A common Root superclass provides a uniform object identification mechanism and specifies the general semantics for preparation/destruction and activation/deactivation of objects, including notification of changes of an object's availability and running status. These general provisions are further specialized moving downwards through the inheritance tree, which first branches into the Group and Ingredient classes.
Group
-- This abstract class handles the grouping of objects in the Ingredient class as a unique entity of interchange. In fact, Group objects can be addressed and independently downloaded from the server. A Group can be specialized into Application and Scene classes.

Application
-- An MHEG-5 application is structurally organized into one Application and one or more Scene objects. The Application object represents the entry point that performs a transition to the presentation's first Scene. Generally, this transition occurs at startup (see below code examples) because a presentation can't happen without a Scene running.

The Launch action activates an Application after quitting the active Application. The Quit action ends the active Application, which also terminates the active Scene's presentation. The Ingredients of an Application are available to the different Scenes that become active, thereby allowing an uninterrupted presentation of contents (for example, a bitmap can serve as the common background for all Scenes in an Application).

Scene
-- This class allows spatially and temporally coordinated presentations of Ingredients. At most, one Scene can be active at one time. Navigating within an Application is performed via the TransitionToaction that closes the current Scene, including its Ingredients, and activates the new one. The SceneCoordinateSystem attribute specifies the presentation space's 2D size for the Scene. If a user interaction occurs in this space, a UserInput event is generated. A Scene also supports timers. A Timer event is generated when a timer expires.

Ingredient
-- This abstract class provides the common behavior for all objects that can be included in an Application or a Scene.

The OriginalContent attribute maps object and content data. It contains either included content or a reference to an external data source (such as a URL or a DSMCC file name). The ContentHook attribute specifies the encoding format for the content. However, MHEG-5 does not list the supported encoding formats. See coding examples below for the use of content references and hooks.

The action Preload gives hints to the RTE for making the content available for presentation. Especially for streams, this action does not completely download the content, it just sets up the proper network connection to the site where the content is stored. The action Unload frees allocated resources for the content.

The Presentable, Stream, and Link classes are subclasses of the Ingredient class.

Presentable
-- This abstract class specifies the common aspects for information that can be seen or heard by the user. The Run and Stop actions activate and terminate the presentation, while generating the IsRunning and IsStopped events.
Visible
-- The Visible abstract class specializes the Presentable class with provisions for displaying objects in the active Scene's presentation space.

The OriginalBoxSize and OriginalPosition attributes respectively specify the size and position of the object's bounding box relative to the Scene's presentation space. The actions SetSize and SetPosition change the current values of these attributes.

The specialized objects in the Visible class include:

  • Bitmap -- This object displays a 2D array of pixels. The Tiling attribute specifies whether the content will be replicated throughout the BoxSize area. The action ScaleBitmap scales the content to a new size.

    Example, to create a simple bitmap object:

    (bitmap: BgndInfo
        content-hook: #bitmapHook
        content-data: referenced-content: "Info.bitmap" 
        box-size: ( 320 240 )
        original-position: ( 0 0 )
    )
    
  • LineArt, DynamicLineArt -- A LineArt is a vectorial representation of graphical entities, like polylines and ellipses. DynamicLineArt draws lines and curves on the fly in the BoxSize area.
  • Text -- This object represents a text string with a set of rendition attributes. Essentially, these attributes specify fonts and formatting information like justification and wrapping.

Stream
-- This class (a subclass of Ingredient) controls the synchronized presentation of multiplexed audio-visual data (such as an MPEG-2 file). A Stream object consists of a list of components from the Video, Audio, and RTGraphics (animated graphics) classes. The OriginalContent attribute of the Stream object refers to the whole multiplex of data streams.

When a Stream object is running, its streams can be switched on and off independently. This lets users switch between different audio trails (different languages) or choose which video stream(s) to present among a range of available ones. For example, the Turin code example below contains an MPEG-1 Stream composed of one audio and one video component. These components automatically activate when a run action targets the whole Stream because their InitiallyActive attribute is set to true.

Specific events are associated with playback: StreamPlaying/StreamStopped notifies the actual initiation/termination and CounterTrigger notifies the system when a previously booked time-code event occurs. The Turin code example below shows how the CounterTrigger event can be used to synchronize text subtitling and also illustrates the SetCounterPosition and SetCounterEndPosition actions to specify a temporal segment for presentation.

Link
-- The Link class implements event-action behavior by a condition and an effect. The LinkCondition contains an EventSource -‹ a reference to the object on which the event occurs -‹ an EventType that specifies the kind of event and a possible EventData that is a data value associated with the event.

MHEG-5 Action objects consist of a sequence of elementary actions. Elementary actions are comparable to methods in an object-oriented paradigm. The execution of an Action object means that each of its elementary actions are invoked sequentially.

As an example, consider the following Link, which transitions to another Scene when the character A is entered in the EntryField EF1.

Example, to create a simple link:

(link: Link1
    event-source: EF1
    event-type: #NewChar
    event-data: 'A'
    link-effect:
        (action: transition-to: Scene2)
)

In the Turin code example below, Link 49 triggers only if a CounterTrigger event on the video clip occurs with EventData = 3.

Specifically, this lets you associate a different effect with every booked value of the CounterPosition. The LinkEffect comprises a set of actions that are executed in sequence when an event that matches with the LinkCondition occurs. Every action specifies the target object and, possibly, other parameters depending on the type of action. MHEG-5 specifies more than 100 kinds of actions.

Interactible
-- This abstract class provides a way for users to interact with objects within the following sub-classes:

Hotspot, PushButton, and SwitchButton
-- These subclasses implement button selection capability and generate the IsSelected event. Example, to create a simple SwitchButton:

(switchbutton: Switch1
    style: #radiobutton
    position: ( 50 70 )
    label: "On"
)

Hypertext
-- This class extends the Text class with anchors. When selected, these anchors link text content to associated information.
Slider and EntryField
-- Respectively, these objects let users adjust a numeric value (such as the volume of an audio stream) and edit text.

Example, to create a simple slider:

(slider: Slider1 
    box-size: ( 40 5 )
    original-position: ( 100  100 )
    max-value: 20
    orientation: #right
)


next up previous
Next: Interaction within a Scene Up: Multimedia and Hypermedia Information Previous: MHEG-5 overview
Dave Marshall
10/4/2001