Mercurial > libdvdnav.hg
changeset 5:c1b55dc1bfed src
Add API call to get number of programmes in current title.
author | richwareham |
---|---|
date | Tue, 02 Apr 2002 22:25:21 +0000 |
parents | 99bed5d6db2f |
children | 5f319e02e333 |
files | dvdnav.h navigation.c |
diffstat | 2 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 */
--- 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;