Changeset 2348
- Timestamp:
- 11/08/07 23:32:43 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java
r2329 r2348 260 260 String promptID9; 261 261 String promptID10; 262 262 // !!!!!! 263 263 JTextField usernameTextField; 264 264 265 String usernamePanelLabel = "Username:"; 265 266 String userName; 267 266 268 String copyrightName = "Free Software Foundation"; 267 269 String gplAccepted = "Yes"; … … 270 272 public static final String notApplicable = "unknown"; 271 273 274 String genderPanelLabel = "Gender:"; 275 JComboBox genderChooser; 276 public static final String male = "Male"; 277 public static final String female = "Female"; 278 String gender = notApplicable; 279 280 String ageRangePanelLabel = "Age Range:"; 272 281 JComboBox ageRangeChooser; 273 282 public static final String youth = "Youth"; … … 275 284 public static final String senior = "Senior"; 276 285 String ageRange = notApplicable; 277 278 JComboBox genderChooser; 279 public static final String male = "Male"; 280 public static final String female = "Female"; 281 String gender = notApplicable; 282 286 287 String dialectPanelLabel = "Pronunciation Dialect:"; 283 288 JComboBox dialectChooser; 284 289 public static final String australian = "Australian English"; … … 292 297 String dialect = notApplicable; 293 298 299 String microphonePanelLabel = "Microphone Type:"; 294 300 JComboBox microphoneChooser; 295 301 public static final String headset = "Headset mic"; … … 299 305 public static final String studio = "Studio mic"; 300 306 public static final String otherMic = "Other"; 301 String microphone = notApplicable; 307 String microphone = notApplicable; 308 309 String uploadText = "<html>By clicking the \"Upload\" button, you agree to assign the Copyright to your recorded speech to <br> " 310 + "the Free Software Foundation, and to license your submission under the GNU Public Licence (\"GPL\"):" ; 311 String uploadButtonLabel = "Upload"; 312 313 String moreInfoText = "For more information on Copyright and GPL, click here:"; 314 String moreInfoButtonLabel = "More Information"; 315 316 String disclaimerText = 317 "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>" 318 +"This program comes with ABSOLUTELY NO WARRANTY; without even the implied<br> " 319 +"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For<br>" 320 +"more details click the \"About\" button:"; 321 String aboutButtonLabel = "About"; 322 323 public static final String recordButton = "Record"; 324 public static final String stopButton = "Stop"; 325 public static final String playButton = "Play"; 302 326 // !!!!!! 327 328 303 329 String fileFieldName; 304 330 305 JComboBox compressionChooser;306 307 public static final String comp1 = "Smaller file, low quality";308 public static final String comp2 = "Standard";309 public static final String comp3 = "Higher quality, larger file";310 311 331 URL endPageURL; 312 332 URL helpPageURL; … … 392 412 // Create a single WAV file that will hold our recordings 393 413 try { 394 wavFile = File.createTempFile("mdl", ".wav");395 wavFile.deleteOnExit();396 // !!!!!!397 414 wavFile1 = new File(tempdir + "wavFile1.wav"); 398 415 wavFile1.deleteOnExit(); … … 436 453 uploadWavFile10 = new File(tempdir + this.promptID10 + ".wav"); 437 454 uploadWavFile10.deleteOnExit(); 438 // archiveFile = File.createTempFile("vxf", ".zip");439 // archiveFile.deleteOnExit();440 455 promptsFile = new File(tempdir + "prompts.txt"); 441 456 promptsFile.deleteOnExit(); … … 446 461 licenseNoticeFile = new File(tempdir + "license.txt"); 447 462 licenseFile.deleteOnExit(); 448 // !!!!!!449 463 } catch (Exception e) { 450 464 System.err.println("Unable to create WAV cache file for storing audio\n" + e); 451 465 return; 452 466 } 453 // !!!!!!454 455 System.err.println("CapturePlayback's WAV file for recording is: " + wavFile);456 467 System.err.println("CapturePlayback's WAV file for recording wavFile1 is:" + wavFile1); 457 468 System.err.println("CapturePlayback's WAV file for recording wavFile2 is:" + wavFile2); … … 488 499 JPanel usernamePanel = new JPanel(); 489 500 usernamePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 490 usernamePanel.add(new JLabel( "Username:"));501 usernamePanel.add(new JLabel(usernamePanelLabel)); 491 502 usernamePanel.add(usernameTextField = new JTextField(20)); 492 usernamePanel.add(new JLabel("(leave blank to submit anonymously)")); 503 504 String usernamePanelText = "(leave blank to submit anonymously)"; 505 usernamePanel.add(new JLabel(usernamePanelText)); 493 506 494 507 p2.add(usernamePanel); … … 497 510 genderPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 498 511 499 genderPanel.add(new JLabel( "Gender:"));512 genderPanel.add(new JLabel(genderPanelLabel)); 500 513 String[] genderSelection = {pleaseSelect,male, female}; 501 514 genderPanel.add(genderChooser = new JComboBox(genderSelection)); … … 520 533 JPanel ageRangePanel = new JPanel(); 521 534 ageRangePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 522 ageRangePanel.add(new JLabel( "Age Range:"));535 ageRangePanel.add(new JLabel(ageRangePanelLabel)); 523 536 String[] ageSelection = {pleaseSelect, youth, adult, senior}; 524 537 ageRangePanel.add(ageRangeChooser = new JComboBox(ageSelection)); … … 544 557 JPanel dialectPanel = new JPanel(); 545 558 dialectPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 546 dialectPanel.add(new JLabel( "Pronunciation Dialect:"));559 dialectPanel.add(new JLabel(dialectPanelLabel)); 547 560 String[] dialectSelection = {pleaseSelect,australian, american, british, canadian, european, newzealand, southafrican, otherDialect}; 548 561 dialectPanel.add(dialectChooser = new JComboBox(dialectSelection)); … … 574 587 } 575 588 }); 576 dialectPanel.add(new JLabel("(mother tongue)"));577 589 p2.add(dialectPanel); 578 590 … … 580 592 JPanel microphonePanel = new JPanel(); 581 593 microphonePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 582 microphonePanel.add(new JLabel( "Microphone Type:"));594 microphonePanel.add(new JLabel(microphonePanelLabel)); 583 595 String[] microphonetSelection = {pleaseSelect,headset, desktopBoom, laptopBuiltin, webcam, studio, otherMic}; 584 596 microphonePanel.add(microphoneChooser = new JComboBox(microphonetSelection)); … … 615 627 // ############ Prompts panel #################################### 616 628 JPanel prompts = new JPanel(); 617 // prompts.add(new JLabel("Prompts:"));618 629 prompts.setLayout(new BoxLayout(prompts, BoxLayout.Y_AXIS)); 619 630 Color voxforgeColour = new Color(197, 216, 234); … … 626 637 prompt1InnerPanel.add(new JLabel(this.prompt1)); 627 638 prompt1Panel.add(prompt1InnerPanel); 628 play1 = addButton( "Play", prompt1Panel, false);639 play1 = addButton(playButton, prompt1Panel, false); 629 640 play1.setSize(10,10); 630 capt1 = addButton( "Record", prompt1Panel, true);641 capt1 = addButton(recordButton, prompt1Panel, true); 631 642 prompts.add(prompt1Panel); 632 643 // ############ Prompt2 #################################### … … 637 648 prompt2InnerPanel.add(new JLabel(this.prompt2)); 638 649 prompt2Panel.add(prompt2InnerPanel); 639 play2 = addButton( "Play", prompt2Panel, false);640 capt2 = addButton( "Record", prompt2Panel, false);650 play2 = addButton(playButton, prompt2Panel, false); 651 capt2 = addButton(recordButton, prompt2Panel, false); 641 652 prompts.add(prompt2Panel); 642 653 // ############ Prompt3 #################################### … … 647 658 prompt3InnerPanel.add(new JLabel(this.prompt3)); 648 659 prompt3Panel.add(prompt3InnerPanel); 649 play3 = addButton( "Play", prompt3Panel, false);650 capt3 = addButton( "Record", prompt3Panel, false);660 play3 = addButton(playButton, prompt3Panel, false); 661 capt3 = addButton(recordButton, prompt3Panel, false); 651 662 prompts.add(prompt3Panel); 652 663 // ############ Prompt4 #################################### … … 657 668 prompt4InnerPanel.add(new JLabel(this.prompt4)); 658 669 prompt4Panel.add(prompt4InnerPanel); 659 play4 = addButton( "Play", prompt4Panel, false);660 capt4 = addButton( "Record", prompt4Panel, false);670 play4 = addButton(playButton, prompt4Panel, false); 671 capt4 = addButton(recordButton, prompt4Panel, false); 661 672 prompts.add(prompt4Panel); 662 673 // ############ Prompt5 #################################### … … 667 678 prompt5InnerPanel.add(new JLabel(this.prompt5)); 668 679 prompt5Panel.add(prompt5InnerPanel); 669 play5 = addButton( "Play", prompt5Panel, false);670 capt5 = addButton( "Record", prompt5Panel, false);680 play5 = addButton(playButton, prompt5Panel, false); 681 capt5 = addButton(recordButton, prompt5Panel, false); 671 682 prompts.add(prompt5Panel); 672 683 … … 678 689 prompt6InnerPanel.add(new JLabel(this.prompt6)); 679 690 prompt6Panel.add(prompt6InnerPanel); 680 play6 = addButton( "Play", prompt6Panel, false);691 play6 = addButton(playButton, prompt6Panel, false); 681 692 play6.setSize(10,10); 682 capt6 = addButton( "Record", prompt6Panel, false);693 capt6 = addButton(recordButton, prompt6Panel, false); 683 694 prompts.add(prompt6Panel); 684 695 // ############ prompt7 #################################### … … 689 700 prompt7InnerPanel.add(new JLabel(this.prompt7)); 690 701 prompt7Panel.add(prompt7InnerPanel); 691 play7 = addButton( "Play", prompt7Panel, false);692 capt7 = addButton( "Record", prompt7Panel, false);702 play7 = addButton(playButton, prompt7Panel, false); 703 capt7 = addButton(recordButton, prompt7Panel, false); 693 704 prompts.add(prompt7Panel); 694 705 // ############ prompt8 #################################### … … 699 710 prompt8InnerPanel.add(new JLabel(this.prompt8)); 700 711 prompt8Panel.add(prompt8InnerPanel); 701 play8 = addButton( "Play", prompt8Panel, false);702 capt8 = addButton( "Record", prompt8Panel, false);712 play8 = addButton(playButton, prompt8Panel, false); 713 capt8 = addButton(recordButton, prompt8Panel, false); 703 714 prompts.add(prompt8Panel); 704 715 // ############ prompt9 #################################### … … 709 720 prompt9InnerPanel.add(new JLabel(this.prompt9)); 710 721 prompt9Panel.add(prompt9InnerPanel); 711 play9 = addButton( "Play", prompt9Panel, false);712 capt9 = addButton( "Record", prompt9Panel, false);722 play9 = addButton(playButton, prompt9Panel, false); 723 capt9 = addButton(recordButton, prompt9Panel, false); 713 724 prompts.add(prompt9Panel); 714 725 // ############ prompt10 #################################### … … 719 730 prompt10InnerPanel.add(new JLabel(this.prompt10)); 720 731 prompt10Panel.add(prompt10InnerPanel); 721 play10 = addButton( "Play", prompt10Panel, false);722 capt10 = addButton( "Record", prompt10Panel, false);732 play10 = addButton(playButton, prompt10Panel, false); 733 capt10 = addButton(recordButton, prompt10Panel, false); 723 734 prompts.add(prompt10Panel); 724 735 promptsContainer.add(prompts); … … 735 746 p2.add(samplingPanel); 736 747 // ############ Upload Text #################################### 737 JPanel UploadTextPanel = new JPanel(); 738 String text = "<html>By clicking the \"Upload\" button, you agree to assign the Copyright to your recorded speech to <br> " 739 + "the Free Software Foundation, and to license your submission under the GNU Public Licence (\"GPL\"):" ; 740 UploadTextPanel.add(new JLabel(text)); 741 p2.add(UploadTextPanel); 748 JPanel uploadTextPanel = new JPanel(); 749 uploadTextPanel.add(new JLabel(uploadText)); 750 p2.add(uploadTextPanel); 742 751 //############ Upload #################################### 743 JPanel UploadButtonPanel = new JPanel();744 UploadButtonPanel.setBorder(new EmptyBorder(5,0,5,0));745 uploadB = addButton( "Upload", UploadButtonPanel, false); // upload all submissions746 p2.add( UploadButtonPanel);752 JPanel uploadButtonPanel = new JPanel(); 753 uploadButtonPanel.setBorder(new EmptyBorder(5,0,5,0)); 754 uploadB = addButton(uploadButtonLabel, uploadButtonPanel, false); // upload all submissions 755 p2.add(uploadButtonPanel); 747 756 //############ Upload Progress bar #################################### 748 757 progBar = new JProgressBar(); … … 753 762 // ############ More Information Button #################################### 754 763 JPanel moreInfoButtonPanel = new JPanel(); 755 // moreInfoButtonPanel.setBorder(new EmptyBorder(25,0,35,0)); 756 moreInfoButtonPanel.add(new JLabel("For more information on Copyright and GPL, click here:")); 757 moreInfoB = addButton("More Information", moreInfoButtonPanel, true); 764 moreInfoButtonPanel.add(new JLabel(moreInfoText)); 765 moreInfoB = addButton(moreInfoButtonLabel, moreInfoButtonPanel, true); 758 766 p2.add(moreInfoButtonPanel); 759 767 // ############ Disclaimer #################################### … … 761 769 DisclaimerPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 762 770 JPanel DisclaimerInnerPanel = new JPanel(); 763 String DisclaimerText = 764 "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>" 765 +"This program comes with ABSOLUTELY NO WARRANTY; without even the implied<br> " 766 +"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For<br>" 767 +"more details click the \"About\" button:"; 768 DisclaimerInnerPanel.add(new JLabel(DisclaimerText)); 769 aboutB = addButton("About", DisclaimerInnerPanel, true); 771 DisclaimerInnerPanel.add(new JLabel(disclaimerText)); 772 aboutB = addButton(aboutButtonLabel, DisclaimerInnerPanel, true); 770 773 DisclaimerInnerPanel.setBorder(BorderFactory.createLineBorder (voxforgeColour, 3)); 771 774 … … 916 919 // ################### Play ####################################### 917 920 else if (obj.equals(playB)) { 918 if (playB.getText().startsWith( "Play")) {921 if (playB.getText().startsWith(playButton)) { 919 922 playback.start(); 920 923 samplingGraph.start(); 921 924 captB.setEnabled(false); 922 925 pausB.setEnabled(true); 923 playB.setText( "Stop");926 playB.setText(stopButton); 924 927 } else { 925 928 playback.stop(); … … 927 930 captB.setEnabled(true); 928 931 pausB.setEnabled(false); 929 playB.setText( "Play");932 playB.setText(playButton); 930 933 } 931 934 } 932 935 // !!!!!! 933 936 else if (obj.equals(play1)) { 934 if (play1.getText().startsWith( "Play")) {937 if (play1.getText().startsWith(playButton)) { 935 938 wavFile = wavFile1; // !!!!!! 936 939 duration = duration1; … … 939 942 samplingGraph.start(); 940 943 capt1.setEnabled(false); 941 play1.setText( "Stop");944 play1.setText(stopButton); 942 945 } else { 943 946 playback.stop(); 944 947 samplingGraph.stop(); 945 948 capt1.setEnabled(true); 946 play1.setText( "Play");949 play1.setText(playButton); 947 950 } 948 951 } 949 952 else if (obj.equals(play2)) { 950 if (play2.getText().startsWith( "Play")) {953 if (play2.getText().startsWith(playButton)) { 951 954 wavFile = wavFile2; // !!!!!! 952 955 duration = duration2; … … 955 958 samplingGraph.start(); 956 959 capt2.setEnabled(false); 957 play2.setText( "Stop");960 play2.setText(stopButton); 958 961 } else { 959 962 playback.stop(); 960 963 samplingGraph.stop(); 961 964 capt2.setEnabled(true); 962 play2.setText( "Play");965 play2.setText(playButton); 963 966 } 964 967 } 965 968 else if (obj.equals(play3)) { 966 if (play3.getText().startsWith( "Play")) {969 if (play3.getText().startsWith(playButton)) { 967 970 wavFile = wavFile3; // !!!!!! 968 971 playback.start(); … … 971 974 samplingGraph.start(); 972 975 capt3.setEnabled(false); 973 play3.setText( "Stop");976 play3.setText(stopButton); 974 977 } else { 975 978 playback.stop(); 976 979 samplingGraph.stop(); 977 980 capt3.setEnabled(true); 978 play3.setText( "Play");981 play3.setText(playButton); 979 982 } 980 983 } 981 984 else if (obj.equals(play4)) { 982 if (play4.getText().startsWith( "Play")) {985 if (play4.getText().startsWith(playButton)) { 983 986 wavFile = wavFile4; // !!!!!! 984 987 duration = duration4; … … 987 990 samplingGraph.start(); 988 991 capt4.setEnabled(false); 989 play4.setText( "Stop");992 play4.setText(stopButton); 990 993 } else { 991 994 playback.stop(); 992 995 samplingGraph.stop(); 993 996 capt4.setEnabled(true); 994 play4.setText( "Play");997 play4.setText(playButton); 995 998 } 996 999 } 997 1000 else if (obj.equals(play5)) { 998 if (play5.getText().startsWith( "Play")) {1001 if (play5.getText().startsWith(playButton)) { 999 1002 wavFile = wavFile5; // !!!!!! 1000 1003 duration = duration5; … … 1003 1006 samplingGraph.start(); 1004 1007 capt5.setEnabled(false); 1005 play5.setText( "Stop");1008 play5.setText(stopButton); 1006 1009 } else { 1007 1010 playback.stop(); 1008 1011 samplingGraph.stop(); 1009 1012 capt5.setEnabled(true); 1010 play5.setText( "Play");1013 play5.setText(playButton); 1011 1014 } 1012 1015 } 1013 1016 else if (obj.equals(play6)) { 1014 if (play6.getText().startsWith( "Play")) {1017 if (play6.getText().startsWith(playButton)) { 1015 1018 wavFile = wavFile6; // !!!!!! 1016 1019 duration = duration6; … … 1019 1022 samplingGraph.start(); 1020 1023 capt6.setEnabled(false); 1021 play6.setText( "Stop");1024 play6.setText(stopButton); 1022 1025 } else { 1023 1026 playback.stop(); 1024 1027 samplingGraph.stop(); 1025 1028 capt6.setEnabled(true); 1026 play6.setText( "Play");1029 play6.setText(playButton); 1027 1030 } 1028 1031 } 1029 1032 else if (obj.equals(play7)) { 1030 if (play7.getText().startsWith( "Play")) {1033 if (play7.getText().startsWith(playButton)) { 1031 1034 wavFile = wavFile7; // !!!!!! 1032 1035 duration = duration7; … … 1035 1038 samplingGraph.start(); 1036 1039 capt7.setEnabled(false); 1037 play7.setText( "Stop");1040 play7.setText(stopButton); 1038 1041 } else { 1039 1042 playback.stop(); 1040 1043 samplingGraph.stop(); 1041 1044 capt7.setEnabled(true); 1042 play7.setText( "Play");1045 play7.setText(playButton); 1043 1046 } 1044 1047 } 1045 1048 else if (obj.equals(play8)) { 1046 if (play8.getText().startsWith( "Play")) {1049 if (play8.getText().startsWith(playButton)) { 1047 1050 wavFile = wavFile8; // !!!!!! 1048 1051 duration = duration8; … … 1051 1054 samplingGraph.start(); 1052 1055 capt8.setEnabled(false); 1053 play8.setText( "Stop");1056 play8.setText(stopButton); 1054 1057 } else { 1055 1058 playback.stop(); 1056 1059 samplingGraph.stop(); 1057 1060 capt8.setEnabled(true); 1058 play8.setText( "Play");1061 play8.setText(playButton); 1059 1062 } 1060 1063 } 1061 1064 else if (obj.equals(play9)) { 1062 if (play9.getText().startsWith( "Play")) {1065 if (play9.getText().startsWith(playButton)) { 1063 1066 wavFile = wavFile9; // !!!!!! 1064 1067 duration = duration9; … … 1067 1070 samplingGraph.start(); 1068 1071 capt9.setEnabled(false); 1069 play9.setText( "Stop");1072 play9.setText(stopButton); 1070 1073 } else { 1071 1074 playback.stop(); 1072 1075 samplingGraph.stop(); 1073 1076 capt9.setEnabled(true); 1074 play9.setText( "Play");1077 play9.setText(playButton); 1075 1078 } 1076 1079 } 1077 1080 else if (obj.equals(play10)) { 1078 if (play10.getText().startsWith( "Play")) {1081 if (play10.getText().startsWith(playButton)) { 1079 1082 wavFile = wavFile10; // !!!!!! 1080 1083 duration = duration10; … … 1083 1086 samplingGraph.start(); 1084 1087 capt10.setEnabled(false); 1085 play10.setText( "Stop");1088 play10.setText(stopButton); 1086 1089 } else { 1087 1090 playback.stop(); 1088 1091 samplingGraph.stop(); 1089 1092 capt10.setEnabled(true); 1090 play10.setText( "Play");1093 play10.setText(playButton); 1091 1094 } 1092 1095 } … … 1108 1111 //temp hidden aiffB.setEnabled(false); 1109 1112 //temp hidden waveB.setEnabled(false); 1110 captB.setText( "Stop");1113 captB.setText(stopButton); 1111 1114 } else { 1112 1115 lines.removeAllElements(); … … 1127 1130 // !!!!!! 1128 1131 else if (obj.equals(capt1)) { 1129 if (capt1.getText().startsWith( "Record")) {1132 if (capt1.getText().startsWith(recordButton)) { 1130 1133 file = null; 1131 1134 wavFile = wavFile1; … … 1141 1144 // play1.setEnabled(false); 1142 1145 // !!!!!! 1143 capt1.setText( "Stop");1146 capt1.setText(stopButton); 1144 1147 moreInfoB.setEnabled(false); 1145 1148 aboutB.setEnabled(false); … … 1150 1153 restoreButtonState(); //!!!!!! 1151 1154 play1.setEnabled(true); 1152 capt1.setText( "Record");1155 capt1.setText(recordButton); 1153 1156 moreInfoB.setEnabled(true); 1154 1157 aboutB.setEnabled(true); … … 1171 1174 // play2.setEnabled(false); 1172 1175 // !!!!!! 1173 capt2.setText( "Stop");1176 capt2.setText(stopButton); 1174 1177 moreInfoB.setEnabled(false); 1175 1178 aboutB.setEnabled(false); … … 1180 1183 restoreButtonState(); //!!!!!! 1181 1184 play2.setEnabled(true); 1182 capt2.setText( "Record");1185 capt2.setText(recordButton); 1183 1186 moreInfoB.setEnabled(true); 1184 1187 aboutB.setEnabled(true); … … 1187 1190 } 1188 1191 else if (obj.equals(capt3)) { 1189 if (capt3.getText().startsWith( "Record")) {1192 if (capt3.getText().startsWith(recordButton)) { 1190 1193 file = null; 1191 1194 wavFile = wavFile3; … … 1201 1204 // play3.setEnabled(false); 1202 1205 // !!!!!! 1203 capt3.setText( "Stop");1206 capt3.setText(stopButton); 1204 1207 moreInfoB.setEnabled(false); 1205 1208 aboutB.setEnabled(false); … … 1210 1213 restoreButtonState(); //!!!!!! 1211 1214 play3.setEnabled(true); 1212 capt3.setText( "Record");1215 capt3.setText(recordButton); 1213 1216 moreInfoB.setEnabled(true); 1214 1217 aboutB.setEnabled(true); … … 1218 1221 } 1219 1222 else if (obj.equals(capt4)) { 1220 if (capt4.getText().startsWith( "Record")) {1223 if (capt4.getText().startsWith(recordButton)) { 1221 1224 file = null; 1222 1225 wavFile = wavFile4; … … 1232 1235 // play4.setEnabled(false); 1233 1236 // !!!!!! 1234 capt4.setText( "Stop");1237 capt4.setText(stopButton); 1235 1238 moreInfoB.setEnabled(false); 1236 1239 aboutB.setEnabled(false); … … 1241 1244 restoreButtonState(); //!!!!!! 1242 1245 play4.setEnabled(true); 1243 capt4.setText( "Record");1246 capt4.setText(recordButton); 1244 1247 moreInfoB.setEnabled(true); 1245 1248 aboutB.setEnabled(true); … … 1249 1252 } 1250 1253 else if (obj.equals(capt5)) { 1251 if (capt5.getText().startsWith( "Record")) {1254 if (capt5.getText().startsWith(recordButton)) { 1252 1255 file = null; 1253 1256 wavFile = wavFile5; … … 1263 1266 // play5.setEnabled(false); 1264 1267 // !!!!!! 1265 capt5.setText( "Stop");1268 capt5.setText(stopButton); 1266 1269 moreInfoB.setEnabled(false); 1267 1270 aboutB.setEnabled(false); … … 1272 1275 restoreButtonState(); //!!!!!! 1273 1276 play5.setEnabled(true); 1274 capt5.setText( "Record");1277 capt5.setText(recordButton); 1275 1278 moreInfoB.setEnabled(true); 1276 1279 aboutB.setEnabled(true); … … 1280 1283 } 1281 1284 else if (obj.equals(capt6)) { 1282 if (capt6.getText().startsWith( "Record")) {1285 if (capt6.getText().startsWith(recordButton)) { 1283 1286 file = null; 1284 1287 wavFile = wavFile6; … … 1294 1297 // play6.setEnabled(false); 1295 1298 // !!!!!! 1296 capt6.setText( "Stop");1299 capt6.setText(stopButton); 1297 1300 moreInfoB.setEnabled(false); 1298 1301 aboutB.setEnabled(false); … … 1303 1306 restoreButtonState(); //!!!!!! 1304 1307 play6.setEnabled(true); 1305 capt6.setText( "Record");1308 capt6.setText(recordButton); 1306 1309 moreInfoB.setEnabled(true); 1307 1310 aboutB.setEnabled(true); … … 1310 1313 } 1311 1314 else if (obj.equals(capt7)) { 1312 if (capt7.getText().startsWith( "Record")) {1315 if (capt7.getText().startsWith(recordButton)) { 1313 1316 file = null; 1314 1317 wavFile = wavFile7; … … 1324 1327 // play7.setEnabled(false); 1325 1328 // !!!!!! 1326 capt7.setText( "Stop");1329 capt7.setText(stopButton); 1327 1330 moreInfoB.setEnabled(false); 1328 1331 aboutB.setEnabled(false); … … 1333 1336 restoreButtonState(); //!!!!!! 1334 1337 play7.setEnabled(true); 1335 capt7.setText( "Record");1338 capt7.setText(recordButton); 1336 1339 moreInfoB.setEnabled(true); 1337 1340 aboutB.setEnabled(true); … … 1340 1343 } 1341 1344 else if (obj.equals(capt8)) { 1342 if (capt8.getText().startsWith( "Record")) {1345 if (capt8.getText().startsWith(recordButton)) { 1343 1346 file = null; 1344 1347 wavFile = wavFile8; … … 1354 1357 // play8.setEnabled(false); 1355 1358 // !!!!!! 1356 capt8.setText( "Stop");1359 capt8.setText(stopButton); 1357 1360 moreInfoB.setEnabled(false); 1358 1361 aboutB.setEnabled(false); … … 1363 1366 restoreButtonState(); //!!!!!! 1364 1367 play8.setEnabled(true); 1365 capt8.setText( "Record");1368 capt8.setText(recordButton); 1366 1369 moreInfoB.setEnabled(true); 1367 1370 aboutB.setEnabled(true); … … 1370 1373 } 1371 1374 else if (obj.equals(capt9)) { 1372 if (capt9.getText().startsWith( "Record")) {1375 if (capt9.getText().startsWith(recordButton)) { 1373 1376 file = null; 1374 1377 wavFile = wavFile9; … … 1384 1387 // play9.setEnabled(false); 1385 1388 // !!!!!! 1386 capt9.setText( "Stop");1389 capt9.setText(stopButton); 1387 1390 moreInfoB.setEnabled(false); 1388 1391 aboutB.setEnabled(false); … … 1393 1396 restoreButtonState(); //!!!!!! 1394 1397 play9.setEnabled(true); 1395 capt9.setText( "Record");1398 capt9.setText(recordButton); 1396 1399 moreInfoB.setEnabled(true); 1397 1400 aboutB.setEnabled(true); … … 1400 1403 } 1401 1404 else if (obj.equals(capt10)) { 1402 if (capt10.getText().startsWith( "Record")) {1405 if (capt10.getText().startsWith(recordButton)) { 1403 1406 file = null; 1404 1407 wavFile = wavFile10; … … 1414 1417 // play10.setEnabled(false); 1415 1418 // !!!!!! 1416 capt10.setText( "Stop");1419 capt10.setText(stopButton); 1417 1420 moreInfoB.setEnabled(false); 1418 1421 aboutB.setEnabled(false); … … 1423 1426 restoreButtonState(); //!!!!!! 1424 1427 play10.setEnabled(true); 1425 capt10.setText( "Record");1428 capt10.setText(recordButton); 1426 1429 moreInfoB.setEnabled(true); 1427 1430 aboutB.setEnabled(true); … … 1680 1683 samplingGraph.stop(); 1681 1684 // !!!!!! FIXME 1682 if (play1.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1685 if (play1.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1683 1686 capt1.setEnabled(true); 1684 } else if (play2.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1687 } else if (play2.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1685 1688 capt2.setEnabled(true); 1686 }else if (play3.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1689 }else if (play3.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1687 1690 capt3.setEnabled(true); 1688 }else if (play4.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1691 }else if (play4.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1689 1692 capt4.setEnabled(true); 1690 }else if (play5.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1693 }else if (play5.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1691 1694 capt5.setEnabled(true); 1692 }else if (play6.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1695 }else if (play6.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1693 1696 capt6.setEnabled(true); 1694 }else if (play7.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1697 }else if (play7.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1695 1698 capt7.setEnabled(true); 1696 }else if (play8.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1699 }else if (play8.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1697 1700 capt8.setEnabled(true); 1698 }else if (play9.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1701 }else if (play9.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1699 1702 capt9.setEnabled(true); 1700 }else if (play10.getText().startsWith( "Stop")) { //play button gets set to "Stop" after play is pressed1703 }else if (play10.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 1701 1704 capt10.setEnabled(true); 1702 1705 } 1703 1706 1704 play1.setText( "Play");1705 play2.setText( "Play");1706 play3.setText( "Play");1707 play4.setText( "Play");1708 play5.setText( "Play");1709 play6.setText( "Play");1710 play7.setText( "Play");1711 play8.setText( "Play");1712 play9.setText( "Play");1713 play10.setText( "Play");1707 play1.setText(playButton); 1708 play2.setText(playButton); 1709 play3.setText(playButton); 1710 play4.setText(playButton); 1711 play5.setText(playButton); 1712 play6.setText(playButton); 1713 play7.setText(playButton); 1714 play8.setText(playButton); 1715 play9.setText(playButton); 1716 play10.setText(playButton); 1714 1717 // !!!!!! 1715 1718 } … … 1875 1878 playB.setEnabled(true); 1876 1879 waveB.setEnabled(true); 1877 captB.setText( "Record");1880 captB.setText(recordButton); 1878 1881 System.err.println(errStr); 1879 1882 samplingGraph.repaint();