#pragma once #include #include #include #include #include #include #include class SpectranHTTPClient { public: SpectranHTTPClient(std::string host, int port, dsp::stream* stream); void startWorker(); void streaming(bool enabled); bool isOpen(); void close(); void setCenterFrequency(uint64_t freq); NewEvent onCenterFrequencyChanged; NewEvent onSamplerateChanged; private: void worker(); std::string host; int port; std::shared_ptr sock; net::http::Client http; dsp::stream* stream; std::thread workerThread; bool streamingEnabled = false; int64_t _centerFreq = 0; uint64_t _samplerate = 0; };