Chris@74: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@74: Chris@74: /* Chris@74: Sonic Visualiser Chris@74: An audio file viewer and annotation editor. Chris@74: Centre for Digital Music, Queen Mary, University of London. Chris@74: This file copyright 2006 Chris Cannam. Chris@74: Chris@74: This program is free software; you can redistribute it and/or Chris@74: modify it under the terms of the GNU General Public License as Chris@74: published by the Free Software Foundation; either version 2 of the Chris@74: License, or (at your option) any later version. See the file Chris@74: COPYING included with this distribution for more information. Chris@74: */ Chris@74: Chris@74: #ifndef _CLIPBOARD_H_ Chris@74: #define _CLIPBOARD_H_ Chris@74: Chris@74: #include Chris@74: #include Chris@74: Chris@1044: #include "BaseTypes.h" Chris@1044: Chris@74: class Clipboard Chris@74: { Chris@74: public: Chris@74: class Point Chris@74: { Chris@74: public: Chris@1044: Point(sv_frame_t frame, QString label); Chris@1044: Point(sv_frame_t frame, float value, QString label); Chris@1044: Point(sv_frame_t frame, float value, sv_frame_t duration, QString label); Chris@1044: Point(sv_frame_t frame, float value, sv_frame_t duration, float level, QString label); Chris@74: Point(const Point &point); Chris@74: Point &operator=(const Point &point); Chris@74: Chris@74: bool haveFrame() const; Chris@1044: sv_frame_t getFrame() const; Chris@1044: Point withFrame(sv_frame_t frame) const; Chris@74: Chris@74: bool haveValue() const; Chris@74: float getValue() const; Chris@872: Point withValue(float value) const; Chris@74: Chris@74: bool haveDuration() const; Chris@1044: sv_frame_t getDuration() const; Chris@1044: Point withDuration(sv_frame_t duration) const; Chris@74: Chris@74: bool haveLabel() const; Chris@74: QString getLabel() const; Chris@872: Point withLabel(QString label) const; Chris@74: Chris@340: bool haveLevel() const; Chris@340: float getLevel() const; Chris@872: Point withLevel(float level) const; Chris@340: Chris@370: bool haveReferenceFrame() const; Chris@370: bool referenceFrameDiffers() const; // from point frame Chris@370: Chris@1044: sv_frame_t getReferenceFrame() const; Chris@1044: void setReferenceFrame(sv_frame_t); Chris@340: Chris@74: private: Chris@74: bool m_haveFrame; Chris@1044: sv_frame_t m_frame; Chris@74: bool m_haveValue; Chris@74: float m_value; Chris@74: bool m_haveDuration; Chris@1044: sv_frame_t m_duration; Chris@74: bool m_haveLabel; Chris@74: QString m_label; Chris@340: bool m_haveLevel; Chris@340: float m_level; Chris@370: bool m_haveReferenceFrame; Chris@1044: sv_frame_t m_referenceFrame; Chris@74: }; Chris@74: Chris@74: Clipboard(); Chris@74: ~Clipboard(); Chris@74: Chris@74: typedef std::vector PointList; Chris@74: Chris@74: void clear(); Chris@74: bool empty() const; Chris@74: const PointList &getPoints() const; Chris@74: void setPoints(const PointList &points); Chris@74: void addPoint(const Point &point); Chris@74: Chris@370: bool haveReferenceFrames() const; Chris@369: bool referenceFramesDiffer() const; Chris@340: Chris@74: protected: Chris@74: PointList m_points; Chris@74: }; Chris@74: Chris@74: #endif