feat(music): add custom-playback-speed patch

This commit is contained in:
inotia00
2023-09-18 01:27:52 +09:00
parent 8ca6fd9a53
commit da1cfa7ad9
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package app.revanced.patches.music.video.customspeed.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.intenthook.patch.IntentHookPatch
import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch
import app.revanced.patches.shared.patch.customspeed.AbstractCustomPlaybackSpeedPatch
import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH
@Patch
@Name("Custom playback speed")
@Description("Adds more playback speed options.")
@DependsOn([IntentHookPatch::class])
@MusicCompatibility
class CustomPlaybackSpeedPatch : AbstractCustomPlaybackSpeedPatch(
"$MUSIC_VIDEO_PATH/CustomPlaybackSpeedPatch;",
3.0f
) {
override fun execute(context: BytecodeContext) {
super.execute(context)
SettingsPatch.addMusicPreferenceWithIntent(
CategoryType.VIDEO,
"revanced_custom_playback_speeds"
)
}
}