llstreamingaudio.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @file streamingaudio.h
  3. * @author Tofu Linden
  4. * @brief Definition of LLStreamingAudioInterface base class abstracting the
  5. * streaming audio interface
  6. *
  7. * $LicenseInfo:firstyear=2009&license=viewergpl$
  8. *
  9. * Copyright (c) 2009, Linden Research, Inc.
  10. *
  11. * Second Life Viewer Source Code
  12. * The source code in this file ("Source Code") is provided by Linden Lab
  13. * to you under the terms of the GNU General Public License, version 2.0
  14. * ("GPL"), unless you have obtained a separate licensing agreement
  15. * ("Other License"), formally executed by you and Linden Lab. Terms of
  16. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  17. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  18. *
  19. * There are special exceptions to the terms and conditions of the GPL as
  20. * it is applied to this Source Code. View the full text of the exception
  21. * in the file doc/FLOSS-exception.txt in this software distribution, or
  22. * online at
  23. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  24. *
  25. * By copying, modifying or distributing this software, you acknowledge
  26. * that you have read and understood your obligations described above,
  27. * and agree to abide by those obligations.
  28. *
  29. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  30. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  31. * COMPLETENESS OR PERFORMANCE.
  32. * $/LicenseInfo$
  33. */
  34. #ifndef LL_STREAMINGAUDIO_H
  35. #define LL_STREAMINGAUDIO_H
  36. #include "stdtypes.h" // from llcommon
  37. // Entirely abstract. Based exactly on the historic API.
  38. class LLStreamingAudioInterface
  39. {
  40. public:
  41. virtual ~LLStreamingAudioInterface() = default;
  42. virtual void start(const std::string& url) = 0;
  43. virtual void stop() = 0;
  44. virtual void pause(int pause) = 0;
  45. virtual void update() = 0;
  46. virtual S32 isPlaying() = 0;
  47. // use a value from 0.0 to 1.0, inclusive
  48. virtual void setGain(F32 vol) = 0;
  49. virtual F32 getGain() = 0;
  50. virtual std::string getURL() = 0;
  51. virtual bool supportsAdjustableBufferSizes() { return false; }
  52. virtual void setBufferSizes(U32 streambuffertime,
  53. U32 decodebuffertime) {}
  54. virtual bool newMetaData() { return false; }
  55. virtual void gotMetaData() {}
  56. virtual std::string getArtist() { return ""; }
  57. virtual std::string getTitle() { return ""; }
  58. };
  59. #endif // LL_STREAMINGAUDIO_H