2020-05-17 12:40:10 +00:00
|
|
|
.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
|
2020-08-20 19:28:48 +00:00
|
|
|
.locals 2
|
2020-05-17 12:40:10 +00:00
|
|
|
.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_3
|
|
|
|
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/media/AppSound;->getResId()I
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result v0
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-static {p1, v0}, Landroid/media/MediaPlayer;->create(Landroid/content/Context;I)Landroid/media/MediaPlayer;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result-object p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
iput-object p1, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
if-eqz p1, :cond_0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
new-instance v0, Landroid/media/AudioAttributes$Builder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-direct {v0}, Landroid/media/AudioAttributes$Builder;-><init>()V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
const/4 v1, 0x2
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {v0, v1}, Landroid/media/AudioAttributes$Builder;->setContentType(I)Landroid/media/AudioAttributes$Builder;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result-object v0
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
const/4 v1, 0x1
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {v0, v1}, Landroid/media/AudioAttributes$Builder;->setUsage(I)Landroid/media/AudioAttributes$Builder;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result-object v0
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {v0}, Landroid/media/AudioAttributes$Builder;->build()Landroid/media/AudioAttributes;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result-object v0
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {p1, v0}, Landroid/media/MediaPlayer;->setAudioAttributes(Landroid/media/AudioAttributes;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/media/AppSound;->getShouldLoop()Z
|
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
move-result v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {p1, v0}, Landroid/media/MediaPlayer;->setLooping(Z)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
new-instance v0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer$$special$$inlined$let$lambda$1;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-direct {v0, p2, p3}, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer$$special$$inlined$let$lambda$1;-><init>(Lcom/discord/utilities/media/AppSound;Lkotlin/jvm/functions/Function0;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
invoke-virtual {p1, v0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p1, "onCompletion"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "sound"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p1, "context"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final release()Lkotlin/Unit;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V
|
|
|
|
|
|
|
|
sget-object v0, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final start()Lkotlin/Unit;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/media/AppSoundManager$SoundPlayer;->mediaPlayer:Landroid/media/MediaPlayer;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaPlayer;->start()V
|
|
|
|
|
|
|
|
sget-object v0, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-object v0
|
|
|
|
.end method
|