瀏覽代碼

Refactor: reformat music player code

Shan-PC\Shan 6 年之前
父節點
當前提交
1504e7b2e5
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/main/java/com/bomostory/sceneeditmodule/utils/MusicPlayer.kt

+ 7 - 7
src/main/java/com/bomostory/sceneeditmodule/utils/MusicPlayer.kt

@@ -10,11 +10,11 @@ class MusicPlayer {
         musicPaths.add(path)
     }
 
-    fun remove(path: String){
+    fun remove(path: String) {
         musicPaths.remove(path)
     }
 
-    fun clear(){
+    fun clear() {
         musicPaths.clear()
     }
 
@@ -46,7 +46,7 @@ class MusicPlayer {
         }
     }
 
-    fun start(){
+    fun start() {
         for (mediaPlayer in mediaPlayers) {
             mediaPlayer.apply {
                 start()
@@ -54,14 +54,14 @@ class MusicPlayer {
         }
     }
 
-    fun pause(){
-        for(mediaPlayer in mediaPlayers){
+    fun pause() {
+        for (mediaPlayer in mediaPlayers) {
             mediaPlayer.pause()
         }
     }
 
-    fun seekTo(mSec:Int){
-        for(mediaPlayer in mediaPlayers){
+    fun seekTo(mSec: Int) {
+        for (mediaPlayer in mediaPlayers) {
             mediaPlayer.seekTo(mSec)
         }
     }