tidy&format(all): all files formatted and relevant warnings resolved
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
This commit is contained in:
@@ -22,55 +22,55 @@ constexpr quint32 CHUNK_SIZE = 512;
|
||||
class AudioCollector;
|
||||
|
||||
class PipeWireWorker {
|
||||
public:
|
||||
explicit PipeWireWorker(std::stop_token token, AudioCollector* collector);
|
||||
public:
|
||||
explicit PipeWireWorker(std::stop_token token, AudioCollector* collector);
|
||||
|
||||
void run();
|
||||
void run();
|
||||
|
||||
private:
|
||||
pw_main_loop* m_loop;
|
||||
pw_stream* m_stream;
|
||||
spa_source* m_timer;
|
||||
bool m_idle;
|
||||
private:
|
||||
pw_main_loop* m_loop;
|
||||
pw_stream* m_stream;
|
||||
spa_source* m_timer;
|
||||
bool m_idle;
|
||||
|
||||
std::stop_token m_token;
|
||||
AudioCollector* m_collector;
|
||||
std::stop_token m_token;
|
||||
AudioCollector* m_collector;
|
||||
|
||||
static void handleTimeout(void* data, uint64_t expirations);
|
||||
void streamStateChanged(pw_stream_state state);
|
||||
void processStream();
|
||||
static void handleTimeout(void* data, uint64_t expirations);
|
||||
void streamStateChanged(pw_stream_state state);
|
||||
void processStream();
|
||||
|
||||
[[nodiscard]] unsigned int nextPowerOf2(unsigned int n);
|
||||
[[nodiscard]] unsigned int nextPowerOf2(unsigned int n);
|
||||
};
|
||||
|
||||
class AudioCollector : public Service {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AudioCollector(const AudioCollector&) = delete;
|
||||
AudioCollector& operator=(const AudioCollector&) = delete;
|
||||
public:
|
||||
AudioCollector(const AudioCollector&) = delete;
|
||||
AudioCollector& operator=(const AudioCollector&) = delete;
|
||||
|
||||
static AudioCollector& instance();
|
||||
static AudioCollector& instance();
|
||||
|
||||
void clearBuffer();
|
||||
void loadChunk(const qint16* samples, quint32 count);
|
||||
quint32 readChunk(float* out, quint32 count = 0);
|
||||
quint32 readChunk(double* out, quint32 count = 0);
|
||||
void clearBuffer();
|
||||
void loadChunk(const qint16* samples, quint32 count);
|
||||
quint32 readChunk(float* out, quint32 count = 0);
|
||||
quint32 readChunk(double* out, quint32 count = 0);
|
||||
|
||||
private:
|
||||
explicit AudioCollector(QObject* parent = nullptr);
|
||||
~AudioCollector() override;
|
||||
private:
|
||||
explicit AudioCollector(QObject* parent = nullptr);
|
||||
~AudioCollector() override;
|
||||
|
||||
std::jthread m_thread;
|
||||
std::vector<float> m_buffer1;
|
||||
std::vector<float> m_buffer2;
|
||||
std::atomic<std::vector<float>*> m_readBuffer;
|
||||
std::atomic<std::vector<float>*> m_writeBuffer;
|
||||
quint32 m_sampleCount;
|
||||
std::jthread m_thread;
|
||||
std::vector<float> m_buffer1;
|
||||
std::vector<float> m_buffer2;
|
||||
std::atomic<std::vector<float>*> m_readBuffer;
|
||||
std::atomic<std::vector<float>*> m_writeBuffer;
|
||||
quint32 m_sampleCount;
|
||||
|
||||
void reload();
|
||||
void start() override;
|
||||
void stop() override;
|
||||
void reload();
|
||||
void start() override;
|
||||
void stop() override;
|
||||
};
|
||||
|
||||
} // namespace ZShell::services
|
||||
|
||||
Reference in New Issue
Block a user