LCOV - code coverage report
Current view: top level - src/audio/backend - portaudio_backend.h (source / functions) Coverage Total Hit
Test: merged.info Lines: 100.0 % 2 2
Test Date: 2026-06-07 15:51:50 Functions: 100.0 % 2 2

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : #include <portaudio.h>
       4              : 
       5              : #include "audio/backend/i_audio_backend.h"
       6              : 
       7              : namespace Amplitron {
       8              : 
       9              : class PortAudioBackend : public IAudioBackend {
      10              :    public:
      11              :     PortAudioBackend();
      12              :     ~PortAudioBackend() override;
      13              : 
      14              :     bool initialize(IAudioEngine* engine) override;
      15              :     void shutdown() override;
      16              :     bool start() override;
      17              :     void stop() override;
      18              : 
      19              :     std::vector<AudioDeviceInfo> get_input_devices() const override;
      20              :     std::vector<AudioDeviceInfo> get_output_devices() const override;
      21              : 
      22              :     bool set_input_device(int device_index) override;
      23              :     bool set_output_device(int device_index) override;
      24              : 
      25              :     std::string get_input_device_name() const override;
      26              :     std::string get_output_device_name() const override;
      27              : 
      28              :     int get_sample_rate() const override;
      29              :     int get_buffer_size() const override;
      30              : 
      31           12 :     int get_input_device() const override { return input_device_; }
      32           12 :     int get_output_device() const override { return output_device_; }
      33              : 
      34              :    private:
      35              :     void auto_detect_devices();
      36              : 
      37              :     IAudioEngine* engine_ = nullptr;
      38              :     PaStream* stream_ = nullptr;
      39              :     bool initialized_ = false;
      40              :     bool running_ = false;
      41              :     int input_device_ = -1;
      42              :     int output_device_ = -1;
      43              : };
      44              : 
      45              : }  // namespace Amplitron
        

Generated by: LCOV version 2.0-1