Android Open Source - BluetoothRecord Waveform Panel Container






From Project

Back to project page BluetoothRecord.

License

The source code is released under:

Apache License

If you think the Android project BluetoothRecord listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.audioseparate;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.util.ArrayList;
//w w w  .ja  va  2 s .  c  om
import javax.sound.sampled.AudioInputStream;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class WaveformPanelContainer extends JPanel {    
  /**
   *
   */
  private static final long serialVersionUID = -275269905102149949L;
  private ArrayList<SingleWaveformPanel> singleChannelWaveformPanels = new ArrayList<SingleWaveformPanel>();
  private AudioSep audioSep = null;
   
  public WaveformPanelContainer() {
    setLayout(new GridLayout(0,1));
  }

  public void setAudioToDisplay(AudioInputStream audioInputStream){
    singleChannelWaveformPanels = new ArrayList<SingleWaveformPanel>();
    audioSep = new AudioSep(audioInputStream);
    for (int t=0; t<audioSep.getNumberOfChannels(); t++){
      SingleWaveformPanel waveformPanel
        = new SingleWaveformPanel(audioSep, t);
      singleChannelWaveformPanels.add(waveformPanel);
      add(createChannelDisplay(waveformPanel, t));
    }
  }
  private JComponent createChannelDisplay(
      SingleWaveformPanel waveformPanel,
      int index) {

       JPanel panel = new JPanel(new BorderLayout());
     panel.add(waveformPanel, BorderLayout.CENTER);

     JLabel label = new JLabel("Channel " + ++index);
     panel.add(label, BorderLayout.NORTH);

     return panel;
  }
}




Java Source Code List

com.audioseparate.AudioSampleReader.java
com.audioseparate.AudioSep.java
com.audioseparate.BTConnect.java
com.audioseparate.MainActivity.java
com.audioseparate.Record.java
com.audioseparate.SingleWaveformPanel.java
com.audioseparate.WaveformPanelContainer.java
com.audioserver.BTServer.java
com.audioserver.ServerCommand.java