Mercurial > hg > beaglert
annotate include/Scope.h @ 475:faa5f58c71af prerelease
Headers
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 20 Jun 2016 20:39:00 +0100 |
parents | 733006bdbca2 |
children | 506a319c08cf |
rev | line source |
---|---|
l@272 | 1 /***** Scope.h *****/ |
l@272 | 2 #ifndef __Scope_H_INCLUDED__ |
l@272 | 3 #define __Scope_H_INCLUDED__ |
l@272 | 4 |
l@272 | 5 #include <OSCServer.h> |
l@272 | 6 #include <OSCClient.h> |
l@272 | 7 #include <stdarg.h> |
l@272 | 8 |
giuliomoro@475 | 9 #define OSC_RECEIVE_PORT 8675 |
l@272 | 10 #define OSC_SEND_PORT 8676 |
l@272 | 11 #define SCOPE_UDP_PORT 8677 |
l@272 | 12 |
l@272 | 13 #define FRAMES_STORED 2 |
l@272 | 14 |
l@272 | 15 class Scope{ |
l@272 | 16 public: |
l@272 | 17 Scope(); |
l@272 | 18 |
l@272 | 19 void setup(unsigned int numChannels, float sampleRate); |
l@272 | 20 void log(float chn1, ...); |
l@272 | 21 bool trigger(); |
l@272 | 22 |
l@272 | 23 private: |
l@272 | 24 OSCServer oscServer; |
l@272 | 25 OSCClient oscClient; |
l@272 | 26 UdpClient socket; |
l@272 | 27 |
l@272 | 28 void parseMessage(oscpkt::Message); |
l@272 | 29 void start(); |
l@272 | 30 void stop(); |
l@272 | 31 void doTrigger(); |
l@272 | 32 void triggerNormal(); |
l@272 | 33 void triggerAuto(); |
l@272 | 34 void scheduleSendBufferTask(); |
l@272 | 35 void sendBuffer(); |
l@272 | 36 void customTrigger(); |
l@272 | 37 bool triggered(); |
l@272 | 38 |
l@272 | 39 // settings |
l@272 | 40 int numChannels; |
l@272 | 41 float sampleRate; |
l@272 | 42 int connected; |
l@272 | 43 int frameWidth; |
l@272 | 44 int triggerMode; |
l@272 | 45 int triggerChannel; |
l@272 | 46 int triggerDir; |
l@272 | 47 float triggerLevel; |
l@272 | 48 int xOffset; |
l@272 | 49 int upSampling; |
l@272 | 50 int downSampling; |
l@272 | 51 float holdOff; |
l@272 | 52 |
l@272 | 53 int channelWidth; |
l@272 | 54 int downSampleCount; |
l@272 | 55 int holdOffSamples; |
l@272 | 56 |
l@272 | 57 // buffers |
l@272 | 58 std::vector<float> buffer; |
l@272 | 59 std::vector<float> outBuffer; |
l@272 | 60 |
l@272 | 61 // pointers |
l@272 | 62 int writePointer; |
l@272 | 63 int readPointer; |
l@272 | 64 int triggerPointer; |
l@272 | 65 int customTriggerPointer; |
l@272 | 66 |
l@272 | 67 // trigger status |
l@272 | 68 bool triggerPrimed; |
l@272 | 69 bool triggerCollecting; |
l@272 | 70 bool triggerWaiting; |
l@272 | 71 bool triggering; |
l@272 | 72 int triggerCount; |
l@272 | 73 int autoTriggerCount; |
l@272 | 74 bool started; |
l@272 | 75 bool customTriggered; |
l@272 | 76 |
l@272 | 77 // aux tasks |
l@272 | 78 AuxiliaryTask scopeTriggerTask; |
l@272 | 79 static void triggerTask(void*); |
l@272 | 80 |
l@272 | 81 AuxiliaryTask scopeSendBufferTask; |
l@272 | 82 static void sendBufferTask(void*); |
l@272 | 83 |
l@272 | 84 }; |
l@272 | 85 |
l@272 | 86 #endif |