MD_types.h 832 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef MD_TYPES_H
  2. #define MD_TYPES_H
  3. #include <stdint.h>
  4. #include "yuzuparse.h"
  5. #include "orangetree.h"
  6. typedef struct {
  7. float left_tone;
  8. float right_tone;
  9. float left_amplitude;
  10. float right_amplitude;
  11. float (*tone_generator)(float, float);
  12. uint32_t current_sample;
  13. uint32_t sample_count;
  14. uint32_t sample_rate;
  15. float duration;
  16. float value; // a value that is passed into the tone generator. could be HZ for example
  17. } pa_tone_callback_data;
  18. typedef struct {
  19. void* OT_next;
  20. void* OT_prev;
  21. pa_tone_callback_data* tone_data;
  22. pa_callback_data* sound_data;
  23. unsigned char is_started;
  24. double sample_rate;
  25. double start_time; // seconds since epoch until sound will start
  26. } MD_sound;
  27. typedef struct {
  28. unsigned char is_empty;
  29. MD_sound* sounds;
  30. } MD_queue;
  31. #endif