IDvdControl Interface


The IDvdControl interface controls the playback and search mechanisms of a digital versatile disc that contains one or more video movies.

The DVD file system is very different than a format such as CD-ROM, which contains a linear series of tracks not easily customizable by the author. The author of DVD-formatted media files can control track layout and navigation much more precisely; the media file itself comprises many parts and control mechanisms, which enables the author to arrange and rearrange the playback order as needed. You can locate a specific portion of a file by time (in hours, minutes, seconds, and frames) or by chapter value.

A media file is made up of a list of program chains (PGCs), each of which are made up of a list of programs, each of which is made up of a list of cells, each of which is made up of a list of video object units (VOBUs), each of which is made up of a list of packs, and each of which is made up of actual MPEG data.

To obtain a copy of the DVD-Video specification, "DVD Specifications for Read-Only Disc, Part 3, Video Specifications," contact Toshiba Corporation at 1-1, Shibaura 1-Chrome, Minato-ku, Tokyo 105-01, Japan, Tel. +81-3-5444-9580, Fax. +81-3-5444-9430.

When to Implement

Do not implement this interface. DirectShow implements it for you.

When to Use

Use this interface to control playback (set root drive, play, stop, and so forth) or use DVD-specific functionality such as menus and buttons when playing DVD-Video files.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IDvdControl methods Description
TitlePlay Finds the media file with the specified title index and plays it back.
ChapterPlay Plays the media file with the specified title index and chapter value.
TimePlay Plays the media file with the specified title index, starting at the specified time.
Stop Transitions playback to the DVD_DOMAIN_Stop state.
GoUp Halts playback of the current media file and starts playback of the designated previous program group chain (PGC).
TimeSearch Halts playback of the current media file and starts playback from the specified time in the same media file.
ChapterSearch Halts playback of the current media file and starts playback from the specified chapter value in the same media file.
PrevPGSearch Halts playback of the current media file and starts playback from the previous media file in the same PGC.
TopPGSearch Halts playback of the current media file and starts playback from the first media file in the PGC.
NextPGSearch Halts playback of the current media file and starts playback from the next media file in the same PGC.
ForwardScan Search forward through the current disc at the specified speed.
BackwardScan Search backward through the current disc at the specified speed.
MenuCall Displays the specified menu on the screen.
Resume Continues playback of a media file, if the file is paused.
UpperButtonSelect Selects the upper directional button from the displayed menu.
LowerButtonSelect Selects the lower directional button from the displayed menu.
LeftButtonSelect Selects the left directional button from the displayed menu.
RightButtonSelect Selects the right directional button from the displayed menu.
ButtonActivate Activates the selected button.
ButtonSelectAndActivate Selects and activates the specified button.
StillOff Resumes updating the display, which stops still-store mode.
PauseOn Pauses the current media file playback.
PauseOff Unpauses the current media file playback.
MenuLanguageSelect Sets the displayed language for navigation menus.
AudioStreamChange Sets the current audio stream.
SubpictureStreamChange Enables or disables picture-in-picture mode and sets the subpicture to the specified source.
AngleChange Sets the new display angle.
ParentalLevelSelect Sets the access level for the current media file.
ParentalCountrySelect Sets the current country for controlling access levels.
KaraokeAudioPresentationModeChange Sets the audio playback mode to karaoke.
VideoModePreferrence Sets the video display mode the user prefers.
SetRoot Sets the root directory containing the DVD-Video volume.
MouseActivate Selects and activates a DVD button in response to a mouse click.
MouseSelect Selects a DVD button in response to mouse movement.
ChapterPlayAutoStop Start playing at the specified chapter within the specified title and play the number of chapters specified.


IDvdControl::AngleChange

IDvdControl Interface

Sets the new display angle.

HRESULT AngleChange(
  ULONG ulAngle
  );

Parameters
ulAngle
[in] Value of the new angle, which must be between 1 and 9.
Return Values

Returns an HRESULT value that depends on the implementation of the interface.


IDvdControl::AudioStreamChange

IDvdControl Interface

Sets the current audio stream.

HRESULT AudioStreamChange(
  ULONG nAudio
  );

Parameters
nAudio
[in] Value that specifies the track to use, which must be between 0 and 7.
Return Values

Returns an HRESULT value that depends on the implementation of the interface.


IDvdControl::BackwardScan

IDvdControl Interface

Search backward through the current disc at the specified speed.

HRESULT BackwardScan(
  double dwSpeed
  );

Parameters
dwSpeed
[in] Value that specifies how quickly DirectShow will search through the media file. This value is a multiplier, where 1.0 is the authored speed, so a value of 2.5 would search backward at two and one-half times the authored speed.
Return Values

Returns an HRESULT value that depends on the implementation of the interface.


IDvdControl::ButtonActivate

IDvdControl Interface

Activates the selected button.

HRESULT ButtonActivate(void);

Return Values

Returns an HRESULT value that depends on the implementation of the interface.

See Also

IDvdControl::ButtonSelectAndActivate


IDvdControl::ButtonSelectAndActivate

IDvdControl Interface

Selects and activates the specified button.

HRESULT ButtonSelectAndActivate(
  ULONG uiButton
  );

Parameters
uiButton
[in] Value that specifies the button that will be selected and activated, which must be between 1 and 36.
Return Values

Returns an HRESULT value.

Remarks

Electronic remote control devices typically have a number of buttons that activate various functions of a DVD playback unit. Typically, you call this method when a user clicks a button on the control device; DirectShow then indicates that the button was selected (by playing a sound or changing a graphic, for example) and calls methods appropriate to which button was selected, such as ButtonActivate.


IDvdControl::ChapterPlayAutoStop

IDvdControl Interface

Start playing at the specified chapter within the specified title and play the number of chapters specified.

HRESULT ChapterPlayAutoStop(
  ULONG ulTitle,
  ULONG ulChapter,
  ULONG ulChaptersToPlay
  );

Parameters
ulTitle
[in] Title number for playback.
ulChapter
[in] Chapter number to start playback.
ulChaptersToPlay
[in] Number of chapters to play from the start chapter.
Return Values

Returns an HRESULT value.

Remarks

Chapters range from 1 to 999.


IDvdControl::ChapterSearch

IDvdControl Interface

Halts playback of the current media file and starts playback from the specified chapter value in the same media file.

HRESULT ChapterSearch(
  ULONG Chapter
  );

Parameters
Chapter
Chapter value that specifies the point where playback will begin.
Return Values

Returns an HRESULT value.


IDvdControl::ForwardScan

IDvdControl Interface

Search forward through the current disc at the specified speed.

HRESULT ForwardScan(
  double dwSpeed
  );

Parameters
dwSpeed
[in] Value that specifies how quickly DirectShow will search through the media file. This value is a multiplier, where 1.0 is the authored speed, so a value of 2.5 would search forward at two and one-half times the authored speed.
Return Values

Returns an HRESULT value.


IDvdControl::GoUp

IDvdControl Interface

Halts playback of the current media file and starts playback of the designated previous program group chain (PGC).

HRESULT GoUp(void);

Return Values

Returns an HRESULT value.

Remarks

Each PGC is associated with a previous PGC at authoring time, which this method sets as the new playback file.


IDvdControl::KaraokeAudioPresentationModeChange

IDvdControl Interface

Sets the audio playback mode to karaoke.

HRESULT KaraokeAudioPresentationModeChange(
  ULONG ulMode
  );

Parameters
ulMode
[in] Requested audio playback mode.
Return Values

Returns an HRESULT value.

Remarks

Karaoke support is currently not implemented.


IDvdControl::LeftButtonSelect

IDvdControl Interface

Selects the left directional button from the displayed menu.

HRESULT LeftButtonSelect(void);

Return Values

Returns an HRESULT value.

Remarks

On physical or electronic remote control devices, there is often a group of four directional buttons used for certain types of operations (such as menu navigation). This method tells DirectShow that something (the user, probably) triggered the left directional button.


IDvdControl::LowerButtonSelect

IDvdControl Interface

Selects the lower directional button from the displayed menu.

HRESULT LowerButtonSelect(void);

Return Values

Returns an HRESULT value.

Remarks

On physical or electronic remote control devices, there is often a group of four directional buttons used for certain types of operations (such as menu navigation). This method tells DirectShow that something (the user, probably) triggered the lower directional button.


IDvdControl::MenuCall

IDvdControl Interface

Displays the specified menu on the screen.

HRESULT MenuCall(
  DVD_MENU_ID MenuID
  );

Parameters
MenuID
[in] Value that specifies the menu to display. Member of the DVD_MENU_ID enumerated data type.
Return Values

Returns an HRESULT value.


IDvdControl::MenuLanguageSelect

IDvdControl Interface

Sets the displayed language for navigation menus.

HRESULT MenuLanguageSelect(
  LCID LanguageCode
  );

Parameters
LanguageCode
Value that specifies the new language.
Return Values

Returns an HRESULT value.

Remarks

This method selects the default language for menus. Call this method only from the DVD stop state (DVD_DOMAIN_Stop). Applications specify languages with Windows standard LCIDs. LCIDs can be created from ISO-639 codes with:


MAKELCID( MAKELANGID(wISO639LangID ,SUBLANG_DEFAULT ), SORT_DEFAULT )

You might have to use 'jp' instead of 'ja' for the ISO639 code for Japanese.


IDvdControl::MouseActivate

IDvdControl Interface

Selects and activates a DVD button in response to a mouse click.

HRESULT MouseActivate(
  POINT point );

Parameters
point
[in] Specified point within the display window.
Return Values

Returns an HRESULT value.

Remarks

This method checks the specified point within the display window to see if it is within a current DVD button's highlight rectangle. If it is, this method selects and then activates the button.

DVD Buttons do not all necessarily have highlight rectangles. Button rectangles can overlap, and the rectangles do not always correspond to the visual representation of DVD buttons.


IDvdControl::MouseSelect

IDvdControl Interface

Selects a DVD button in response to mouse movement.

HRESULT MouseSelect(
  POINT point );

Parameters
point
[in] Specified point within the display window.
Return Values

Returns an HRESULT value.

Remarks

This method checks the specified point within the display window to see if it is within a current DVD button's highlight rectangle. If it is, this method selects the button.

DVD Buttons do not all necessarily have highlight rectangles. Button rectangles can overlap, and the rectangles do not always correspond to the visual representation of DVD buttons.


IDvdControl::NextPGSearch

IDvdControl Interface

Halts playback of the current media file and starts playback from the next media file in the same program group chain.

HRESULT NextPGSearch(void);

Return Values

Returns an HRESULT value.


IDvdControl::ParentalCountrySelect

IDvdControl Interface

Sets the current country for controlling access levels.

HRESULT ParentalCountrySelect(
  WORD wCountry
  );

Parameters
wCountry
[in] Value that specifies the current country.
Return Values

Returns an HRESULT value.

See Also

ParentalLevelSelect


IDvdControl::ParentalLevelSelect

IDvdControl Interface

Sets the access level for the current media file.

HRESULT ParentalLevelSelect(
  ULONG ulParentalLevel
  );

Parameters
ulParentalLevel
Value that specifies the current media file access level, which must be DVD_PARENTAL_LEVEL_1 (child safe, most restriction), DVD_PARENTAL_LEVEL_6 (theatrical), DVD_PARENTAL_LEVEL_8 (adult, no restriction), or disabled (0xffffffff).
Return Values

Returns an HRESULT value.

Remarks

This method sets the current user's access level; this access level determines what media files the user can play back. Higher levels can play lower level content; lower levels can't play higher-level content. For example, adults can watch child-safe content, but children can't watch adult content.

The DVD Navigator filter provides no restriction on setting the parental level. DVD player applications can enforce restrictions on the parental level setting, such as providing password protection for raising the current parental level. The DVD Navigator is initialized by default to parental level 8 (no restriction).

To disable parental management, pass 0xffffffff for ulParentalLevel. If parental management is disabled, then the player will play the first program chain (PGC) in a parental block regardless of parental IDs.

See Also

ParentalCountrySelect


IDvdControl::PauseOff

IDvdControl Interface

Unpauses the current media file playback, which returns it to normal playback.

HRESULT PauseOff(void);

Return Values

Returns an HRESULT value.

Remarks

If the media file wasn't paused in playback, this method does nothing.

See Also

IDvdControl::PauseOn


IDvdControl::PauseOn

IDvdControl Interface

Pauses the current media file playback.

HRESULT PauseOn( );

Return Values

Returns an HRESULT value.

Remarks

This method freezes playback and any internal timers, similar to IMediaControl::Pause.

If the media file wasn't running, this method does nothing.

See Also

IDvdControl::PauseOff


IDvdControl::PrevPGSearch

IDvdControl Interface

Halts playback of the current media file and starts playback from the previous media file in the same program group chain.

HRESULT PrevPGSearch(void);

Return Values

Returns an HRESULT value.


IDvdControl::ChapterPlay

IDvdControl Interface

Plays the media file with the specified title index and chapter value.

HRESULT ChapterPlay(
  ULONG uiTitle,
  ULONG uiChapter
  );

Parameters
uiTitle
[in] Value that specifies the title number DirectShow will play back; this value must be between 1 and 99.
uiChapter
[in] Value that specifies the point within the specified title where DirectShow will start playback; this value must be between 1 and 999.
Return Values

Returns an HRESULT value.


IDvdControl::Resume

IDvdControl Interface

Continues playback of a media file, if the file is paused.

HRESULT Resume( );

Return Values

Returns an HRESULT value.

Remarks

If the file is stopped or already running, this method does nothing.

This method returns to title playback in DVD_DOMAIN_Title. Applications typically call this method after MenuCall which puts the DVD Navigator in DVD_DOMAIN_VideoTitleSetMenu or DVD_DOMAIN_VideoManagerMenu.


IDvdControl::RightButtonSelect

IDvdControl Interface

Selects the right directional button from the displayed menu.

HRESULT RightButtonSelect( );

Return Values

Returns an HRESULT value.

Remarks

On physical or electronic remote control devices, there is often a group of four directional buttons used for certain types of operations (such as menu navigation). This method tells DirectShow that something (the user, probably) triggered the right directional button.


IDvdControl::SetRoot

IDvdControl Interface

Sets the root directory containing the DVD-Video volume.

HRESULT SetRoot(
  LPCWSTR pszPath );

Parameters
pszPath
[in] Directory name to set as the root directory.
Return Values

Returns an HRESULT value.

Remarks

The current state must be DVD_DOMAIN_Stop when you call this method.

If you haven't set the root directory before calling IDvdControl::TitlePlay, the first drive starting from C: that contains a VIDEO_TS directory in the top level directory will be used as the root.


IDvdControl::StillOff

IDvdControl Interface

Resumes updating the display, which stops still-store mode.

HRESULT StillOff( );

Return Values

Returns an HRESULT value.

Remarks

If the display image wasn't in still-store mode, this method does nothing.


IDvdControl::Stop

IDvdControl Interface

Transitions playback to the DVD_DOMAIN_Stop state.

HRESULT Stop(void);

Return Values

Returns an HRESULT value.

Remarks

If no file is playing or paused, this method does nothing.

The DVD Navigator filter transfers to the stopped state, but the filter graph remains in DirectShow's Run state.


IDvdControl::SubpictureStreamChange

IDvdControl Interface

Enables or disables picture-in-picture mode and sets the subpicture to the specified source.

HRESULT SubpictureStreamChange(
  ULONG nSubPicture,
  BOOL bDisplay
  );

Parameters
nSubPicture
Value that specifies the source of the subpicture, which must be between 0 and 31, or 63.
bDisplay
Boolean value that specifies whether the subpicture is enabled; TRUE makes the subpicture visible and FALSE hides it.
Return Values

Returns an HRESULT value.


IDvdControl::TimePlay

IDvdControl Interface

Plays the media file with the specified title index, starting at the specified time.

HRESULT TimePlay(
  ULONG uiTitle,
  ULONG bcdTime
  );

Parameters
uiTitle
Value that specifies the title number DirectShow will play back; this value must be between 1 and 99.
bcdTime
Time, in hours, minutes, seconds, and frames, where DirectShow will start playback.
Return Values

Returns an HRESULT value.


IDvdControl::TimeSearch

IDvdControl Interface

Halts playback of the current media file and starts playback from the specified time in the same media file.

HRESULT TimeSearch(
  ULONG bcdTime
  );

Parameters
bcdTime
Time, in hours, minutes, seconds, and frames, where DirectShow will start playback.
Return Values

Returns an HRESULT value.


IDvdControl::TitlePlay

IDvdControl Interface

Finds the media file with the specified title index and plays it back.

HRESULT TitlePlay(
  ULONG uiTitle
  );

Parameters
uiTitle
Value that specifies the title number DirectShow will play back; this value must be between 1 and 99.
Return Values

Returns an HRESULT value.


IDvdControl::TopPGSearch

IDvdControl Interface

Halts playback of the current media file and starts playback from the first media file in the program group chain.

HRESULT TopPGSearch( );

Return Values

Returns an HRESULT value.


IDvdControl::UpperButtonSelect

IDvdControl Interface

Selects the upper directional button from the displayed menu.

HRESULT UpperButtonSelect( );

Return Values

Returns an HRESULT value.

Remarks

On physical or electronic remote control devices, there is often a group of four directional buttons used for certain types of operations (such as menu navigation). This method tells DirectShow that something (the user, probably) triggered the upper directional button.

"Selecting" a DVD button simply highlights the button but does not "activate" the button. Selecting is the Windows equivalent of tabbing to a button but not pressing the space bar or enter key. Activating is the Windows equivalent of pressing the space bar or enter key after tabbing to a button.


IDvdControl::VideoModePreferrence

IDvdControl Interface

Sets the video display mode the user prefers.

HRESULT VideoModePreferrence(
  ULONG ulPreferredDisplayMode
  );

Parameters
ulPreferredDisplayMode
[in] Value that specifies the new display mode for DVD content. Member of the DVD_PREFERRED_DISPLAY_MODE enumerated data type.
Return Values

Returns an HRESULT value.

Remarks

This method changes the video display's aspect ratio; typical ratios are wide-screen, letterbox, pan and scan, and 16:9.

The definition for the DVD_PREFERRED_DISPLAY_MODE enumerated data type follows.

DVD_PREFERRED_DISPLAY_MODE indicates the user's preferred window aspect ratio and preferred method of conversion of 16*9 content to a 4*3 window aspect ratio. Pan-scan and letterboxing are the two conversion methods. This enumerated type indicates a preference of conversion mechanism since some content can only be converted using one of these methods. 4*3 content is converted to a 16*9 window always by using "reverse" letterboxing where black bars are added to the right and left sides of the display instead of the top and bottom of the display as in the 16*9 to 4*3 conversion using letterboxing.


typedef enum tagDVD_PREFERRED_DISPLAY_MODE
{
    DISPLAY_CONTENT_DEFAULT,    // default to content
    DISPLAY_16x9,               // 16x9 display
    DISPLAY_4x3_PANSCAN_PREFERRED,   // 4x3 display with pan-scan preference
    DISPLAY_4x3_LETTERBOX_PREFERRED  // 4x3 display with letterbox preference

} DVD_PREFERRED_DISPLAY_MODE;

The following table shows the conversion method used between the actual content type listed in the first column, and the user display preference setting, indicated by one of the other columns.
Actual Content Type Content Default 16x9 4x3 pan-scan 4x3 letterbox
4x3 None Reverse Letterbox None None
16x9 letterbox only None None Letterbox Letterbox
16x9 pan-scan only None None Pan-scan Pan-scan
16x9 pan-scan or letterbox None None Pan-scan Letterbox

The native window size used is always the user's preferred size.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.