Gostaria de implementar um código que ao usuário teclar para direita uma mídia seja abortada e outra apareça.
Autor: Paulo J S Júnior
Gostaria de implementar um código que ao usuário teclar para direita uma mídia seja abortada e outra apareça.
Autor: Paulo J S Júnior
Gostaríamos de lembrar aos possíveis interessados que o prazo de registro para participação no Concurso ITU-T de Aplicações para IPTV 2012 (IPTV Application Challenge) se encerra nesta semana, dia 15 de agosto de 2012. Já o prazo para a submissão de aplicações se encerra no dia 07 de setembro de 2012.
Gostaríamos de relembra-los de que há dois concursos de aplicações Ginga-NCL com inscrições ainda abertas. O convite é aberto a toda a comunidade de desenvolvedores de aplicações para o Middleware Ginga-NCL, em nível internacional. São os seguintes concursos:
2121 comentários
e verifique o exemplo 12 no link a seguir: www.ncl.org.br/exemplos/index_30.html Abrax
<bind component="opcao04_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_RIGHT"/>
</bind>
<bind component="opcao01_agenda" role="abort"/>
<bind component="opcao02_agenda" role="abort"/>
<bind component="opcao03_agenda" role="abort"/>
<bind component="opcao04_agenda" role="abort"/>
<bind component="opcao06_agenda" role="start"/>
<bind component="opcao07_agenda" role="start"/>
<bind component="opcao08_agenda" role="start"/>
<bind component="opcao05_agenda" role="start"/>
</link>
- Apenas 4 botões são visíveis (lado a lado horizontalmente). O telespectador pode navegar por esses quatro botões - assim você precisa de um esquema de foco entre eles;
- Quando o foco está no botão mais à esquerda, e o telespectador aperta a tecla para esquerda, os botões visíveis se deslocam para a direita, fazendo surgir um novo mais à esquerda;
- Idem para a direita. É isso? Peço confirmação porque pretendo fazer uma NCL para isso e postar. Carlos
<head>
<regionBase>
<region id="rgAPLICATIVO" left="0px" top="0px" width="640px" height="480px" zIndex="1">
<region id="regionD" left="0%" top="50%" width="97%" height="37%" zIndex="3">
<region id="regionD1" left="5%" top="15%" width="94%" height="84%" zIndex="4"/>
<region id="regionD2" left="6%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD3" left="29%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD4" left="52%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD5" left="75%" top="14%" width="23%" height="81%" zIndex="8"/> <region id="regionD6" left="6%" top="14%" width="23%" height="81%" zIndex="7"/>
<region id="regionD7" left="29%" top="14%" width="23%" height="81%" zIndex="7"/>
<region id="regionD8" left="52%" top="14%" width="23%" height="81%" zIndex="7"/>
<region id="regionD9" left="75%" top="14%" width="23%" height="81%" zIndex="7"/> <region id="regionD10" left="6%" top="14%" width="23%" height="81%" zIndex="6"/>
<region id="regionD11" left="29%" top="14%" width="23%" height="81%" zIndex="6"/>
<region id="regionD12" left="52%" top="14%" width="23%" height="81%" zIndex="6"/>
<region id="regionD13" left="75%" top="14%" width="23%" height="81%" zIndex="6"/> <region id="regionD15" left="7%" top="14%" width="24%" height="81%" zIndex="6"/>
<region id="regionD16" left="32%" top="14%" width="67%" height="81%" zIndex="6"/> </region> </region>
</regionBase>
<descriptorBase>
<descriptor id="dscptD2" region="regionD2" focusIndex="1" moveLeft="4" moveRight="2" focusBorderWidth="-5" focusBorderColor="aqua">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD3" region="regionD3" focusIndex="2" moveLeft="1" moveRight="3" focusBorderWidth="-5" focusBorderColor="yellow">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD4" region="regionD4" focusIndex="3" moveLeft="2" moveRight="4" focusBorderWidth="-5" focusBorderColor="aqua">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD5" region="regionD5" focusIndex="4" moveLeft="3" moveRight="1" focusBorderWidth="-5" focusBorderColor="yellow">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
</descriptorBase> <connectorBase>
<causalConnector id="onSelectionAbortStart">
<connectorParam name="keyCode"/>
<simpleCondition role="onSelection" key="$keyCode" />
<compoundAction operator="seq">
<simpleAction role="abort" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector>
</connectorBase>
</head> <body> <port id="pInicio13" component="opcao01_agenda" />
<port id="pInicio14" component="opcao02_agenda" />
<port id="pInicio15" component="opcao03_agenda" />
<port id="pInicio16" component="opcao04_agenda" /> <media type="text/html" id="opcao01_agenda" src="textos/jan2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao02_agenda" src="textos/fev2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao03_agenda" src="textos/mar2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao04_agenda" src="textos/abr2008.html" descriptor="dscptD5" />
<media type="text/html" id="opcao05_agenda" src="textos/mai2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao06_agenda" src="textos/jun2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao07_agenda" src="textos/jul2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao08_agenda" src="textos/ago2008.html" descriptor="dscptD5" />
<media type="text/html" id="opcao09_agenda" src="textos/set2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao010_agenda" src="textos/out2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao011_agenda" src="textos/nov2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao012_agenda" src="textos/dez2008.html" descriptor="dscptD5" /> <link id="Voltar_agenda1" xconnector="onSelectionAbortStart">
<bind component="opcao04_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_RIGHT"/>
</bind>
<bind component="opcao01_agenda" role="abort"/>
<bind component="opcao02_agenda" role="abort"/>
<bind component="opcao03_agenda" role="abort"/>
<bind component="opcao04_agenda" role="abort"/>
<bind component="opcao05_agenda" role="start"/>
<bind component="opcao06_agenda" role="start"/>
<bind component="opcao07_agenda" role="start"/>
<bind component="opcao08_agenda" role="start"/>
</link> <link id="Voltar_agenda5" xconnector="onSelectionAbortStart">
<bind component="opcao08_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_RIGHT"/>
</bind>
<bind component="opcao05_agenda" role="abort"/>
<bind component="opcao06_agenda" role="abort"/>
<bind component="opcao07_agenda" role="abort"/>
<bind component="opcao08_agenda" role="abort"/>
<bind component="opcao09_agenda" role="start"/>
<bind component="opcao010_agenda" role="start"/>
<bind component="opcao011_agenda" role="start"/>
<bind component="opcao012_agenda" role="start"/>
</link> <link id="Voltar_agenda9" xconnector="onSelectionAbortStart">
<bind component="opcao09_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_LEFT"/>
</bind>
<bind component="opcao05_agenda" role="abort"/>
<bind component="opcao06_agenda" role="abort"/>
<bind component="opcao07_agenda" role="abort"/>
<bind component="opcao08_agenda" role="abort"/>
<bind component="opcao01_agenda" role="start"/>
<bind component="opcao02_agenda" role="start"/>
<bind component="opcao03_agenda" role="start"/>
<bind component="opcao04_agenda" role="start"/>
</link> <link id="Voltar_agenda13" xconnector="onSelectionAbortStart">
<bind component="opcao05_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_LEFT"/>
</bind>
<bind component="opcao09_agenda" role="abort"/>
<bind component="opcao10_agenda" role="abort"/>
<bind component="opcao11_agenda" role="abort"/>
<bind component="opcao12_agenda" role="abort"/>
<bind component="opcao05_agenda" role="start"/>
<bind component="opcao06_agenda" role="start"/>
<bind component="opcao07_agenda" role="start"/>
<bind component="opcao08_agenda" role="start"/>
</link> </body> </ncl>
<head>
<regionBase>
<region id="rgAPLICATIVO" left="0px" top="0px" width="640px" height="480px" zIndex="1">
<region id="regionD" left="0%" top="50%" width="97%" height="37%" zIndex="3">
<region id="regionD2" left="6%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD3" left="29%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD4" left="52%" top="14%" width="23%" height="81%" zIndex="8"/>
<region id="regionD5" left="75%" top="14%" width="23%" height="81%" zIndex="8"/> </region> </region>
</regionBase>
<descriptorBase>
<descriptor id="dscptD2" region="regionD2" focusIndex="1" moveLeft="4" moveRight="2" focusBorderWidth="-5" focusBorderColor="aqua">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD3" region="regionD3" focusIndex="2" moveLeft="1" moveRight="3" focusBorderWidth="-5" focusBorderColor="yellow">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD4" region="regionD4" focusIndex="3" moveLeft="2" moveRight="4" focusBorderWidth="-5" focusBorderColor="aqua">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
<descriptor id="dscptD5" region="regionD5" focusIndex="4" moveLeft="3" moveRight="1" focusBorderWidth="-5" focusBorderColor="yellow">
<descriptorParam name="transparency" value="1"/>
<descriptorParam name="border" value="none" />
</descriptor>
</descriptorBase> <connectorBase>
<causalConnector id="onKeySelectionAbort">
<connectorParam name="keyCode"/>
<simpleCondition role="onSelection" key="$keyCode" />
<simpleAction role="abort" max="unbounded" qualifier="par"/>
</causalConnector> <causalConnector id="onAbortAbortStart">
<simpleCondition role="onAbort"/>
<compoundAction operator="seq"/>
<simpleAction role="abort" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector> </connectorBase>
</head> <body>
<port id="pStartDocument" component="submenu1" /> <context id="submenu1">
<port id="sub1op1" component="opcao01_agenda"/>
<port id="sub1op2" component="opcao02_agenda"/>
<port id="sub1op3" component="opcao03_agenda"/>
<port id="sub1op4" component="opcao04_agenda"/>
<media type="text/html" id="opcao01_agenda" src="textos/jan2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao02_agenda" src="textos/fev2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao03_agenda" src="textos/mar2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao04_agenda" src="textos/abr2008.html" descriptor="dscptD5" /> <link id="RIGHT_agenda1" xconnector="onKeySelectionAbort">
<bind component="opcao04_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_RIGHT"/>
</bind>
<bind component="opcao04_agenda" role="abort"/>
</link> </context> <context id="submenu2">
<port id="sub2op1" component="opcao05_agenda"/>
<port id="sub2op2" component="opcao06_agenda"/>
<port id="sub2op3" component="opcao07_agenda"/>
<port id="sub2op4" component="opcao08_agenda"/>
<media type="text/html" id="opcao05_agenda" src="textos/mai2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao06_agenda" src="textos/jun2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao07_agenda" src="textos/jul2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao08_agenda" src="textos/ago2008.html" descriptor="dscptD5" /> <link id="LEFT_agenda2" xconnector="onKeySelectionAbort">
<bind component="opcao05_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_LEFT"/>
</bind>
<bind component="opcao05_agenda" role="abort"/>
</link> <link id="RIGHT_agenda2" xconnector="onKeySelectionAbort">
<bind component="opcao08_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_RIGHT"/>
</bind>
<bind component="opcao08_agenda" role="abort"/>
</link> </context> <context id="submenu3">
<port id="sub3op1" component="opcao09_agenda"/>
<port id="sub3op2" component="opcao10_agenda"/>
<port id="sub3op3" component="opcao11_agenda"/>
<port id="sub3op4" component="opcao12_agenda"/>
<media type="text/html" id="opcao09_agenda" src="textos/set2008.html" descriptor="dscptD2" />
<media type="text/html" id="opcao010_agenda" src="textos/out2008.html" descriptor="dscptD3" />
<media type="text/html" id="opcao011_agenda" src="textos/nov2008.html" descriptor="dscptD4" />
<media type="text/html" id="opcao012_agenda" src="textos/dez2008.html" descriptor="dscptD5" /> <link id="LEFT_agenda3" xconnector="onKeySelectionAbort">
<bind component="opcao09_agenda" role="onSelection">
<bindParam name="keyCode" value="CURSOR_LEFT"/>
</bind>
<bind component="opcao09_agenda" role="abort"/>
</link> </context> <link id="agenda1_para_agenda2" xconnector="onAbortAbortStart">
<bind component="submenu1" interface="sub1op4" role="onAbort"/>
<bind component="submenu1" role="abort"/>
<bind component="submenu2" role="abort"/>
</link> <link id="agenda2_para_agenda1" xconnector="onAbortAbortStart">
<bind component="submenu2" interface="sub2op1" role="onAbort"/>
<bind component="submenu2" role="abort"/>
<bind component="submenu1" role="abort"/>
</link> <link id="agenda2_para_agenda3" xconnector="onAbortAbortStart">
<bind component="submenu2" interface="sub2op4" role="onAbort"/>
<bind component="submenu2" role="abort"/>
<bind component="submenu3" role="abort"/>
</link> <link id="agenda3_para_agenda2" xconnector="onAbortAbortStart">
<bind component="submenu3" interface="sub3op1" role="onAbort"/>
<bind component="submenu3" role="abort"/>
<bind component="submenu2" role="abort"/>
</link>
</body> </ncl> === Explicação geral === Organizei seus três blocos de botões em três contextos: submenu1, submenu2 e submenu3. Dentro de cada submenu, capturo o deslocamento de um submenu para outro (LEFT ou RIGHT) parando apenas o respectivo botão (o primeiro ou o quarto). Isso é importante para eu saber no submenu2 quando devo migrar para o submenu1 ou submenu3. Foi no contexto externo que coloquei o elo que pára cada submenu e alterna para o vizinho. Utilizei o onAbort e não stop porque havia feito isso no exemplo inicial. Nesse caso, faz mais sentido utilizar o stop já que não há laços de repetição e aparentemente nada que justifique o uso de abort. Carlos
<simpleCondition role="onAbort"/>
<compoundAction operator="seq"/>
<simpleAction role="abort" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector> mas com isto a lógica não funcionará. Estava acontecendo isto no exemplo que postei. Atenciosamente, Paulo.
<connectorParam name="value"/>
<connectorParam name="keyCode"/> <compoundCondition operator="and">
<simpleCondition role="onSelection" key="$keyCode"/>
<assessmentStatement comparator="eq">
<attributeAssessment role="attNodeTest" eventType="attribution" attributeType="nodeProperty"/>
<valueAssessment value="$value"/>
</assessmentStatement>
</compoundCondition> <simpleAction role="abort" max="unbounded" qualifier="par"/>
</causalConnector> (Editei direto aqui, avise-me se algum erro de sintaxe). 3) Precisa mudar os elos dentro dos contextos com os submenus e adicionar mais um teste para o currentFocus. Exemplo: supondo que seu nó de mídia (<media>) do tipo settings tiver o id "mySettings" (e tenha a propriedade currentFocus). O elo do contexto "submenu1" teria mais um bind assim: <link xconnector="onKeySelectionAttNodeTestAbort">
(...)
<bind role="attNodeTest" component="mySettings" interface="currentFocus">
<bindParam name="value" value="4"/>
</bind>
</link> Poderia postar o resultado final?
Carlos