-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaveformsegments.h
More file actions
58 lines (52 loc) · 2.19 KB
/
Copy pathwaveformsegments.h
File metadata and controls
58 lines (52 loc) · 2.19 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
#ifndef WAVEFORMSEGMENTS_H
#define WAVEFORMSEGMENTS_H
#include <QObject>
/*
* File: waveformsegments.h
* Description:
* This header file defines the 'WaveFormSegments' class, this class recieves places to make segments of audio data,
* uses them to make lists of the audio sample data of the given segments, and sends them to be graphed.
*
* Purpose:
* - this class connects the audio graph information to
* graphs of user defined segments that allow for closer analysis of raw audio information.
*
* Key Members:
* - 'QList<QList<float>> wavSegments': holds the wavSegments to be emitted
- 'QList<float> originalAudio': the original sample audio data to chop up
*
* Public Methods:
* - 'uploadAudio(QList<float> audio)': gives the object the audio data to slice
*
* Slots:
* - 'void collectWavSegment(QList<int> segmentPlaces)': collects wav segments and divides audio graph based on segment location
* - 'void clearAllWavSegments()': clears segment information (to be used when user clears segments from graph)
* - 'void autoSegment(QList<float> dataSample)': creates automated points in the audio wave for segementation
*
*Signals:
* - 'createWavSegmentGraphs(QList<QList<float>>)' : tells the detailed graphs to make them from the wavSegments
* Notes:
* - This works in tandum with SegmentGraph and user input on the graph closely, all changes to those should involve
* double checking the functionality here is not compromised
*
*/
class WaveFormSegments : public QObject
{
Q_OBJECT
QList<QList<float>> wavSegments;
QList<QPair<double, double>> wavSegmentStartEndPositions;
QList<float> originalAudio;
double audioSampleLength;
public:
explicit WaveFormSegments(QList<float> _audioSamples = QList<float>(), QObject *parent = nullptr);
void uploadAudio(QList<float> audio);
public slots:
void collectWavSegment(QList<int> segmentPlaces, bool isAuto);
void clearAllWavSegments();
void autoSegment(QList<float> dataSample, int startIndex);
signals:
void createWavSegmentGraphs(QList<QList<float>>);
void drawAutoSegments(QList<int>);
void storeStartEndValuesOfSegments(QList<QPair<double, double>>);
};
#endif // WAVEFORMSEGMENTS_H