public MeditationToolbox(AnimatedPaint_IContainer animatedPaint_iContainer)
 {
     var stopFilename = UtilsIO.GetFileFromThisAppDirectory(Settings.Default.StopMp3Filename);
     MeditateOnStop = new InvokeAtRandomIntervals(
         TimeSpan.FromSeconds(Settings.Default.StopMedMinSec),
         TimeSpan.FromSeconds(Settings.Default.StopMedMaxSec),
         () => {
             playa = new AudioPlaya(stopFilename);
             playa.Play();
             playa.Finished += (playaDone) =>
             {
                 playaDone.Dispose();
                 playaDone = null;
             };
         });
     MeditateOnStopQuicker = new InvokeAtRandomIntervals(
         TimeSpan.FromSeconds(Settings.Default.StopMed2MinSec),
         TimeSpan.FromSeconds(Settings.Default.StopMed2MaxSec),
         () =>
         {
             playa = new AudioPlaya(stopFilename);
             playa.Play();
             playa.Finished += (playaDone) =>
             {
                 playaDone.Dispose();
                 playaDone = null;
             };
         });
     CurAnimation = new AnimatedPaintThread(animatedPaint_iContainer) {
         DelayMs = Settings.Default.AnimationsDelay,
     };
 }
Ejemplo n.º 2
0
        private void playbackLastSegment()
        {
            var lastSeg = xml.Segments.LastOrDefault();
            if (lastSeg == null)
                return;

            if (playa != null)
            {
                playa.Stop();
                return;
            }

            playa = new AudioPlaya(lastSeg.Filename);
            playa.Play();
            playa.Finished += (playaDone) =>
            {
                playa.Dispose();
                playa = null;
            };
        }