annotate settings.c @ 392:0a5a6f03b029 src

Remove useless $Id$ and $Name$ keywords.
author diego
date Sun, 14 Sep 2008 20:31:43 +0000
parents d3c273ced49c
children 9c5aef10d165
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
1 /*
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
2 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net>
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
3 *
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
4 * This file is part of libdvdnav, a DVD navigation library.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
5 *
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
6 * libdvdnav is free software; you can redistribute it and/or modify
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
9 * (at your option) any later version.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
10 *
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
11 * libdvdnav is distributed in the hope that it will be useful,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
14 * GNU General Public License for more details.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
15 *
389
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
16 * You should have received a copy of the GNU General Public License along
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
17 * with libdvdnav; if not, write to the Free Software Foundation, Inc.,
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
19 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
20
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
21 #ifdef HAVE_CONFIG_H
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
22 #include "config.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
23 #endif
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
24
286
6fac6a613ea5 moved inclusion of inttypes.h from dvd_types.h to the including .c files
nicodvb
parents: 285
diff changeset
25 #include <inttypes.h>
294
2146ff691bcd include limits.h; it was included in the previous dvdnav_internal.h and without it players segfault
nicodvb
parents: 293
diff changeset
26 #include <limits.h>
288
ce4230602517 moved away from dvdnav_internal.h inclusion of various system headers
nicodvb
parents: 286
diff changeset
27 #include <string.h>
290
54b6a000f6da decoder.h needs inclusion of sys/time.h
nicodvb
parents: 288
diff changeset
28 #include <sys/time.h>
285
52877d182e96 moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents: 218
diff changeset
29 #include "dvd_types.h"
386
579a3538d284 Sync with current libdvdread header location.
rathann
parents: 378
diff changeset
30 #include <dvdread/nav_types.h>
579a3538d284 Sync with current libdvdread header location.
rathann
parents: 378
diff changeset
31 #include <dvdread/ifo_types.h>
285
52877d182e96 moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents: 218
diff changeset
32 #include "remap.h"
52877d182e96 moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents: 218
diff changeset
33 #include "vm/decoder.h"
52877d182e96 moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents: 218
diff changeset
34 #include "vm/vm.h"
52877d182e96 moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents: 218
diff changeset
35 #include "dvdnav.h"
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
36 #include "dvdnav_internal.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
37
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
38 /* Characteristics/setting API calls */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
39
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
40 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int32_t *region) {
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 0
diff changeset
41 (*region) = this->vm->state.registers.SPRM[20];
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
42 return DVDNAV_STATUS_OK;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
43 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
44
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
45 dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int32_t mask) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 93
diff changeset
46 pthread_mutex_lock(&this->vm_lock);
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 0
diff changeset
47 this->vm->state.registers.SPRM[20] = (mask & 0xff);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 93
diff changeset
48 pthread_mutex_unlock(&this->vm_lock);
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
49 return DVDNAV_STATUS_OK;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
50 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
51
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
52 dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int32_t use_readahead) {
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 0
diff changeset
53 this->use_read_ahead = use_readahead;
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
54 return DVDNAV_STATUS_OK;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
55 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
56
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
57 dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int32_t *flag) {
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 0
diff changeset
58 (*flag) = this->use_read_ahead;
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
59 return DVDNAV_STATUS_OK;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
60 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
61
44
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
62 static dvdnav_status_t set_language_register(dvdnav_t *this, char *code, int reg) {
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
63 if(!code[0] || !code[1]) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 93
diff changeset
64 printerr("Passed illegal language code.");
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
65 return DVDNAV_STATUS_ERR;
44
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
66 }
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 386
diff changeset
67
44
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
68 pthread_mutex_lock(&this->vm_lock);
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
69 this->vm->state.registers.SPRM[reg] = (code[0] << 8) | code[1];
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
70 pthread_mutex_unlock(&this->vm_lock);
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
71 return DVDNAV_STATUS_OK;
44
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
72 }
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
73
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
74 dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *this, char *code) {
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
75 return set_language_register(this, code, 0);
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
76 }
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
77
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
78 dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *this, char *code) {
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
79 return set_language_register(this, code, 16);
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
80 }
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
81
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
82 dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *this, char *code) {
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
83 return set_language_register(this, code, 18);
c50cb59dbb19 Add dvd menu language selection api.
jcdutton
parents: 22
diff changeset
84 }
132
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
85
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
86 dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *this, int32_t pgc) {
132
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
87 this->pgc_based = pgc;
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
88 return DVDNAV_STATUS_OK;
132
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
89 }
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
90
218
c2d0cf87a5ee Some fixes to that libdvdnav compiles under cygwin.
jcdutton
parents: 193
diff changeset
91 dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *this, int32_t *flag) {
132
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
92 (*flag) = this->pgc_based;
193
b80dff4bef76 Remove all references to S_OK and S_ERR.
jcdutton
parents: 136
diff changeset
93 return DVDNAV_STATUS_OK;
132
f22458f928b8 PGC based positioning
mroi
parents: 114
diff changeset
94 }