-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdojoysticklooper.hpp
73 lines (73 loc) · 1.78 KB
/
dojoysticklooper.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
72
73
//#ifndef DOJOYSTICKLOOPER_HPP
//#define DOJOYSTICKLOOPER_HPP
//
//#include <iostream>
//
//#include "jsevent.h"
//#include "loopersm.hpp"
//
//using namespace smlooper;
//
//static char const* const state_names[] = {"Stopped", "Recording", "Playback", "Overdub", "StoppedWithLoop"};
//
//class DoJoyStickLooper {
//public:
//
// DoJoyStickLooper() {
// init();
// }
//
// void start() {
// _looper.start();
//
// _events.setEventHandler(&DoJoyStickLooper::looperEventHandler, this);
// _events.startJoystickEvents();
// }
//
// static void looperEventHandler(JsEvents::CLICK_TYPE clickType, void * data) {
// // TODO checking for null and conversion error...
// DoJoyStickLooper *_this = static_cast<DoJoyStickLooper*> (data);
//
// switch (clickType) {
// case JsEvents::SINGLE:
// _this->_looper.process_event(smlooper::CLICK());
// break;
// case JsEvents::DOUBLE:
// _this->_looper.process_event( smlooper::DBL_CLICK());
// break;
// case JsEvents::HOLD:
// _this->_looper.process_event(smlooper::HOLD());
// break;
// case JsEvents::DOUBLE_HOLD:
// _this->_looper.process_event(smlooper::DBL_HOLD());
// break;
// default:
// throw "Undefinded ClickType";
// break;
// }
//
// _this->pstate();
// }
//
// virtual ~DoJoyStickLooper() {
// _looper.stop();
// }
//
//private:
// looper _looper;
// JsEvents _events;
//
// void init() {
//#ifndef NDEBUG
// std::cout << "Clearing loops to add a single one. Compile with -DNDEBUG to avoid debugging behaviour!" << std::endl;
// system("oscsend osc.udp://localhost:9951 /loop_del i -1");
// system("oscsend osc.udp://localhost:9951 /loop_add ii 2 0");
//#endif
// }
//
// void pstate() const {
// std::cout << " -> " << state_names[_looper.current_state()[0]] << std::endl;
// }
//};
//
//#endif // DOJOYSTICKLOOPER_HPP