voxforge.org
VoxForge Dev

Changeset 2252

Show
Ignore:
Timestamp:
08/13/07 16:17:15 (1 year ago)
Author:
kmaclean
Message:

cleanup of Speech Submission program

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/CapturePlayback.java

    r2245 r2252  
    342342        // !!!!!! 
    343343   
    344 System.err.println("CapturePlayback's WAV file for recording is: " + wavFile); 
    345 System.err.println("CapturePlayback's WAV file for recording wavFile1 is:" + wavFile1); 
    346 System.err.println("CapturePlayback's WAV file for recording wavFile2 is:" + wavFile2); 
    347 System.err.println("CapturePlayback's WAV file for recording wavFile3 is:" + wavFile3); 
    348 System.err.println("CapturePlayback's WAV file for recording wavFile4 is:" + wavFile4); 
    349 System.err.println("CapturePlayback's WAV file for recording wavFile5 is:" + wavFile5); 
    350 System.err.println("CapturePlayback's WAV file for recording uploadWavFile1 is:" + uploadWavFile1); 
    351 System.err.println("CapturePlayback's WAV file for recording uploadWavFile2 is:" + uploadWavFile2); 
    352 System.err.println("CapturePlayback's WAV file for recording uploadWavFile3 is:" + uploadWavFile3); 
    353 System.err.println("CapturePlayback's WAV file for recording uploadWavFile4 is:" + uploadWavFile4); 
    354 System.err.println("CapturePlayback's WAV file for recording uploadWavFile5 is:" + uploadWavFile5); 
     344               System.err.println("CapturePlayback's WAV file for recording is: " + wavFile); 
     345               System.err.println("CapturePlayback's WAV file for recording wavFile1 is:" + wavFile1); 
     346               System.err.println("CapturePlayback's WAV file for recording wavFile2 is:" + wavFile2); 
     347               System.err.println("CapturePlayback's WAV file for recording wavFile3 is:" + wavFile3); 
     348               System.err.println("CapturePlayback's WAV file for recording wavFile4 is:" + wavFile4); 
     349               System.err.println("CapturePlayback's WAV file for recording wavFile5 is:" + wavFile5); 
     350               System.err.println("CapturePlayback's WAV file for recording uploadWavFile1 is:" + uploadWavFile1); 
     351               System.err.println("CapturePlayback's WAV file for recording uploadWavFile2 is:" + uploadWavFile2); 
     352               System.err.println("CapturePlayback's WAV file for recording uploadWavFile3 is:" + uploadWavFile3); 
     353               System.err.println("CapturePlayback's WAV file for recording uploadWavFile4 is:" + uploadWavFile4); 
     354               System.err.println("CapturePlayback's WAV file for recording uploadWavFile5 is:" + uploadWavFile5); 
    355355        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 
    356356        //setLayout(new GridBagLayout()); 
     
    364364        p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); 
    365365 
    366 // !!!!!! 
    367         // "SUBJECT" FOR MOODLE - IF NEEDED 
    368 /*        if(subject != null) { // Will be non-null if passed in as a param - even if blank 
    369             JPanel subjPanel = new JPanel(); //new GridLayout(1, 2)); 
    370             subjPanel.setLayout(new BoxLayout(subjPanel, BoxLayout.X_AXIS)); 
    371             subjPanel.setBorder(new EmptyBorder(10,5,5,5)); 
    372             subjPanel.add(new JLabel("Subject:")); 
    373             subjPanel.add(subjectBox = new JTextField(subject, 25)); 
    374             p2.add(subjPanel); 
    375         } 
    376 */ 
    377 //      this should be removed 
    378         JPanel subjPanel = new JPanel(); //new GridLayout(1, 2)); 
    379         subjPanel.setLayout(new BoxLayout(subjPanel, BoxLayout.X_AXIS)); 
    380         subjPanel.setBorder(new EmptyBorder(10,5,5,5)); 
    381         subjPanel.add(new JLabel("Subject:")); 
    382         subjPanel.add(subjectBox = new JTextField(subject, 50)); 
    383 // but it used somewhere ... 
    384          
    385         /* !!!!!! 
    386         JPanel compressionPanel = new JPanel(); 
    387         compressionPanel.add(new JLabel("Compression:")); 
    388         String[] compModes = {comp1, comp2, comp3}; 
    389         compressionPanel.add(compressionChooser = new JComboBox(compModes)); 
    390         compressionChooser.setSelectedIndex(compressionMode - 1); 
    391         compressionChooser.addActionListener(new ActionListener(){ 
    392                  public void actionPerformed(ActionEvent e){ 
    393                      String choice = (String)compressionChooser.getSelectedItem(); 
    394                      if(choice.equals(comp1)){ 
    395                          compressionMode = 1; 
    396                      }else if(choice.equals(comp2)){ 
    397                          compressionMode = 2; 
    398                      }else if(choice.equals(comp3)){ 
    399                          compressionMode = 3; 
    400                      } 
    401                  } 
    402                  }); 
    403         p2.add(compressionPanel); 
    404 */ 
    405 // ############ User name ####################################              
    406 // userName is read when user clicks Upload 
    407         JPanel usernamePanel = new JPanel(); 
    408         usernamePanel.setLayout(new FlowLayout(FlowLayout.LEFT));   
    409         usernamePanel.add(new JLabel("Username:")); 
    410         usernamePanel.add(usernameTextField = new JTextField(20)); 
    411  //       usernameTextField.setText("hello world"); 
    412         p2.add(usernamePanel);  
    413366// ############ Gender ####################################              
    414367        JPanel genderPanel = new JPanel(); 
    415         genderPanel.setLayout(new FlowLayout(FlowLayout.LEFT));         
     368        genderPanel.setLayout(new FlowLayout(FlowLayout.CENTER));         
    416369        genderPanel.add(new JLabel("Gender:")); 
    417370        String[] genderSelection = {male, female}; 
     
    431384// ############ Age Range ####################################              
    432385        JPanel ageRangePanel = new JPanel(); 
    433         ageRangePanel.setLayout(new FlowLayout(FlowLayout.LEFT));   
     386        ageRangePanel.setLayout(new FlowLayout(FlowLayout.CENTER));   
    434387        ageRangePanel.add(new JLabel("Age Range:")); 
    435388        String[] ageSelection = {youth, adult, senior}; 
     
    451404//      ############ Pronunciation Dialect: ####################################        
    452405        JPanel dialectPanel = new JPanel(); 
    453         dialectPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); 
     406        dialectPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 
    454407        dialectPanel.add(new JLabel("Pronunciation Dialect:")); 
    455408        String[] dialectSelection = {australian, american, british, canadian, european, newzealand, southafrican, otherDialect}; 
     
    481434//      ############ Microphone Type: ####################################        
    482435        JPanel microphonePanel = new JPanel(); 
    483         microphonePanel.setLayout(new FlowLayout(FlowLayout.LEFT)); 
     436        microphonePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 
    484437        microphonePanel.add(new JLabel("Microphone Type:")); 
    485438        String[] microphonetSelection = {headset, desktopBoom, laptopBuiltin, webcam, studio, otherMic}; 
     
    508461//      ############ Prompts panel ####################################    
    509462        JPanel promptsContainer = new JPanel();  
    510         promptsContainer.setLayout(new FlowLayout(FlowLayout.LEFT)); 
     463        promptsContainer.setLayout(new FlowLayout(FlowLayout.CENTER)); 
    511464         
    512465        JPanel prompts = new JPanel();  
     
    603556        p2.add(samplingPanel); 
    604557 
    605 //      Save Panel - to be removed      
    606         JPanel savePanel = new JPanel(); 
    607         savePanel.setLayout(new BoxLayout(savePanel, BoxLayout.Y_AXIS)); 
    608  
    609         /* !!!!!! 
    610         JPanel compressionPanel = new JPanel(); 
    611         compressionPanel.add(new JLabel("Compression:")); 
    612         String[] compModes = {comp1, comp2, comp3}; 
    613         compressionPanel.add(compressionChooser = new JComboBox(compModes)); 
    614         compressionChooser.setSelectedIndex(compressionMode - 1); 
    615         compressionChooser.addActionListener(new ActionListener(){ 
    616                  public void actionPerformed(ActionEvent e){ 
    617                      String choice = (String)compressionChooser.getSelectedItem(); 
    618                      if(choice.equals(comp1)){ 
    619                          compressionMode = 1; 
    620                      }else if(choice.equals(comp2)){ 
    621                          compressionMode = 2; 
    622                      }else if(choice.equals(comp3)){ 
    623                          compressionMode = 3; 
    624                      } 
    625                  } 
    626                  }); 
    627         p2.add(compressionPanel); 
    628                 */      
    629                 //Temp hidden        JPanel saveTFpanel = new JPanel(); 
    630                 //Temp hidden        saveTFpanel.add(new JLabel("File to save:  ")); 
    631                 //Temp hidden        saveTFpanel.add(textField = new JTextField(fileName)); 
    632                 //Temp hidden        textField.setPreferredSize(new Dimension(140,25)); 
    633                 //Temp hidden        savePanel.add(saveTFpanel); 
    634                  
    635                 //Temp hidden        JPanel saveBpanel = new JPanel(); 
    636                 //Temp hidden        auB = addButton("Save AU", saveBpanel, false); 
    637                 //Temp hidden        aiffB = addButton("Save AIFF", saveBpanel, false); 
    638                 //Temp hidden        waveB = addButton("Save WAVE", saveBpanel, false); 
    639                 //Temp hidden        savePanel.add(saveBpanel); 
    640  
    641 //Temp hidden        p2.add(savePanel); 
    642   
     558//      ############ Anonymous Upload ####################################           
     559        JPanel AnonymousPanel = new JPanel(); 
     560        AnonymousPanel.setBorder(new EmptyBorder(5,0,5,0)); 
     561        uploadB = addButton("Anonymous Upload", AnonymousPanel, true); // upload all submissions 
     562        p2.add(AnonymousPanel); 
     563 
     564//      ############ User name ####################################              
     565//      userName is read when user clicks Upload 
     566             JPanel usernamePanel = new JPanel(); 
     567             usernamePanel.setLayout(new FlowLayout(FlowLayout.CENTER));   
     568             usernamePanel.add(new JLabel("Username:")); 
     569             usernamePanel.add(usernameTextField = new JTextField(20)); 
     570      //       usernameTextField.setText("hello world"); 
     571             p2.add(usernamePanel);   
    643572//      ############ Copyright Name ####################################              
    644573//      userName is read when user clicks Upload