volume.h 729 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _COMPONENTS_VOLUME_H
  2. #define _COMPONENTS_VOLUME_H
  3. #if defined(USE_ALSA)
  4. # include <alsa/asoundlib.h>
  5. # include <alsa/control.h>
  6. struct volume_static_data {
  7. snd_mixer_selem_id_t *sid;
  8. struct {
  9. long int min, max;
  10. } volume;
  11. snd_ctl_event_t *e;
  12. snd_ctl_t *ctl;
  13. };
  14. # define VOLUME_STATIC_SIZE sizeof(struct volume_static_data)
  15. #elif defined(USE_PULSE)
  16. # include <stdint.h>
  17. # include <pthread.h>
  18. # include <pulse/pulseaudio.h>
  19. struct volume_static_data {
  20. char* out;
  21. pa_mainloop_api* mainloop;
  22. uint8_t pulse_thread_started;
  23. pthread_t volume_thread, pulse_thread;
  24. };
  25. # define VOLUME_STATIC_SIZE sizeof(struct volume_static_data)
  26. #else
  27. # define VOLUME_STATIC_SIZE 0
  28. #endif
  29. #endif /* _COMPONENTS_VOLUME_H */