# HG changeset patch # User richwareham # Date 1017786321 0 # Node ID c1b55dc1bfed964a13b05518624057f0476616a6 # Parent 99bed5d6db2f157c56bbdd7762d8ce0f102dc596 Add API call to get number of programmes in current title. diff -r 99bed5d6db2f -r c1b55dc1bfed dvdnav.h --- a/dvdnav.h Tue Apr 02 18:22:27 2002 +0000 +++ b/dvdnav.h Tue Apr 02 22:25:21 2002 +0000 @@ -24,6 +24,10 @@ #ifndef DVDNAV_H_INCLUDED #define DVDNAV_H_INCLUDED +#ifdef __cplusplus +extern "C" { +#endif + /* Defines the various events and dvdnav_event_t */ #include "dvdnav_events.h" @@ -147,6 +151,11 @@ dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int *titles); /** + * Returns the number of programs within the current title in programs. + */ +dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *self, int *programs); + +/** * If we are currently in a still-frame, skip it. */ dvdnav_status_t dvdnav_still_skip(dvdnav_t *self); @@ -459,6 +468,7 @@ int8_t dvdnav_audio_physical_to_logical(dvdnav_t *self, uint8_t physical); int8_t dvdnav_spu_physical_to_logical(dvdnav_t *self, uint8_t physical); + /* Following functions returns: * -1 on failure, * 1 if condition is true, @@ -474,5 +484,9 @@ /* Video Title domain (playing movie). */ int8_t dvdnav_is_domain_vts(dvdnav_t *self); +#ifdef __cplusplus +} +#endif + #endif /* DVDNAV_H_INCLUDED */ diff -r 99bed5d6db2f -r c1b55dc1bfed navigation.c --- a/navigation.c Tue Apr 02 18:22:27 2002 +0000 +++ b/navigation.c Tue Apr 02 22:25:21 2002 +0000 @@ -66,6 +66,20 @@ return S_OK; } +dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *self, int *programs) { + if(!self) + return S_ERR; + + if(!programs) { + printerr("Passed a NULL pointer"); + return S_ERR; + } + + (*programs) = self->vm->state.pgc->nr_of_programs; + + return S_OK; +} + dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int title) { int num_titles;