Class ShadowSoundPool


  • @Implements(android.media.SoundPool.class)
    public class ShadowSoundPool
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ShadowSoundPool.Playback
      Record of a single call to SoundPool.play(int, float, float, int, int, float).
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowSoundPool()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int _play​(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)  
      void clearPlayed()
      Clears the sounds played by this SoundPool.
      java.util.List<ShadowSoundPool.Playback> getPathPlaybacks​(java.lang.String path)
      Return a list of calls to play made for the given path.
      java.util.List<ShadowSoundPool.Playback> getResourcePlaybacks​(int resId)
      Return a list of calls to play made for the given resource.
      protected static android.media.IAudioService getService()  
      protected int load​(android.content.Context context, int resId, int priority)  
      protected int load​(java.lang.String path, int priority)  
      void notifyPathLoaded​(java.lang.String path, boolean success)
      Notify the SoundPool.OnLoadCompleteListener, if present, that the given path was loaded.
      void notifyResourceLoaded​(int resId, boolean success)
      Notify the SoundPool.OnLoadCompleteListener, if present, that the given resource was loaded.
      protected int play​(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)  
      protected void setOnLoadCompleteListener​(android.media.SoundPool.OnLoadCompleteListener listener)  
      boolean wasPathPlayed​(java.lang.String path)
      Returns true if the given path was played.
      boolean wasResourcePlayed​(int resId)
      Returns true if the given resource was played.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowSoundPool

        public ShadowSoundPool()
    • Method Detail

      • getService

        @Implementation(minSdk=24,
                        maxSdk=25)
        protected static android.media.IAudioService getService()
      • play

        @Implementation(maxSdk=22)
        protected int play​(int soundID,
                           float leftVolume,
                           float rightVolume,
                           int priority,
                           int loop,
                           float rate)
      • _play

        @Implementation(minSdk=23)
        protected int _play​(int soundID,
                            float leftVolume,
                            float rightVolume,
                            int priority,
                            int loop,
                            float rate)
      • load

        @Implementation
        protected int load​(java.lang.String path,
                           int priority)
      • load

        @Implementation
        protected int load​(android.content.Context context,
                           int resId,
                           int priority)
      • setOnLoadCompleteListener

        @Implementation
        protected void setOnLoadCompleteListener​(android.media.SoundPool.OnLoadCompleteListener listener)
      • notifyPathLoaded

        public void notifyPathLoaded​(java.lang.String path,
                                     boolean success)
        Notify the SoundPool.OnLoadCompleteListener, if present, that the given path was loaded.
      • notifyResourceLoaded

        public void notifyResourceLoaded​(int resId,
                                         boolean success)
        Notify the SoundPool.OnLoadCompleteListener, if present, that the given resource was loaded.
      • wasPathPlayed

        public boolean wasPathPlayed​(java.lang.String path)
        Returns true if the given path was played.
      • wasResourcePlayed

        public boolean wasResourcePlayed​(int resId)
        Returns true if the given resource was played.
      • getPathPlaybacks

        public java.util.List<ShadowSoundPool.Playback> getPathPlaybacks​(java.lang.String path)
        Return a list of calls to play made for the given path.
      • getResourcePlaybacks

        public java.util.List<ShadowSoundPool.Playback> getResourcePlaybacks​(int resId)
        Return a list of calls to play made for the given resource.
      • clearPlayed

        public void clearPlayed()
        Clears the sounds played by this SoundPool.