Android Open Source - OpenSynth Envelope View From Project Back to project page OpenSynth .
License The source code is released under:
Apache License
If you think the Android project OpenSynth 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.indigo_lab.android.opensynth.view;
/ * w w w . j a v a 2 s . c o m * /
import android.content.Context;
import android.util.AttributeSet;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import com.indigo_lab.android.opensynth.R;
public abstract class EnvelopeView extends ControllerView implements OnSeekBarChangeListener {
private SeekBar mAttackSeekBar;
private SeekBar mDecaySeekBar;
private SeekBar mSustainSeekBar;
private SeekBar mReleaseSeekBar;
public EnvelopeView(Context context, AttributeSet attrs, int defStyle, int resource) {
super (context, attrs, defStyle, resource);
mAttackSeekBar = (SeekBar)findViewById(R.id.attack_seekbar);
mAttackSeekBar.setOnSeekBarChangeListener(this );
mAttackSeekBar.setMax(100);
mDecaySeekBar = (SeekBar)findViewById(R.id.decay_seekbar);
mDecaySeekBar.setOnSeekBarChangeListener(this );
mAttackSeekBar.setMax(100);
mSustainSeekBar = (SeekBar)findViewById(R.id.sustain_seekbar);
mSustainSeekBar.setOnSeekBarChangeListener(this );
mAttackSeekBar.setMax(100);
mReleaseSeekBar = (SeekBar)findViewById(R.id.release_seekbar);
mReleaseSeekBar.setOnSeekBarChangeListener(this );
mAttackSeekBar.setMax(100);
}
protected long calcSample(int progress, float scale) {
float seconds = (progress / 100f) * scale;
return Math.round(44100 * seconds);
}
public abstract void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) ;
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
}
Java Source Code List com.google.synthesizer.android.widgets.piano.BlackPianoKey.java com.google.synthesizer.android.widgets.piano.NotePianoKey.java com.google.synthesizer.android.widgets.piano.OctavePianoKey.java com.google.synthesizer.android.widgets.piano.PianoKey.java com.google.synthesizer.android.widgets.piano.PianoViewListener.java com.google.synthesizer.android.widgets.piano.PianoView.java com.google.synthesizer.android.widgets.piano.WhitePianoKey.java com.google.synthesizer.core.midi.MidiListener.java com.google.synthesizer.core.music.Note.java com.indigo_lab.android.opensynth.OpenSynthActivity.java com.indigo_lab.android.opensynth.ViewPagerAdapter.java com.indigo_lab.android.opensynth.view.ArpeggioView.java com.indigo_lab.android.opensynth.view.ControllerView.java com.indigo_lab.android.opensynth.view.EnvelopeView.java com.indigo_lab.android.opensynth.view.FilterEnvelopeView.java com.indigo_lab.android.opensynth.view.FilterView.java com.indigo_lab.android.opensynth.view.ImageRadioButton.java com.indigo_lab.android.opensynth.view.ModulationView.java com.indigo_lab.android.opensynth.view.OscillatorDetailView.java com.indigo_lab.android.opensynth.view.OscillatorView.java com.indigo_lab.android.opensynth.view.RadioButton.java com.indigo_lab.android.opensynth.view.VolumeEnvelopeView.java org.thebends.synth.Arpeggio.java org.thebends.synth.Controller.java org.thebends.synth.Envelope.java org.thebends.synth.FilterCutoff.java org.thebends.synth.Filter.java org.thebends.synth.FixedParameter.java org.thebends.synth.KeyStack.java org.thebends.synth.KeyboardOscillator.java org.thebends.synth.LFO.java org.thebends.synth.LagProcessor.java org.thebends.synth.LowPassFilter.java org.thebends.synth.MutableParameter.java org.thebends.synth.Oscillator.java org.thebends.synth.Parameter.java org.thebends.synth.ResonantFilter.java org.thebends.synth.SynthJni.java org.thebends.synth.SynthTrack.java org.thebends.synth.Volume.java