Esempio n. 1
0
        //***********************************************************************************************************************************************************************************************************

        #region Remove spotify fades

        /// <summary>
        /// Find all places where the record was paused and remove the fade outs and fade ins that spotify applies when pausing and resuming a playback.
        /// </summary>
        /// <param name="inputWavFileName">WAV file to remove fades</param>
        /// <param name="outputWavFileName">WAV file with removed fades</param>
        private void RemoveSpotifyFades(string inputWavFileName, string outputWavFileName)
        {
            RecordState = RecordStates.REMOVING_FADES;

            string spotifyPauseFadeOutPointsPath = System.AppDomain.CurrentDomain.BaseDirectory + @"\SpotifyPauseFadeOutPoints.xml";
            string spotifyPlayFadeInPointsPath   = System.AppDomain.CurrentDomain.BaseDirectory + @"\SpotifyPlayFadeInPoints.xml";

            WaveFileClass       file    = new WaveFileClass(inputWavFileName);
            List <SilenceParts> silence = file.RemoveSilence(200, -1, 0.0001);

            double allowedPauseSilenceDifference_ms = 500;
            List <FadeSettings> fades = new List <FadeSettings>();

            foreach (SilenceParts sil in silence)
            {
                List <double> validPauseTimes = _recordPauseTimes_s.Where(p => ((p * 1000) > (sil.Original_Start_ms - allowedPauseSilenceDifference_ms)) && ((p * 1000) < (sil.Original_Start_ms + allowedPauseSilenceDifference_ms))).ToList();
                if (validPauseTimes.Count() == 0)   //Only remove fades if the difference between the current silencePart and any of the pauseTimes is small enough
                {
                    continue;
                }

                FadeSettings fadeOutSettings = new FadeSettings(sil.New_Start_ms, FadeTypes.UNDO_CUSTOM, spotifyPauseFadeOutPointsPath, AudioChannels.RIGHT_AND_LEFT);
                fadeOutSettings.FadeStartTime_ms -= fadeOutSettings.FadePoints.Last().X;
                fades.Add(fadeOutSettings);
                fades.Add(new FadeSettings(sil.New_Start_ms, FadeTypes.UNDO_CUSTOM, spotifyPlayFadeInPointsPath, AudioChannels.RIGHT_AND_LEFT));
            }
            file.ApplyFading(fades);
            file.SaveFile(outputWavFileName);
        }
Esempio n. 2
0
 public override void SetVolume(FadeSettings fs)
 {
     if (fs.fadeLength > 0f)
         FadeVolume (fs);
     else
         SetVolume (fs.endValue);
 }
Esempio n. 3
0
    public static AudioElement SetElementVolume(string name, FadeSettings fadeSettings)
    {
        AudioElement e = GetElement(name);

        e.SetVolume(fadeSettings);
        return(e);
    }
Esempio n. 4
0
    public static Category SetCategoryVolume(string name, FadeSettings fadeSettings)
    {
        Category c = GetCategory(name);

        c.SetVolume(fadeSettings);
        return(c);
    }
Esempio n. 5
0
    public static Category SetCategoryPan(string name, float pan, FadeSettings fadeSettings)
    {
        Category c = GetCategory(name);

        c.SetPan(fadeSettings);
        return(c);
    }
Esempio n. 6
0
    public static AudioElement SetPan(string name, FadeSettings FadeSettings)
    {
        AudioElement e = GetElement(name);

        e.SetPan(FadeSettings);
        return(e);
    }
Esempio n. 7
0
        static void Main(string[] args)
        {
            TKWindow window = new TKWindow();

            window.AgentSettings = AgentSettings.Default();
            window.FadeSettings  = FadeSettings.Default();
            window.Run();
            Console.Read();
        }
 private void ReverseSettings()
 {
     activate                 = true;
     scaleSettings            = scaleSettings.Reversed();
     rotateSettings           = rotateSettings.Reversed();
     worldPositionSettings    = worldPositionSettings.Reversed();
     anchoredPositionSettings = anchoredPositionSettings.Reversed();
     colourSettings           = colourSettings.Reversed();
     fadeSettings             = fadeSettings.Reversed();
 }
Esempio n. 9
0
 public override void SetVolume(FadeSettings fs)
 {
     if (fs.fadeLength > 0f)
     {
         FadeVolume(fs);
     }
     else
     {
         SetVolume(fs.endValue);
     }
 }
Esempio n. 10
0
    /// <summary>
    /// Volume
    /// </summary>

    public override void SetVolume(FadeSettings fs)
    {
        if (fs.fadeLength > 0f)
        {
            FadeVolume(fs);
        }
        else
        {
            volume.ElementLevel = fs.endValue;
        }
    }
Esempio n. 11
0
    /// <summary>
    /// Panning
    /// </summary>

    public override void SetPan(FadeSettings fs)
    {
        if (fs.fadeLength > 0f)
        {
            FadePan(fs);
        }
        else
        {
            pan.SetPan(fs.endValue);
        }
    }
Esempio n. 12
0
        public static FadeProgram Create(int width, int height, Texture2D texture, FadeSettings settings)
        {
            FadeProgram _fadeProgram = ObjectTK.Shaders.ProgramFactory.Create <FadeProgram>();

            _fadeProgram.Use();
            _fadeProgram.Texture.Bind(0, texture, TextureAccess.ReadWrite);
            _fadeProgram.Width.Set(width);
            _fadeProgram.Height.Set(height);

            _fadeProgram.FadeSettings = settings;

            return(_fadeProgram);
        }
Esempio n. 13
0
 // Panning a category means that all elements will have the same pan-
 // even if individually they were different before the category panned them,
 // so make sure it's what you want!
 public override void SetPan(FadeSettings fs)
 {
     if (fs.fadeLength > 0f) {
         foreach (AudioElement e in elements) {
             e.SetPan (fs.endValue);
         }
     } else {
         foreach (AudioElement e in elements) {
             e.SetPan (fs);
         }
     }
     foreach (Category c in subcategories) {
         c.SetPan (fs);
     }
 }
Esempio n. 14
0
    private IEnumerator DoFade(FadeSettings settings)
    {
        if (!settings.IsValid())
        {
            yield break;
        }

        settings.DoneFading = false;

        var   duration = settings.Duration;
        var   type     = settings.Type;
        float t;

        var color = _image.color;

        if (type == FadingType.FadeIn)
        {
            t = 0f;
            while (t < duration)
            {
                color.a = t / duration;

                _image.color = color;

                t += Time.deltaTime;
                yield return(null);
            }
            color.a      = 1f;
            _image.color = color;
        }
        else if (type == FadingType.FadeOut)
        {
            t = duration;
            while (t > 0f)
            {
                color.a = t / duration;

                _image.color = color;

                t -= Time.deltaTime;
                yield return(null);
            }
            color.a      = 0f;
            _image.color = color;
        }

        settings.DoneFading = true;
    }
Esempio n. 15
0
    private IEnumerator DoRIP()
    {
        var fade = new FadeSettings()
        {
            Type     = FadingType.FadeIn,
            Duration = 0.8f
        };

        Fader.Instance.Fade(fade);
        while (!fade.DoneFading)
        {
            yield return(null);
        }

        Application.LoadLevel(DeathScreenScene);
    }
    public AnimationOperation(AnimationOperation animationOperation)
    {
        targetObject = animationOperation.targetObject;
        type         = animationOperation.type;
        easing       = animationOperation.easing;
        delay        = animationOperation.delay;
        duration     = animationOperation.duration;

        activate                 = animationOperation.activate;
        scaleSettings            = animationOperation.scaleSettings;
        rotateSettings           = animationOperation.rotateSettings;
        worldPositionSettings    = animationOperation.worldPositionSettings;
        anchoredPositionSettings = animationOperation.anchoredPositionSettings;
        colourSettings           = animationOperation.colourSettings;
        fadeSettings             = animationOperation.fadeSettings;
    }
Esempio n. 17
0
 public void FadePan(FadeSettings fs)
 {
     if (fs.fadeLength == 0f) {
         pan.SetPan (fs.endValue);
     }
     if (fs.startValue == fs.endValue) {
         pan.FadeTo (fs.fadeLength,
                     fs.endValue,
                     fs.fadeType,
                     fs.power);
     } else {
         pan.Fade (fs.fadeLength,
                   fs.startValue,
                   fs.endValue,
                   fs.fadeType,
                   fs.power);
     }
 }
Esempio n. 18
0
 public void FadeVolume(FadeSettings fs)
 {
     if (fs.fadeLength == 0f) {
         volume.Level = fs.endValue;
     }
     if (fs.startValue == fs.endValue) {
         volume.FadeTo (fs.fadeLength,
                        fs.endValue,
                        fs.fadeType,
                        fs.power);
     } else {
         volume.Fade (fs.fadeLength,
                      fs.startValue,
                      fs.endValue,
                      fs.fadeType,
                      fs.power);
     }
 }
Esempio n. 19
0
 // Panning a category means that all elements will have the same pan-
 // even if individually they were different before the category panned them,
 // so make sure it's what you want!
 public override void SetPan(FadeSettings fs)
 {
     if (fs.fadeLength > 0f)
     {
         foreach (AudioElement e in elements)
         {
             e.SetPan(fs.endValue);
         }
     }
     else
     {
         foreach (AudioElement e in elements)
         {
             e.SetPan(fs);
         }
     }
     foreach (Category c in subcategories)
     {
         c.SetPan(fs);
     }
 }
Esempio n. 20
0
 public void FadeVolume(FadeSettings fs)
 {
     if (fs.fadeLength == 0f)
     {
         volume.ElementLevel = fs.endValue;
     }
     if (fs.startValue == fs.endValue)
     {
         volume.FadeTo(fs.fadeLength,
                       fs.endValue,
                       fs.fadeType,
                       fs.power);
     }
     else
     {
         volume.Fade(fs.fadeLength,
                     fs.startValue,
                     fs.endValue,
                     fs.fadeType,
                     fs.power);
     }
 }
Esempio n. 21
0
 public void FadePan(FadeSettings fs)
 {
     if (fs.fadeLength == 0f)
     {
         pan.SetPan(fs.endValue);
     }
     if (fs.startValue == fs.endValue)
     {
         pan.FadeTo(fs.fadeLength,
                    fs.endValue,
                    fs.fadeType,
                    fs.power);
     }
     else
     {
         pan.Fade(fs.fadeLength,
                  fs.startValue,
                  fs.endValue,
                  fs.fadeType,
                  fs.power);
     }
 }
Esempio n. 22
0
 public MainViewModel()
 {
     window = new TKWindow();
     window.AgentSettings = AgentSettings.Default();
     window.FadeSettings  = FadeSettings.Default();
 }
Esempio n. 23
0
 public virtual void SetPan(FadeSettings fadeSettings)
 {
     return;
 }
Esempio n. 24
0
 public virtual void SetVolume(FadeSettings fadeSettings)
 {
     return;
 }
Esempio n. 25
0
 /// <summary>
 /// Volume 
 /// </summary>
 public override void SetVolume(FadeSettings fs)
 {
     if (fs.fadeLength > 0f)
         FadeVolume (fs);
     else
         volume.ElementLevel = fs.endValue;
 }
Esempio n. 26
0
 public void Fade(FadeSettings settings)
 {
     StartCoroutine(DoFade(settings));
 }
Esempio n. 27
0
 /// <summary>
 /// Panning
 /// </summary>
 public override void SetPan(FadeSettings fs)
 {
     if (fs.fadeLength > 0f)
         FadePan (fs);
     else
         pan.SetPan (fs.endValue);
 }