annotate highlight.c @ 191:dbea22936623 src

when a command has been issued to leave a menu, filter all further commands for this menu
author mroi
date Tue, 06 May 2003 14:11:44 +0000
parents 90b1f6f0520e
children b80dff4bef76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
1 /*
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
2 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net>
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
3 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
4 * This file is part of libdvdnav, a DVD navigation library.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
5 *
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.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
10 *
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.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
15 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
19 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
20 * $Id$
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
21 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
22 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
23
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
25 #include "config.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
26 #endif
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
27
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
28 #include <assert.h>
169
90b1f6f0520e Modified libdvdnav to do without libdvdread.
jcdutton
parents: 166
diff changeset
29 #include "nav_types.h"
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
30 #include "dvdnav_internal.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
31
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
32 /*
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
33 #define BUTTON_TESTING
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
34 */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
35
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
36 #ifdef BUTTON_TESTING
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
37
169
90b1f6f0520e Modified libdvdnav to do without libdvdread.
jcdutton
parents: 166
diff changeset
38 #include "nav_print.h"
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
39
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
40 static void print_time(dvd_time_t *dtime) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
41 const char *rate;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
42
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
43 assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
44 assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
45 assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
46 assert((dtime->frame_u&0xf) < 0xa);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
47
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
48 fprintf(MSG_OUT,"%02x:%02x:%02x.%02x",
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
49 dtime->hour,
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
50 dtime->minute,
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
51 dtime->second,
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
52 dtime->frame_u & 0x3f);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
53 switch((dtime->frame_u & 0xc0) >> 6) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
54 case 1:
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
55 rate = "25.00";
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
56 break;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
57 case 3:
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
58 rate = "29.97";
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
59 break;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
60 default:
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
61 rate = "(please send a bug report)";
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
62 break;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
63 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
64 fprintf(MSG_OUT," @ %s fps", rate);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
65 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
66
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
67 static void nav_print_PCI_GI(pci_gi_t *pci_gi) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
68 int i;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
69
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
70 fprintf(MSG_OUT,"libdvdnav: pci_gi:\n");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
71 fprintf(MSG_OUT,"libdvdnav: nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
72 fprintf(MSG_OUT,"libdvdnav: vobu_cat 0x%04x\n", pci_gi->vobu_cat);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
73 fprintf(MSG_OUT,"libdvdnav: vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
74 fprintf(MSG_OUT,"libdvdnav: vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
75 fprintf(MSG_OUT,"libdvdnav: vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
76 fprintf(MSG_OUT,"libdvdnav: vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
77 fprintf(MSG_OUT,"libdvdnav: e_eltm ");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
78 print_time(&pci_gi->e_eltm);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
79 fprintf(MSG_OUT,"\n");
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
80
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
81 fprintf(MSG_OUT,"libdvdnav: vobu_isrc \"");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
82 for(i = 0; i < 32; i++) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
83 char c = pci_gi->vobu_isrc[i];
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
84 if((c >= ' ') && (c <= '~'))
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
85 fprintf(MSG_OUT,"%c", c);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
86 else
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
87 fprintf(MSG_OUT,".");
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
88 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
89 fprintf(MSG_OUT,"\"\n");
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
90 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
91
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
92 static void nav_print_NSML_AGLI(nsml_agli_t *nsml_agli) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
93 int i, j = 0;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
94
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
95 for(i = 0; i < 9; i++)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
96 j |= nsml_agli->nsml_agl_dsta[i];
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
97 if(j == 0)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
98 return;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
99
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
100 fprintf(MSG_OUT,"libdvdnav: nsml_agli:\n");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
101 for(i = 0; i < 9; i++)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
102 if(nsml_agli->nsml_agl_dsta[i])
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
103 fprintf(MSG_OUT,"libdvdnav: nsml_agl_c%d_dsta 0x%08x\n", i + 1,
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
104 nsml_agli->nsml_agl_dsta[i]);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
105 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
106
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
107 static void nav_print_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
108
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
109 if((hl_gi->hli_ss & 0x03) == 0)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
110 return;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
111
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
112 fprintf(MSG_OUT,"libdvdnav: hl_gi:\n");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
113 fprintf(MSG_OUT,"libdvdnav: hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
114 fprintf(MSG_OUT,"libdvdnav: hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
115 fprintf(MSG_OUT,"libdvdnav: hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
116 fprintf(MSG_OUT,"libdvdnav: btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
117
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
118 *btngr_ns = hl_gi->btngr_ns;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
119 fprintf(MSG_OUT,"libdvdnav: btngr_ns %d\n", hl_gi->btngr_ns);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
120 fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
121 fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
122 fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
123
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
124 fprintf(MSG_OUT,"libdvdnav: btn_ofn %d\n", hl_gi->btn_ofn);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
125 *btn_ns = hl_gi->btn_ns;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
126 fprintf(MSG_OUT,"libdvdnav: btn_ns %d\n", hl_gi->btn_ns);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
127 fprintf(MSG_OUT,"libdvdnav: nsl_btn_ns %d\n", hl_gi->nsl_btn_ns);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
128 fprintf(MSG_OUT,"libdvdnav: fosl_btnn %d\n", hl_gi->fosl_btnn);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
129 fprintf(MSG_OUT,"libdvdnav: foac_btnn %d\n", hl_gi->foac_btnn);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
130 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
131
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
132 static void nav_print_BTN_COLIT(btn_colit_t *btn_colit) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
133 int i, j;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
134
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
135 j = 0;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
136 for(i = 0; i < 6; i++)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
137 j |= btn_colit->btn_coli[i/2][i&1];
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
138 if(j == 0)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
139 return;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
140
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
141 fprintf(MSG_OUT,"libdvdnav: btn_colit:\n");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
142 for(i = 0; i < 3; i++)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
143 for(j = 0; j < 2; j++)
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
144 fprintf(MSG_OUT,"libdvdnav: btn_cqoli %d %s_coli: %08x\n",
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
145 i, (j == 0) ? "sl" : "ac",
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
146 btn_colit->btn_coli[i][j]);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
147 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
148
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
149 static void nav_print_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
150 int i, j, k;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
151
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
152 fprintf(MSG_OUT,"libdvdnav: btnit:\n");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
153 fprintf(MSG_OUT,"libdvdnav: btngr_ns: %i\n", btngr_ns);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
154 fprintf(MSG_OUT,"libdvdnav: btn_ns: %i\n", btn_ns);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
155
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
156 if(btngr_ns == 0)
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
157 return;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
158
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
159 for(i = 0; i < btngr_ns; i++) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
160 for(j = 0; j < (36 / btngr_ns); j++) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
161 if(j < btn_ns) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
162 btni_t *btni = &btni_table[(36 / btngr_ns) * i + j];
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
163
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
164 fprintf(MSG_OUT,"libdvdnav: group %d btni %d: ", i+1, j+1);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
165 fprintf(MSG_OUT,"btn_coln %d, auto_action_mode %d\n",
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
166 btni->btn_coln, btni->auto_action_mode);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
167 fprintf(MSG_OUT,"libdvdnav: coords (%d, %d) .. (%d, %d)\n",
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
168 btni->x_start, btni->y_start, btni->x_end, btni->y_end);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
169
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
170 fprintf(MSG_OUT,"libdvdnav: up %d, ", btni->up);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
171 fprintf(MSG_OUT,"down %d, ", btni->down);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
172 fprintf(MSG_OUT,"left %d, ", btni->left);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
173 fprintf(MSG_OUT,"right %d\n", btni->right);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
174 for(k = 0; k < 8; k++) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
175 fprintf(MSG_OUT, "libdvdnav: %02x ", btni->cmd.bytes[k]);
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
176 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
177 fprintf(MSG_OUT, "| ");
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
178 #ifdef TRACE
153
175d5fef21e4 Minor changes.
jcdutton
parents: 136
diff changeset
179 vm_print_mnemonic(&btni->cmd);
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
180 #endif
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
181 fprintf(MSG_OUT, "\n");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
182 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
183 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
184 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
185 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
186
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
187 static void nav_print_HLI(hli_t *hli) {
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
188 int btngr_ns = 0, btn_ns = 0;
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
189
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
190 fprintf(MSG_OUT,"libdvdnav: hli:\n");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
191 nav_print_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
192 nav_print_BTN_COLIT(&hli->btn_colit);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
193 nav_print_BTNIT(hli->btnit, btngr_ns, btn_ns);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
194 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
195
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
196 void nav_print_PCI(pci_t *pci) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
197 fprintf(MSG_OUT,"libdvdnav: pci packet:\n");
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
198 nav_print_PCI_GI(&pci->pci_gi);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
199 nav_print_NSML_AGLI(&pci->nsml_agli);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
200 nav_print_HLI(&pci->hli);
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
201 }
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
202
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
203 #endif
86
129ac4af16a4 Improve debugging output to help with debugging button activations.
jcdutton
parents: 76
diff changeset
204
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
205
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
206 /* Highlighting API calls */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
207
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
208 dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *this, int *button) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
209
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
210 if(!this || !button) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
211 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
212 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
213 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
214
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
215 /* Simply return the appropriate value based on the SPRM */
117
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
216 (*button) = this->position_current.button;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
217
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
218 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
219 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
220
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
221 static btni_t *get_current_button(dvdnav_t *this, pci_t *pci) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
222 int button = 0;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
223
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
224 if(!this || !pci) {
117
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
225 printerr("Passed a NULL pointer.");
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
226 return S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
227 }
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
228 if(!pci->hli.hl_gi.hli_ss) {
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
229 printerr("Not in a menu.");
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
230 return S_ERR;
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
231 }
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
232 if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
233 printerr("This NAV has already been left.");
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
234 return S_ERR;
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
235 }
117
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
236
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
237 button = this->vm->state.HL_BTNN_REG >> 10;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
238 #ifdef BUTTON_TESTING
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
239 nav_print_PCI(pci);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
240 #endif
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
241
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
242 return &(pci->hli.btnit[button-1]);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
243 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
244
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
245 static dvdnav_status_t button_auto_action(dvdnav_t *this, pci_t *pci) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
246 if (get_current_button(this, pci)->auto_action_mode)
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
247 return dvdnav_button_activate(this, pci);
29
c3c8b98d7e95 Enable auto action buttons.
jcdutton
parents: 26
diff changeset
248 }
c3c8b98d7e95 Enable auto action buttons.
jcdutton
parents: 26
diff changeset
249
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
250 dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *this, pci_t *pci) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
251 btni_t *button_ptr;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
252
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
253 if(!(button_ptr = get_current_button(this, pci)))
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
254 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
255
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
256 dvdnav_button_select(this, pci, button_ptr->up);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
257 button_auto_action(this, pci);
29
c3c8b98d7e95 Enable auto action buttons.
jcdutton
parents: 26
diff changeset
258
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
259 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
260 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
261
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
262 dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *this, pci_t *pci) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
263 btni_t *button_ptr;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
264
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
265 if(!(button_ptr = get_current_button(this, pci)))
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
266 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
267
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
268 dvdnav_button_select(this, pci, button_ptr->down);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
269 button_auto_action(this, pci);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
270
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
271 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
272 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
273
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
274 dvdnav_status_t dvdnav_right_button_select(dvdnav_t *this, pci_t *pci) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
275 btni_t *button_ptr;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
276
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
277 if(!(button_ptr = get_current_button(this, pci)))
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
278 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
279
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
280 dvdnav_button_select(this, pci, button_ptr->right);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
281 button_auto_action(this, pci);
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
282
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
283 return S_OK;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
284 }
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
285
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
286 dvdnav_status_t dvdnav_left_button_select(dvdnav_t *this, pci_t *pci) {
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
287 btni_t *button_ptr;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
288
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
289 if(!(button_ptr = get_current_button(this, pci)))
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
290 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
291
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
292 dvdnav_button_select(this, pci, button_ptr->left);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
293 button_auto_action(this, pci);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
294
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
295 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
296 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
297
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
298 dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode,
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
299 dvdnav_highlight_area_t *highlight) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
300 btni_t *button_ptr;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
301
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
302 #ifdef BUTTON_TESTING
76
0e2abe7083de more consistent console output
mroi
parents: 69
diff changeset
303 fprintf(MSG_OUT, "libdvdnav: Button get_highlight_area %i\n", button);
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
304 #endif
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
305
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
306 if(!nav_pci->hli.hl_gi.hli_ss)
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
307 return S_ERR;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
308 if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns))
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
309 return S_ERR;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
310
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
311
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
312 button_ptr = &nav_pci->hli.btnit[button-1];
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
313
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
314 highlight->sx = button_ptr->x_start;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
315 highlight->sy = button_ptr->y_start;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
316 highlight->ex = button_ptr->x_end;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
317 highlight->ey = button_ptr->y_end;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
318 if(button_ptr->btn_coln != 0) {
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
319 highlight->palette = nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode];
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
320 } else {
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
321 highlight->palette = 0;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
322 }
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
323 highlight->pts = nav_pci->hli.hl_gi.hli_s_ptm;
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
324 highlight->buttonN = button;
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
325 #ifdef BUTTON_TESTING
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
326 fprintf(MSG_OUT, "libdvdnav: highlight: Highlight area is (%u,%u)-(%u,%u), display = %i, button = %u\n",
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
327 button_ptr->x_start, button_ptr->y_start,
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
328 button_ptr->x_end, button_ptr->y_end,
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
329 1,
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
330 button);
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
331 #endif
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
332
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
333 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
334 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
335
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
336 dvdnav_status_t dvdnav_button_activate(dvdnav_t *this, pci_t *pci) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
337 int button;
26
794d2e16a4d4 Removed un-needed variables.
jcdutton
parents: 22
diff changeset
338 btni_t *button_ptr = NULL;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
339
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
340 if(!this || !pci) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
341 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
342 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
343 }
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
344 if(!pci->hli.hl_gi.hli_ss) {
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
345 printerr("Not in a menu.");
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
346 return S_ERR;
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
347 }
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
348 if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
349 printerr("This NAV has already been left.");
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
350 return S_ERR;
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
351 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
352
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
353 pthread_mutex_lock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
354
117
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
355 button = this->vm->state.HL_BTNN_REG >> 10;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
356
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
357 if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) {
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
358 /* Special code to handle still menus with no buttons.
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
359 * The navigation is expected to report to the application that a STILL is
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
360 * underway. In turn, the application is supposed to report to the user
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
361 * that the playback is paused. The user is then expected to undo the pause,
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
362 * ie: hit play. At that point, the navigation should release the still and
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
363 * go to the next Cell.
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
364 * Explanation by Mathieu Lacage <mathieu_lacage@realmagic.fr>
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
365 * Code added by jcdutton.
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
366 */
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
367 if (this->position_current.still != 0) {
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
368 /* In still, but no buttons. */
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
369 vm_get_next_cell(this->vm);
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
370 this->position_current.still = 0;
116
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
371 this->sync_wait = 0;
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
372 this->last_cmd_nav_lbn = pci->pci_gi.nv_pck_lbn;
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
373 pthread_mutex_unlock(&this->vm_lock);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
374 /* clear error message */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
375 printerr("");
57
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
376 return S_OK;
e1505b603eb8 Fix problem with Still menus that have NO BUTTONS.
jcdutton
parents: 42
diff changeset
377 }
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
378 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
379 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
380 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
381
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
382 button_ptr = get_current_button(this, pci);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
383 /* Finally, make the VM execute the appropriate code and probably
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
384 * scedule a jump */
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
385 #ifdef BUTTON_TESTING
76
0e2abe7083de more consistent console output
mroi
parents: 69
diff changeset
386 fprintf(MSG_OUT, "libdvdnav: Evaluating Button Activation commands.\n");
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
387 #endif
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
388 if(vm_exec_cmd(this->vm, &(button_ptr->cmd)) == 1) {
26
794d2e16a4d4 Removed un-needed variables.
jcdutton
parents: 22
diff changeset
389 /* Command caused a jump */
794d2e16a4d4 Removed un-needed variables.
jcdutton
parents: 22
diff changeset
390 this->vm->hop_channel++;
794d2e16a4d4 Removed un-needed variables.
jcdutton
parents: 22
diff changeset
391 this->position_current.still = 0;
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
392 this->last_cmd_nav_lbn = pci->pci_gi.nv_pck_lbn;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
393 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
394
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
395 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
396 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
397 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
398
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
399 dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *this, int32_t button, vm_cmd_t *cmd)
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
400 {
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
401 if(!this || !cmd) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
402 printerr("Passed a NULL pointer.");
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
403 return S_ERR;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
404 }
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
405
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
406 pthread_mutex_lock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
407 /* make the VM execute the appropriate code and probably
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
408 * schedule a jump */
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
409 #ifdef BUTTON_TESTING
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
410 fprintf(MSG_OUT, "libdvdnav: dvdnav_button_activate_cmd: Evaluating Button Activation commands.\n");
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
411 #endif
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
412 if(button > 0) {
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
413 this->vm->state.HL_BTNN_REG = (button << 10);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
414 if(vm_exec_cmd(this->vm, cmd) == 1) {
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
415 /* Command caused a jump */
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
416 this->vm->hop_channel++;
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
417 }
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
418 }
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
419 /* Always remove still, because some still menus have no buttons. */
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
420 this->position_current.still = 0;
116
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
421 this->sync_wait = 0;
91
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
422 pthread_mutex_unlock(&this->vm_lock);
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
423 return S_OK;
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
424 }
df9712507b30 Add a new API function, to allow for more flexible menu button control.
jcdutton
parents: 86
diff changeset
425
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
426 dvdnav_status_t dvdnav_button_select(dvdnav_t *this, pci_t *pci, int button) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
427
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
428 if(!this || !pci) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
429 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
430 return S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
431 }
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
432 if(!pci->hli.hl_gi.hli_ss) {
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
433 printerr("Not in a menu.");
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
434 return S_ERR;
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
435 }
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
436 if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
437 printerr("This NAV has already been left.");
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
438 return S_ERR;
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
439 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
440
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
441 #ifdef BUTTON_TESTING
76
0e2abe7083de more consistent console output
mroi
parents: 69
diff changeset
442 fprintf(MSG_OUT, "libdvdnav: Button select %i\n", button);
31
8b08ee66cbff Quiet please!!!
jcdutton
parents: 30
diff changeset
443 #endif
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
444
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
445 if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
446 printerr("Button does not exist.");
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
447 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
448 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
449
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 10
diff changeset
450 this->vm->state.HL_BTNN_REG = (button << 10);
64
2759605b41f6 We need to update the button info when moving around in menus.
mroi
parents: 57
diff changeset
451 this->position_current.button = -1; /* Force Highligh change */
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
452
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
453 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
454 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
455
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
456 dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *this, pci_t *pci,
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
457 int button) {
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
458 /* A trivial function */
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
459 if(dvdnav_button_select(this, pci, button) != S_ERR)
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
460 return dvdnav_button_activate(this, pci);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
461 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
462 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
463
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
464 dvdnav_status_t dvdnav_mouse_select(dvdnav_t *this, pci_t *pci, int x, int y) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
465 int button, cur_button;
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
466 int best,dist,d;
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
467 int mx,my,dx,dy;
69
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
468
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
469 if(!this || !pci) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
470 printerr("Passed a NULL pointer.");
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
471 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
472 }
166
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
473 if(!pci->hli.hl_gi.hli_ss) {
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
474 printerr("Not in a menu.");
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
475 return S_ERR;
3bfaec0c1288 * fix warnings with gcc 3.3
mroi
parents: 153
diff changeset
476 }
191
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
477 if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
478 printerr("This NAV has already been left.");
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
479 return S_ERR;
dbea22936623 when a command has been issued to leave a menu, filter all further commands
mroi
parents: 169
diff changeset
480 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
481
117
816d82ff7eed return the correct current hightlight
mroi
parents: 116
diff changeset
482 cur_button = this->vm->state.HL_BTNN_REG >> 10;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
483
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
484 best = 0;
69
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
485 dist = 0x08000000; /* >> than (720*720)+(567*567); */
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
486
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
487 /* Loop through all buttons */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
488 for(button = 1; button <= pci->hli.hl_gi.btn_ns; button++) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
489 btni_t *button_ptr = &(this->pci.hli.btnit[button-1]);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
490
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
491 if((x >= button_ptr->x_start) && (x <= button_ptr->x_end) &&
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
492 (y >= button_ptr->y_start) && (y <= button_ptr->y_end)) {
69
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
493 mx = (button_ptr->x_start + button_ptr->x_end)/2;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
494 my = (button_ptr->y_start + button_ptr->y_end)/2;
69
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
495 dx = mx - x;
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
496 dy = my - y;
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
497 d = (dx*dx) + (dy*dy);
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
498 /* If the mouse is within the button and the mouse is closer
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
499 * to the center of this button then it is the best choice. */
940b438a9c9f Modified version of button selection patch from
richwareham
parents: 67
diff changeset
500 if(d < dist) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
501 dist = d;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
502 best = button;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
503 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
504 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
505 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
506
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
507 /* As an efficiency measure, only re-select the button
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
508 * if it is different to the previously selected one. */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
509 if (best != 0 && best != cur_button)
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
510 dvdnav_button_select(this, pci, best);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
511
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
512 /* return S_OK only if we actually found a matching button */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
513 return best ? S_OK : S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
514 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
515
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
516 dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *this, pci_t *pci, int x, int y) {
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
517 /* A trivial function */
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 98
diff changeset
518 if(dvdnav_mouse_select(this, pci, x,y) != S_ERR)
98
457f35f43ba6 Improved DVD menu selection.
jcdutton
parents: 91
diff changeset
519 return dvdnav_button_activate(this, pci);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
520 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
521 }