148 lines
4.2 KiB
Smali
148 lines
4.2 KiB
Smali
.class public final Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;
|
|
.super Ljava/lang/Object;
|
|
.source "AppSoundManager.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/media/AppSoundManager;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "SoundPlayer"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Lcom/discord/utilities/media/AppSound;Lkotlin/jvm/functions/Function0;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Lcom/discord/utilities/media/AppSound;",
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/media/AppSound;->getResId()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p1, v0}, Landroid/media/MediaPlayer;->create(Landroid/content/Context;I)Landroid/media/MediaPlayer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
new-instance p1, Landroid/media/AudioAttributes$Builder;
|
|
|
|
invoke-direct {p1}, Landroid/media/AudioAttributes$Builder;-><init>()V
|
|
|
|
const/4 v0, 0x2
|
|
|
|
invoke-virtual {p1, v0}, Landroid/media/AudioAttributes$Builder;->setContentType(I)Landroid/media/AudioAttributes$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p1, v0}, Landroid/media/AudioAttributes$Builder;->setUsage(I)Landroid/media/AudioAttributes$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioAttributes$Builder;->build()Landroid/media/AudioAttributes;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/media/MediaPlayer;->setAudioAttributes(Landroid/media/AudioAttributes;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
const-string v0, "mediaPlayer"
|
|
|
|
invoke-static {p1, v0}, Lx/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/media/AppSound;->getShouldLoop()Z
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p1, p2}, Landroid/media/MediaPlayer;->setLooping(Z)V
|
|
|
|
iget-object p1, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
new-instance p2, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer$1;
|
|
|
|
invoke-direct {p2, p3}, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer$1;-><init>(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual {p1, p2}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "onCompletion"
|
|
|
|
invoke-static {p1}, Lx/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "sound"
|
|
|
|
invoke-static {p1}, Lx/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lx/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final release()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final start()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->start()V
|
|
|
|
return-void
|
|
.end method
|