volume_catcher.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * @file volume_catcher.h
  3. * @brief Interface to a class with platform-specific implementations that allows control of the audio volume of all sources in the current process.
  4. *
  5. * @cond
  6. * $LicenseInfo:firstyear=2010&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. * @endcond
  27. */
  28. #ifndef VOLUME_CATCHER_H
  29. #define VOLUME_CATCHER_H
  30. #include "linden_common.h"
  31. class VolumeCatcherImpl;
  32. class VolumeCatcher final
  33. {
  34. public:
  35. VolumeCatcher();
  36. void setVolume(F32 volume); // 0.0 - 1.0
  37. // Set the left-right pan of audio sources
  38. // where -1.0 = left, 0 = center, and 1.0 = right
  39. void setPan(F32 pan);
  40. void pump(); // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume
  41. private:
  42. VolumeCatcherImpl* pimpl;
  43. };
  44. #endif // VOLUME_CATCHER_H