Diff of /libkwave/Curve.h [3e4acc] .. [1f6d2f] Maximize Restore

  Switch to side-by-side view

--- a/libkwave/Curve.h
+++ b/libkwave/Curve.h
@@ -32,136 +32,142 @@
 
 #include "Interpolation.h"
 
-class KDE_EXPORT Curve: public QList<QPointF>
+namespace Kwave
 {
-public:
+    class KDE_EXPORT Curve: public QList<QPointF>
+    {
+    public:
 
-    /** Iterator */
-    typedef QListIterator<QPointF> ConstIterator;
+	/** Iterator */
+	typedef QListIterator<QPointF> ConstIterator;
 
-    /** Iterator */
-    typedef QMutableListIterator<QPointF> Iterator;
+	/** Iterator */
+	typedef QMutableListIterator<QPointF> Iterator;
 
-    /** class used for the points */
-    typedef QPointF Point;
+	/** class used for the points */
+	typedef QPointF Point;
 
-    /** used for the "invalid" point */
-    static QPointF NoPoint;
+	/** used for the "invalid" point */
+	static QPointF NoPoint;
 
-    /**
-     * Default constructor, creates an empty curve.
-     */
-    Curve();
+	/**
+	 * Default constructor, creates an empty curve.
+	 */
+	Curve();
 
-    /**
-     * Constructor, creates a curve from a command string.
-     * @param command string with parameters
-     */
-    Curve(const QString &command);
+	/**
+	 * Constructor, creates a curve from a command string.
+	 * @param command string with parameters
+	 */
+	Curve(const QString &command);
 
-    /** Destructor */
-    virtual ~Curve();
+	/** Destructor */
+	virtual ~Curve();
 
-    /** Moves all current points into the left half */
-    void firstHalf();
+	/** Moves all current points into the left half */
+	void firstHalf();
 
-    /** Moves all current points into the right half */
-    void secondHalf();
+	/** Moves all current points into the right half */
+	void secondHalf();
 
-    /**
-     * Removes and deletes a point from the curve. Note that after this
-     * call the passed point is no longer valid!
-     * @param p point to be deleted
-     * @param check if true, the last or first point will not be deleted
-     */
-    void deletePoint(Point p, bool check);
+	/**
+	 * Removes and deletes a point from the curve. Note that after this
+	 * call the passed point is no longer valid!
+	 * @param p point to be deleted
+	 * @param check if true, the last or first point will not be deleted
+	 */
+	void deletePoint(Point p, bool check);
 
-    /**
-     * Deletes every second point.
-     */
-    void deleteSecondPoint();
+	/**
+	 * Deletes every second point.
+	 */
+	void deleteSecondPoint();
 
-    /**
-     * Flips/mirrors the curve horizontally (x-axis).
-     */
-    void HFlip();
+	/**
+	 * Flips/mirrors the curve horizontally (x-axis).
+	 */
+	void HFlip();
 
-    /**
-     * Flips/mirrors the curve vertically (y-axis).
-     */
-    void VFlip();
+	/**
+	 * Flips/mirrors the curve vertically (y-axis).
+	 */
+	void VFlip();
 
-    /**
-     * Scales the curve vertically to fit into a range of (+/- range/2)
-     * on the y-axis.
-     * @param range
-     */
-    void scaleFit(unsigned int range = 1024);
+	/**
+	 * Scales the curve vertically to fit into a range of (+/- range/2)
+	 * on the y-axis.
+	 * @param range
+	 */
+	void scaleFit(unsigned int range = 1024);
 
-    /**
-     * Creates a new point and inserts it into the curve. The new
-     * point will be sorted in by it's x coordinate.
-     * @param x coordinate on the x axis, should be [0...+1.0]
-     * @param y coordinate on the y axis, should be [0...+1.0]
-     */
-    void insert(double x, double y);
+	/**
+	 * Creates a new point and inserts it into the curve. The new
+	 * point will be sorted in by it's x coordinate.
+	 * @param x coordinate on the x axis, should be [0...+1.0]
+	 * @param y coordinate on the y axis, should be [0...+1.0]
+	 */
+	void insert(double x, double y);
 
-    /**
-     * Searches for a point at given coordinates with a definable
-     * tolerance.
-     * @param x coordinate on the x axis
-     * @param y coordinate on the y axis
-     * @param tol tolerance for x and y direction, absolute value
-     * @return pointer to the found point or "NoPoint" if nothing found.
-     */
-    Point findPoint(double x, double y, double tol = .05);
+	/**
+	 * Searches for a point at given coordinates with a definable
+	 * tolerance.
+	 * @param x coordinate on the x axis
+	 * @param y coordinate on the y axis
+	 * @param tol tolerance for x and y direction, absolute value
+	 * @return pointer to the found point or "NoPoint" if nothing found.
+	 */
+	Point findPoint(double x, double y, double tol = .05);
 
-    /**
-     * Sets a curve from a command string. Opposite of getCommand().
-     * @param command a string that contains the interpolation
-     *        type and pairs of x/y coordinates.
-     */
-    void fromCommand(const QString &command);
+	/**
+	 * Sets a curve from a command string. Opposite of getCommand().
+	 * @param command a string that contains the interpolation
+	 *        type and pairs of x/y coordinates.
+	 */
+	void fromCommand(const QString &command);
 
-    /**
-     * Returns a command string out of the curve points and
-     * interpolation type.
-     */
-    QString getCommand();
+	/**
+	 * Returns a command string out of the curve points and
+	 * interpolation type.
+	 */
+	QString getCommand();
 
-    /**
-     * Returns the interpolation type.
-     */
-    interpolation_t interpolationType();
+	/**
+	 * Returns the interpolation type.
+	 */
+	Kwave::interpolation_t interpolationType();
 
-    /**
-     * Sets a new interpolation type.
-     * @param type the new interpolation type
-     */
-    void setInterpolationType(interpolation_t type);
+	/**
+	 * Sets a new interpolation type.
+	 * @param type the new interpolation type
+	 */
+	void setInterpolationType(Kwave::interpolation_t type);
 
-    /** Returns a reference to the Interpolation object itself */
-    Interpolation &interpolation();
+	/** Returns a reference to the Interpolation object itself */
+	Kwave::Interpolation &interpolation();
 
-    /**
-     * Returns an array of points, calculated out of the
-     * current interpolation parameters.
-     * @param points number of points
-     * @return Array of interpolated values or null if the
-     *         number of points was zero or the curve was empty.
-     */
-    QVector<double> interpolation(unsigned int points);
+	/**
+	 * Returns an array of points, calculated out of the
+	 * current interpolation parameters.
+	 * @param points number of points
+	 * @return Array of interpolated values or null if the
+	 *         number of points was zero or the curve was empty.
+	 */
+	QVector<double> interpolation(unsigned int points);
 
-protected:
+    protected:
 
-    /** sorts the list by ascending x coordinate */
-    void sort();
+	/** sorts the list by ascending x coordinate */
+	void sort();
 
-private:
+    private:
 
-    /** interpolation object */
-    Interpolation m_interpolation;
+	/** interpolation object */
+	Kwave::Interpolation m_interpolation;
 
-};
+    };
+}
 
 #endif /* _CURVE_H_ */
+
+//***************************************************************************
+//***************************************************************************