Mercurial > hg > svcore
annotate base/Clipboard.h @ 308:14e0f60435b8
* Make it possible to drop audio files, layer files, session files and images
  onto SV panes.
  Need to do a bit more work on where we expect the dropped file to go,
  particularly in the case of audio files -- at the moment they're always
  opened in new panes, but it may be better to by default replace whatever is
  in the target pane.
| author | Chris Cannam | 
|---|---|
| date | Wed, 10 Oct 2007 15:18:02 +0000 | 
| parents | 47fd14e29813 | 
| children | 516819f2b97b 6f6ab834449d | 
| 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@74 | 30 Point(long frame, float value, size_t duration, QString label); | 
| Chris@74 | 31 Point(const Point &point); | 
| Chris@74 | 32 Point &operator=(const Point &point); | 
| Chris@74 | 33 | 
| Chris@74 | 34 bool haveFrame() const; | 
| Chris@74 | 35 long getFrame() const; | 
| Chris@74 | 36 | 
| Chris@74 | 37 bool haveValue() const; | 
| Chris@74 | 38 float getValue() const; | 
| Chris@74 | 39 | 
| Chris@74 | 40 bool haveDuration() const; | 
| Chris@74 | 41 size_t getDuration() const; | 
| Chris@74 | 42 | 
| Chris@74 | 43 bool haveLabel() const; | 
| Chris@74 | 44 QString getLabel() const; | 
| Chris@74 | 45 | 
| Chris@74 | 46 private: | 
| Chris@74 | 47 bool m_haveFrame; | 
| Chris@74 | 48 long m_frame; | 
| Chris@74 | 49 bool m_haveValue; | 
| Chris@74 | 50 float m_value; | 
| Chris@74 | 51 bool m_haveDuration; | 
| Chris@74 | 52 size_t m_duration; | 
| Chris@74 | 53 bool m_haveLabel; | 
| Chris@74 | 54 QString m_label; | 
| Chris@74 | 55 }; | 
| Chris@74 | 56 | 
| Chris@74 | 57 Clipboard(); | 
| Chris@74 | 58 ~Clipboard(); | 
| Chris@74 | 59 | 
| Chris@74 | 60 typedef std::vector<Point> PointList; | 
| Chris@74 | 61 | 
| Chris@74 | 62 void clear(); | 
| Chris@74 | 63 bool empty() const; | 
| Chris@74 | 64 const PointList &getPoints() const; | 
| Chris@74 | 65 void setPoints(const PointList &points); | 
| Chris@74 | 66 void addPoint(const Point &point); | 
| Chris@74 | 67 | 
| Chris@74 | 68 protected: | 
| Chris@74 | 69 PointList m_points; | 
| Chris@74 | 70 }; | 
| Chris@74 | 71 | 
| Chris@74 | 72 #endif | 
