-
Notifications
You must be signed in to change notification settings - Fork 0
/
SLClip.hpp
71 lines (61 loc) · 1.64 KB
/
SLClip.hpp
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
#ifndef INC_SLClip_H
#define INC_SLClip_H
#include <stk/FileWvIn.h>
//#include <stk/LentPitShift.h>
#include <stk/PitShift.h>
#include "Clip.hpp"
#include <cereal/types/memory.hpp>
//#include <cereal/archives/binary.hpp>
#include <cereal/archives/xml.hpp>
#include <cereal/types/polymorphic.hpp>
class SLClip : public Clip
{
public:
SLClip (std::string);
SLClip (std::string, std::string, int, int, int, int, int, float, float, int);
~SLClip ();
inline void setSLid( int i ) { sl_id_ = i; }
void SLload();
inline std::string getURI() { return uri_; }
inline void rewind() {}
unsigned long getLength ();
stk::StkFloat getTime ();
float getProgress();
float * getVolume ();
void SLget( std::string );
//void setVolume (StkFloat);
template <class Archive>
void serialize (Archive & archive)
{
archive (
CEREAL_NVP(filename_),
CEREAL_NVP(name_),
CEREAL_NVP(launchstyle_),
CEREAL_NVP(stopstyle_),
CEREAL_NVP(loopstyle_),
CEREAL_NVP(armMIDIchannel_),
CEREAL_NVP(armMIDIkey_),
CEREAL_NVP(volume_)
);
}
template <class Archive>
static void load_and_construct (Archive & archive, cereal::construct<SLClip> & construct)
{
std::string fname, name;
int launch, stop, loop;
int amc, amk;
float volume, gui_rate;
int gui_pitch;
archive (fname, name, launch, stop, loop, amc, amk, volume, gui_rate, gui_pitch);
construct (fname, name, launch, stop, loop, amc, amk, volume, gui_rate, gui_pitch);
}
protected:
std::string uri_;
int sl_id_;
float volume_;
void send2SL( const char*, lo_message );
void SLload( std::string );
};
CEREAL_REGISTER_TYPE (SLClip)
CEREAL_REGISTER_POLYMORPHIC_RELATION (Clip, SLClip)
#endif