-
Notifications
You must be signed in to change notification settings - Fork 1
/
IMusicPlayer.cs
36 lines (35 loc) · 1.45 KB
/
IMusicPlayer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using UnityEngine;
namespace HexGrimmDev.Audio
{
public interface IMusicPlayer
{
/// <summary>
/// plays music clip as 2d sound with concrete volume padding.
/// </summary>
/// <param name="clip">music clip</param>
/// <param name="volumeProportion">volume proportions of sound in range of 1 - 0. Its also affected by global music volume settings</param>
/// <returns>concrete music playback code for future control</returns>
int PlayMusicClip(AudioClip clip, float volumeProportion = 1f);
/// <summary>
/// stops playing music clip and clear data for this code.
/// </summary>
/// <param name="audioCode">audio code to find audio clip playback</param>
void StopPlayingMusicClip(int audioCode);
/// <summary>
/// Pauses concrete music clip play, it could be resumed.
/// </summary>
/// <param name="audioCode"></param>
void PausePlayingClip(int audioCode);
/// <summary>
/// Resumes concrete music clip play if it was paused before.
/// </summary>
/// <param name="audioCode"></param>
void ResumeClipIfInPause(int audioCode);
/// <summary>
/// Returns true if audio code contains in player and can be controlled.
/// </summary>
/// <param name="audioCode">audio code</param>
/// <returns></returns>
bool IsMusicClipCodePlaying(int audioCode);
}
}