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

GapeAudioPlot Class Reference

Superclass for all built in graphical waveform displays. More...

#include <gapeaudioplot.h>

Inheritance diagram for GapeAudioPlot::

GapeController GapeFreqDomainPlot GapeTimeDomainPlot List of all members.

Public Slots

virtual void receiveTick (const GapeFloat *values, int numValues)
 Recieves new data to plot. More...

void setRefreshFrequency (int rf)
 Sets the inverse refresh frequency, ie higher numbers refresh less often and are less cpu intensive. More...

virtual void setRangeAutoscale (bool autoScaleOn)
 Sets whether the graph automatically scales its ranges to take up the entire display. More...


Signals

void emitSetRangeAutoScale (bool t)
 Emitted when user moves the number of samples slider. More...


Public Methods

 GapeAudioPlot (QWidget *parent=NULL, const char *title="", const char *hlabel="", const char *vlabel="", int nSamples=AUDIOPLOT_DEFAULT_NUM_SAMPLES, double independentScalar=AUDIOPLOT_IVAR_SCALAR, int rFrequency=AUDIOPLOT_DEFAULT_REFRESH_FREQUENCY)
 The Constructor. More...

 ~GapeAudioPlot ()
 The destructor.

void setBackgroundColor (const QColor &color)
 Sets the background color. More...

void setCurveColor (const QColor &color)
 Sets the curve color. More...

void resize (const QSize &size)
 Resizes the display. More...

void setAxisTitle (int axis, const char *t)
 Sets an axis title. More...


Protected Methods

virtual void updateDisplay ()
 Updates the screen. More...


Protected Attributes

QwtPlot* plotDisplay

Detailed Description

Superclass for all built in graphical waveform displays.

The GUI end of either a time domain waveform display or fft frequency display, this class is more of a display than a controller, although it implements the GapeController interface in order to work with GapeUnits. It signals emitTick(), and as soon as the unit chain which has been hooked to it have all completed their work, it will signal emitTick() again. In this manner, it will drive units at the sampling rate if they are hooked up to a real time output, or as fast as possible if they are writing to disk or some other non real time situation. See the GapeSignalDisplay classes for more info (you should probably only be working with those classes anyway)

Author:
Dave Chisholm
Since:
Beta 1.0
Version:
Last Modified Beta 1.0

Definition at line 42 of file gapeaudioplot.h.


Constructor & Destructor Documentation

GapeAudioPlot::GapeAudioPlot ( QWidget * parent = NULL,
const char * title = "",
const char * xlabel = "",
const char * ylabel = "",
int nSamples = AUDIOPLOT_DEFAULT_NUM_SAMPLES,
double independentScalar = AUDIOPLOT_IVAR_SCALAR,
int rFrequency = AUDIOPLOT_DEFAULT_REFRESH_FREQUENCY )
 

The Constructor.

Parameters:
parent   the parent widget.
title   title of the display.
hlabel   x axis label.
vlabel   y axis label.
nSamples   the number of samples of data it will graph (or the number of coefficients it will graph for fft)
independantScalar   numbers the x axis data. Generally set to one. But if, for instance, you were only graphing every third sample for efficiency, you would set this to 3
rFrequency   the INVERSE refresh frequency - ie 3 will make the display refresh only 1/3 of the time, so a high number is less cpu intensive, but less accurate

Definition at line 24 of file gapeaudioplot.cpp.


Member Function Documentation

void GapeAudioPlot::setBackgroundColor ( const QColor & color ) [inline]
 

Sets the background color.

Parameters:
color   a const color passed by reference

Definition at line 68 of file gapeaudioplot.h.

void GapeAudioPlot::setCurveColor ( const QColor & color ) [inline]
 

Sets the curve color.

Parameters:
color   a const color passed by reference

Definition at line 76 of file gapeaudioplot.h.

void GapeAudioPlot::resize ( const QSize & size ) [inline]
 

Resizes the display.

Parameters:
size   a const size passed by reference

Definition at line 84 of file gapeaudioplot.h.

void GapeAudioPlot::setAxisTitle ( int axis,
const char * t ) [inline]
 

Sets an axis title.

Parameters:
axis   which axis to set the title for - use QwtPlot::xBottom, QwtPlot::yLeft, etc...
t   the new title

Definition at line 94 of file gapeaudioplot.h.

Referenced by GapeFreqDomainPlot::takeLogOfSpectrum().

void GapeAudioPlot::receiveTick ( const GapeFloat * values,
int numValues ) [virtual, slot]
 

Recieves new data to plot.

Although this is a controller, not a GapeUnit, we implement recieve tick because the graphical plotter needs the actual data to plot it on the screen. This should recieve large bunches of samples, not one at a time

Parameters:
values   A pointer to our data
numValues   Size of our data

Definition at line 79 of file gapeaudioplot.cpp.

void GapeAudioPlot::setRefreshFrequency ( int rf ) [inline, slot]
 

Sets the inverse refresh frequency, ie higher numbers refresh less often and are less cpu intensive.

Parameters:
rf   the inverse refresh freq, ie 3 = refresh 1/3 the time

Definition at line 117 of file gapeaudioplot.h.

void GapeAudioPlot::setRangeAutoscale ( bool autoScaleOn ) [inline, virtual, slot]
 

Sets whether the graph automatically scales its ranges to take up the entire display.

Parameters:
autoscaleOn   true if you want to scale the display.

Reimplemented in GapeFreqDomainPlot.

Definition at line 125 of file gapeaudioplot.h.

void GapeAudioPlot::emitSetRangeAutoScale ( bool t ) [signal]
 

Emitted when user moves the number of samples slider.

This notifes our underlying GapeSignalDisplayUnit of the new number of samples requested for the display.

Parameters:
ns   The number of samples to display.

Referenced by GapeFreqDomainPlot::setRangeAutoscale(), and setRangeAutoscale().

void GapeAudioPlot::updateDisplay ( ) [inline, protected, virtual]
 

Updates the screen.

We use GapeController's threadsafe screen refreshing because our display is receiving data on a GapeAudioDriver thread, which is independant of our GUI thread. Users will never call this.

Reimplemented from GapeController.

Definition at line 149 of file gapeaudioplot.h.


The documentation for this class was generated from the following files:
Generated at Thu Jun 21 13:28:51 2001 for GAPE by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001