Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

QwavStereoWaveView Class Reference

#include <qwavstereowaveview.h>

Inheritance diagram for QwavStereoWaveView:

Inheritance graph
[legend]
Collaboration diagram for QwavStereoWaveView:

Collaboration graph
[legend]
List of all members.

Public Slots

void activatePeakLayer (bool)
void activateAverageLayer (bool)
void activateZeroLineLayer (bool)
Customization
void setBgColor (const QColor &c)
const QColor & bgColor (void) const
void setPeakColor (const QColor &c)
const QColor & peakColor (void) const
void setAvgColor (const QColor &c)
const QColor & avgColor (void) const
Samples and pixels
void setSamplesVisible (const long &newVal)
void setZoomFac (double zoomFac)
void setZoomYFac (double zoomYFac)
void setFirstSample (ulong sample)
void setChannel (uint channel=1)
uint channel (void) const
void scrollBy (int)

Signals

void selBeginChanged (long sample)
void selEndChanged (long sample)
void zoomFacChanged (double fac)
void positionChanged (ulong sample)
void firstSampleChanged (ulong sample)

Public Methods

const State & state (void) const
Constructor & Destructor
 QwavStereoWaveView (QwavWaveDataInterface *waveData, QWidget *parent, const char *name, int wflags)
 QwavStereoWaveView (const string &file, QWidget *parent, const char *name) throw ( InvalidNrOfChannels, FileOpenError, FileReadError )
virtual ~QwavStereoWaveView ()
Document / View
virtual void update (QWidget *pSender)
Layer
int addLayer (QwavViewLayer *layer)
QwavViewLayergetLayer (const string &name)
QwavViewLayergetLayer (uint index)
uint getNrOfLayers (void) const
QPixmap * getBackbuf (void)
Samples and pixels
int sample2Pixel (long sample) const
long pixel2Sample (int pixel) const
bool isSampleVisible (long sample) const
const int nrOfPixels (void) const
double zoomFac (void) const
double zoomYFac (void) const
double maxZoomFac (void) const
const ulong firstSample (void) const
const long lastSample (void) const
const long samplesVisible (void) const
void setPeakInterpolator (QwavPeakInterpolator *s)
QwavPeakInterpolatorpeakInterpolator () const
Position
void setPosition (const ulong sample)
const ulong & position () const
Selection
uint addSelection (const QwavSelection &s)
uint getNrOfSelections (void) const
const QwavSelectiongetSelection (uint index=0) const
QwavSelectiongetSelection (uint index=0)
int isSelectionBegin (int pixel)
int isSelectionEnd (int pixel)
int activeSelection (void) const
void clearSelections (void)

Protected Slots

void onZoomFacChanged (double)
void onZoomFacInWaveViewChanged (double)
void onZoomFacEntered ()
void onPeakColor ()
void onBgColor ()
void onHScrollBarChanged (int)
void onSelChanged (long)
void onFirstSampleChanged (ulong)

Protected Methods

virtual void resizeEvent (QResizeEvent *e)

Detailed Description

Author:
Peter Eschler
Frames the aggregated SoneView with some additional widgets.


Constructor & Destructor Documentation

QwavStereoWaveView::~QwavStereoWaveView   [virtual]
 

Destructor.


Member Function Documentation

void QwavStereoWaveView::activateZeroLineLayer bool    b [slot]
 

Activates the layer that paints the zero and two helper lines.

Parameters:
b  true to turn the layer on, false to turn it off

int QwavStereoWaveView::activeSelection void    const [inline, virtual]
 

Returns the index of the active selection or -1 of no active selection. The returned index can be just with getQwavSelection() to obtain the active selection.

Returns:
index to the active selection

Implements QwavWaveViewInterface.

int QwavStereoWaveView::addLayer QwavViewLayer   layer [inline, virtual]
 

Adds a layer to this view.

If there is no layer of layer's type present, layer is added and it's index returned.

If a layer with the same type as layer is already present (the type is determined by layer->getName()), layer is not added and -1 is returned.

Parameters:
layer  the layer to add
Returns:
index of the added layer, or -1 if layer was not added
See also:
getLayer

Implements QwavWaveViewInterface.

uint QwavStereoWaveView::addSelection const QwavSelection   s [inline, virtual]
 

Adds the selection s to the selection vector. For now only single selection is implemented. The selection s is added as a deep copy.

Parameters:
s  the selection to add
Returns:
the index of s in the selection vector

Implements QwavWaveViewInterface.

const QColor & QwavStereoWaveView::avgColor void    const [inline, virtual, slot]
 

Returns the average color of this view.

Returns:
the actual average color
See also:
setAvgColor

Implements QwavWaveViewInterface.

const QColor & QwavStereoWaveView::bgColor void    const [inline, virtual, slot]
 

Returns the background color of this view.

Returns:
the actual background color
See also:
setBgColor

Implements QwavWaveViewInterface.

void QwavStereoWaveView::clearSelections void    [inline, virtual]
 

Clears the selection vector and repaints the view.

Implements QwavWaveViewInterface.

const ulong QwavStereoWaveView::firstSample void    const [inline, virtual]
 

Returns the first visible sample in this view.

Returns:
the first visible sample [0,nrOfSamples()]

Implements QwavWaveViewInterface.

void QwavStereoWaveView::firstSampleChanged ulong    sample [virtual, signal]
 

Is emitted when the first visible sample has changed.

Implements QwavWaveViewInterface.

QPixmap * QwavStereoWaveView::getBackbuf void    [inline, virtual]
 

Returns a pointer to the backbuffer QPixmap which is used for flicker-free drawing.

Returns:
pointer to the pixmap

Implements QwavWaveViewInterface.

QwavViewLayer * QwavStereoWaveView::getLayer uint    index [inline, virtual]
 

Returns the view layer with the specified index.

Parameters:
index  index of the layer
Returns:
the QwavViewLayer with that index, or 0 if no layer with that index

Implements QwavWaveViewInterface.

QwavViewLayer * QwavStereoWaveView::getLayer const string &    name [inline, virtual]
 

Returns a pointer to the layer name if present, otherwise 0 is returned.

Parameters:
name  the name of the layer
Returns:
pointer to the layer

Implements QwavWaveViewInterface.

uint QwavStereoWaveView::getNrOfLayers void    const [inline, virtual]
 

Returns the number of layers currently used.

Returns:
the number of layers

Implements QwavWaveViewInterface.

uint QwavStereoWaveView::getNrOfSelections void    const [inline, virtual]
 

Returns the number of selections.

Returns:
the number of selections

Implements QwavWaveViewInterface.

QwavSelection & QwavStereoWaveView::getSelection uint    index = 0 [inline, virtual]
 

Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.

Parameters:
index  the selection to get
Returns:
the selection at index, or Selection::NullSelection

Implements QwavWaveViewInterface.

const QwavSelection & QwavStereoWaveView::getSelection uint    index = 0 const [inline, virtual]
 

Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.

Parameters:
index  the selection to get
Returns:
the selection at index, or Selection::NullSelection

Implements QwavWaveViewInterface.

bool QwavStereoWaveView::isSampleVisible long    sample const [inline, virtual]
 

Checks if sample is visible in this view. If sample is visible true is returned, otherwise false.

Parameters:
sample  the sample to check
Returns:
true if true
false if not

Implements QwavWaveViewInterface.

int QwavStereoWaveView::isSelectionBegin int    pixel [inline, virtual]
 

If pixel is the begin of an available selection, the index of that selection is returned. If pixel is not the begin of any selection -1 is returned.

Parameters:
pixel  the pixel to test
Returns:
index of the selection or -1

Implements QwavWaveViewInterface.

int QwavStereoWaveView::isSelectionEnd int    pixel [inline, virtual]
 

If pixel is the end of an available selection, the index of that selection is returned. If pixel is not the end of any selection -1 is returned.

Parameters:
pixel  the pixel to test
Returns:
index of the selection or -1

Implements QwavWaveViewInterface.

const long QwavStereoWaveView::lastSample void    const [inline, virtual]
 

Returns the first visible sample in this view.

Returns:
the first visible sample [0,nrOfSamples()]

Implements QwavWaveViewInterface.

double QwavStereoWaveView::maxZoomFac void    const [inline, virtual]
 

Returns the maximum zoom factor.

Parameters:
the  maximum zoom factor

Implements QwavWaveViewInterface.

const int QwavStereoWaveView::nrOfPixels void    const [inline, virtual]
 

Returns the number of pixels available. The number of pixel is equal to the width of this widget.

Returns:
the numer of pixels available

Implements QwavWaveViewInterface.

void QwavStereoWaveView::onBgColor   [protected, slot]
 

This slot is called when the background button was clicked.

const QColor & QwavStereoWaveView::peakColor void    const [inline, virtual, slot]
 

Returns the peak color of this view.

Returns:
the actual peak color
See also:
setPeakColor

Implements QwavWaveViewInterface.

QwavPeakInterpolator * QwavStereoWaveView::peakInterpolator   const [inline, virtual]
 

Returns the peak interpolator used.

Returns:
the QwavPeakInterpolator used

Implements QwavWaveViewInterface.

long QwavStereoWaveView::pixel2Sample int    pixel const [inline, virtual]
 

Converts pixel from pixel-space to sample-space. pixel is not bounds checked to allow negative pixel's for some drawing calculations.

The returned position in sample-space is possibly lesser than zero or greater than the number of samples in the waveform.

Parameters:
pixel  the pixel to convert
Returns:
pixel in sample-space

Implements QwavWaveViewInterface.

const ulong & QwavStereoWaveView::position   const [inline, virtual]
 

Returns the current position of the position marker.

Returns:
the current position

Implements QwavWaveViewInterface.

void QwavStereoWaveView::positionChanged ulong    sample [virtual, signal]
 

Is emitted when the current position has changed.

Implements QwavWaveViewInterface.

void QwavStereoWaveView::resizeEvent QResizeEvent *    e [protected, virtual]
 

No descriptions

int QwavStereoWaveView::sample2Pixel long    sample const [inline, virtual]
 

Converts sample from sample-space to pixel-space. sample is not bounds checked to allow negative sample's for some drawing calculations.

The returned position in pixel-space is possibly lesser than zero or greater than the width of the widget.

Parameters:
sample  the sample to convert
Returns:
sample in pixel-space

Implements QwavWaveViewInterface.

const long QwavStereoWaveView::samplesVisible void    const [inline, virtual]
 

Returns the number of samples visible in this view.

Returns:
the number of visible samples

Implements QwavWaveViewInterface.

void QwavStereoWaveView::selBeginChanged long    sample [virtual, signal]
 

Is emitted when the selection begin has changed.

Implements QwavWaveViewInterface.

void QwavStereoWaveView::selEndChanged long    sample [virtual, signal]
 

Is emitted when the selection end has changed.

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setAvgColor const QColor &    c [inline, virtual, slot]
 

Sets the average color of this view to the color c.

Parameters:
c  the new average color
See also:
averageColor

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setBgColor const QColor &    c [inline, virtual, slot]
 

Sets the background color of this view to the color c.

Parameters:
c  the new background color
See also:
bgColor

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setFirstSample ulong    sample [inline, virtual, slot]
 

Sets the first visible sample to be sample.

Parameters:
sample  the sample to make the first one visible
Todo:
should this check sample < nrOfSamples

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setPeakColor const QColor &    c [inline, virtual, slot]
 

Sets the peak color of this view to the color c.

Parameters:
c  the new peak color
See also:
peakColor

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setPosition const ulong    sample [inline, virtual]
 

Sets the position of the position marker to sample.

Parameters:
sample  the new position

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setZoomFac double    zoomFac [inline, virtual, slot]
 

Sets the zoom factor of this view.

Parameters:
zoomFac  the zoom factor to set

Implements QwavWaveViewInterface.

void QwavStereoWaveView::setZoomYFac double    zoomYFac [inline, virtual, slot]
 

Sets the vertical zoom factor of this view.

Parameters:
zoomYFac  the vertical zoom factor

Implements QwavWaveViewInterface.

const QwavWaveViewInterface::State & QwavStereoWaveView::state void    const [inline, virtual]
 

Returns the state of this view.

Returns:
the state
See also:
State

Implements QwavWaveViewInterface.

void QwavStereoWaveView::update QWidget *    pSender [virtual]
 

gets called to redraw the document contents if it has been modified

double QwavStereoWaveView::zoomFac void    const [inline, virtual]
 

Returns the zoom factor of this view. The zoom factor is the quotient
visibleSamples() / width()

The zoom factor is measured in samples per pixel. It tells how much samples are visualised by one pixel. Thus if zoom is 1.0 you get a 1:1 visualization (one sample=one pixel).

To zoom out from the waveform use zoom values greater than 1. The maximum value for zoom is limited to the double of the number of samples.

See also:
samplesVisible
Returns:
the zoom factor

Implements QwavWaveViewInterface.

void QwavStereoWaveView::zoomFacChanged double    fac [virtual, signal]
 

Is emitted when the zoom factor has changed.

Implements QwavWaveViewInterface.

double QwavStereoWaveView::zoomYFac void    const [inline, virtual]
 

Return the vertical zoom factor of this view.

Returns:
the vertical zoom factor

Implements QwavWaveViewInterface.


The documentation for this class was generated from the following files:
Generated on Mon Jan 20 00:24:56 2003 for Qwav by doxygen1.2.16