-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
760c97e
commit 5a0631f
Showing
5 changed files
with
72 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// PlayMusicUseCase.swift | ||
// Segno | ||
// | ||
// Created by Gordon Choi on 2022/12/07. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol PlayMusicUseCase { | ||
func setupPlayer(_ song: MusicInfo?) | ||
func togglePlayer() | ||
func stopPlaying() | ||
} | ||
|
||
final class PlayMusicUseCaseImpl: PlayMusicUseCase { | ||
let musicRepository: MusicRepository | ||
|
||
init(musicRepository: MusicRepository = MusicRepositoryImpl()) { | ||
self.musicRepository = musicRepository | ||
} | ||
|
||
func setupPlayer(_ song: MusicInfo?) { | ||
musicRepository.setupMusic(song) | ||
} | ||
|
||
func togglePlayer() { | ||
musicRepository.toggleMusicPlayer() | ||
} | ||
|
||
func stopPlaying() { | ||
musicRepository.stopPlayingMusic() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters