6 #ifndef OFXPDSPMIDI_PDSPOSCOUT_H_INCLUDED 7 #define OFXPDSPMIDI_PDSPOSCOUT_H_INCLUDED 14 #include <condition_variable> 16 #include "../DSP/pdspCore.h" 17 #include "../sequencer/SequencerSection.h" 24 namespace pdsp {
namespace osc {
35 class ScheduledOscMessage{
37 ScheduledOscMessage();
38 ScheduledOscMessage(ofxOscMessage message, chrono::high_resolution_clock::time_point schedule);
39 ScheduledOscMessage(
const ScheduledOscMessage &other);
40 ScheduledOscMessage& operator= (
const ScheduledOscMessage &other);
41 ~ScheduledOscMessage();
43 ofxOscMessage message;
44 chrono::high_resolution_clock::time_point scheduledTime;
48 static bool scheduledSort(
const ScheduledOscMessage &lhs,
const ScheduledOscMessage &rhs );
65 void openPort(
const std::string &hostname,
int port );
70 void close()
override;
90 pdsp::ExtSequencer&
address( std::string oscAddress );
95 void process(
int bufferSize ) noexcept
override;
97 void linkToMessageBuffer(pdsp::MessageBuffer &messageBuffer)
override;
98 void unlinkMessageBuffer(pdsp::MessageBuffer &messageBuffer)
override;
103 void prepareToPlay(
int expectedBufferSize,
double sampleRate )
override;
104 void releaseResources()
override ;
109 std::vector<std::string> addresses;
110 std::string selectedAddress;
117 std::vector<pdsp::MessageBuffer*> inputs;
119 std::vector<ScheduledOscMessage> messagesToSend;
126 void daemonFunction() noexcept;
127 static void daemonFunctionWrapper(
Output* parent);
130 std::atomic<bool> runDaemon;
133 std::chrono::time_point<std::chrono::high_resolution_clock> bufferChrono;
135 double usecPerSample;
136 std::vector<ScheduledOscMessage> circularBuffer;
138 std::atomic<int> writeindex;
145 #endif //OFXPDSPMIDI_PDSPOSCOUT_H_INCLUDED void close() override
shuts down the output
Definition: OscOutput.cpp:90
Definition: OscOutput.h:26
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
void openPort(const std::string &hostname, int port)
open the port with the given index
Definition: OscOutput.cpp:75
bool isConnected()
return true if the port has been sucessfully opened
Definition: OscOutput.h:77
pdsp::ExtSequencer & address(std::string oscAddress)
patch a pdsp::ScoreSection::out_message() method to the result of this method for message to the seri...
Definition: OscOutput.cpp:100
void setVerbose(bool verbose)
enable or disable diagnostic messages
Definition: OscOutput.cpp:70
Definition: Preparable.h:36