kwave  18.07.70
SampleFormat.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  SampleFormat.cpp - Map for all known sample formats
3  -------------------
4  begin : Sun Jul 28 2002
5  copyright : (C) 2002 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 
18 #include "libkwave/SampleFormat.h"
19 #include "libkwave/String.h"
20 
21 //***************************************************************************
24 {
25  fill();
26 }
27 
28 //***************************************************************************
30 {
31 }
32 
33 //***************************************************************************
35 {
36  append(0, Kwave::SampleFormat::Signed, _("SIGNED"),
37  _(I18N_NOOP("Linear Two's Complement")));
38  append(1, Kwave::SampleFormat::Unsigned, _("UNSIGNED"),
39  _(I18N_NOOP("Unsigned Integer")));
40  append(2, Kwave::SampleFormat::Float, _("FLOAT"),
41  _(I18N_NOOP("32-bit IEEE Floating-Point")));
42  append(3, Kwave::SampleFormat::Double, _("DOUBLE"),
43  _(I18N_NOOP("64-bit IEEE Double Precision Floating-Point")));
44 }
45 
46 //***************************************************************************
48 {
51  static_cast<Kwave::SampleFormat::Format>(i);
52  int index = map.findFromData(format);
53  m_format = (index >= 0) ? format : Kwave::SampleFormat::Unknown;
54 }
55 
56 //***************************************************************************
57 //***************************************************************************
Definition: App.h:33
virtual void append(int index, Format data, const QString &name, const QString &description)
Definition: TypesMap.h:72
virtual void fill() Q_DECL_OVERRIDE
#define _(m)
Definition: memcpy.c:66
IDX findFromData(const DATA &data) const
Definition: TypesMap.h:89
virtual ~Map() Q_DECL_OVERRIDE