kwave  18.07.70
Label.h
Go to the documentation of this file.
1 /***************************************************************************
2  Label.h - representation of a label within a signal
3  -------------------
4  begin : Mon Jul 31 2006
5  copyright : (C) 2006 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #ifndef LABEL_H
18 #define LABEL_H
19 
20 #include "config.h"
21 
22 #include <QtGlobal>
23 #include <QString>
24 
25 #include <KLocalizedString>
26 
27 #include "libkwave/MetaData.h"
28 #include "libkwave/Sample.h"
29 #include "libkwave/String.h"
30 
31 namespace Kwave
32 {
33 
34  class Q_DECL_EXPORT Label: public Kwave::MetaData
35  {
36  public:
37 
39  Label();
40 
45  explicit Label(const Kwave::MetaData &meta_data);
46 
53  Label(sample_index_t position, const QString &name);
54 
56  virtual ~Label();
57 
59  static QString metaDataType() { return _("Label"); }
60 
65  virtual void moveTo(sample_index_t position);
66 
68  virtual sample_index_t pos() const;
69 
74  virtual void rename(const QString &name);
75 
77  virtual QString name() const;
78 
80  inline bool operator < (const Kwave::Label &other) const {
81  return (pos() < other.pos());
82  }
83 
85  inline bool operator == (const Kwave::Label &other) const {
86  return ((pos() == other.pos()) && (name() == other.name()));
87  }
88 
89  };
90 }
91 
92 #endif /* LABEL_H */
93 
94 //***************************************************************************
95 //***************************************************************************
Definition: App.h:33
virtual sample_index_t pos() const
Definition: Label.cpp:56
quint64 sample_index_t
Definition: Sample.h:28
static QString metaDataType()
Definition: Label.h:59
const char name[16]
Definition: memcpy.c:510
virtual QString name() const
Definition: Label.cpp:74
#define _(m)
Definition: memcpy.c:66