// include the LEAD Multimedia TOOLKIT header#include "ltmm.h"void SetDVDSettings(){// Create the converter objectIltmmConvert* pConvert;IUnknown* punk;IltmmDVDSource* pDVDSource;HRESULT hr = CoCreateInstance(CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, IID_IltmmConvert, (void**) &pConvert);if(FAILED(hr)){AfxMessageBox(_T("Can't instantiate convert library"));return;}// Force the DVD source to be usedpConvert->put_UseDVDSource(VARIANT_TRUE);// Set the source DVD imageBSTR bstr = ::SysAllocString(MAKE_MEDIA_PATH("video_ts.ifo"));pConvert->put_SourceFile(bstr);SysFreeString(bstr);bstr = ::SysAllocString(MAKE_MEDIA_PATH("DVDImage.avi"));pConvert->put_TargetFile(bstr);SysFreeString(bstr);// Get the DVD source interfacepConvert->GetSubObject(ltmmConvert_Object_SourceFilter, &punk);if(punk){punk->QueryInterface(IID_IltmmDVDSource, (void**)&pDVDSource);if(pDVDSource){IltmmDVDTitle *pTitle;long lCount;long lVal;VARIANT_BOOL vbVal;double dVal;BSTR strPlayList;// Select the main title for the diskpDVDSource->get_Selected(&lVal);if (lVal != ltmmDVDSource_Main_Selected)pDVDSource->put_Selected(ltmmDVDSource_Main_Selected);// Get the disc durationpDVDSource->get_TotalDuration(&dVal);// Do something with the value// Get the selected title durationpDVDSource->get_SelectedDuration(&dVal);// Do something with the value// Get the play list settingspDVDSource->get_PlayList(&strPlayList);// You can save this to a file and restore the settings later// Restore the playlist settingspDVDSource->put_PlayList(strPlayList);// Free the stringSysFreeString(strPlayList);// Get the title count in the discpDVDSource->get_TitleCount(&lCount);for (int i = 0; i < lCount; i++){// Get the title interfacepDVDSource->GetTitle(i, &pTitle);if (pTitle){// Get the X aspectpTitle->get_AspectX(&lVal);// Do something with the value// Get the Y aspectpTitle->get_AspectY(&lVal);// Do something with the value// Determine whether the title is in film mode or camera modepTitle->get_IsFilmMode(&vbVal);// Do something with the value// Determine whether there is user data in line 21, field 1pTitle->get_Line21Field1InGOP(&vbVal);// Do something with the value// Determine whether there is user data in line 21, field 2pTitle->get_Line21Field2InGOP(&vbVal);// Do something with the value// Get the compressionpTitle->get_Compression(&lVal);// Do something with the value// Get the X source resolutionpTitle->get_SourceResolutionX(&lVal);// Do something with the value// Get the Y source resolutionpTitle->get_SourceResolutionY(&lVal);// Do something with the value// Get the Frame HeightpTitle->get_FrameHeight(&lVal);// Do something with the value// Get the Frame RatepTitle->get_FrameRate(&lVal);// Do something with the value// Determine whether the source is letter boxedpTitle->get_IsSourceLetterboxed(&vbVal);// Do something with the value// Determine whether the picture can be shown as letterboxpTitle->get_LetterboxPermitted(&vbVal);// Do something with the value// Determine whether the picture can be shown as pan-scanpTitle->get_PanscanPermitted(&vbVal);// Do something with the value// Get the title durationpTitle->get_TotalDuration(&dVal);// Do something with the value// Select all title chapterspTitle->get_Selected(&lVal);if (lVal != ltmmDVDSource_Selected)pTitle->put_Selected(ltmmDVDSource_Selected);// Get the selected chapter's durationpTitle->get_SelectedDuration(&dVal);// Do something with the value// Get the audio stream count for the titlepTitle->get_AudioStreamCount(&lVal);if (lVal > 0){// Select the first audio streampTitle->get_SelectedAudioStream(&lVal);if (lVal == -1)pTitle->put_SelectedAudioStream(0);// Get the first audio streamIltmmDVDAudioStream* pAudioStream;pTitle->GetAudioStream(0, &pAudioStream);if (pAudioStream){// Select the audio streampAudioStream->get_Selected(&vbVal);if (vbVal == VARIANT_FALSE)pAudioStream->put_Selected(VARIANT_TRUE);// Get the application modepAudioStream->get_AppMode(&lVal);// Do something with the value// Get the application mode datapAudioStream->get_AppModeData(&lVal);// Do something with the value// Get the audio formatpAudioStream->get_AudioFormat(&lVal);// Do something with the value// Get the number of channelspAudioStream->get_Channels(&lVal);// Do something with the value// Get the frequencypAudioStream->get_Frequency(&lVal);// Do something with the value// Get the languagepAudioStream->get_Language(&lVal);// Do something with the value// Get the language extensionpAudioStream->get_LanguageExtension(&lVal);// Do something with the value// Get the quantizationpAudioStream->get_Quantization(&lVal);// Do something with the value// Free the pointerpAudioStream->Release();}}// Get the subpicture stream countpTitle->get_SubpictureStreamCount(&lVal);if (lVal > 0){// Select the first subpicture streampTitle->get_SelectedSubpictureStream(&lVal);if (lVal == -1)pTitle->put_SelectedSubpictureStream(0);// Get the first subpicture streamIltmmDVDSubpictureStream* pSubpictureStream;pTitle->GetSubpictureStream(0, &pSubpictureStream);if (pSubpictureStream){// Select the subpicture streampSubpictureStream->get_Selected(&vbVal);if (vbVal == VARIANT_FALSE)pSubpictureStream->put_Selected(VARIANT_TRUE);// Get the coding modepSubpictureStream->get_CodingMode(&lVal);// Do something with the value// Get the langaugepSubpictureStream->get_Language(&lVal);// Do something with the value// Get the language extensionpSubpictureStream->get_LanguageExtension(&lVal);// Do something with the value// Get the typepSubpictureStream->get_Type(&lVal);// Do something with the value// Free the pointerpSubpictureStream->Release();}}// Get the chapter countpTitle->get_ChapterCount(&lVal);if (lVal > 0){// Get the first chapterIltmmDVDChapter* pChapter;pTitle->GetChapter(0, &pChapter);// Get the chapter durationpChapter->get_Duration(&dVal);// Determine whether the chapter is selectedpChapter->get_Selected(&vbVal);if (vbVal == VARIANT_FALSE)pChapter->put_Selected(VARIANT_TRUE);// Free the pointerpChapter->Release();}pTitle->Release();}}pDVDSource->Release();}punk->Release();}pConvert->Release();}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
