#ifndef PIPEWIREDEVICE_H
#define PIPEWIREDEVICE_H

#include <spa/utils/hook.h>
#include <pipewire/device.h>

namespace UkuiAudioFramwork
{
struct pw_device;
class Pipewire;

/**
 * @todo write docs
 */
class PipewireDevice
{
    void volumeChanged(float);

public:
    /**
     * Default constructor
     */
    PipewireDevice(Pipewire *parent, uint32_t id, const struct spa_dict *props);

    /**
     * Destructor
     */
    virtual ~PipewireDevice();

    void _device_info (const struct pw_device_info *info);

    void _device_param (int seq, uint32_t id, uint32_t index, uint32_t next,
                        const struct spa_pod *param);

    // setters getters
    float volume() const { return m_volume; }
    void setVolume(float v) { m_volume = v; /*TODO*/ }

private:
    const Pipewire* pipewire;
    const uint32_t m_id;
    pw_device* m_device = nullptr;
    spa_hook m_listener;

    float m_volume = 0;
};
}
#endif // PIPEWIREDEVICE_H
