public void OnSetTrack(int currIndx, int prevIndx) { currentDurationText.text = UtilitsAP.TimeFormat(audioSource.clip.length, "#00:00"); currentTimeText.text = UtilitsAP.TimeFormat(0, "#00:00"); progressSlider.maxValue = audioSource.clip.length; progressSlider.value = audioSource.time; currentTrackNameText.text = audioSource.clip.name; currTrackInfo = uiBehaviourController.PlayListContent.GetChild(currIndx).GetComponent <TrackInfo>(); currTrackInfo.IsSelected = true; uiBehaviourController.currTrackInfo = currTrackInfo; if (currTrackInfo.IsFavorite) { uiBehaviourController.FavoriteImg.overrideSprite = uiBehaviourController.FillFavoriteSprite; } else { uiBehaviourController.FavoriteImg.overrideSprite = uiBehaviourController.EmptyFavoriteSprite; } tracksCount = playListController.currentTrackList.Count(); currentTrackNumber.text = $"{currIndx + 1}/{tracksCount}"; if (prevIndx != -1 && prevIndx != currIndx) { uiBehaviourController.PlayListContent.GetChild(prevIndx).GetComponent <TrackInfo>().IsSelected = false; } }
public void OnUpdateTrackInfoPanel() { var _currTrackTime = audioSource.time; progressSlider.value = _currTrackTime; currentTimeText.text = UtilitsAP.TimeFormat(_currTrackTime, "#00:00"); progressSlider.maxValue = audioSource.clip != null ? audioSource.clip.length : 0.0f; }
public void GetInfo(AudioClip track, int num, TrackMenu currentTrackMenu, PlayerController player = null, PlayListController playList = null, string folder = "") { currentTrack = track; trackMenu = currentTrackMenu; folderName = folder; playerContrl = player; playListContrl = playList; textTrackName.text = currentTrack.name; textFolderName.text = folderName; textTrackDuration.text = UtilitsAP.TimeFormat(currentTrack.length, "#00:00"); textTrackNum.text = num.ToString() + "."; IsFavorite = playListContrl.favoriteTrackList.Contains(currentTrack); IsInQueue = playListContrl.queueTrackList.Contains(currentTrack); if (IsInQueue) { queueTextBlock.text = $"[{playListContrl.queueTrackList.IndexOf(currentTrack) + 1}]"; } }
public void OnChangeTrackProgress(float val) { audioSource.time = val; currentTimeText.text = UtilitsAP.TimeFormat(audioSource.time, "#00:00"); }