-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMixingIO.h
More file actions
57 lines (37 loc) · 1.35 KB
/
Copy pathMixingIO.h
File metadata and controls
57 lines (37 loc) · 1.35 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
//
// Created by asalehin on 9/9/20.
//
#ifndef FAST_MIXER_MIXINGIO_H
#define FAST_MIXER_MIXINGIO_H
#include <memory>
#include <FileDataSource.h>
#include <BufferedDataSource.h>
#include "streams/MixingStreamConstants.h"
#include "../audio/Player.h"
#include "../audio/MixedAudioWriter.h"
using namespace std;
class MixingIO {
public:
MixingIO();
shared_ptr<FileDataSource> readFile(string filename, int fd);
shared_ptr<BufferedDataSource> createClipboardDataSource(vector<float>& clipboard);
void read_playback(float *targetData, int32_t numSamples);
void setPlaying(bool setPlaying);
void clearPlayerSources();
void addSource(string key, shared_ptr<DataSource> source);
void addSourceMap(map<string, shared_ptr<DataSource>> playMap);
void syncPlayHeads();
void setStopPlaybackCallback(function<void(void)> stopPlaybackCallback);
int getTotalSampleFrames();
int getCurrentPlaybackProgress();
void setPlayHead(int position);
void setPlayerBoundStart(int64_t boundStart);
void setPlayerBoundEnd(int64_t boundEnd);
void resetPlayerBoundStart();
void resetPlayerBoundEnd();
bool writeSourcesToFile(map<string, shared_ptr<DataSource>> playMap, int fd);
private:
shared_ptr<Player> mPlayer {nullptr};
function<void(void)> mStopPlaybackCallback = nullptr;
};
#endif //FAST_MIXER_MIXINGIO_H