Mercurial > libdvdnav.hg
changeset 157:7094c8661c05 src
Return details about menu number in dvdnav_current_title_info()
If title = 0, we are in menu, and part gives us what menu number.
If title > 0, we are in a title.
author | jcdutton |
---|---|
date | Sun, 06 Apr 2003 10:59:28 +0000 |
parents | a68751e6e84f |
children | 66a615581b3f |
files | navigation.c vm.c vm.h |
diffstat | 3 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/navigation.c Sat Apr 05 21:23:02 2003 +0000 +++ b/navigation.c Sun Apr 06 10:59:28 2003 +0000 @@ -111,6 +111,13 @@ return S_ERR; } if (this->vm->state.domain != VTS_DOMAIN) { + if ( (this->vm->state.domain == VTSM_DOMAIN) + || (this->vm->state.domain == VMGM_DOMAIN) ) { + /* Get current Menu ID: into *part. */ + vm_get_current_menu(this->vm, part); + pthread_mutex_unlock(&this->vm_lock); + return S_OK; + } printerr("Not in VTS domain."); pthread_mutex_unlock(&this->vm_lock); return S_ERR;
--- a/vm.c Sat Apr 05 21:23:02 2003 +0000 +++ b/vm.c Sun Apr 06 10:59:28 2003 +0000 @@ -574,6 +574,18 @@ /* getting information */ +int vm_get_current_menu(vm_t *vm, int *menuid) +{ + pgcit_t* pgcit; + int pgcn; + pgcn = (vm->state).pgcN; + pgcit = get_PGCIT(vm); + *menuid = pgcit->pgci_srp[pgcn - 1].entry_id & 0xf ; + printf("PGCN = %d, MENU_ID = %d\n", pgcn, *menuid); + return S_OK; + +} + int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result) { vts_ptt_srpt_t *vts_ptt_srpt; @@ -1593,6 +1605,8 @@ } (vm->state).pgc = pgcit->pgci_srp[pgcN - 1].pgc; + printf("Setting PGCN = %d\n",pgcN); + (vm->state).pgcN = pgcN; (vm->state).pgN = 1; if((vm->state).domain == VTS_DOMAIN) @@ -1818,6 +1832,11 @@ /* * $Log$ + * Revision 1.54 2003/04/06 10:59:28 jcdutton + * Return details about menu number in dvdnav_current_title_info() + * If title = 0, we are in menu, and part gives us what menu number. + * If title > 0, we are in a title. + * * Revision 1.53 2003/04/05 13:11:13 jcdutton * Minor changes. *
--- a/vm.h Sat Apr 05 21:23:02 2003 +0000 +++ b/vm.h Sun Apr 06 10:59:28 2003 +0000 @@ -47,6 +47,7 @@ domain_t domain; int vtsN; /* 0 is vmgm? */ pgc_t *pgc; /* either this or 'int pgcN' is enough? */ + int pgcN; /* but provide pgcN for quick lookup */ int pgN; /* is this needed? can allways fid pgN from cellN? */ int cellN; int32_t cell_restart; /* get cell to restart */ @@ -151,6 +152,7 @@ int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd); /* getting information */ +int vm_get_current_menu(vm_t *vm, int *menuid); int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); int vm_get_audio_stream(vm_t *vm, int audioN); int vm_get_subp_stream(vm_t *vm, int subpN, int mode);