<commit_before>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AVFoundation;
using CoreFoundation;
using Foundation;
using Metal;
using MusicPlayer.Data;
using MusicPlayer.iOS;
using MusicPlayer.iOS.Playback;
using MusicPlayer.Managers;
using MusicPlayer.Models;
using MusicPlayer.Models.Scrobbling;
using UIKit;
using CoreAnimation;

namespace MusicPlayer.Playback
{
	internal partial class NativeAudioPlayer : BaseModel
	{
		public static NativeAudioPlayer Shared {get;set;}
		public readonly AudioFadePlayer player;
		readonly AVAudioPlayer silentPlayer;
		IDisposable observer;

		NSTimer timer;
        PlaybackState lastState;
        DateTime lastInterupt;

		public CustomVideoLayer VideoLayer { get; } = new CustomVideoLayer ();
		public NativeAudioPlayer()
		{
			Shared = this;
            timer = NSTimer.CreateRepeatingScheduledTimer(2,CheckPlaybackStatus);
			NSError error;
			#if __IOS__
			AVAudioSession.SharedInstance().SetCategory(AVAudioSession.CategoryPlayback, out error);
			#endif

			player = new AudioFadePlayer
			{
				Parent = this,
				Finished = (obj) => {
					finishedPlaying(player.CurrentSong);
				},
			};

			#if __IOS__
			silentPlayer = new AVAudioPlayer(NSBundle.MainBundle.GetUrlForResource("empty","mp3"),"mp3", out error) {
				NumberOfLoops = -1,
			};

			PictureInPictureManager.Shared.Setup(VideoLayer);
//			observer = player.AddObserver("rate", NSKeyValueObservingOptions.New, (change) =>
//			{
//				Console.WriteLine("Playback state changed: {0}", player.Rate);<commit_msg>Set the timer to 10 min<commit_after>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AVFoundation;
using CoreFoundation;
using Foundation;
using Metal;
using MusicPlayer.Data;
using MusicPlayer.iOS;
using MusicPlayer.iOS.Playback;
using MusicPlayer.Managers;
using MusicPlayer.Models;
using MusicPlayer.Models.Scrobbling;
using UIKit;
using CoreAnimation;

namespace MusicPlayer.Playback
{
	internal partial class NativeAudioPlayer : BaseModel
	{
		public static NativeAudioPlayer Shared {get;set;}
		public readonly AudioFadePlayer player;
		readonly AVAudioPlayer silentPlayer;
		IDisposable observer;

		NSTimer timer;
        PlaybackState lastState;
        DateTime lastInterupt;

		public CustomVideoLayer VideoLayer { get; } = new CustomVideoLayer ();
		public NativeAudioPlayer()
		{
			Shared = this;
            timer = NSTimer.CreateRepeatingScheduledTimer(10,CheckPlaybackStatus);
			NSError error;
			#if __IOS__
			AVAudioSession.SharedInstance().SetCategory(AVAudioSession.CategoryPlayback, out error);
			#endif

			player = new AudioFadePlayer
			{
				Parent = this,
				Finished = (obj) => {
					finishedPlaying(player.CurrentSong);
				},
			};

			#if __IOS__
			silentPlayer = new AVAudioPlayer(NSBundle.MainBundle.GetUrlForResource("empty","mp3"),"mp3", out error) {
				NumberOfLoops = -1,
			};

			PictureInPictureManager.Shared.Setup(VideoLayer);
//			observer = player.AddObserver("rate", NSKeyValueObservingOptions.New, (change) =>
//			{
//				Console.WriteLine("Playback state changed: {0}", player.Rate);
{'fraction_non_alphanumeric': 0.09552061702758825, 'fraction_numerical': 0.00385642242657965, 'mean_word_length': 4.638795986622074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3512826', 'n_tokens_mistral': 1121, 'n_tokens_neox': 987, 'n_words': 232}