Mercurial > libdvdnav.hg
annotate navigation.c @ 59:6b90f8ffd8c0 src
Move documentation around a little
author | richwareham |
---|---|
date | Fri, 12 Jul 2002 14:02:52 +0000 |
parents | 794d2e16a4d4 |
children | eeabf5a51b2b |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net> | |
3 * | |
4 * This file is part of libdvdnav, a DVD navigation library. | |
5 * | |
6 * libdvdnav is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * libdvdnav is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
19 * | |
20 * $Id$ | |
21 * | |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include "config.h" | |
26 #endif | |
27 | |
28 #include <dvdnav.h> | |
29 #include "dvdnav_internal.h" | |
30 | |
31 #include "vm.h" | |
32 | |
33 /* Navigation API calls */ | |
34 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
35 dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
36 if(!this) |
0 | 37 return S_ERR; |
38 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
39 this->position_current.still = 0; |
23 | 40 this->skip_still = 1; |
0 | 41 |
42 return S_OK; | |
43 } | |
44 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
45 dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
46 if(!this) |
0 | 47 return S_ERR; |
48 | |
49 if(!titles) { | |
50 printerr("Passed a NULL pointer"); | |
51 return S_ERR; | |
52 } | |
53 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
54 (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts; |
0 | 55 |
56 return S_OK; | |
57 } | |
58 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
59 dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *this, int *programs) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
60 if(!this) |
5
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
61 return S_ERR; |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
62 |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
63 if(!programs) { |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
64 printerr("Passed a NULL pointer"); |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
65 return S_ERR; |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
66 } |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
67 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
68 (*programs) = this->vm->state.pgc->nr_of_programs; |
5
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
69 |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
70 return S_OK; |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
71 } |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
72 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
73 dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) { |
0 | 74 int num_titles; |
75 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
76 if(!this) { |
0 | 77 return S_ERR; |
78 } | |
79 | |
80 /* Check number of titles */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
81 dvdnav_get_number_of_titles(this, &num_titles); |
0 | 82 if((title > num_titles) || (title <= 0)) { |
83 printerrf("Invalid title passed (%i, maximum %i)", title, | |
84 num_titles); | |
85 return S_ERR; | |
86 } | |
87 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
88 vm_start_title(this->vm, title); |
0 | 89 |
90 return S_OK; | |
91 } | |
92 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
93 dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) { |
0 | 94 int num_titles, num_progs; |
95 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
96 if(!this) { |
0 | 97 return S_ERR; |
98 } | |
99 | |
100 /* Check number of titles */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
101 dvdnav_get_number_of_titles(this, &num_titles); |
0 | 102 if((title > num_titles) || (title <= 0)) { |
103 printerrf("Invalid title passed (%i, maximum %i)", title, | |
104 num_titles); | |
105 return S_ERR; | |
106 } | |
107 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
108 vm_start_title(this->vm, title); |
0 | 109 |
110 | |
111 /* Check number of parts */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
112 num_progs = this->vm->state.pgc->nr_of_programs; |
0 | 113 if((part > num_progs) || (part <= 0)) { |
114 printerrf("Invalid program passed (%i, maximum %i)", part, | |
115 num_progs); | |
116 return S_ERR; | |
117 } | |
118 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
119 vm_jump_prog(this->vm, part); |
0 | 120 |
121 return S_OK; | |
122 } | |
123 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
124 dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title, |
0 | 125 int part, int parts_to_play) { |
126 /* Perform jump as per usual */ | |
127 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
128 return dvdnav_part_play(this, title, part); |
0 | 129 |
130 /* FIXME: Impement auto-stop */ | |
131 | |
132 /* return S_OK;*/ | |
133 } | |
134 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
135 dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title, |
0 | 136 unsigned long int time) { |
137 /* FIXME: Implement */ | |
138 | |
139 return S_OK; | |
140 } | |
141 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
142 dvdnav_status_t dvdnav_stop(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
143 if(!this) |
0 | 144 return S_ERR; |
145 | |
146 /* Set the STOP flag */ | |
147 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
148 this->stop = 1; |
0 | 149 |
150 return S_OK; | |
151 } | |
152 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
153 dvdnav_status_t dvdnav_go_up(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
154 if(!this) |
0 | 155 return S_ERR; |
156 | |
157 /* A nice easy function... delegate to the VM */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
158 vm_go_up(this->vm); |
0 | 159 |
160 return S_OK; | |
161 } | |
162 | |
163 | |
164 |