Mercurial > libdvdnav.hg
annotate navigation.c @ 94:e29110f67f3a src
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
author | jcdutton |
---|---|
date | Mon, 16 Sep 2002 16:27:18 +0000 |
parents | eeabf5a51b2b |
children | e7ebabe059b9 |
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 | |
94
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
54 if(!this->started) { |
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
55 /* Start the VM */ |
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
56 vm_start(this->vm); |
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
57 this->started = 1; |
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
58 } |
e29110f67f3a
Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents:
90
diff
changeset
|
59 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
60 (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts; |
0 | 61 |
62 return S_OK; | |
63 } | |
64 | |
90 | 65 /* This function should not be used. FIXME: Suggest alternative */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
66 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
|
67 if(!this) |
5
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
68 return S_ERR; |
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 if(!programs) { |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
71 printerr("Passed a NULL pointer"); |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
72 return S_ERR; |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
73 } |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
74 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
75 (*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
|
76 |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
77 return S_OK; |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
78 } |
c1b55dc1bfed
Add API call to get number of programmes in current title.
richwareham
parents:
0
diff
changeset
|
79 |
90 | 80 dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int *title, int *part) { |
81 if(!this || !this->vm) | |
82 return S_ERR; | |
83 | |
84 if(!title || !part) { | |
85 printerr("Passed a NULL pointer"); | |
86 return S_ERR; | |
87 } | |
88 | |
89 return vm_get_current_title_part(this->vm, title, part); | |
90 } | |
91 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
92 dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) { |
0 | 93 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
94 if(!this) { |
0 | 95 return S_ERR; |
96 } | |
97 | |
90 | 98 return dvdnav_part_play(this, title, 1); |
0 | 99 } |
100 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
101 dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) { |
0 | 102 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
103 if(!this) { |
0 | 104 return S_ERR; |
105 } | |
106 | |
90 | 107 return vm_jump_title_part(this->vm, title, part); |
0 | 108 } |
109 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
110 dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title, |
0 | 111 int part, int parts_to_play) { |
112 /* Perform jump as per usual */ | |
113 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
114 return dvdnav_part_play(this, title, part); |
0 | 115 |
116 /* FIXME: Impement auto-stop */ | |
117 | |
118 /* return S_OK;*/ | |
119 } | |
120 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
121 dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title, |
0 | 122 unsigned long int time) { |
123 /* FIXME: Implement */ | |
124 | |
125 return S_OK; | |
126 } | |
127 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
128 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
|
129 if(!this) |
0 | 130 return S_ERR; |
131 | |
132 /* Set the STOP flag */ | |
133 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
134 this->stop = 1; |
0 | 135 |
136 return S_OK; | |
137 } | |
138 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
5
diff
changeset
|
139 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
|
140 if(!this) |
0 | 141 return S_ERR; |
142 | |
143 /* 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
|
144 vm_go_up(this->vm); |
0 | 145 |
146 return S_OK; | |
147 } | |
148 | |
149 | |
150 |