#include <qwavwaveview.h>
Inheritance diagram for QwavWaveView:
Public Slots | |
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 pixel) |
void | displayHelp (void) |
Signals | |
void | selBeginChanged (long sample) |
void | selEndChanged (long sample) |
void | zoomFacChanged (double fac) |
void | positionChanged (ulong sample) |
void | firstSampleChanged (ulong sample) |
Public Methods | |
const QwavWaveViewInterface::State & | state (void) const |
Constructor & Destructor | |
QwavWaveView (QwavWaveDataInterface *waveData, QWidget *parent, const char *name, int wflags=WDestructiveClose) throw (InvalidNrOfChannels, FileOpenError) | |
QwavWaveView (const string &file, QWidget *parent, const char *name) throw (InvalidNrOfChannels, FileOpenError, FileReadError) | |
virtual | ~QwavWaveView () |
Layer | |
int | addLayer (QwavViewLayer *layer) |
QwavViewLayer * | getLayer (const string &name) |
QwavViewLayer * | getLayer (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) |
QwavPeakInterpolator * | peakInterpolator () const |
Position | |
void | setPosition (const ulong sample) |
const ulong & | position () const |
QwavSelection | |
uint | addSelection (const QwavSelection &s) |
uint | getNrOfSelections (void) const |
const QwavSelection & | getSelection (uint index=0) const |
QwavSelection & | getSelection (uint index=0) |
int | isSelectionBegin (int pixel) |
int | isSelectionEnd (int pixel) |
int | activeSelection (void) const |
void | clearSelections (void) |
Protected Methods | |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | keyReleaseEvent (QKeyEvent *e) |
void | setState (State s) |
virtual void | initLayers () |
Friends | |
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().
|
Constructs a new view on a waveform. This constructor gets it's data from the given pDoc. If the sounddata has more than one channel an InvalidNrOfChannels exception is thrown.
|
|
Constructs a QwavWaveView displaying the mono sound in file. If file is not a mono sound an InvalidNrOfChannels exception is thrown. |
|
Destructor. |
|
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.
Implements QwavWaveViewInterface. |
|
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.
Implements QwavWaveViewInterface. |
|
Adds the selection s to the selection vector. For now only single selection is implemented. The selection s is added as a deep copy.
Implements QwavWaveViewInterface. |
|
Returns the average color of this view.
Implements QwavWaveViewInterface. |
|
Returns the background color of this view.
Implements QwavWaveViewInterface. |
|
Clears the selection vector and repaints the view. Implements QwavWaveViewInterface. |
|
Returns the first visible sample in this view.
Implements QwavWaveViewInterface. |
|
Is emitted when the first visible sample has changed. Implements QwavWaveViewInterface. |
|
Returns a pointer to the backbuffer pixmap. The pixmap is used by the view layers of this QwavWaveView to paint onto.
Implements QwavWaveViewInterface. |
|
Returns the view layer with the specified index.
Implements QwavWaveViewInterface. |
|
Returns a pointer to the layer name if present, otherwise 0 is returned.
Implements QwavWaveViewInterface. |
|
Returns the number of layers currently used.
Implements QwavWaveViewInterface. |
|
Returns the number of selections.
Implements QwavWaveViewInterface. |
|
Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.
Implements QwavWaveViewInterface. |
|
Returns a reference to the selection with the given index. If no selection with index exists, Selection::NullSelection is returned.
Implements QwavWaveViewInterface. |
|
Checks if sample is visible in this view. If sample is visible true is returned, otherwise false.
Implements QwavWaveViewInterface. |
|
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. Implements QwavWaveViewInterface. |
|
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. Implements QwavWaveViewInterface. |
|
Returns the first visible sample in this view.
Implements QwavWaveViewInterface. |
|
Returns the maximum zoom factor.
Implements QwavWaveViewInterface. |
|
Returns the number of pixels available. The number of pixel is equal to the width of this widget.
Implements QwavWaveViewInterface. |
|
No descriptions |
|
Returns the peak color of this view.
Implements QwavWaveViewInterface. |
|
Returns the peak interpolator used.
Implements QwavWaveViewInterface. |
|
Returns the sample of the given pixel.
Implements QwavWaveViewInterface. |
|
Returns the current position of the position marker.
Implements QwavWaveViewInterface. |
|
Is emitted when the current position has changed. Implements QwavWaveViewInterface. |
|
Returns the pixel position of the given sample. If sample is not visible in this view -1 is returned.
Implements QwavWaveViewInterface. |
|
Returns the number of samples visible in this view.
Implements QwavWaveViewInterface. |
|
Is emitted when the selection begin has changed. Implements QwavWaveViewInterface. |
|
Is emitted when the selection end has changed. Implements QwavWaveViewInterface. |
|
Sets the average color of this view to the color c.
Implements QwavWaveViewInterface. |
|
Sets the background color of this view to the color c.
Implements QwavWaveViewInterface. |
|
\copydoc QwavWaveViewInterface::setFirstSample() This implementation first checks if sample is different to the current first sample. Implements QwavWaveViewInterface. |
|
Sets the peak color of this view to the color c.
Implements QwavWaveViewInterface. |
|
Sets the position of the position marker to sample.
Implements QwavWaveViewInterface. |
|
Sets the number of pixels visible in this view. Implements QwavWaveViewInterface. |
|
Sets the zoom factor of this view.
Implements QwavWaveViewInterface. |
|
Sets the vertical zoom factor of this view.
Implements QwavWaveViewInterface. |
|
Returns the state of this view.
Implements QwavWaveViewInterface. |
|
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.
Implements QwavWaveViewInterface. |
|
Is emitted when the zoom factor has changed. Implements QwavWaveViewInterface. |
|
Return the vertical zoom factor of this view.
Implements QwavWaveViewInterface. |