Changeset 2256
- Timestamp:
- 08/14/07 00:36:23 (1 year ago)
- Files:
-
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/CapturePlayback.java (modified) (51 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/License.java (modified) (2 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/MoodleSpeexRecorderApplet.java (modified) (3 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/moodle (deleted)
- Trunk/SpeechSubmission/VFSpeechSubmission/moodlepatches (deleted)
- Trunk/SpeechSubmission/VFSpeechSubmission/server (added)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUpload.php (added)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/speechSubmission.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/CapturePlayback.java
r2255 r2256 96 96 JButton loadB; 97 97 JButton uploadB; 98 JButton moreInfoB; 98 99 // !!!!!! 99 100 JButton play1; … … 122 123 JButton load5; 123 124 JButton upload5; 124 125 JButton play6; 126 JButton capt6; 127 JButton paus6; 128 JButton load6; 129 JButton upload6; 130 JButton play7; 131 JButton capt7; 132 JButton paus7; 133 JButton load7; 134 JButton upload7; 135 JButton play8; 136 JButton capt8; 137 JButton paus8; 138 JButton load8; 139 JButton upload8; 140 JButton play9; 141 JButton capt9; 142 JButton paus9; 143 JButton load9; 144 JButton upload9; 145 JButton play10; 146 JButton capt10; 147 JButton paus10; 148 JButton load10; 149 JButton upload10; 125 150 JCheckBox acceptLicenseCB; 126 151 … … 157 182 private File uploadWavFile3; 158 183 private File uploadWavFile4; 159 private File uploadWavFile5; 184 private File uploadWavFile5; 185 private File wavFile6; 186 private File wavFile7; 187 private File wavFile8; 188 private File wavFile9; 189 private File wavFile10; 190 private File uploadWavFile6; 191 private File uploadWavFile7; 192 private File uploadWavFile8; 193 private File uploadWavFile9; 194 private File uploadWavFile10; 160 195 // private File archiveFile; 161 196 private File promptsFile; … … 190 225 String promptID4; 191 226 String promptID5; 192 227 String prompt6; 228 String prompt7; 229 String prompt8; 230 String prompt9; 231 String prompt10; 232 String promptID6; 233 String promptID7; 234 String promptID8; 235 String promptID9; 236 String promptID10; 193 237 194 238 JTextField usernameTextField; … … 252 296 // String language, URL destinationURL, 253 297 // URL endPageURL, URL helpPageURL, String cookie, int defaultCompressionMode) { 254 public CapturePlayback(String subject, String promptID1, String prompt1, String promptID2, String prompt2, String promptID3, String prompt3, String promptID4, String prompt4, String promptID5, String prompt5,String fileFieldName, 255 String language, URL destinationURL, 298 public CapturePlayback(String subject, 299 String promptID1, String prompt1, String promptID2, String prompt2, String promptID3, String prompt3, String promptID4, String prompt4, String promptID5, String prompt5, 300 String promptID6, String prompt6, String promptID7, String prompt7, String promptID8, String prompt8, String promptID9, String prompt9, String promptID10, String prompt10, 301 String fileFieldName,String language, URL destinationURL, 256 302 URL endPageURL, URL helpPageURL, String cookie, int defaultCompressionMode) { 257 303 258 304 if (prompt1 == null || prompt1.length() == 0) { 259 Prompts prompts = new Prompts( 5);305 Prompts prompts = new Prompts(10); 260 306 String [][] promptArray = prompts.getPrompts(); 261 307 this.promptID1 = promptArray[0][0]; … … 269 315 this.promptID5 = promptArray[0][4]; 270 316 this.prompt5 = promptArray[1][4]; 317 this.promptID6 = promptArray[0][5]; 318 this.prompt6 = promptArray[1][5]; 319 this.promptID7 = promptArray[0][6]; 320 this.prompt7 = promptArray[1][6]; 321 this.promptID8 = promptArray[0][7]; 322 this.prompt8 = promptArray[1][7]; 323 this.promptID9 = promptArray[0][8]; 324 this.prompt9 = promptArray[1][8]; 325 this.promptID10 = promptArray[0][9]; 326 this.prompt10 = promptArray[1][9]; 271 327 } else { 272 328 this.prompt1 = prompt1; … … 280 336 this.promptID4 = promptID4; 281 337 this.promptID5 = promptID5; 338 this.prompt6 = prompt6; 339 this.prompt7 = prompt7; 340 this.prompt8 = prompt8; 341 this.prompt9 = prompt9; 342 this.prompt10 = prompt10; 343 this.promptID6 = promptID6; 344 this.promptID7 = promptID7; 345 this.promptID8 = promptID8; 346 this.promptID9 = promptID9; 347 this.promptID10 = promptID10; 282 348 } 283 349 … … 319 385 uploadWavFile5 = new File(this.promptID5 + ".wav"); 320 386 uploadWavFile5.deleteOnExit(); 387 wavFile6 = File.createTempFile("vxf", ".raw"); 388 wavFile6.deleteOnExit(); 389 wavFile7 = File.createTempFile("vxf", ".raw"); 390 wavFile7.deleteOnExit(); 391 wavFile8 = File.createTempFile("vxf", ".raw"); 392 wavFile8.deleteOnExit(); 393 wavFile9 = File.createTempFile("vxf", ".raw"); 394 wavFile9.deleteOnExit(); 395 wavFile10 = File.createTempFile("vxf", ".raw"); 396 wavFile10.deleteOnExit(); 397 uploadWavFile6 = new File(this.promptID6 + ".wav"); 398 uploadWavFile6.deleteOnExit(); 399 uploadWavFile7 = new File(this.promptID7 + ".wav"); 400 uploadWavFile7.deleteOnExit(); 401 uploadWavFile8 = new File(this.promptID8 + ".wav"); 402 uploadWavFile8.deleteOnExit(); 403 uploadWavFile9 = new File(this.promptID9 + ".wav"); 404 uploadWavFile9.deleteOnExit(); 405 uploadWavFile10 = new File(this.promptID10 + ".wav"); 406 uploadWavFile10.deleteOnExit(); 321 407 // archiveFile = File.createTempFile("vxf", ".zip"); 322 408 // archiveFile.deleteOnExit(); … … 357 443 //p2.setBorder(sbb); 358 444 p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); 445 // ########################################################### 359 446 // ############ User name #################################### 360 447 // userName is read when user clicks Upload 361 JPanel usernamePanel = new JPanel();362 usernamePanel.setLayout(new FlowLayout(FlowLayout.CENTER));363 usernamePanel.add(new JLabel("Username:"));364 usernamePanel.add(usernameTextField = new JTextField(20));365 usernamePanel.add(new JLabel("(leave blank to submit anonymously)"));366 p2.add(usernamePanel);448 JPanel usernamePanel = new JPanel(); 449 usernamePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 450 usernamePanel.add(new JLabel("Username:")); 451 usernamePanel.add(usernameTextField = new JTextField(20)); 452 usernamePanel.add(new JLabel("(leave blank to submit anonymously)")); 453 p2.add(usernamePanel); 367 454 // ############ Gender #################################### 368 455 JPanel genderPanel = new JPanel(); 369 genderPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 456 genderPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 457 370 458 genderPanel.add(new JLabel("Gender:")); 371 459 String[] genderSelection = {male, female}; … … 382 470 } 383 471 }); 472 384 473 p2.add(genderPanel); 385 474 // ############ Age Range #################################### … … 433 522 }); 434 523 p2.add(dialectPanel); 524 435 525 // ############ Microphone Type: #################################### 436 526 JPanel microphonePanel = new JPanel(); … … 460 550 }); 461 551 p2.add(microphonePanel); 462 // ############ Prompts panel #################################### 552 553 // ############ Prompts container #################################### 463 554 JPanel promptsContainer = new JPanel(); 464 555 promptsContainer.setLayout(new FlowLayout(FlowLayout.CENTER)); 465 556 557 // ############ Prompts panel #################################### 466 558 JPanel prompts = new JPanel(); 467 prompts.add(new JLabel("Prompts:"));559 // prompts.add(new JLabel("Prompts:")); 468 560 prompts.setLayout(new BoxLayout(prompts, BoxLayout.Y_AXIS)); 469 561 … … 471 563 // ############ Prompt1 #################################### 472 564 JPanel prompt1Panel = new JPanel(); 473 // prompt1Panel.setLayout(new BoxLayout(prompt1Panel, BoxLayout.X_AXIS));474 // prompt1Panel.setBorder(new EmptyBorder(10,5,5,5));475 565 prompt1Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 476 477 566 JPanel prompt1InnerPanel = new JPanel(); 478 567 prompt1InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 479 568 prompt1InnerPanel.add(new JLabel(this.prompt1)); 480 569 prompt1Panel.add(prompt1InnerPanel); 481 // prompt1Panel.add(new JTextField(this.prompt1, 50));482 483 570 play1 = addButton("Play", prompt1Panel, false); 484 571 play1.setSize(10,10); 485 572 capt1 = addButton("Record", prompt1Panel, true); 486 // paus1 = addButton("Pause", prompt1Panel, false);487 573 prompts.add(prompt1Panel); 488 574 // ############ Prompt2 #################################### 489 575 JPanel prompt2Panel = new JPanel(); 490 // prompt2Panel.setLayout(new BoxLayout(prompt2Panel, BoxLayout.X_AXIS));491 // prompt2Panel.setBorder(new EmptyBorder(10,5,5,5));492 576 prompt2Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 493 577 JPanel prompt2InnerPanel = new JPanel(); … … 495 579 prompt2InnerPanel.add(new JLabel(this.prompt2)); 496 580 prompt2Panel.add(prompt2InnerPanel); 497 // prompt2Panel.add(prompt1Box = new JTextField(this.prompt2, 50));498 499 581 play2 = addButton("Play", prompt2Panel, false); 500 582 capt2 = addButton("Record", prompt2Panel, true); 501 // paus2 = addButton("Pause", prompt2Panel, false);502 583 prompts.add(prompt2Panel); 503 584 // ############ Prompt3 #################################### 504 585 JPanel prompt3Panel = new JPanel(); 505 // prompt3Panel.setLayout(new BoxLayout(prompt3Panel, BoxLayout.X_AXIS));506 // prompt3Panel.setBorder(new EmptyBorder(10,5,5,5));507 586 prompt3Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 508 587 JPanel prompt3InnerPanel = new JPanel(); … … 510 589 prompt3InnerPanel.add(new JLabel(this.prompt3)); 511 590 prompt3Panel.add(prompt3InnerPanel); 512 // prompt3Panel.add(prompt1Box = new JTextField(this.prompt3, 50));513 514 591 play3 = addButton("Play", prompt3Panel, false); 515 592 capt3 = addButton("Record", prompt3Panel, true); 516 // paus3 = addButton("Pause", prompt3Panel, false);517 593 prompts.add(prompt3Panel); 518 594 // ############ Prompt4 #################################### 519 595 JPanel prompt4Panel = new JPanel(); 520 // prompt4Panel.setLayout(new BoxLayout(prompt4Panel, BoxLayout.X_AXIS));521 // prompt4Panel.setBorder(new EmptyBorder(10,5,5,5));522 596 prompt4Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 523 597 JPanel prompt4InnerPanel = new JPanel(); … … 525 599 prompt4InnerPanel.add(new JLabel(this.prompt4)); 526 600 prompt4Panel.add(prompt4InnerPanel); 527 // prompt4Panel.add(prompt1Box = new JTextField(this.prompt4, 50));528 601 play4 = addButton("Play", prompt4Panel, false); 529 602 capt4 = addButton("Record", prompt4Panel, true); 530 // paus4 = addButton("Pause", prompt4Panel, false);531 603 prompts.add(prompt4Panel); 532 604 // ############ Prompt5 #################################### 533 605 JPanel prompt5Panel = new JPanel(); 534 // prompt5Panel.setLayout(new BoxLayout(prompt5Panel, BoxLayout.X_AXIS));535 // prompt5Panel.setBorder(new EmptyBorder(10,5,5,5));536 606 prompt5Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 537 607 JPanel prompt5InnerPanel = new JPanel(); … … 539 609 prompt5InnerPanel.add(new JLabel(this.prompt5)); 540 610 prompt5Panel.add(prompt5InnerPanel); 541 // prompt5Panel.add(prompt1Box = new JTextField(this.prompt5, 50));542 543 611 play5 = addButton("Play", prompt5Panel, false); 544 612 capt5 = addButton("Record", prompt5Panel, true); 545 // paus5 = addButton("Pause", prompt5Panel, false);546 547 548 613 prompts.add(prompt5Panel); 614 615 // ############ Prompt6 #################################### 616 JPanel prompt6Panel = new JPanel(); 617 prompt6Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 618 JPanel prompt6InnerPanel = new JPanel(); 619 prompt6InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 620 prompt6InnerPanel.add(new JLabel(this.prompt6)); 621 prompt6Panel.add(prompt6InnerPanel); 622 play6 = addButton("Play", prompt6Panel, false); 623 play6.setSize(10,10); 624 capt6 = addButton("Record", prompt6Panel, true); 625 prompts.add(prompt6Panel); 626 // ############ prompt7 #################################### 627 JPanel prompt7Panel = new JPanel(); 628 prompt7Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 629 JPanel prompt7InnerPanel = new JPanel(); 630 prompt7InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 631 prompt7InnerPanel.add(new JLabel(this.prompt7)); 632 prompt7Panel.add(prompt7InnerPanel); 633 play7 = addButton("Play", prompt7Panel, false); 634 capt7 = addButton("Record", prompt7Panel, true); 635 prompts.add(prompt7Panel); 636 // ############ prompt8 #################################### 637 JPanel prompt8Panel = new JPanel(); 638 prompt8Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 639 JPanel prompt8InnerPanel = new JPanel(); 640 prompt8InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 641 prompt8InnerPanel.add(new JLabel(this.prompt8)); 642 prompt8Panel.add(prompt8InnerPanel); 643 play8 = addButton("Play", prompt8Panel, false); 644 capt8 = addButton("Record", prompt8Panel, true); 645 prompts.add(prompt8Panel); 646 // ############ prompt9 #################################### 647 JPanel prompt9Panel = new JPanel(); 648 prompt9Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 649 JPanel prompt9InnerPanel = new JPanel(); 650 prompt9InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 651 prompt9InnerPanel.add(new JLabel(this.prompt9)); 652 prompt9Panel.add(prompt9InnerPanel); 653 play9 = addButton("Play", prompt9Panel, false); 654 capt9 = addButton("Record", prompt9Panel, true); 655 prompts.add(prompt9Panel); 656 // ############ prompt10 #################################### 657 JPanel prompt10Panel = new JPanel(); 658 prompt10Panel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 659 JPanel prompt10InnerPanel = new JPanel(); 660 prompt10InnerPanel.setBorder(BorderFactory.createLineBorder (Color.blue, 1)); 661 prompt10InnerPanel.add(new JLabel(this.prompt10)); 662 prompt10Panel.add(prompt10InnerPanel); 663 play5 = addButton("Play", prompt10Panel, false); 664 capt5 = addButton("Record", prompt10Panel, true); 665 prompts.add(prompt10Panel); 549 666 promptsContainer.add(prompts); 550 667 p2.add(promptsContainer); 551 // !!!!!! 668 // ############ Prompts container #################################### 669 promptsContainer.add(prompts); 670 671 p2.add(promptsContainer); 552 672 // ############ Sampling Graph #################################### 553 673 JPanel samplingPanel = new JPanel(new BorderLayout()); … … 556 676 samplingPanel.add(samplingGraph = new SamplingGraph()); 557 677 p2.add(samplingPanel); 558 559 678 // ############ Upload Text #################################### 679 JPanel UploadTextPanel = new JPanel(); 680 String text = "<html>By clicking the \"Upload\" button, you agree to assign your Copyright to your recorded speech to <br> " 681 + "the Free Software Foundation, and to license your submission under the GNU Public Licence (\"GPL\")." ; 682 UploadTextPanel.add(new JLabel(text)); 683 p2.add(UploadTextPanel); 560 684 //############ Upload #################################### 561 JPanel UploadButtonPanel = new JPanel(); 562 UploadButtonPanel.setBorder(new EmptyBorder(5,0,5,0)); 563 uploadB = addButton("Upload", UploadButtonPanel, true); // upload all submissions 564 p2.add(UploadButtonPanel); 565 // ############ Upload Progress bar #################################### 566 progBar = new JProgressBar(); 567 progBar.setStringPainted(false); 568 progBar.setString("Ready"); 569 //progBar.setVisible(false); 570 p2.add(progBar); 571 // ############ Upload Text #################################### 572 JPanel UploadTextPanel = new JPanel(); 573 String text = "<html>Please Note: by clicking upload, you agree to assign the Copyright to your recorded speech to <br> " 574 + "the Free Software Foundation, and to license your submission under the GNU Public Licence" ; 575 UploadTextPanel.add(new JLabel(text)); 576 p2.add(UploadTextPanel); 577 // ############ License #################################### 578 JPanel licenseScrollPanel = new JPanel(); 579 licenseScrollPanel.add(new JLabel("For more information on Copyright and the GPL, scroll down this panel:")); 580 p2.add(licenseScrollPanel); 581 582 JTextArea textArea = new JTextArea(license); 583 textArea.setLineWrap(true); 584 textArea.setWrapStyleWord(true); 585 JScrollPane areaScrollPane = new JScrollPane(textArea); 586 areaScrollPane.setVerticalScrollBarPolicy( 587 JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 588 areaScrollPane.setPreferredSize(new Dimension(200, 100)); 589 590 p2.add(areaScrollPane); 591 592 593 594 685 JPanel UploadButtonPanel = new JPanel(); 686 UploadButtonPanel.setBorder(new EmptyBorder(5,0,5,0)); 687 uploadB = addButton("Upload", UploadButtonPanel, true); // upload all submissions 688 p2.add(UploadButtonPanel); 689 //############ Upload Progress bar #################################### 690 progBar = new JProgressBar(); 691 progBar.setStringPainted(false); 692 progBar.setString("Ready"); 693 //progBar.setVisible(false); 694 p2.add(progBar); 695 696 // ############ More Information Button #################################### 697 JPanel moreInfoButtonPanel = new JPanel(); 698 // moreInfoButtonPanel.setBorder(new EmptyBorder(25,0,35,0)); 699 moreInfoButtonPanel.add(new JLabel("For more information on Copyright and/or GPL, click this button:")); 700 moreInfoB = addButton("More Information", moreInfoButtonPanel, true); 701 p2.add(moreInfoButtonPanel); 702 // ######################################################################### 595 703 add(p2); 596 704 } … … 651 759 samplingGraph.start(); 652 760 capt1.setEnabled(false); 653 // paus1.setEnabled(true);654 761 play1.setText("Stop"); 655 762 } else { … … 657 764 samplingGraph.stop(); 658 765 capt1.setEnabled(true); 659 // paus1.setEnabled(false);660 766 play1.setText("Play"); 661 767 } … … 667 773 samplingGraph.start(); 668 774 capt2.setEnabled(false); 669 // paus2.setEnabled(true);670 775 play2.setText("Stop"); 671 776 } else { … … 673 778 samplingGraph.stop(); 674 779 capt2.setEnabled(true); 675 // paus2.setEnabled(false);676 780 play2.setText("Play"); 677 781 } … … 683 787 samplingGraph.start(); 684 788 capt3.setEnabled(false); 685 // paus3.setEnabled(true);686 789 play3.setText("Stop"); 687 790 } else { … … 689 792 samplingGraph.stop(); 690 793 capt3.setEnabled(true); 691 // paus3.setEnabled(false);692 794 play3.setText("Play"); 693 795 } … … 699 801 samplingGraph.start(); 700 802 capt4.setEnabled(false); 701 // paus4.setEnabled(true);702 803 play4.setText("Stop"); 703 804 } else { … … 705 806 samplingGraph.stop(); 706 807 capt4.setEnabled(true); 707 // paus4.setEnabled(false);708 808 play4.setText("Play"); 709 809 } … … 715 815 samplingGraph.start(); 716 816 capt5.setEnabled(false); 717 // paus5.setEnabled(true);718 817 play5.setText("Stop"); 719 818 } else { … … 721 820 samplingGraph.stop(); 722 821 capt5.setEnabled(true); 723 // paus5.setEnabled(false);724 822 play5.setText("Play"); 823 } 824 } 825 else if (obj.equals(play6)) { 826 if (play6.getText().startsWith("Play")) { 827 wavFile = wavFile6; // !!!!!! 828 playback.start(); 829 samplingGraph.start(); 830 capt6.setEnabled(false); 831 play6.setText("Stop"); 832 } else { 833 playback.stop(); 834 samplingGraph.stop(); 835 capt6.setEnabled(true); 836 play6.setText("Play"); 837 } 838 } 839 else if (obj.equals(play7)) { 840 if (play7.getText().startsWith("Play")) { 841 wavFile = wavFile7; // !!!!!! 842 playback.start(); 843 samplingGraph.start(); 844 capt7.setEnabled(false); 845 play7.setText("Stop"); 846 } else { 847 playback.stop(); 848 samplingGraph.stop(); 849 capt7.setEnabled(true); 850 play7.setText("Play"); 851 } 852 } 853 else if (obj.equals(play8)) { 854 if (play8.getText().startsWith("Play")) { 855 wavFile = wavFile8; // !!!!!! 856 playback.start(); 857 samplingGraph.start(); 858 capt8.setEnabled(false); 859 play8.setText("Stop"); 860 } else { 861 playback.stop(); 862 samplingGraph.stop(); 863 capt8.setEnabled(true); 864 play8.setText("Play"); 865 } 866 } 867 else if (obj.equals(play9)) { 868 if (play9.getText().startsWith("Play")) { 869 wavFile = wavFile9; // !!!!!! 870 playback.start(); 871 samplingGraph.start(); 872 capt9.setEnabled(false); 873 play9.setText("Stop"); 874 } else { 875 playback.stop(); 876 samplingGraph.stop(); 877 capt9.setEnabled(true); 878 play9.setText("Play"); 879 } 880 } 881 else if (obj.equals(play10)) { 882 if (play10.getText().startsWith("Play")) { 883 wavFile = wavFile10; // !!!!!! 884 playback.start(); 885 samplingGraph.start(); 886 capt10.setEnabled(false); 887 play10.setText("Stop"); 888 } else { 889 playback.stop(); 890 samplingGraph.stop(); 891 capt10.setEnabled(true); 892 play10.setText("Play"); 725 893 } 726 894 } … … 735 903 //Temp hidden loadB.setEnabled(false); 736 904 uploadB.setEnabled(false); 905 moreInfoB.setEnabled(false); 737 906 playB.setEnabled(false); 738 907 pausB.setEnabled(true); … … 747 916 //Temp hidden loadB.setEnabled(true); 748 917 uploadB.setEnabled(true); 918 moreInfoB.setEnabled(true); 749 919 playB.setEnabled(true); 750 920 pausB.setEnabled(false); … … 759 929 if (capt1.getText().startsWith("Record")) { 760 930 file = null; 761 // !!!!!!762 931 wavFile = wavFile1; 763 // capture.start();764 932 capture.start(uploadWavFile1); 765 // !!!!!!766 933 fileName = "untitled"; 767 934 samplingGraph.start(); 768 935 play1.setEnabled(false); 769 // paus1.setEnabled(true);770 936 capt1.setText("Stop"); 937 moreInfoB.setEnabled(false); 771 938 } else { 772 939 lines.removeAllElements(); … … 774 941 samplingGraph.stop(); 775 942 play1.setEnabled(true); 776 // paus1.setEnabled(false);777 943 capt1.setText("Record"); 944 moreInfoB.setEnabled(true); 778 945 } 779 946 } … … 781 948 if (capt2.getText().startsWith("Record")) { 782 949 file = null; 783 // !!!!!!784 950 wavFile = wavFile2; // !!!!!! 785 // capture.start();786 951 capture.start(uploadWavFile2); 787 // !!!!!!788 952 fileName = "untitled"; 789 953 samplingGraph.start(); 790 954 play2.setEnabled(false); 791 // paus2.setEnabled(true);792 955 capt2.setText("Stop"); 956 moreInfoB.setEnabled(false); 793 957 } else { 794 958 lines.removeAllElements(); … … 796 960 samplingGraph.stop(); 797 961 play2.setEnabled(true); 798 // paus2.setEnabled(false);799 962 capt2.setText("Record"); 963 moreInfoB.setEnabled(true); 800 964 } 801 965 } … … 803 967 if (capt3.getText().startsWith("Record")) { 804 968 file = null; 805 // !!!!!!806 969 wavFile = wavFile3; // !!!!!! 807 // capture.start();808 970 capture.start(uploadWavFile3); 809 // !!!!!!810 971 fileName = "untitled"; 811 972 samplingGraph.start(); 812 973 play3.setEnabled(false); 813 // paus3.setEnabled(true);814 974 capt3.setText("Stop"); 975 moreInfoB.setEnabled(false); 815 976 } else { 816 977 lines.removeAllElements(); … … 818 979 samplingGraph.stop(); 819 980 play3.setEnabled(true); 820 // paus3.setEnabled(false);821 981 capt3.setText("Record"); 982 moreInfoB.setEnabled(true); 822 983 } 823 984 } … … 825 986 if (capt4.getText().startsWith("Record")) { 826 987 file = null; 827 // !!!!!!828 988 wavFile = wavFile4; // !!!!!! 829 // capture.start();830 989 capture.start(uploadWavFile4); 831 // !!!!!!832 990 fileName = "untitled"; 833 991 samplingGraph.start(); 834 992 play4.setEnabled(false); 835 // paus4.setEnabled(true);836 993 capt4.setText("Stop"); 994 moreInfoB.setEnabled(false); 837 995 } else { 838 996 lines.removeAllElements(); … … 840 998 samplingGraph.stop(); 841 999 play4.setEnabled(true); 842 // paus4.setEnabled(false);843 1000 capt4.setText("Record"); 1001 moreInfoB.setEnabled(true); 844 1002 } 845 1003 } … … 847 1005 if (capt5.getText().startsWith("Record")) { 848 1006 file = null; 849 // !!!!!!850 1007 wavFile = wavFile5; // !!!!!! 851 // capture.start();852 1008 capture.start(uploadWavFile5); 853 // !!!!!!854 1009 fileName = "untitled"; 855 1010 samplingGraph.start(); 856 1011 play5.setEnabled(false); 857 // paus5.setEnabled(true);858 1012 capt5.setText("Stop"); 1013 moreInfoB.setEnabled(false); 859 1014 } else { 860 1015 lines.removeAllElements(); … … 862 1017 samplingGraph.stop(); 863 1018 play5.setEnabled(true); 864 // paus5.setEnabled(false);865 1019 capt5.setText("Record"); 1020 moreInfoB.setEnabled(true); 866 1021 } 867 } 1022 } 1023 else if (obj.equals(capt6)) { 1024 if (capt6.getText().startsWith("Record")) { 1025 file = null; 1026 wavFile = wavFile6; 1027 capture.start(uploadWavFile6); 1028 fileName = "untitled"; 1029 samplingGraph.start(); 1030 play6.setEnabled(false); 1031 capt6.setText("Stop"); 1032 moreInfoB.setEnabled(false); 1033 } else { 1034 lines.removeAllElements(); 1035 capture.stop(); 1036 samplingGraph.stop(); 1037 play6.setEnabled(true); 1038 capt6.setText("Record"); 1039 moreInfoB.setEnabled(true); 1040 } 1041 } 1042 else if (obj.equals(capt7)) { 1043 if (capt7.getText().startsWith("Record")) { 1044 file = null; 1045 wavFile = wavFile7; // !!!!!! 1046 capture.start(uploadWavFile7); 1047 fileName = "untitled"; 1048 samplingGraph.start(); 1049 play7.setEnabled(false); 1050 capt7.setText("Stop"); 1051 moreInfoB.setEnabled(false); 1052 } else { 1053 lines.removeAllElements(); 1054 capture.stop(); 1055 samplingGraph.stop(); 1056 play7.setEnabled(true); 1057 capt7.setText("Record"); 1058 moreInfoB.setEnabled(true); 1059 } 1060 } 1061 else if (obj.equals(capt8)) { 1062 if (capt8.getText().startsWith("Record")) { 1063 file = null; 1064 wavFile = wavFile8; // !!!!!! 1065 capture.start(uploadWavFile8); 1066 fileName = "untitled"; 1067 samplingGraph.start(); 1068 play8.setEnabled(false); 1069 capt8.setText("Stop"); 1070 moreInfoB.setEnabled(false); 1071 } else { 1072 lines.removeAllElements(); 1073 capture.stop(); 1074 samplingGraph.stop(); 1075 play8.setEnabled(true); 1076 capt8.setText("Record"); 1077 moreInfoB.setEnabled(true); 1078 } 1079 } 1080 else if (obj.equals(capt9)) { 1081 if (capt9.getText().startsWith("Record")) { 1082 file = null; 1083 wavFile = wavFile9; // !!!!!! 1084 capture.start(uploadWavFile9); 1085 fileName = "untitled"; 1086 samplingGraph.start(); 1087 play9.setEnabled(false); 1088 capt9.setText("Stop"); 1089 moreInfoB.setEnabled(false); 1090 } else { 1091 lines.removeAllElements(); 1092 capture.stop(); 1093 samplingGraph.stop(); 1094 play9.setEnabled(true); 1095 capt9.setText("Record"); 1096 moreInfoB.setEnabled(true); 1097 } 1098 } 1099 else if (obj.equals(capt10)) { 1100 if (capt10.getText().startsWith("Record")) { 1101 file = null; 1102 wavFile = wavFile10; // !!!!!! 1103 capture.start(uploadWavFile10); 1104 fileName = "untitled"; 1105 samplingGraph.start(); 1106 play10.setEnabled(false); 1107 capt10.setText("Stop"); 1108 moreInfoB.setEnabled(false); 1109 } else { 1110 lines.removeAllElements(); 1111 capture.stop(); 1112 samplingGraph.stop(); 1113 play10.setEnabled(true); 1114 capt10.setText("Record"); 1115 moreInfoB.setEnabled(true); 1116 } 1117 } 868 1118 // !!!!!! 869 1119 // ################### Pause ####################################### … … 889 1139 } 890 1140 } 891 // !!!!!! 892 else if (obj.equals(paus1)) { 893 if (paus1.getText().startsWith("Pause")) { 894 if (capture.thread != null) { 895 capture.line.stop(); 896 } else { 897 if (playback.thread != null) { 898 playback.line.stop(); 899 } 900 } 901 paus1.setText("Resume"); 902 } else { 903 if (capture.thread != null) { 904 capture.line.start(); 905 } else { 906 if (playback.thread != null) { 907 playback.line.start(); 908 } 909 } 910 paus1.setText("Pause"); 911 } 912 } 913 else if (obj.equals(paus2)) { 914 if (paus2.getText().startsWith("Pause")) { 915 if (capture.thread != null) { 916 capture.line.stop(); 917 } else { 918 if (playback.thread != null) { 919 playback.line.stop(); 920 } 921 } 922 paus2.setText("Resume"); 923 } else { 924 if (capture.thread != null) { 925 capture.line.start(); 926 } else { 927 if (playback.thread != null) { 928 playback.line.start(); 929 } 930 } 931 paus2.setText("Pause"); 932 <