AudioInterfaces.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. /**
  5. *
  6. * GE::GA General interfaces
  7. * tuomo.hirvonen@digia.com
  8. *
  9. */
  10. #ifndef __GE_IGA_INTERFACES__
  11. #define __GE_IGA_INTERFACES__
  12. #include "audiosourceif.h"
  13. namespace GF {
  14. typedef GE::AudioSource IAudioSource;
  15. class AudioSourceItem {
  16. public:
  17. AudioSourceItem(IAudioSource *s); // s will be owned
  18. ~AudioSourceItem();
  19. IAudioSource *m_currentAudioSource; // owned
  20. AudioSourceItem *m_next; // for listing, do not touch if you don't know what you are doing.
  21. };
  22. class AudioMixer : public IAudioSource {
  23. public:
  24. AudioMixer();
  25. virtual ~AudioMixer();
  26. void destroyList(); // destroy all the sources in the list
  27. IAudioSource* addAudioSource( IAudioSource *s ); // add new audio source to the list
  28. bool removeAudioSource( IAudioSource *s ); // remove an audio source from the list
  29. int pullAudio( AUDIO_SAMPLE_TYPE *target, int sampleCount );
  30. void setGeneralVolume( float vol );
  31. protected:
  32. int m_fixedGeneralVolume;
  33. AUDIO_SAMPLE_TYPE *m_mixingBuffer;
  34. // Length in AUDIO_SAMPLE_TYPE units (not in bytes)
  35. int m_mixingBufferLength;
  36. AudioSourceItem *m_sourceList;
  37. };
  38. };
  39. #endif