//*********************************************************************************************************************************************************************************************************** #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); }
public override void SetVolume(FadeSettings fs) { if (fs.fadeLength > 0f) FadeVolume (fs); else SetVolume (fs.endValue); }
public static AudioElement SetElementVolume(string name, FadeSettings fadeSettings) { AudioElement e = GetElement(name); e.SetVolume(fadeSettings); return(e); }
public static Category SetCategoryVolume(string name, FadeSettings fadeSettings) { Category c = GetCategory(name); c.SetVolume(fadeSettings); return(c); }
public static Category SetCategoryPan(string name, float pan, FadeSettings fadeSettings) { Category c = GetCategory(name); c.SetPan(fadeSettings); return(c); }
public static AudioElement SetPan(string name, FadeSettings FadeSettings) { AudioElement e = GetElement(name); e.SetPan(FadeSettings); return(e); }
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(); }
public override void SetVolume(FadeSettings fs) { if (fs.fadeLength > 0f) { FadeVolume(fs); } else { SetVolume(fs.endValue); } }
/// <summary> /// Volume /// </summary> public override void SetVolume(FadeSettings fs) { if (fs.fadeLength > 0f) { FadeVolume(fs); } else { volume.ElementLevel = fs.endValue; } }
/// <summary> /// Panning /// </summary> public override void SetPan(FadeSettings fs) { if (fs.fadeLength > 0f) { FadePan(fs); } else { pan.SetPan(fs.endValue); } }
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); }
// 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); } }
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; }
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; }
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); } }
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); } }
// 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); } }
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); } }
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); } }
public MainViewModel() { window = new TKWindow(); window.AgentSettings = AgentSettings.Default(); window.FadeSettings = FadeSettings.Default(); }
public virtual void SetPan(FadeSettings fadeSettings) { return; }
public virtual void SetVolume(FadeSettings fadeSettings) { return; }
/// <summary> /// Volume /// </summary> public override void SetVolume(FadeSettings fs) { if (fs.fadeLength > 0f) FadeVolume (fs); else volume.ElementLevel = fs.endValue; }
public void Fade(FadeSettings settings) { StartCoroutine(DoFade(settings)); }
/// <summary> /// Panning /// </summary> public override void SetPan(FadeSettings fs) { if (fs.fadeLength > 0f) FadePan (fs); else pan.SetPan (fs.endValue); }