13 #include "ofxNetwork.h" 70 template<
typename T1,
typename arg,
class T>
72 using namespace std::placeholders;
98 void audioIn(
float *input,
int buffer_size,
int nChannel);
99 virtual bool start()
final;
100 virtual void stop()
final;
103 uint32_t downsample_rate_;
104 unique_ptr<ofSoundStream> sound_stream_;
105 bool setup_successful_;
117 virtual bool start()
final;
118 virtual void stop()
final;
123 ofSoundPlayer player_;
124 unique_ptr<std::thread> update_thread_;
148 virtual bool start()
final;
149 virtual void stop()
final;
153 serial_->listDevices();
154 vector<string> retval;
155 vector<ofSerialDeviceInfo> device_list = serial_->getDeviceList();
156 retval.reserve(device_list.size());
157 for (
auto& d : device_list) {
158 retval.push_back(d.getDevicePath());
165 &&
"Should only reach here if ASCIISerialStream hasn't started");
168 if (!serial_->setup(port_, baud_)) {
172 reading_thread_.reset(
new std::thread(&BaseSerialInputStream::readSerial,
this));
178 virtual void parseSerial(vector<unsigned char> &buffer) = 0;
186 vector<unsigned char> buffer_;
189 unique_ptr<std::thread> reading_thread_;
196 virtual bool start()
final;
197 virtual void stop()
final;
203 uint32_t kBufferSize_ = 64;
205 unique_ptr<ofSerial> serial_;
208 unique_ptr<std::thread> reading_thread_;
225 virtual bool start()
final;
226 virtual void stop()
final;
237 void useAnalogPin(
int i);
243 bool configured_arduino_;
246 unique_ptr<std::thread> update_thread_;
259 : port_num_(port_num), dim_(dimension) {
262 virtual bool start()
final;
263 virtual void stop()
final;
267 void parseInput(
const string& buffer);
268 ofxTCPServer server_;
269 unique_ptr<std::thread> reading_thread_;
280 : port_num_(port_num), addr_(addr), dim_(dimension) {
283 void handleMessage(ofxOscMessage& m);
284 virtual bool start()
final;
285 virtual void stop()
final;
289 void parseInput(
const string& buffer);
290 ofxOscReceiver receiver_;
291 unique_ptr<std::thread> reading_thread_;
Input stream for reading audio from the computer's microphone.
Definition: istream.h:95
std::atomic_bool has_started_
Definition: stream.h:24
virtual bool start()
Definition: stream.h:13
const uint32_t kOfSoundStream_BufferSize
Definition: istream.h:22
const uint32_t kOfSoundStream_nBuffers
Definition: istream.h:23
const uint32_t kOfSoundStream_SamplingRate
Definition: istream.h:21
virtual void stop()
Definition: stream.h:14
constexpr uint32_t downsample_rate
Definition: cli.cpp:16
Input stream for getting the FFT spectrum of an audio file as it plays. This class plays an audio fil...
Definition: istream.h:114
Input stream for reading analog data from an Arduino running Firmata. To use an FirmataStream in your...
Definition: istream.h:217
Definition: istream.h:193