annotate base/Clipboard.h @ 997:2104ea2204d2

Separate out stdout ability (not all writers that support one-file will necessarily want to support it, e.g. for binary formats)
author Chris Cannam
date Mon, 13 Oct 2014 10:56:16 +0100
parents 6a94bb528e9d
children 31f01931b781
rev   line source
Chris@74 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@74 2
Chris@74 3 /*
Chris@74 4 Sonic Visualiser
Chris@74 5 An audio file viewer and annotation editor.
Chris@74 6 Centre for Digital Music, Queen Mary, University of London.
Chris@74 7 This file copyright 2006 Chris Cannam.
Chris@74 8
Chris@74 9 This program is free software; you can redistribute it and/or
Chris@74 10 modify it under the terms of the GNU General Public License as
Chris@74 11 published by the Free Software Foundation; either version 2 of the
Chris@74 12 License, or (at your option) any later version. See the file
Chris@74 13 COPYING included with this distribution for more information.
Chris@74 14 */
Chris@74 15
Chris@74 16 #ifndef _CLIPBOARD_H_
Chris@74 17 #define _CLIPBOARD_H_
Chris@74 18
Chris@74 19 #include <QString>
Chris@74 20 #include <vector>
Chris@74 21
Chris@74 22 class Clipboard
Chris@74 23 {
Chris@74 24 public:
Chris@74 25 class Point
Chris@74 26 {
Chris@74 27 public:
Chris@74 28 Point(long frame, QString label);
Chris@74 29 Point(long frame, float value, QString label);
Chris@928 30 Point(long frame, float value, int duration, QString label);
Chris@928 31 Point(long frame, float value, int duration, float level, QString label);
Chris@74 32 Point(const Point &point);
Chris@74 33 Point &operator=(const Point &point);
Chris@74 34
Chris@74 35 bool haveFrame() const;
Chris@74 36 long getFrame() const;
Chris@872 37 Point withFrame(long frame) const;
Chris@74 38
Chris@74 39 bool haveValue() const;
Chris@74 40 float getValue() const;
Chris@872 41 Point withValue(float value) const;
Chris@74 42
Chris@74 43 bool haveDuration() const;
Chris@928 44 int getDuration() const;
Chris@928 45 Point withDuration(int duration) const;
Chris@74 46
Chris@74 47 bool haveLabel() const;
Chris@74 48 QString getLabel() const;
Chris@872 49 Point withLabel(QString label) const;
Chris@74 50
Chris@340 51 bool haveLevel() const;
Chris@340 52 float getLevel() const;
Chris@872 53 Point withLevel(float level) const;
Chris@340 54
Chris@370 55 bool haveReferenceFrame() const;
Chris@370 56 bool referenceFrameDiffers() const; // from point frame
Chris@370 57
Chris@340 58 long getReferenceFrame() const;
Chris@340 59 void setReferenceFrame(long);
Chris@340 60
Chris@74 61 private:
Chris@74 62 bool m_haveFrame;
Chris@74 63 long m_frame;
Chris@74 64 bool m_haveValue;
Chris@74 65 float m_value;
Chris@74 66 bool m_haveDuration;
Chris@928 67 int m_duration;
Chris@74 68 bool m_haveLabel;
Chris@74 69 QString m_label;
Chris@340 70 bool m_haveLevel;
Chris@340 71 float m_level;
Chris@370 72 bool m_haveReferenceFrame;
Chris@340 73 long m_referenceFrame;
Chris@74 74 };
Chris@74 75
Chris@74 76 Clipboard();
Chris@74 77 ~Clipboard();
Chris@74 78
Chris@74 79 typedef std::vector<Point> PointList;
Chris@74 80
Chris@74 81 void clear();
Chris@74 82 bool empty() const;
Chris@74 83 const PointList &getPoints() const;
Chris@74 84 void setPoints(const PointList &points);
Chris@74 85 void addPoint(const Point &point);
Chris@74 86
Chris@370 87 bool haveReferenceFrames() const;
Chris@369 88 bool referenceFramesDiffer() const;
Chris@340 89
Chris@74 90 protected:
Chris@74 91 PointList m_points;
Chris@74 92 };
Chris@74 93
Chris@74 94 #endif