Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.laoe.clip
Class AChannelSelection  view AChannelSelection download AChannelSelection.java

java.lang.Object
  extended bych.laoe.clip.AObject
      extended bych.laoe.clip.ASelection
          extended bych.laoe.clip.AChannelSelection

public class AChannelSelection
extends ASelection

This file is part of LAoE. LAoE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. LAoE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LAoE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Class: ASelection Autor: olivier gäumann, neuchâtel (switzerland) JDK: 1.3 Desctription: a selection defines a continuous set of samples inside a channel. History: Date: Description: Autor: 25.07.00 erster Entwurf oli4 03.08.00 neuer Stil oli4 19.12.00 float audio samples oli4 16.05.01 add start/endOperation oli4 11.01.02 introduce intensity-points oli4


Nested Class Summary
 class AChannelSelection.Point
          this class represents one point of intensity of this selection
 
Field Summary
private  int activeIntensityPointIndex
           
static int CUBIC_INTENSITY_SCALE
           
private  boolean intensityChanged
           
private  java.util.ArrayList intensityPoints
           
private static int intensityScale
           
private  boolean intensityUsed
           
private  int length
           
static int LINEAR_INTENSITY_SCALE
           
private static int nameCounter
           
private  int offset
           
private  ASelectionPlotter plotter
           
private  float[] px
           
private  float[] py
           
static int SQUARE_INTENSITY_SCALE
           
static int SQUARE_ROOT_INTENSITY_SCALE
           
 
Fields inherited from class ch.laoe.clip.ASelection
model
 
Fields inherited from class ch.laoe.clip.AObject
name
 
Constructor Summary
AChannelSelection()
          null-constructor
AChannelSelection(AChannel ch)
          constructor
AChannelSelection(AChannel ch, int offset, int length)
          easy constructor
AChannelSelection(AChannelSelection s)
          copy-constructor
 
Method Summary
 void addIntensityPoint(float x, float y)
          add a new intensity-point at the right place in the arraylist if x corresponds to an existing point, then just change its y-value
 void clearIntensity()
          clear the intensity-points to default value (all 1)
 int getActiveIntensityPointIndex()
           
 AChannel getChannel()
           
 float getIntensity(int x)
          returns the (interpolated) intensity at the given channel-index x
 java.util.ArrayList getIntensityPoints()
          returns the arraylist of all intensity-points of this selection
 int getLength()
          get length
 int getOffset()
          get offset
 ASelectionPlotter getPlotter()
           
private  void initIntensityPoints()
           
 boolean isSelected()
          returns true if anything is selected
 boolean isSelected(int x)
          returns true if x is inside the selectioned indexes
 float mixIntensity(int index, float original, float modified)
          mixes directly original and modified sample in function of the current intensity-value.
 void modifyIntensityPoint(int index, float x, float y)
          modify an existing intensity-point
 void operateChannel(ch.laoe.operation.AOperation o)
          operate this channel
 void removeIntensityPoint(float x)
          remove a intensity-point from the arraylist
 int searchLeftIntensityPointIndex(float x)
          returns the index of the next left intensity-point from x, where x is the normalized horizontal position, in the range of 0 to 1.
 int searchNearestIntensityPointIndex(float x)
          returns the index of the nearest intensity-point from x, where x is the normalized horizontal position, in the range of 0 to 1.
 void setActiveIntensityPoint(float x)
           
 void setChannel(AChannel ch)
           
 void setDefaultName()
          set the default name of the layer
static void setIntensityScale(int s)
          scale
 void setLength(int l)
          set length
 void setOffset(int o)
          set offset
 
Methods inherited from class ch.laoe.clip.ASelection
getModel
 
Methods inherited from class ch.laoe.clip.AObject
getName, setDefaultName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nameCounter

private static int nameCounter

plotter

private ASelectionPlotter plotter

offset

private int offset

length

private int length

intensityPoints

private java.util.ArrayList intensityPoints

intensityUsed

private boolean intensityUsed

activeIntensityPointIndex

private int activeIntensityPointIndex

LINEAR_INTENSITY_SCALE

public static final int LINEAR_INTENSITY_SCALE
See Also:
Constant Field Values

SQUARE_INTENSITY_SCALE

public static final int SQUARE_INTENSITY_SCALE
See Also:
Constant Field Values

CUBIC_INTENSITY_SCALE

public static final int CUBIC_INTENSITY_SCALE
See Also:
Constant Field Values

SQUARE_ROOT_INTENSITY_SCALE

public static final int SQUARE_ROOT_INTENSITY_SCALE
See Also:
Constant Field Values

intensityScale

private static int intensityScale

px

private float[] px

py

private float[] py

intensityChanged

private boolean intensityChanged
Constructor Detail

AChannelSelection

public AChannelSelection(AChannel ch)
constructor


AChannelSelection

public AChannelSelection()
null-constructor


AChannelSelection

public AChannelSelection(AChannel ch,
                         int offset,
                         int length)
easy constructor


AChannelSelection

public AChannelSelection(AChannelSelection s)
copy-constructor

Method Detail

getChannel

public AChannel getChannel()

setChannel

public void setChannel(AChannel ch)

setDefaultName

public void setDefaultName()
set the default name of the layer

Specified by:
setDefaultName in class AObject

getPlotter

public ASelectionPlotter getPlotter()

setOffset

public void setOffset(int o)
set offset


getOffset

public int getOffset()
get offset


setLength

public void setLength(int l)
set length


getLength

public int getLength()
get length


isSelected

public boolean isSelected(int x)
returns true if x is inside the selectioned indexes


isSelected

public boolean isSelected()
returns true if anything is selected

Specified by:
isSelected in class ASelection

getIntensityPoints

public java.util.ArrayList getIntensityPoints()
returns the arraylist of all intensity-points of this selection


searchLeftIntensityPointIndex

public int searchLeftIntensityPointIndex(float x)
returns the index of the next left intensity-point from x, where x is the normalized horizontal position, in the range of 0 to 1.


searchNearestIntensityPointIndex

public int searchNearestIntensityPointIndex(float x)
returns the index of the nearest intensity-point from x, where x is the normalized horizontal position, in the range of 0 to 1.


addIntensityPoint

public void addIntensityPoint(float x,
                              float y)
add a new intensity-point at the right place in the arraylist if x corresponds to an existing point, then just change its y-value


modifyIntensityPoint

public void modifyIntensityPoint(int index,
                                 float x,
                                 float y)
modify an existing intensity-point


removeIntensityPoint

public void removeIntensityPoint(float x)
remove a intensity-point from the arraylist


clearIntensity

public void clearIntensity()
clear the intensity-points to default value (all 1)


setActiveIntensityPoint

public void setActiveIntensityPoint(float x)

getActiveIntensityPointIndex

public int getActiveIntensityPointIndex()

setIntensityScale

public static void setIntensityScale(int s)
scale


getIntensity

public float getIntensity(int x)
returns the (interpolated) intensity at the given channel-index x


mixIntensity

public float mixIntensity(int index,
                          float original,
                          float modified)
mixes directly original and modified sample in function of the current intensity-value.


initIntensityPoints

private void initIntensityPoints()

operateChannel

public void operateChannel(ch.laoe.operation.AOperation o)
operate this channel