Einzelnen Beitrag anzeigen

Benutzerbild von TERWI
TERWI

Registriert seit: 29. Mär 2008
Ort: D-49626
381 Beiträge
 
Delphi 11 Alexandria
 
#9

AW: DirectX - DVD - Anzahl Titel abfragen

  Alt 3. Dez 2019, 09:07
Die MS-Doku dazu hab ich auch schon mehrfach durch und ist ja auch recht gut im DSPack für Delphi adaptiert.

Ab wie das immer so ist, wenn man den Wald vor lauter Bäumen nicht sieht .... hab nun doch was passendes gefunden:
Aus 'DVDInfo.GetDVDVolumeInfo' kann man die Anzahl der verfügbaren Titel lesen und
mit 'DVDInfo.GetNumberOfChapters' die Kapitel je Titel.

Spiel man nach der DVD-Initialisierung (erst dann !) mittels 'DVDControl.PlayChapterInTitle' jedes vorhandene Kaitel einmal kurz an, kann man mit 'DvdInfo.GetCurrentLocation' und 'DvdInfo.GetTotalTitleTime' die Spieldauer jedes Kapitels und bzw. oder die Gesamtdauer auslesen.

Hier mal meine kleine Routine dazu:
Delphi-Quellcode:
procedure TDVDctrl.GetVolumeInfo();
var
  numVol : cardinal;
  actVol : cardinal;
  side : TDVDDiscSide; // DVD_SIDE_A, DVD_SIDE_B
  numTitles : cardinal;
  Flags : cardinal;
  numChaps : cardinal;
  TCFlags : cardinal;
  DvdCmd : IDvdCmd;
  PBloc : TDVDPlayBackLocation2;
  totalTime : TDVDHMSFTimeCode;
  i, ii : integer;
begin
  FDVDInfo.GetDVDVolumeInfo(numVol, actVol, side, numTitles);
  Log('VolInfo', 'Num. of volumes: ' + inttostr(numVol));
  Log('VolInfo', 'Actual volume: ' + inttostr(actVol));
  Log('VolInfo', 'Num. of sides: ' + inttostr(ord(side)));
  Log('VolInfo', 'Num. of titles: ' + inttostr(numtitles));
  Flags := DVD_CMD_FLAG_Flush;
  for i := 1 to numtitles do
  begin
    FDVDInfo.GetNumberOfChapters(i, numChaps);
    Log('VolInfo', 'Title: ' + inttostr(i) + ' - num chapters: ' + inttostr(numchaps));
    for ii := 1 to numChaps do
    begin
      FDVDControl.PlayChapterInTitle(i, ii, Flags, DvdCmd);
      FDvdInfo.GetCurrentLocation(PBloc);
      FDvdInfo.GetTotalTitleTime(TotalTime, TCFlags);
      Log('VolInfo', ' - Chapter ' + inttostr(pbloc.ChapterNum) +
                             ' / ' + inttostr(pbloc.TitleNum) +
                        ' - Pos: ' + format('%.2d:%.2d:%.2d',[pbloc.TimeCode.bHours,
                                                              pbloc.TimeCode.bMinutes,
                                                              pbloc.TimeCode.bSeconds]) +
                      ' | Total: ' + format('%.2d:%.2d:%.2d',[TotalTime.bHours,
                                                              TotalTime.bMinutes,
                                                              TotalTime.bSeconds]));
    end;
  end;
  FDVDControl.PlayChapterInTitle(1,1, Flags, DvdCmd); // ... start from begin
end;
Das Ergebnis sieht dann z.B. so aus:
Delphi-Quellcode:
[08:27:52:634] [DVD - VolInfo]: Num. of volumes: 1
[08:27:52:634] [DVD - VolInfo]: Actual volume: 1
[08:27:52:634] [DVD - VolInfo]: Num. of sides: 1
[08:27:52:634] [DVD - VolInfo]: Num. of titles: 15
[08:27:52:634] [DVD - VolInfo]: Title: 1 - num chapters: 1
[08:27:52:673] [DVD - VolInfo]: - Chapter 1 / 1 - Pos: 00:00:00 | Total: 00:00:20
[08:27:52:673] [DVD - VolInfo]: Title: 2 - num chapters: 1
[08:27:52:689] [DVD - VolInfo]: - Chapter 1 / 2 - Pos: 00:00:00 | Total: 00:00:16
[08:27:52:689] [DVD - VolInfo]: Title: 3 - num chapters: 1
[08:27:52:711] [DVD - VolInfo]: - Chapter 1 / 3 - Pos: 00:00:00 | Total: 00:00:19
[08:27:52:711] [DVD - VolInfo]: Title: 4 - num chapters: 1
[08:27:52:732] [DVD - VolInfo]: - Chapter 1 / 4 - Pos: 00:00:00 | Total: 00:00:00
[08:27:52:732] [DVD - VolInfo]: Title: 5 - num chapters: 1
[08:27:52:745] [DVD - VolInfo]: - Chapter 1 / 5 - Pos: 00:00:00 | Total: 00:00:30
[08:27:52:745] [DVD - VolInfo]: Title: 6 - num chapters: 20
[08:27:52:762] [DVD - VolInfo]: - Chapter 1 / 6 - Pos: 00:00:00 | Total: 01:25:52
[08:27:52:801] [DVD - VolInfo]: - Chapter 2 / 6 - Pos: 00:08:07 | Total: 01:25:52
[08:27:52:820] [DVD - VolInfo]: - Chapter 3 / 6 - Pos: 00:17:44 | Total: 01:25:52
[08:27:52:844] [DVD - VolInfo]: - Chapter 4 / 6 - Pos: 00:20:46 | Total: 01:25:52
[08:27:52:874] [DVD - VolInfo]: - Chapter 5 / 6 - Pos: 00:22:21 | Total: 01:25:52
[08:27:52:890] [DVD - VolInfo]: - Chapter 6 / 6 - Pos: 00:27:09 | Total: 01:25:52
[08:27:52:912] [DVD - VolInfo]: - Chapter 7 / 6 - Pos: 00:34:23 | Total: 01:25:52
[08:27:52:931] [DVD - VolInfo]: - Chapter 8 / 6 - Pos: 00:36:15 | Total: 01:25:52
[08:27:52:953] [DVD - VolInfo]: - Chapter 9 / 6 - Pos: 00:41:09 | Total: 01:25:52
[08:27:52:971] [DVD - VolInfo]: - Chapter 10 / 6 - Pos: 00:44:44 | Total: 01:25:52
[08:27:52:987] [DVD - VolInfo]: - Chapter 11 / 6 - Pos: 00:48:07 | Total: 01:25:52
[08:27:53:010] [DVD - VolInfo]: - Chapter 12 / 6 - Pos: 00:52:58 | Total: 01:25:52
[08:27:53:026] [DVD - VolInfo]: - Chapter 13 / 6 - Pos: 01:00:02 | Total: 01:25:52
[08:27:53:058] [DVD - VolInfo]: - Chapter 14 / 6 - Pos: 01:04:08 | Total: 01:25:52
[08:27:53:082] [DVD - VolInfo]: - Chapter 15 / 6 - Pos: 01:14:08 | Total: 01:25:52
[08:27:53:107] [DVD - VolInfo]: - Chapter 16 / 6 - Pos: 01:17:10 | Total: 01:25:52
[08:27:53:131] [DVD - VolInfo]: - Chapter 17 / 6 - Pos: 01:20:11 | Total: 01:25:52
[08:27:53:155] [DVD - VolInfo]: - Chapter 18 / 6 - Pos: 01:21:15 | Total: 01:25:52
[08:27:53:176] [DVD - VolInfo]: - Chapter 19 / 6 - Pos: 01:22:15 | Total: 01:25:52
[08:27:53:197] [DVD - VolInfo]: - Chapter 20 / 6 - Pos: 01:22:50 | Total: 01:25:52
[08:27:53:197] [DVD - VolInfo]: Title: 7 - num chapters: 1
[08:27:53:216] [DVD - VolInfo]: - Chapter 1 / 7 - Pos: 00:00:00 | Total: 00:01:49
[08:27:53:216] [DVD - VolInfo]: Title: 8 - num chapters: 1
[08:27:53:238] [DVD - VolInfo]: - Chapter 1 / 8 - Pos: 00:00:00 | Total: 00:00:49
[08:27:53:239] [DVD - VolInfo]: Title: 9 - num chapters: 1
[08:27:53:256] [DVD - VolInfo]: - Chapter 1 / 9 - Pos: 00:00:00 | Total: 00:00:57
[08:27:53:256] [DVD - VolInfo]: Title: 10 - num chapters: 1
[08:27:53:275] [DVD - VolInfo]: - Chapter 1 / 10 - Pos: 00:00:00 | Total: 00:00:00
[08:27:53:275] [DVD - VolInfo]: Title: 11 - num chapters: 1
[08:27:53:289] [DVD - VolInfo]: - Chapter 1 / 11 - Pos: 00:00:00 | Total: 00:00:00
[08:27:53:289] [DVD - VolInfo]: Title: 12 - num chapters: 1
[08:27:53:297] [DVD - VolInfo]: - Chapter 1 / 12 - Pos: 00:00:00 | Total: 00:00:00
[08:27:53:297] [DVD - VolInfo]: Title: 13 - num chapters: 16
[08:27:53:307] [DVD - VolInfo]: - Chapter 1 / 13 - Pos: 00:00:00 | Total: 00:08:17
[08:27:53:323] [DVD - VolInfo]: - Chapter 2 / 13 - Pos: 00:00:33 | Total: 00:08:17
[08:27:53:340] [DVD - VolInfo]: - Chapter 3 / 13 - Pos: 00:01:42 | Total: 00:08:17
[08:27:53:361] [DVD - VolInfo]: - Chapter 4 / 13 - Pos: 00:02:22 | Total: 00:08:17
[08:27:53:385] [DVD - VolInfo]: - Chapter 5 / 13 - Pos: 00:02:49 | Total: 00:08:17
[08:27:53:403] [DVD - VolInfo]: - Chapter 6 / 13 - Pos: 00:03:25 | Total: 00:08:17
[08:27:53:426] [DVD - VolInfo]: - Chapter 7 / 13 - Pos: 00:03:48 | Total: 00:08:17
[08:27:53:444] [DVD - VolInfo]: - Chapter 8 / 13 - Pos: 00:04:07 | Total: 00:08:17
[08:27:53:466] [DVD - VolInfo]: - Chapter 9 / 13 - Pos: 00:04:19 | Total: 00:08:17
[08:27:53:488] [DVD - VolInfo]: - Chapter 10 / 13 - Pos: 00:04:53 | Total: 00:08:17
[08:27:53:508] [DVD - VolInfo]: - Chapter 11 / 13 - Pos: 00:05:33 | Total: 00:08:17
[08:27:53:528] [DVD - VolInfo]: - Chapter 12 / 13 - Pos: 00:06:34 | Total: 00:08:17
[08:27:53:567] [DVD - VolInfo]: - Chapter 13 / 13 - Pos: 00:06:48 | Total: 00:08:17
[08:27:53:599] [DVD - VolInfo]: - Chapter 14 / 13 - Pos: 00:06:53 | Total: 00:08:17
[08:27:53:615] [DVD - VolInfo]: - Chapter 15 / 13 - Pos: 00:07:16 | Total: 00:08:17
[08:27:53:639] [DVD - VolInfo]: - Chapter 16 / 13 - Pos: 00:07:32 | Total: 00:08:17
[08:27:53:639] [DVD - VolInfo]: Title: 14 - num chapters: 1
[08:27:53:665] [DVD - VolInfo]: - Chapter 1 / 14 - Pos: 00:00:00 | Total: 00:00:00
[08:27:53:665] [DVD - VolInfo]: Title: 15 - num chapters: 3
[08:27:53:675] [DVD - VolInfo]: - Chapter 1 / 15 - Pos: 00:00:00 | Total: 00:35:51
[08:27:53:697] [DVD - VolInfo]: - Chapter 2 / 15 - Pos: 00:10:01 | Total: 00:35:51
[08:27:53:723] [DVD - VolInfo]: - Chapter 3 / 15 - Pos: 00:19:04 | Total: 00:35:51
Schön wäre es jetzt noch zu wissen, welcher Titel was auf der DVD ist, zum VideoManager oder VideoTitleSet-Menu gehört, bzw. (nur) ein SubPicture und nur zu den Menüs gehört.
Das könnte man ggf. zwar aus aus den Zeiten ableiten, ....

Das offenbart sich hier (jedenfalls z. Zt.) erst, wenn man durch die DVD manoveriert und die passenden Events (z.B. EC_DVD_DOMAIN_CHANGE, EC_DVD_TITLE_CHANGE, EC_DVD_STILL_ON/OFF) abfragt.
Eine Herleitung scheint nicht sinnig - hier ist Titel 11 das 'Play-Menü' - und offensichtlich abhängig vom Authoring der DVD.

Oder weiß jemand mehr Details ?

Geändert von TERWI ( 3. Dez 2019 um 09:09 Uhr)
  Mit Zitat antworten Zitat