LEADTOOLS Multimedia (Leadtools.Multimedia assembly)

UseDVDSource Property (PlayCtrl)

Show in webframe
Example 



Gets or sets a value that indicates whether the object will use the DVD Source object when attempting to convert a DVD image.
Syntax
'Declaration
 
Public Overridable Property UseDVDSource As Boolean
'Usage
 
Dim instance As PlayCtrl
Dim value As Boolean
 
instance.UseDVDSource = value
 
value = instance.UseDVDSource
public virtual bool UseDVDSource {get; set;}
public:
virtual property bool UseDVDSource {
   bool get();
   void set (    bool value);
}

Property Value

true to use the DVD Source object; false, otherwise.
Remarks
A DVD image is a set of files that contain all of the video and audio content for a DVD, organized with a table of contents.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Multimedia
Imports LeadtoolsMultimediaExamples.Fixtures

Public _result As Boolean = False
Public _form As PlayCtrlForm = New PlayCtrlForm()
Public Sub UseDVDSourceExample()
   ' reference the play control
   Dim playctrl As PlayCtrl = _form.PlayCtrl

   ' input file
   Dim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "VIDEO_TS\VIDEO_TS.IFO")

   Try
      Dim dvdSource As DVDSource
      Dim title As DVDTitle
      Dim chapter As DVDChapter
      Dim subpictureStream As DVDSubpictureStream
      Dim audioStream As DVDAudioStream
      Dim comp As DVDVideoCompression
      Dim appMode As DVDAudioAppMode
      Dim audFormat As DVDAudioFormat
      Dim audLangExt As DVDAudioLangExt
      Dim subPicCoding As DVDSubpictureCoding
      Dim subPicLangExt As DVDSubpictureLangExt
      Dim subPicType As DVDSubpictureType

      Dim i As Integer
      Dim lCount As Integer
      Dim lVal As Long
      Dim bVal As Boolean
      Dim dVal As Double
      Dim strPlayList As String

      ' disable auto start
      playctrl.AutoStart = False

      ' force to use the DVD source
      playctrl.UseDVDSource = True

      ' set the source file
      playctrl.SourceFile = inFile

      ' reference the DVDSource object
      dvdSource = CType(playctrl.GetSubObject(PlayObject.SourceFilter), DVDSource)

      '  Select the main title on the disc
      If (dvdSource.Selected <> DVDSourceSelectedState.MainSelected) Then
         dvdSource.Selected = DVDSourceSelectedState.MainSelected
      End If

      '  Get the disc duration
      dVal = dvdSource.TotalDuration
      '  Get the selected title duration
      dVal = dvdSource.SelectedDuration

      '  Get the play list settings
      strPlayList = dvdSource.PlayList

      '  You can save this to a file and restore the settings later
      '  Restore the playlist settings
      dvdSource.PlayList = strPlayList

      '  Get the title count in the disc
      lCount = dvdSource.TitleCount

      i = 0
      Do While (i <= (lCount - 1))
         '  Get the title interface
         title = dvdSource.GetTitle(i)

         '  Get the X and Y aspects
         lVal = title.AspectX
         lVal = title.AspectY

         '  Check if the title is a film mode or camera mode
         bVal = title.IsFilmMode

         '  Check if there is a user data in line 21, field 1
         bVal = title.Line21Field1InGOP

         '  Check if there is a user data in line 21, field 2
         bVal = title.Line21Field2InGOP

         '  Check the compression
         comp = title.Compression

         '  Get the X source resolution
         lVal = title.SourceResolutionX

         '  Get the Y source resolution
         lVal = title.SourceResolutionY

         '  Get the Frame Height
         lVal = title.FrameHeight

         '  Get the Frame Rate
         lVal = title.FrameRate

         '  Check if the source is a letter boxed
         bVal = title.IsSourceLetterboxed

         '  Check if the picture can be shown as letterbox
         bVal = title.LetterboxPermitted

         '  Check if the picture can be shown as pan-scan
         bVal = title.PanscanPermitted

         '  Get the title duration
         dVal = title.TotalDuration

         '  Select all title chapters
         If (title.Selected <> DVDTitleSelectedState.Selected) Then
            title.Selected = DVDTitleSelectedState.Selected
         End If

         '  Get the selected chapter duration
         dVal = title.SelectedDuration

         '  Get the audio stream count in the title
         If (title.AudioStreamCount > 0) Then
            '  Select the first audio stream
            If (title.SelectedAudioStream = -1) Then
               title.SelectedAudioStream = 0
            End If

            '  Get the first audio stream
            audioStream = title.GetAudioStream(0)

            '  Select the audio stream
            If (audioStream.Selected = False) Then
               audioStream.Selected = True
            End If

            '  Get the application mode
            appMode = audioStream.AppMode

            '  Get the application mode data
            lVal = audioStream.AppModeData

            '  Get the auido format
            audFormat = audioStream.AudioFormat

            '  Get the number of channels
            lVal = audioStream.Channels

            '  Get the frequency
            lVal = audioStream.Frequency

            '  Get the language
            lVal = audioStream.Language

            '  Get the language extension
            audLangExt = audioStream.LanguageExtension

            '  Get the quantization
            lVal = audioStream.Quantization

            If (title.SubpictureStreamCount > 0) Then
               '  Select the first subpicture stream
               If (title.SelectedSubpictureStream = -1) Then
                  title.SelectedSubpictureStream = 0
               End If

               '  Get the first subpicture stream
               subpictureStream = title.GetSubpictureStream(0)

               '  Select the subpicture stream
               If (subpictureStream.Selected = False) Then
                  subpictureStream.Selected = True
               End If

               '  Get the coding mode
               subPicCoding = subpictureStream.CodingMode

               '  Get the langauge
               lVal = subpictureStream.Language

               '  Get the language extension
               subPicLangExt = subpictureStream.LanguageExtension

               '  Get the type
               subPicType = subpictureStream.Type
            End If
            '  Get the chapter count
            If (title.ChapterCount > 0) Then
               '  Get the first chapter
               chapter = title.GetChapter(0)

               '  Get the chapter duration
               dVal = chapter.Duration

               '  Get if the chapter is selected
               If (chapter.Selected = False) Then
                  chapter.Selected = True
               End If

               ' set the result to what we expect
               _result = (Not chapter Is Nothing)
            End If
         End If
         i += 1
      Loop
   Catch e1 As COMException
      _result = False
   Catch e2 As Exception
      _result = False
   End Try

   ' we'll loop on the state and pump messages for this example.
   ' but you should not need to if running from a Windows Forms application.
   Do While playctrl.State = PlayState.Running
      Application.DoEvents()
   Loop
End Sub

Public NotInheritable Class LEAD_VARS
Public Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media"
End Class
using Leadtools;
using Leadtools.Multimedia;
using LeadtoolsMultimediaExamples.Fixtures;

public bool _result = false;
public PlayCtrlForm _form = new PlayCtrlForm();
public void UseDVDSourceExample()
{
   // reference the play control
   PlayCtrl playctrl = _form.PlayCtrl;

   // input file
   string inFile =Path.Combine(LEAD_VARS.MediaDir,"VIDEO_TS.IFO");

   try
   {
      DVDSource dvdSource;
      DVDTitle title;
      DVDChapter chapter;
      DVDSubpictureStream subpictureStream;
      DVDAudioStream audioStream;
      DVDVideoCompression comp;
      DVDAudioAppMode appMode;
      DVDAudioFormat audFormat;
      DVDAudioLangExt audLangExt;
      DVDSubpictureCoding subPicCoding;
      DVDSubpictureLangExt subPicLangExt;
      DVDSubpictureType subPicType;

      int i;
      int lCount;
      long lVal;
      bool bVal;
      double dVal;
      string strPlayList;

      // disable auto start
      playctrl.AutoStart = false;

      // force to use the DVD source
      playctrl.UseDVDSource = true;

      // set the source file
      playctrl.SourceFile = inFile;

      // reference the DVDSource object
      dvdSource = (DVDSource)playctrl.GetSubObject(PlayObject.SourceFilter);

      //  Select the main title on the disc
      if ((dvdSource.Selected != DVDSourceSelectedState.MainSelected))
         dvdSource.Selected = DVDSourceSelectedState.MainSelected;

      //  Get the disc duration
      dVal = dvdSource.TotalDuration;
      //  Get the selected title duration
      dVal = dvdSource.SelectedDuration;

      //  Get the play list settings
      strPlayList = dvdSource.PlayList;

      //  You can save this to a file and restore the settings later
      //  Restore the playlist settings
      dvdSource.PlayList = strPlayList;

      //  Get the title count in the disc
      lCount = dvdSource.TitleCount;

      for (i = 0; (i <= (lCount - 1)); i++)
      {
         //  Get the title interface
         title = dvdSource.GetTitle(i);

         //  Get the X and Y aspects
         lVal = title.AspectX;
         lVal = title.AspectY;

         //  check whether the title is in film mode or camera mode
         bVal = title.IsFilmMode;

         //  check whether there is user data in line 21, field 1
         bVal = title.Line21Field1InGOP;

         //  check whether there is user data in line 21, field 2
         bVal = title.Line21Field2InGOP;

         //  Check the compression
         comp = title.Compression;

         //  Get the X source resolution
         lVal = title.SourceResolutionX;

         //  Get the Y source resolution
         lVal = title.SourceResolutionY;

         //  Get the Frame Height
         lVal = title.FrameHeight;

         //  Get the Frame Rate
         lVal = title.FrameRate;

         //  check whether the source is letter boxed
         bVal = title.IsSourceLetterboxed;

         //  check whether the picture can be shown as letterbox
         bVal = title.LetterboxPermitted;

         //  check whether the picture can be shown as pan-scan
         bVal = title.PanscanPermitted;

         //  Get the title duration
         dVal = title.TotalDuration;

         //  Select all title chapters
         if ((title.Selected != DVDTitleSelectedState.Selected))
            title.Selected = DVDTitleSelectedState.Selected;

         //  Get the selected chapter duration
         dVal = title.SelectedDuration;

         //  Get the audio stream count in the title
         if ((title.AudioStreamCount > 0))
         {
            //  Select the first audio stream
            if ((title.SelectedAudioStream == -1))
               title.SelectedAudioStream = 0;

            //  Get the first audio stream
            audioStream = title.GetAudioStream(0);

            //  Select the audio stream
            if ((audioStream.Selected == false))
               audioStream.Selected = true;

            //  Get the application mode
            appMode = audioStream.AppMode;

            //  Get the application mode data
            lVal = audioStream.AppModeData;

            //  Get the auido format
            audFormat = audioStream.AudioFormat;

            //  Get the number of channels
            lVal = audioStream.Channels;

            //  Get the frequency
            lVal = audioStream.Frequency;

            //  Get the language
            lVal = audioStream.Language;

            //  Get the language extension
            audLangExt = audioStream.LanguageExtension;

            //  Get the quantization
            lVal = audioStream.Quantization;

            if ((title.SubpictureStreamCount > 0))
            {
               //  Select the first subpicture stream
               if ((title.SelectedSubpictureStream == -1))
                  title.SelectedSubpictureStream = 0;

               //  Get the first subpicture stream
               subpictureStream = title.GetSubpictureStream(0);

               //  Select the subpicture stream
               if ((subpictureStream.Selected == false))
                  subpictureStream.Selected = true;

               //  Get the coding mode
               subPicCoding = subpictureStream.CodingMode;

               //  Get the langauge
               lVal = subpictureStream.Language;

               //  Get the language extension
               subPicLangExt = subpictureStream.LanguageExtension;

               //  Get the type
               subPicType = subpictureStream.Type;
            }
            //  Get the chapter count
            if ((title.ChapterCount > 0))
            {
               //  Get the first chapter
               chapter = title.GetChapter(0);

               //  Get the chapter duration
               dVal = chapter.Duration;

               //  Get if the chapter is selected
               if ((chapter.Selected == false))
                  chapter.Selected = true;

               // set the result to what we expect
               _result = (chapter != null);
            }
         }
      }
   }
   catch (COMException)
   {
      _result = false;
   }
   catch (Exception)
   {
      _result = false;
   }

   // we'll loop on the state and pump messages for this example.
   // but you should not need to if running from a Windows Forms application.
   while (playctrl.State == PlayState.Running)
      Application.DoEvents();
}

static class LEAD_VARS
{
public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media";
}
Requirements

Target Platforms

See Also

Reference

PlayCtrl Class
PlayCtrl Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Multimedia requires a Multimedia or Multimedia Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features