Mercurial > libdvdnav.hg
annotate settings.c @ 186:fb1b6c1c3d2c src
Comment update.
author | jcdutton |
---|---|
date | Tue, 29 Apr 2003 22:11:46 +0000 |
parents | 5897ff629f7c |
children | b80dff4bef76 |
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_internal.h" | |
29 | |
30 /* Characteristics/setting API calls */ | |
31 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
32 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int *region) { |
114 | 33 if(!this || !region) { |
34 printerr("Passed a NULL this pointer."); | |
0 | 35 return S_ERR; |
36 } | |
37 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
38 (*region) = this->vm->state.registers.SPRM[20]; |
0 | 39 return S_OK; |
40 } | |
41 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
42 dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int mask) { |
114 | 43 if(!this) { |
44 printerr("Passed a NULL this pointer."); | |
0 | 45 return S_ERR; |
46 } | |
47 | |
114 | 48 pthread_mutex_lock(&this->vm_lock); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
49 this->vm->state.registers.SPRM[20] = (mask & 0xff); |
114 | 50 pthread_mutex_unlock(&this->vm_lock); |
0 | 51 return S_OK; |
52 } | |
53 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
54 dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int use_readahead) { |
114 | 55 if(!this) { |
56 printerr("Passed a NULL this pointer."); | |
57 return S_ERR; | |
58 } | |
0 | 59 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
60 this->use_read_ahead = use_readahead; |
0 | 61 return S_OK; |
62 } | |
63 | |
114 | 64 dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int *flag) { |
65 if(!this || !flag) { | |
66 printerr("Passed a NULL this pointer."); | |
0 | 67 return S_ERR; |
68 } | |
69 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
0
diff
changeset
|
70 (*flag) = this->use_read_ahead; |
0 | 71 return S_OK; |
72 } | |
73 | |
44 | 74 static dvdnav_status_t set_language_register(dvdnav_t *this, char *code, int reg) { |
114 | 75 if(!this || !code) { |
76 printerr("Passed a NULL this pointer."); | |
44 | 77 return S_ERR; |
93 | 78 } |
44 | 79 |
80 if(!code[0] || !code[1]) { | |
114 | 81 printerr("Passed illegal language code."); |
44 | 82 return S_ERR; |
83 } | |
84 | |
85 pthread_mutex_lock(&this->vm_lock); | |
86 this->vm->state.registers.SPRM[reg] = (code[0] << 8) | code[1]; | |
87 pthread_mutex_unlock(&this->vm_lock); | |
88 return S_OK; | |
89 } | |
90 | |
91 dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *this, char *code) { | |
92 return set_language_register(this, code, 0); | |
93 } | |
94 | |
95 dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *this, char *code) { | |
96 return set_language_register(this, code, 16); | |
97 } | |
98 | |
99 dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *this, char *code) { | |
100 return set_language_register(this, code, 18); | |
101 } | |
132 | 102 |
103 dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *this, int pgc) { | |
104 if(!this) { | |
105 printerr("Passed a NULL this pointer."); | |
106 return S_ERR; | |
107 } | |
108 | |
109 this->pgc_based = pgc; | |
110 return S_OK; | |
111 } | |
112 | |
113 dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *this, int *flag) { | |
114 if(!this || !flag) { | |
115 printerr("Passed a NULL this pointer."); | |
116 return S_ERR; | |
117 } | |
118 | |
119 (*flag) = this->pgc_based; | |
120 return S_OK; | |
121 } |