Re: C++=>C comment, forgotten file

Martin Piskernig <[email protected]>
Newsgroups gmane.comp.video.ogle.devel
Organization University of Vienna
Message-ID <[email protected]>
On Dienstag, 31. Dezember 2002 01:32, you wrote:
> See atatched patch.

Thanks very much! I've got it to find the correct vobu sector, now 
figuring out how to jump there :-)

And here is also a patch for that DVDGetDVDVolumeInfo() function I 
mentioned in my last mail, it is a clone of the corresponding MS 
DirectX function [1], exporting (nr_of_volumes, volume, side, 
nr_of_titles) to the ogle user. We can add some other values like disc 
name (that was what I meant to take from TXTDT, not the whole thing) 
later. I hope you will accept the patch :-)

Greets,
Martin

[1] 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/directx_cpp/htm/idvdinfo2getdvdvolumeinfo.asp
(sorry for the long url...)
-- 
Martin Piskernig		[email protected]
Institute for Mathematics	 www.mat.univie.ac.at/~martin
University of Vienna
ogle-volinfo.patch (text/x-diff, 4.8 KB)
diff -Nur ogle/ogle/dvd.h ogle-volinfo/ogle/dvd.h
--- ogle/ogle/dvd.h	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/ogle/dvd.h	2002-12-31 15:48:57.000000000 +0100
@@ -298,6 +298,13 @@
   DVDTimecode_t title_total;
 } DVDLocation_t;
 
+typedef struct {
+  int numofvolumes;
+  int volume;
+  int side;
+  int numoftitles;
+} DVDVolumeInfo_t;
+
 /* hack */
 
 typedef enum {
diff -Nur ogle/ogle/dvdcontrol.c ogle-volinfo/ogle/dvdcontrol.c
--- ogle/ogle/dvdcontrol.c	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/ogle/dvdcontrol.c	2002-12-31 16:06:07.000000000 +0100
@@ -489,9 +489,38 @@
 
 }
 
+/**
+ *
+ */
+DVDResult_t DVDGetDVDVolumeInfo(DVDNav_t *nav, DVDVolumeInfo_t *const VolumeInfo)
+{
+  MsgEvent_t ev;
+  ev.type = MsgEventQDVDCtrl;
+  ev.dvdctrl.cmd.type = DVDCtrlGetDVDVolumeInfo;
+ 
+  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {
+    return DVD_E_Unspecified;
+  }
+
+  while(1) {
+    if(MsgNextEvent(nav->msgq, &ev) == -1) {
+      return DVD_E_Unspecified;
+    }
+    if((ev.type == MsgEventQDVDCtrl) &&
+       (ev.dvdctrl.cmd.type == DVDCtrlDVDVolumeInfo)) {
+      DVDVolumeInfo_t v;
+      v.numofvolumes = ev.dvdctrl.cmd.volumeinfo.numofvolumes;
+      v.volume = ev.dvdctrl.cmd.volumeinfo.volume;
+      v.side = ev.dvdctrl.cmd.volumeinfo.side;
+      v.numoftitles = ev.dvdctrl.cmd.volumeinfo.numoftitles;
+      *VolumeInfo = v;
+      return DVD_E_Ok;
+    }
+  }
+}
 
 /** 
- * Querry the number of Titel tracks on the DVD.
+ * Query the number of Titel tracks on the DVD.
  * @param nav Specifies the connection to the DVD navigator.
  * @param TitlesAvailable Will contain the number of Title tracks.
  *
diff -Nur ogle/ogle/dvdcontrol.h ogle-volinfo/ogle/dvdcontrol.h
--- ogle/ogle/dvdcontrol.h	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/ogle/dvdcontrol.h	2002-12-31 15:51:39.000000000 +0100
@@ -59,6 +59,8 @@
 DVDResult_t DVDGetCurrentLocation(DVDNav_t *nav, 
 				  DVDLocation_t *const Location);
 
+DVDResult_t DVDGetDVDVolumeInfo(DVDNav_t *nav, DVDVolumeInfo_t *const VolumeInfo);
+
 DVDResult_t DVDGetTitles(DVDNav_t *nav, int *const TitlesAvailable);
 
 DVDResult_t DVDGetNumberOfPTTs(DVDNav_t *nav, DVDTitle_t Title,
diff -Nur ogle/ogle/dvdevents.h ogle-volinfo/ogle/dvdevents.h
--- ogle/ogle/dvdevents.h	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/ogle/dvdevents.h	2002-12-31 15:52:09.000000000 +0100
@@ -106,6 +106,9 @@
   DVDCtrlGetCurrentUOPS,
   DVDCtrlCurrentUOPS,
   
+  DVDCtrlGetDVDVolumeInfo,
+  DVDCtrlDVDVolumeInfo,
+
   DVDCtrlGetTitles,
   DVDCtrlTitles,
   
@@ -333,6 +336,14 @@
 
 typedef struct {
   DVDCtrlEventType_t type;
+  int numofvolumes;
+  int volume;
+  int side;
+  int numoftitles;
+} DVDCtrlVolumeInfoEvent_t;
+
+typedef struct {
+  DVDCtrlEventType_t type;
   int titles;
 } DVDCtrlTitlesEvent_t;
 
@@ -465,6 +476,7 @@
   DVDCtrlAudioStreamEnabledEvent_t audiostreamenabled;
   DVDCtrlAudioAttributesEvent_t audioattributes;
 
+  DVDCtrlVolumeInfoEvent_t volumeinfo;
   DVDCtrlTitlesEvent_t titles;
   DVDCtrlNumberOfPTTsEvent_t parts;
 
diff -Nur ogle/vmg/nav.c ogle-volinfo/vmg/nav.c
--- ogle/vmg/nav.c	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/vmg/nav.c	2002-12-31 15:57:04.000000000 +0100
@@ -866,6 +866,20 @@
 	    MsgSendEvent(msgq, ev.any.client, &send_ev, 0);
 	  }
 	  break;
+	case DVDCtrlGetDVDVolumeInfo:
+	  {
+	   int nofv,vol,side,noft;
+	   MsgEvent_t send_ev;
+	   send_ev.type = MsgEventQDVDCtrl;
+	   send_ev.dvdctrl.cmd.type = DVDCtrlDVDVolumeInfo;
+	   vm_get_volume_info(&nofv,&vol,&side,&noft);
+	   send_ev.dvdctrl.cmd.volumeinfo.numofvolumes = nofv;
+	   send_ev.dvdctrl.cmd.volumeinfo.volume = vol;
+	   send_ev.dvdctrl.cmd.volumeinfo.side = side;
+	   send_ev.dvdctrl.cmd.volumeinfo.numoftitles = noft;
+	   MsgSendEvent(msgq, ev.any.client, &send_ev, 0);
+	  }
+	  break;
 	case DVDCtrlGetTitles:
 	  {
 	    MsgEvent_t send_ev;
diff -Nur ogle/vmg/vm.c ogle-volinfo/vmg/vm.c
--- ogle/vmg/vm.c	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/vmg/vm.c	2002-12-31 16:00:33.000000000 +0100
@@ -576,6 +576,14 @@
  return state.domain;
 }
 
+void vm_get_volume_info(int *numofvolumes,int *volume,int *side,int *numoftitles)
+{
+ *numofvolumes = vmgi->vmgi_mat->vmg_nr_of_volumes;
+ *volume = vmgi->vmgi_mat->vmg_this_volume_nr;
+ *side = vmgi->vmgi_mat->disc_side;
+ *numoftitles = vmgi->vmgi_mat->vmg_nr_of_title_sets;
+}
+
 int vm_get_titles(void)
 {
  int titles = 0;
diff -Nur ogle/vmg/vm.h ogle-volinfo/vmg/vm.h
--- ogle/vmg/vm.h	2002-12-31 16:39:02.000000000 +0100
+++ ogle-volinfo/vmg/vm.h	2002-12-31 16:01:03.000000000 +0100
@@ -108,6 +108,7 @@
 void vm_get_audio_info(int *num_avail, int *current);
 void vm_get_subp_info(int *num_avail, int *current);
 int vm_get_domain(void);
+void vm_get_volume_info(int *numofvolumes,int *volume,int *side,int *numoftitles);
 int vm_get_titles(void);
 int vm_get_ptts_for_title(DVDTitle_t titleN);
 subp_attr_t vm_get_subp_attr(int streamN);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.