[8a7247]: libkwave / Signal.h Maximize Restore History

Download this file

Signal.h    173 lines (136 with data), 3.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#ifndef _KWAVE_SIGNAL_H_
#define _KWAVE_SIGNAL_H_ 1
#define PROGRESS_SIZE 512*3*5
#include <pthread.h>
#include <qlist.h>
#include "mt/Mutex.h"
#include "libkwave/InsertMode.h"
#include "libkwave/Sample.h"
#include "libkwave/WindowFunction.h"
class SampleInputStream;
class Track;
//**********************************************************************
class Signal
{
public:
/**
* Default Constructor. Creates an empty signal with
* zero-length and no tracks
*/
Signal();
/**
* Copy constructor.
*/
// Signal(const Signal &sig);
/**
* Constructor. Creates an empty signal with a specified
* number of tracks and length. Each track will contain
* only one stripe.
*/
Signal(unsigned int tracks, unsigned int length);
/**
* Destructor.
*/
~Signal ();
/**
* Appends a new track to the end of the tracks list
* and returns a pointer to the created track. If the
* length is omitted or zero, the track will not have
* a length.
*/
Track *appendTrack(unsigned int length = 0);
/**
* Opens an input stream for a track, starting at a specified sample
* position.
* @param track index of the track. If the track does not exist, this
* function will fail and return 0
* @param mode specifies where and how to insert
* @param left start of the input (only useful in insert and
* overwrite mode)
* @param right end of the input (only useful with overwrite mode)
* @see InsertMode
*/
SampleInputStream *openInputStream(unsigned int track, InsertMode mode,
unsigned int left = 0, unsigned int right = 0);
// Signal *copyRange ();
// Signal *cutRange ();
// void cropRange ();
// void deleteRange ();
// void overwritePaste (Signal *);
// void insertPaste (Signal *);
// void mixPaste (Signal *);
//
// void getMaxMin ( int& max, int& min, int begin, int len);
// int getSingleSample (int offset);
inline int rate() {
return m_rate;
};
inline int bits() {
return m_bits;
};
inline unsigned int length() {
return m_length;
};
inline unsigned int selectionStart() {
return m_selection_start;
};
inline unsigned int selectionEnd() {
return m_selection_end;
};
inline int isSelected() {
return m_selected;
};
inline void select(const bool select) {
m_selected = select;
};
inline void setRate(const int rate) {
m_rate = rate;
};
inline void setBits(const int bits) {
m_bits = bits;
};
// int getChannelMaximum ();
//
// void setMarkers (int, int);
// void resample (const char *); //int
private:
// //memory management
//
// void noMemory ();
// void getridof (int *mem);
// int *getNewMem (int size);
//
// //attribute modifying functions
//
// void changeRate (int);
//
// //signal modifying functions
// void replaceStutter (int, int);
// void delayRecursive (int, int);
// void delay (int, int);
// void movingFilter (Filter *filter, int tap, Curve *points, int low, int high);
//
// //functions creating a new Object
//
// void fft (int, bool);
// void averageFFT (int points, window_function_t windowtype);
private:
/** list of tracks */
QList<Track> m_tracks;
/** mutex for access to the track list */
Mutex m_lock_tracks;
/** number of samples */
unsigned int m_length;
/** sample rate [samples per second] */
unsigned int m_rate;
/** resolution in bits per sample */
unsigned int m_bits;
/** selection flag (default=true) */
bool m_selected;
/** start of the selection */
unsigned int m_selection_start;
/** end of the selection */
unsigned int m_selection_end;
};
//**********************************************************************
#endif /* signal.h */