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@74: class Clipboard Chris@74: { Chris@74: public: Chris@74: class Point Chris@74: { Chris@74: public: Chris@74: Point(long frame, QString label); Chris@74: Point(long frame, float value, QString label); Chris@74: Point(long frame, float value, size_t duration, QString label); Chris@340: Point(long frame, float value, size_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@74: long getFrame() const; Chris@74: Chris@74: bool haveValue() const; Chris@74: float getValue() const; Chris@74: Chris@74: bool haveDuration() const; Chris@74: size_t getDuration() const; Chris@74: Chris@74: bool haveLabel() const; Chris@74: QString getLabel() const; Chris@74: Chris@340: bool haveLevel() const; Chris@340: float getLevel() const; Chris@340: Chris@370: bool haveReferenceFrame() const; Chris@370: bool referenceFrameDiffers() const; // from point frame Chris@370: Chris@340: long getReferenceFrame() const; Chris@340: void setReferenceFrame(long); Chris@340: Chris@74: private: Chris@74: bool m_haveFrame; Chris@74: long m_frame; Chris@74: bool m_haveValue; Chris@74: float m_value; Chris@74: bool m_haveDuration; Chris@74: size_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@340: long 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