Author: remi
Date: 2008-08-16 10:48:36 +0200 (Sat, 16 Aug 2008)
New Revision: 1511

Modified:
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneCmdConf.java
   software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
Log:
* The blocks can now be tested and validated. The block length is defined on 
the validation process.

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneCmdConf.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneCmdConf.java
 2008-08-16 08:24:19 UTC (rev 1510)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneCmdConf.java
 2008-08-16 08:48:36 UTC (rev 1511)
@@ -7,6 +7,7 @@
 import javax.swing.*;
 import javax.swing.border.LineBorder;
 
+import com.tuxisalive.api.TuxAPIConst;
 import com.tuxisalive.attitunes.*;
 import com.tuxisalive.attitunes.format.*;
 import com.tuxisalive.attitunes.visual.*;
@@ -27,8 +28,8 @@
        private static JLabel labelText;
        private static JLabel labelPitch;
        private static JLabel labelLocutor;
+       private static JLabel labelNumberQT;
        
-       private static JSlider jSliderCount;
        private static JSpinner jSpinnerCount;
        private static JSlider jSliderSpeed;
        private static JComboBox jComboBoxLocutors;
@@ -48,8 +49,8 @@
                labelText = new JLabel(ATTMessages.getString("BlockConf.5"));
                labelPitch = new JLabel(ATTMessages.getString("BlockConf.6"));
                labelLocutor = new JLabel(ATTMessages.getString("BlockConf.7"));
+               labelNumberQT = new 
JLabel(ATTMessages.getString("BlockConf.8"));
                
-               jSliderCount = new JSlider();
                jSliderSpeed = new JSlider();
            SpinnerModel model = new SpinnerNumberModel(2, 1, 255, 1);
            jSpinnerCount = new JSpinner(model);
@@ -67,7 +68,12 @@
            jTextAreaTTS.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, 
false));
        }
        
-       
+       /**
+        * 
+        * @param attBlockViewer
+        * @param myPanel
+        * @param cmd
+        */
        public static void showBlockConf(ATTBlockViewer attBlockViewer, JPanel 
myPanel, String cmd)
        {
                if 
(cmd.equals((String)attBlockViewer.getFocusedBlock().getFunctionParams().get("cmd")))
@@ -254,6 +260,10 @@
                }
        }
        
+       /**
+        * 
+        * @param attBlockViewer
+        */
        public static void testBlockConf(ATTBlockViewer attBlockViewer)
        {
                if (selectedStruct == null)
@@ -325,11 +335,11 @@
                }
                else if (cmd.equals("spinl_on"))
                {
-                       //testBlockSpinLOn(attBlockViewer);
+                       testBlockSpinLOn(attBlockViewer);
                }
                else if (cmd.equals("spinr_on"))
                {
-                       //testBlockSpinROn(attBlockViewer);
+                       testBlockSpinROn(attBlockViewer);
                }
                else if (cmd.equals("tts_play"))
                {
@@ -353,6 +363,135 @@
                }
        }
        
+       /**
+        * 
+        * @param attBlockViewer
+        */
+       public static void validateBlockConf(ATTBlockViewer attBlockViewer)
+       {
+               if (selectedStruct == null)
+               {
+                       return;
+               }
+               
+               String cmd = (String)selectedStruct.get("cmd");
+
+               if (cmd.equals("leds_on"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("ledl_on"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("ledr_on"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("leds_off"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("ledl_off"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("ledr_off"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("leds_blink"))
+               {
+                       validateBlockLedBlink(attBlockViewer);
+               }
+               else if (cmd.equals("mouth_on"))
+               {
+                       validateBlockMouthOn(attBlockViewer);
+               }
+               else if (cmd.equals("mouth_open"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("mouth_close"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("eyes_on"))
+               {
+                       validateBlockEyesOn(attBlockViewer);
+               }
+               else if (cmd.equals("eyes_open"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("eyes_close"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("sound_play"))
+               {
+                       validateBlockSoundPlay(attBlockViewer);
+               }
+               else if (cmd.equals("wav_play"))
+               {
+                       validateBlockWavPlay(attBlockViewer);
+               }
+               else if (cmd.equals("spinl_on"))
+               {
+                       validateBlockSpinLOn(attBlockViewer);
+               }
+               else if (cmd.equals("spinr_on"))
+               {
+                       validateBlockSpinROn(attBlockViewer);
+               }
+               else if (cmd.equals("tts_play"))
+               {
+                       validateBlockTTS(attBlockViewer);
+               }
+               else if (cmd.equals("wings_on"))
+               {
+                       validateBlockWingsOn(attBlockViewer);
+               }
+               else if (cmd.equals("wings_up"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else if (cmd.equals("wings_down"))
+               {
+                       validateBlockNoParam(attBlockViewer);
+               }
+               else
+               {
+                       return;
+               }
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block without parameters
+        * 
---------------------------------------------------------------------- */
+       private static void showBlockNoParam(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
+       {
+               myPanel.add(labelNoParameters, new GridBagConstraints(1, 0, 1, 
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
+       }
+       
+       private static void testBlockNoParam(ATTBlockViewer attBlockViewer)
+       {
+               ATTBlock block = new ATTBlock(0);
+               block.setFunctionParams(selectedStruct);
+               attBlockViewer.playBlock(block);
+       }
+       
+       private static void validateBlockNoParam(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.playBlock(attBlockViewer.getFocusedBlock());
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block leds blink
+        * 
---------------------------------------------------------------------- */
        private static void showBlockLedBlink(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
@@ -375,18 +514,24 @@
                attBlockViewer.playBlock(block);
        }
        
-       private static void showBlockNoParam(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
+       private static void validateBlockLedBlink(ATTBlockViewer attBlockViewer)
        {
-               myPanel.add(labelNoParameters, new GridBagConstraints(1, 0, 1, 
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", 
((Integer)jSpinnerCount.getValue()).doubleValue());
+               selectedStruct.put("speed", 
((Integer)jSliderSpeed.getValue()).doubleValue());
+               Double length = 
((Integer)jSpinnerCount.getValue()).doubleValue() * 
+                       ((Integer)jSliderSpeed.getValue()).doubleValue() * 
0.002;
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+               attBlockViewer.playBlock(attBlockViewer.getFocusedBlock());
        }
        
-       private static void testBlockNoParam(ATTBlockViewer attBlockViewer)
-       {
-               ATTBlock block = new ATTBlock(0);
-               block.setFunctionParams(selectedStruct);
-               attBlockViewer.playBlock(block);
-       }
-       
+       /* 
-------------------------------------------------------------------------
+        * Block mouth on
+        * 
---------------------------------------------------------------------- */
        private static void showBlockMouthOn(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
@@ -403,6 +548,23 @@
                attBlockViewer.playBlock(block);
        }
        
+       private static void validateBlockMouthOn(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", 
((Integer)jSpinnerCount.getValue()));
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               Double ct = new Date().getTime() / 1000.0;
+               attBlockViewer.tux.mouth.on((Integer)jSpinnerCount.getValue(), 
TuxAPIConst.SSV_NDEF);
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block eyes on
+        * 
---------------------------------------------------------------------- */
        private static void showBlockEyesOn(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
@@ -419,6 +581,23 @@
                attBlockViewer.playBlock(block);
        }
        
+       private static void validateBlockEyesOn(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", 
((Integer)jSpinnerCount.getValue()));
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               Double ct = new Date().getTime() / 1000.0;
+               attBlockViewer.tux.eyes.on((Integer)jSpinnerCount.getValue(), 
TuxAPIConst.SSV_NDEF);
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block wings on
+        * 
---------------------------------------------------------------------- */
        private static void showBlockWingsOn(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
@@ -435,6 +614,23 @@
                attBlockViewer.playBlock(block);
        }
        
+       private static void validateBlockWingsOn(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", 
((Integer)jSpinnerCount.getValue()));
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               Double ct = new Date().getTime() / 1000.0;
+               
attBlockViewer.tux.flippers.on((Integer)jSpinnerCount.getValue(), 
TuxAPIConst.SSV_NDEF);
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block sound flash play
+        * 
---------------------------------------------------------------------- */
        private static void showBlockSoundPlay(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelSoundIndex, new GridBagConstraints(1, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
@@ -451,6 +647,24 @@
                attBlockViewer.playBlock(block);
        }
        
+       private static void validateBlockSoundPlay(ATTBlockViewer 
attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("index", (Integer)jSpinnerCount.getValue());
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               Double ct = new Date().getTime() / 1000.0;
+               
attBlockViewer.tux.soundFlash.play((Integer)jSpinnerCount.getValue());
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               attBlockViewer.getFocusedBlock().closeWaveFile();
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block sound wave play
+        * 
---------------------------------------------------------------------- */
        private static void showBlockWavPlay(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
                myPanel.add(labelWaveName, new GridBagConstraints(1, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
@@ -474,9 +688,24 @@
                attBlockViewer.playBlock(block);
        }
        
+       private static void validateBlockWavPlay(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               String wavFile = 
attBlockViewer.attituneFile.getWaveFile((String)jComboBoxWavs.getSelectedItem());
+               
+               selectedStruct.put("wav_name", 
(String)jComboBoxWavs.getSelectedItem());
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               attBlockViewer.getFocusedBlock().loadWaveFile(wavFile);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block spinning left
+        * 
---------------------------------------------------------------------- */
        private static void showBlockSpinLOn(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
-               myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
+               myPanel.add(labelNumberQT, new GridBagConstraints(1, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
                myPanel.add(labelSpeed, new GridBagConstraints(1, 1, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
                
jSpinnerCount.getModel().setValue((Integer)selectedStruct.get("count"));
                myPanel.add(jSpinnerCount, new GridBagConstraints(3, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
@@ -486,9 +715,40 @@
                myPanel.add(jSliderSpeed, new GridBagConstraints(3, 1, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
        }
        
+       private static void testBlockSpinLOn(ATTBlockViewer attBlockViewer)
+       {
+               ATTBlock block = new ATTBlock(0);
+               
+               selectedStruct.put("count", (Integer)jSpinnerCount.getValue());
+               selectedStruct.put("speed", (Integer)jSliderSpeed.getValue());
+               block.setFunctionParams(selectedStruct);
+               attBlockViewer.playBlock(block);
+       }
+       
+       private static void validateBlockSpinLOn(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", (Integer)jSpinnerCount.getValue());
+               selectedStruct.put("speed", (Integer)jSliderSpeed.getValue());
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               
+               Double ct = new Date().getTime() / 1000.0;
+               Double turns = (Integer)jSpinnerCount.getValue() / 4.0;
+               attBlockViewer.tux.spinning.leftOn(turns, 
(Integer)jSliderSpeed.getValue());
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block spinning right
+        * 
---------------------------------------------------------------------- */
        private static void showBlockSpinROn(ATTBlockViewer attBlockViewer, 
JPanel myPanel)
        {
-               myPanel.add(labelCount, new GridBagConstraints(1, 0, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
+               myPanel.add(labelNumberQT, new GridBagConstraints(1, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
                myPanel.add(labelSpeed, new GridBagConstraints(1, 1, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 
0, 0), 0, 0));
                
jSpinnerCount.getModel().setValue((Integer)selectedStruct.get("count"));
                myPanel.add(jSpinnerCount, new GridBagConstraints(3, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
@@ -498,6 +758,37 @@
                myPanel.add(jSliderSpeed, new GridBagConstraints(3, 1, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
        }
        
+       private static void testBlockSpinROn(ATTBlockViewer attBlockViewer)
+       {
+               ATTBlock block = new ATTBlock(0);
+               
+               selectedStruct.put("count", (Integer)jSpinnerCount.getValue());
+               selectedStruct.put("speed", (Integer)jSliderSpeed.getValue());
+               block.setFunctionParams(selectedStruct);
+               attBlockViewer.playBlock(block);
+       }
+       
+       private static void validateBlockSpinROn(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               selectedStruct.put("count", (Integer)jSpinnerCount.getValue());
+               selectedStruct.put("speed", (Integer)jSliderSpeed.getValue());
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               
+               Double ct = new Date().getTime() / 1000.0;
+               Double turns = (Integer)jSpinnerCount.getValue() / 4.0;
+               attBlockViewer.tux.spinning.rightOn(turns, 
(Integer)jSliderSpeed.getValue());
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
+       
+       /* 
-------------------------------------------------------------------------
+        * Block TTS
+        * 
---------------------------------------------------------------------- */
        private static void showBlockTTS(ATTBlockViewer attBlockViewer, JPanel 
myPanel)
        {
                myPanel.add(labelLocutor, new GridBagConstraints(1, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
@@ -508,6 +799,7 @@
                jComboBoxLocutors.setModel(jComboBox1Model);
                String currLocutor = ATTBlockParams.LOCUTOR_NAMES_LIST 
[(Integer)selectedStruct.get("speaker") - 1];
                currLocutor = currLocutor.replace("8k", "");
+               jComboBoxLocutors.setSelectedItem(currLocutor);
                myPanel.add(jComboBoxLocutors, new GridBagConstraints(3, 0, 1, 
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
        
                
jSpinnerPitch.getModel().setValue((Integer)selectedStruct.get("pitch"));
@@ -529,4 +821,28 @@
                block.setFunctionParams(selectedStruct);
                attBlockViewer.playBlock(block);
        }
+       
+       private static void validateBlockTTS(ATTBlockViewer attBlockViewer)
+       {
+               Double position = 
attBlockViewer.getFocusedBlock().getPosition();
+               
+               String spkName = (String)jComboBoxLocutors.getSelectedItem() + 
"8k";
+               Integer speaker = 
Arrays.asList(ATTBlockParams.LOCUTOR_NAMES_LIST).indexOf(spkName) + 1;
+               selectedStruct.put("speaker", speaker);
+               selectedStruct.put("pitch", (Integer)jSpinnerPitch.getValue());
+               selectedStruct.put("text", jTextAreaTTS.getText());
+               attBlockViewer.updateBlock(attBlockViewer.getFocusedBlock(), 
selectedStruct);
+               
+               Double ct = new Date().getTime() / 1000.0;
+               attBlockViewer.tux.tts.speak(
+                               jTextAreaTTS.getText(), 
+                               (String)jComboBoxLocutors.getSelectedItem(), 
+                               (Integer)jSpinnerPitch.getValue());
+               
attBlockViewer.tux.soundFlash.play((Integer)jSpinnerCount.getValue());
+               Double length = (new Date().getTime() / 1000.0) - ct;
+               
+               attBlockViewer.getFocusedBlock().setLength(length);
+               attBlockViewer.getFocusedBlock().setPosition(position);
+               attBlockViewer.repaint();
+       }
 }

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
===================================================================
--- software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-16 08:24:19 UTC (rev 1510)
+++ software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-16 08:48:36 UTC (rev 1511)
@@ -366,6 +366,12 @@
                                                jButtonValidateBlock = new 
JButton();
                                                
jPanelBlockAction.add(jButtonValidateBlock, new GridBagConstraints(3, 0, 1, 1, 
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 0), 0, 0));
                                                
jButtonValidateBlock.setText(ATTMessages.getString("MainFrame.102"));
+                                               
jButtonValidateBlock.addMouseListener(new MouseAdapter() {
+                                                       public void 
mousePressed(MouseEvent evt)
+                                                       {
+                                                               
onValidateBlockMouseClicked(evt);
+                                                       }
+                                               });
                                        }
                                }
                        }
@@ -729,6 +735,14 @@
                AttituneCmdConf.testBlockConf(attBlockViewer);
        }
        
+       /*
+        * Event on validating block button
+        */
+       private void onValidateBlockMouseClicked(MouseEvent evt)
+       {       
+               AttituneCmdConf.validateBlockConf(attBlockViewer);
+       }
+       
        /* 
------------------------------------------------------------------------
         * Blocks viewer events
         * 
--------------------------------------------------------------------- */

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
     2008-08-16 08:24:19 UTC (rev 1510)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
     2008-08-16 08:48:36 UTC (rev 1511)
@@ -30,6 +30,7 @@
 BlockConf.5=Text to speak :
 BlockConf.6=Pitch :
 BlockConf.7=Locutor :
+BlockConf.8=Number of quarter of turn :
 AttitunePropertiesFrame.1=Attitunes studio - Properties
 AttitunePropertiesFrame.55=The parameters marked as red color are missing.
 AttitunePropertiesFrame.56=Name :

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
  2008-08-16 08:24:19 UTC (rev 1510)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
  2008-08-16 08:48:36 UTC (rev 1511)
@@ -30,6 +30,7 @@
 BlockConf.5=Texte � lire :
 BlockConf.6=Pitch :
 BlockConf.7=Locuteur :
+BlockConf.8=Nombre de quarts de tours :
 AttitunePropertiesFrame.1=Attitunes studio - Propri�t�s
 AttitunePropertiesFrame.55=Les param�tres marqu�s en rouge sont manquant.
 AttitunePropertiesFrame.56=Nom :

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
      2008-08-16 08:24:19 UTC (rev 1510)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
      2008-08-16 08:48:36 UTC (rev 1511)
@@ -1375,7 +1375,9 @@
                Hashtable<Object,Object> varStruct = new 
Hashtable<Object,Object>();
                Hashtable<Object,Object> varResult = new 
Hashtable<Object,Object>();
                
+               tux.access.acquire(TuxAPIConst.ACCESS_PRIORITY_CRITICAL);
                tux.server.request(cmd, varStruct, varResult, false);
+               tux.access.release();
        }
        
        /**


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to