1/*****************************************************************************
2
3 OscSinCos.h
4 Copyright (c) 2005 Laurent de Soras
5
6--- Legal stuff ---
7
8This library is free software; you can redistribute it and/or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation; either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public
19License along with this library; if not, write to the Free Software
20Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22*Tab=3***********************************************************************/
23
24
25
26#if ! defined (OscSinCos_HEADER_INCLUDED)
27#define OscSinCos_HEADER_INCLUDED
28
29#if defined (_MSC_VER)
30 #pragma once
31 #pragma warning (4 : 4250) // "Inherits via dominance."
32#endif
33
34
35
36/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
37
38#include "def.h"
39
40
41
42template <class T>
43class OscSinCos
44{
45
46/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
47
48public:
49
50 typedef T DataType;
51
52 OscSinCos ();
53
54 FORCEINLINE void
55 set_step (double angle_rad);
56
57 FORCEINLINE DataType
58 get_cos () const;
59 FORCEINLINE DataType
60 get_sin () const;
61 FORCEINLINE void
62 step ();
63 FORCEINLINE void
64 clear_buffers ();
65
66
67
68/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
69
70protected:
71
72
73
74/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
75
76private:
77
78 DataType _pos_cos; // Current phase expressed with sin and cos. [-1 ; 1]
79 DataType _pos_sin; // -
80 DataType _step_cos; // Phase increment per step, [-1 ; 1]
81 DataType _step_sin; // -
82
83
84
85/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
86
87private:
88
89 OscSinCos (const OscSinCos &other);
90 OscSinCos & operator = (const OscSinCos &other);
91 bool operator == (const OscSinCos &other);
92 bool operator != (const OscSinCos &other);
93
94}; // class OscSinCos
95
96
97
98#include "OscSinCos.hpp"
99
100
101
102#endif // OscSinCos_HEADER_INCLUDED
103
104
105
106/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
107

source code of qtmultimedia/examples/multimedia/spectrum/3rdparty/fftreal/OscSinCos.h