コード例 #1
0
        public override void OnCreate()
        {
            InitList();
            InitPlayer();

            prefs = new ServiceSharedPref(this);
            RepeatSharedPrefs repPref   = new RepeatSharedPrefs(this);
            RepeatMethod      repMethod = repPref.GetMethod();

            ChangeLoopback(repMethod.ToString());

            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
            {
                var notificationManager  = GetSystemService(Context.NotificationService) as NotificationManager;
                NotificationChannel chan = new NotificationChannel("com.PapIndustries.PapMediaPlayerService", "NotChannel", NotificationImportance.Max)
                {
                    LightColor           = Color.Blue,
                    LockscreenVisibility = NotificationVisibility.Public
                };
                notificationManager.CreateNotificationChannel(chan);
            }
            SetNotificationBar();
            RegisterReceivers();
            if (notify != null)
            {
                StartForeground(SERVICE_ID, notify);
            }
            base.OnCreate();
        }
コード例 #2
0
 public void SetMethod(RepeatMethod repeat)
 {
     using (ISharedPreferencesEditor editor = @Context.GetSharedPreferences(RepeatConf, FileCreationMode.Private).Edit())
     {
         editor.PutInt(RepeatAttr, (int)repeat);
         editor.Apply();
         editor.Commit();
     }
 }
コード例 #3
0
 public RepeatMethodEventArgs(RepeatMethod RMethod)
 {
     newRMethod = RMethod;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new instance of ViewPlayManager
 /// </summary>
 /// <param name="viewMethod">View Method style</param>
 /// <param name="RepMethod">Repeat Method style</param>
 public ViewPlayManager(ViewMethods viewMethod, RepeatMethod RepMethod)
 {
     viewm = viewMethod;
     rep   = RepMethod;
 }
コード例 #5
0
 /// <summary>
 /// Creates a new instance of ViewPlayManager with specified RepeatMethod and default ViewMethod
 /// Default Value: ViewMethod -> AllTracks
 /// </summary>
 /// <param name="RepMethod">Repeat Method style</param>
 public ViewPlayManager(RepeatMethod RepMethod) : this(ViewMethods.AllTracks, RepMethod)
 {
 }