#include <qwavwaveviewinterface.h>
Inheritance diagram for QwavWaveViewInterface:
Public Types | |
enum | State { NORMAL, MOVING_SEL_BEGIN, MOVING_SEL_END, MOVING_MARKER } |
Public Methods | |
virtual const State & | state (void) const=0 |
Layer | |
virtual int | addLayer (QwavViewLayer *layer)=0 |
virtual QwavViewLayer * | getLayer (const string &name)=0 |
virtual QwavViewLayer * | getLayer (uint index)=0 |
virtual uint | getNrOfLayers (void) const=0 |
virtual QPixmap * | getBackbuf (void)=0 |
Samples and pixels | |
virtual int | sample2Pixel (long sample) const=0 |
virtual long | pixel2Sample (int pixel) const=0 |
virtual bool | isSampleVisible (long sample) const=0 |
const long | nrOfSamples (void) const |
virtual const int | nrOfPixels (void) const=0 |
virtual double | zoomFac (void) const=0 |
virtual double | zoomYFac (void) const=0 |
virtual double | maxZoomFac (void) const=0 |
virtual const unsigned long | firstSample (void) const=0 |
virtual const long | lastSample (void) const=0 |
virtual const long | samplesVisible (void) const=0 |
QwavWaveDataInterface * | waveData (void) const |
void | setWaveData (QwavWaveDataInterface *wd) |
virtual void | setPeakInterpolator (QwavPeakInterpolator *s)=0 |
virtual QwavPeakInterpolator * | peakInterpolator () const=0 |
void | setBorderDist (uint topBorder, uint bottomBorder) |
const uint & | topBorderDist () const |
const uint & | bottomBorderDist () const |
Position | |
virtual void | setPosition (const ulong sample)=0 |
virtual const ulong & | position () const=0 |
Selection | |
virtual uint | addSelection (const QwavSelection &s)=0 |
virtual uint | getNrOfSelections (void) const=0 |
virtual const QwavSelection & | getSelection (uint index=0) const=0 |
virtual QwavSelection & | getSelection (uint index=0)=0 |
virtual int | isSelectionBegin (int pixel)=0 |
virtual int | isSelectionEnd (int pixel)=0 |
virtual int | activeSelection (void) const=0 |
virtual void | clearSelections (void)=0 |
Signals | |
virtual void | selBeginChanged (long sample)=0 |
virtual void | selEndChanged (long sample)=0 |
virtual void | zoomFacChanged (double fac)=0 |
virtual void | positionChanged (ulong sample)=0 |
virtual void | firstSampleChanged (ulong sample)=0 |
Customization | |
virtual void | setBgColor (const QColor &c)=0 |
virtual const QColor & | bgColor (void) const=0 |
virtual void | setPeakColor (const QColor &c)=0 |
virtual const QColor & | peakColor (void) const=0 |
virtual void | setAvgColor (const QColor &c)=0 |
virtual const QColor & | avgColor (void) const=0 |
Samples and pixels | |
virtual void | setSamplesVisible (const long &newVal)=0 |
virtual void | setZoomFac (double zoomFac)=0 |
virtual void | setZoomYFac (double zoomYFac)=0 |
virtual void | setFirstSample (ulong sample)=0 |
virtual void | setChannel (uint channel=1)=0 |
virtual uint | channel (void) const=0 |
virtual void | scrollBy (int pixel)=0 |
Protected Methods | |
QwavWaveViewInterface () | |
QwavWaveViewInterface (QwavWaveDataInterface *wd) | |
Friends | |
class | QwavMonoWaveView |
class | QwavStereoWaveView |
nrOfSamples() is the number of samples per channel (stereo sounds are not supported for now, mono only)
nrOfPixels() is the number of available pixels, which simply is the width() of this wave view widget.
samplesVisible() is used to set the number of samples to be visible in the view (which is nrOfPixels() wide).
zoomFac() is the quotient samplesVisible/nrOfPixels and thus depends on samplesVisible()
firstSample() specifies the first visible sample. It can be set by setFirstSample() and is used to implement scrolling.
A QwavWaveView automatically contains some standard layers (otherwise nothing would be painted). The five standard layers are:
These layers can be accessed by their name via getLayer(). The name is simply the classname of the layer (e.g. "QwavPeakDataLayer"). Alternatively a layer can be accessed via it's index using getLayer() and the index obtained by calling addLayer().
|
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.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
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.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Adds the selection s to the selection vector. For now only single selection is implemented. The selection s is added as a deep copy.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the average color of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the background color of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Clears the selection vector and repaints the view. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the first visible sample in this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Is emitted when the first visible sample has changed. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns a pointer to the backbuffer QPixmap which is used for flicker-free drawing.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the view layer with the specified index.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns a pointer to the layer name if present, otherwise 0 is returned.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the number of layers currently used.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the number of selections.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Checks if sample is visible in this view. If sample is visible true is returned, otherwise false.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
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. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
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. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the first visible sample in this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the maximum zoom factor.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the number of pixels available. The number of pixel is equal to the width of this widget.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the number of samples of the waveform displayed by this view. This is a convenient function that calls getDocument()->getWave()->getNrOfSamples();.
|
|
Returns the peak color of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the peak interpolator used.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
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.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the current position of the position marker.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Is emitted when the current position has changed. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
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.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the number of samples visible in this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Is emitted when the selection begin has changed. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Is emitted when the selection end has changed. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the average color of this view to the color c.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the background color of this view to the color c.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the first visible sample to be sample.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the peak color of this view to the color c.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the position of the position marker to sample.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the wave data.
|
|
Sets the zoom factor of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Sets the vertical zoom factor of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns the state of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Returns a pointer to the wave data.
|
|
Returns the zoom factor of this view. The zoom factor is the quotient 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.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Is emitted when the zoom factor has changed. Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |
|
Return the vertical zoom factor of this view.
Implemented in QwavMonoWaveView, QwavStereoWaveView, and QwavWaveView. |