PageRenderTime 22ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/media_plugins/webkit/volume_catcher.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 54 lines | 16 code | 9 blank | 29 comment | 0 complexity | d9d3ce1b4108bd8a00c2d995de5962b2 MD5 | raw file
Possible License(s): LGPL-2.1
  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
  33. {
  34. public:
  35. VolumeCatcher();
  36. ~VolumeCatcher();
  37. void setVolume(F32 volume); // 0.0 - 1.0
  38. // Set the left-right pan of audio sources
  39. // where -1.0 = left, 0 = center, and 1.0 = right
  40. void setPan(F32 pan);
  41. 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
  42. private:
  43. VolumeCatcherImpl *pimpl;
  44. };
  45. #endif // VOLUME_CATCHER_H