Mercurial > libdvdnav.hg
comparison settings.c @ 0:3ddf0eaece51 src
Initial revision
author | richwareham |
---|---|
date | Tue, 12 Mar 2002 19:45:53 +0000 |
parents | |
children | 3c1df0cb3aee |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3ddf0eaece51 |
---|---|
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 /* Characteristics/setting API calls */ | |
34 | |
35 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int *region) { | |
36 if(!self) | |
37 return S_ERR; | |
38 | |
39 if(!region) { | |
40 printerr("Passed a NULL pointer"); | |
41 return S_ERR; | |
42 } | |
43 | |
44 if(!self->vm) { | |
45 printerr("VM not yet initialised"); | |
46 return S_ERR; | |
47 } | |
48 | |
49 (*region) = self->vm->state.registers.SPRM[20]; | |
50 | |
51 return S_OK; | |
52 } | |
53 | |
54 dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int mask) { | |
55 if(!self) | |
56 return S_ERR; | |
57 | |
58 if(!self->vm) { | |
59 printerr("VM not yet initialised"); | |
60 return S_ERR; | |
61 } | |
62 | |
63 self->vm->state.registers.SPRM[20] = (mask & 0xff); | |
64 | |
65 return S_OK; | |
66 } | |
67 | |
68 dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int use_readahead) { | |
69 if(!self) | |
70 return S_ERR; | |
71 | |
72 self->use_read_ahead = use_readahead; | |
73 | |
74 return S_OK; | |
75 } | |
76 | |
77 dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int* flag) { | |
78 if(!self) | |
79 return S_ERR; | |
80 | |
81 if(!flag) { | |
82 printerr("Passed a NULL pointer"); | |
83 return S_ERR; | |
84 } | |
85 | |
86 (*flag) = self->use_read_ahead; | |
87 return S_OK; | |
88 } | |
89 |