Microsoft DirectX 9.0 |
The SetDVDDirectory method sets the DVD drive that the DVD Navigator filter will read from.
Syntax
HRESULT SetDVDDirectory(
LPCWSTR pszwPath
);
Parameters
pszwPath
[in] Variable of type LPCWSTR that specifies the path of the root directory.
Return Values
Returns one of the following values.
Return code | Description |
S_OK | Success. |
E_INVALIDARG | The pszwPath parameter points to an invalid DVD path, or a DVD drive is not found while enumerating. |
E_UNEXPECTED | The DVD Navigator is not initialized. |
S_FALSE | The pszwPath parameter is NULL and the DVD Navigator can't find any DVD volume. |
VFW_E_DVD_INVALIDDOMAIN | Invalid domain. For details, see Remarks. |
Remarks
If pszwPath is NULL, the DVD Navigator tries to select a DVD volume on any available drive. On startup, the DVD Navigator automatically looks for a drive, starting at drive C, with a VIDEO_TS folder in the root folder. It is therefore only necessary to call SetDVDDirectory when you have more than one DVD drive on a machine, or if your DVD drive letter is A or B. When specifying the path, include the video_ts folder.
SetDVDDirectory(L"e:\\video_ts");
Some DVD volumes may have their video in a directory named something other than "video_ts." The general idea is that an additional "DVD volume" (the set of .IFO. VOB, and .BUP files that would normally be stored in the VIDEO_TS directory) can be placed in a subdirectory on the disc. By changing the root to point to this directory, MSWebDVD will operate on this separate DVD volume. A new set of menus, titles, and so on will be available, independent of the titles in the VIDEO_TS root, which will no longer be accessible. Such directories are called "hidden directories." The following example shows how to set a hidden directory as the root, where "hidden" is a placeholder for whatever name the disc authors have given to the directory.
SetDVDDirectory(L"d:\\webdvd\\hidden");
If the filter graph is running and the DVD Navigator finds a DVD in the directory specified by pszwPath, the DVD Navigator automatically begins playing the disc. This conforms with the DVD specification and ensures that the new disc is initialized properly. If you do not want the new disc to play automatically after SetDVDDirectory returns, you must set the DVD_ResetOnStop flag in IDvdControl2::SetOption to TRUE and stop the filter graph through a call to IMediaControl::Stop on the Filter Graph Manager. If DVD_ResetOnStop is set to FALSE, then SetDVDDirectory returns VFW_E_DVD_INVALIDDOMAIN.
This method is demonstrated in the DVDSample application in CDvdCore::SetDirectory.
The following table shows the Annex J command name to which this method name corresponds, and the domains in which this method is valid.
Annex J Command Name | Valid Domains |
None | DVD_DOMAIN_Stop |
See Also