Mercurial > libdvdnav.hg
annotate settings.c @ 260:97ad00b13609 src
fixing typos noticed by Jeff Smith
author | mroi |
---|---|
date | Sun, 16 Jan 2005 16:47:05 +0000 |
parents | c2d0cf87a5ee |
children | 52877d182e96 |
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 | |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
32 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int32_t *region) { |
114 | 33 if(!this || !region) { |
34 printerr("Passed a NULL this pointer."); | |
193 | 35 return DVDNAV_STATUS_ERR; |
0 | 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]; |
193 | 39 return DVDNAV_STATUS_OK; |
0 | 40 } |
41 | |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
42 dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int32_t mask) { |
114 | 43 if(!this) { |
44 printerr("Passed a NULL this pointer."); | |
193 | 45 return DVDNAV_STATUS_ERR; |
0 | 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); |
193 | 51 return DVDNAV_STATUS_OK; |
0 | 52 } |
53 | |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
54 dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int32_t use_readahead) { |
114 | 55 if(!this) { |
56 printerr("Passed a NULL this pointer."); | |
193 | 57 return DVDNAV_STATUS_ERR; |
114 | 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; |
193 | 61 return DVDNAV_STATUS_OK; |
0 | 62 } |
63 | |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
64 dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int32_t *flag) { |
114 | 65 if(!this || !flag) { |
66 printerr("Passed a NULL this pointer."); | |
193 | 67 return DVDNAV_STATUS_ERR; |
0 | 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; |
193 | 71 return DVDNAV_STATUS_OK; |
0 | 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."); | |
193 | 77 return DVDNAV_STATUS_ERR; |
93 | 78 } |
44 | 79 |
80 if(!code[0] || !code[1]) { | |
114 | 81 printerr("Passed illegal language code."); |
193 | 82 return DVDNAV_STATUS_ERR; |
44 | 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); | |
193 | 88 return DVDNAV_STATUS_OK; |
44 | 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 |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
103 dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *this, int32_t pgc) { |
132 | 104 if(!this) { |
105 printerr("Passed a NULL this pointer."); | |
193 | 106 return DVDNAV_STATUS_ERR; |
132 | 107 } |
108 | |
109 this->pgc_based = pgc; | |
193 | 110 return DVDNAV_STATUS_OK; |
132 | 111 } |
112 | |
218
c2d0cf87a5ee
Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents:
193
diff
changeset
|
113 dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *this, int32_t *flag) { |
132 | 114 if(!this || !flag) { |
115 printerr("Passed a NULL this pointer."); | |
193 | 116 return DVDNAV_STATUS_ERR; |
132 | 117 } |
118 | |
119 (*flag) = this->pgc_based; | |
193 | 120 return DVDNAV_STATUS_OK; |
132 | 121 } |