-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from sinBetaKun/v1.0.3.1
V1.0.3.1
- Loading branch information
Showing
31 changed files
with
1,045 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
SinTachiePlugin/LayerValueListController/Extra/IIntervalParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal interface IIntervalParameter | ||
{ | ||
public Animation Interval { get; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
SinTachiePlugin/LayerValueListController/Extra/IStartParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal interface IStartParameter | ||
{ | ||
public Animation Start { get; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
SinTachiePlugin/LayerValueListController/Extra/ITransitionParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal interface ITransitionParameter | ||
{ | ||
public Animation Transition { get; } | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
SinTachiePlugin/LayerValueListController/Extra/IntervalSharedData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
using YukkuriMovieMaker.Controls; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal class IntervalSharedData | ||
{ | ||
public Animation Interval { get; } = new Animation(0, 0, 9999); | ||
|
||
public IntervalSharedData() | ||
{ | ||
} | ||
|
||
public IntervalSharedData(IIntervalParameter parameter) | ||
{ | ||
Interval.CopyFrom(parameter.Interval); | ||
} | ||
|
||
public void CopyTo(IIntervalParameter parameter) | ||
{ | ||
parameter.Interval.CopyFrom(Interval); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
SinTachiePlugin/LayerValueListController/Extra/LayerValueExtraBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
using YukkuriMovieMaker.Project; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
public abstract class LayerValueExtraBase : SharedParameterBase | ||
{ | ||
public LayerValueExtraBase() | ||
{ | ||
} | ||
|
||
public LayerValueExtraBase(SharedDataStore? store = null) : base(store) | ||
{ | ||
} | ||
|
||
public abstract double GetValue(long frame, long length, int fps); | ||
public abstract void CopyFrom(LayerValueExtraBase? origin); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
SinTachiePlugin/LayerValueListController/Extra/Parameter/NoExtra.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
using YukkuriMovieMaker.Project; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra.Parameter | ||
{ | ||
public class NoExtra : LayerValueExtraBase | ||
{ | ||
public NoExtra() | ||
{ | ||
} | ||
|
||
public NoExtra(SharedDataStore? store = null) : base(store) | ||
{ | ||
} | ||
|
||
public override void CopyFrom(LayerValueExtraBase? origin) | ||
{ | ||
return; | ||
} | ||
|
||
public override double GetValue(long frame, long length, int fps) | ||
{ | ||
return 1.0; | ||
} | ||
|
||
protected override IEnumerable<IAnimatable> GetAnimatables() => []; | ||
|
||
protected override void LoadSharedData(SharedDataStore store) | ||
{ | ||
} | ||
|
||
protected override void SaveSharedData(SharedDataStore store) | ||
{ | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
SinTachiePlugin/LayerValueListController/Extra/Parameter/PeriodicParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
using YukkuriMovieMaker.Controls; | ||
using YukkuriMovieMaker.Project; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra.Parameter | ||
{ | ||
public class PeriodicParameter : LayerValueExtraBase, IStartParameter, IIntervalParameter, ITransitionParameter | ||
{ | ||
[Display(Name = "開始", Description = "差分を動かし始めるタイミング")] | ||
[AnimationSlider("F2", "秒", 0, 10)] | ||
public Animation Start { get; } = new Animation(0, 0, 9999); | ||
|
||
[Display(Name = "間隔", Description = "差分を動かす時間間隔(遷移は含まれない)")] | ||
[AnimationSlider("F2", "秒", 0, 10)] | ||
public Animation Interval { get; } = new Animation(0, 0, 9999); | ||
|
||
[Display(Name = "遷移", Description = "差分を動かし始めてから終わるまでの時間")] | ||
[AnimationSlider("F2", "秒", 0, 10)] | ||
public Animation Transition { get; } = new Animation(0, 0, 9999); | ||
|
||
/// <summary> | ||
/// 制御モードが周期的往復/ループのとき、差分を指定する値を返す。 | ||
/// </summary> | ||
/// <param name="frame"></param> | ||
/// <param name="length"></param> | ||
/// <param name="fps"></param> | ||
/// <returns>0から1までのdouble</returns> | ||
public override double GetValue(long frame, long length, int fps) | ||
{ | ||
double start = Start.GetValue(frame, length, fps); | ||
double time = frame / (double)fps - start; | ||
|
||
if (time < 0) | ||
return 1.0; | ||
|
||
double interval = Interval.GetValue(frame, length, fps); | ||
double transition = Transition.GetValue(frame, length, fps); | ||
|
||
double time2 = time % (transition + interval); | ||
|
||
if(time2 < transition) | ||
return 1.0 - time2 / transition; | ||
|
||
return 1.0; | ||
} | ||
|
||
public PeriodicParameter() | ||
{ | ||
} | ||
|
||
public PeriodicParameter(SharedDataStore? store) : base(store) | ||
{ | ||
} | ||
|
||
public override void CopyFrom(LayerValueExtraBase? origin) | ||
{ | ||
var origin2 = origin as PeriodicParameter; | ||
if (origin2 == null) return; | ||
Start.CopyFrom(origin2.Start); | ||
Interval.CopyFrom(origin2.Interval); | ||
Transition.CopyFrom(origin2.Transition); | ||
} | ||
|
||
protected override IEnumerable<IAnimatable> GetAnimatables() => [Start, Interval, Transition]; | ||
|
||
protected override void SaveSharedData(SharedDataStore store) | ||
{ | ||
store.Save(new StartSharedData(this)); | ||
store.Save(new IntervalSharedData(this)); | ||
store.Save(new TransitionSharedData(this)); | ||
} | ||
|
||
protected override void LoadSharedData(SharedDataStore store) | ||
{ | ||
if (store.Load<StartSharedData>() is StartSharedData startParameter) | ||
startParameter.CopyTo(this); | ||
if (store.Load<IntervalSharedData>() is IntervalSharedData intervalParameter) | ||
intervalParameter.CopyTo(this); | ||
if (store.Load<TransitionSharedData>() is TransitionSharedData transitionParameter) | ||
transitionParameter.CopyTo(this); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
SinTachiePlugin/LayerValueListController/Extra/StartSharedData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
using YukkuriMovieMaker.Controls; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal class StartSharedData | ||
{ | ||
public Animation Start { get; } = new Animation(0, 0, 9999); | ||
|
||
public StartSharedData() | ||
{ | ||
} | ||
|
||
public StartSharedData(IStartParameter parameter) | ||
{ | ||
Start.CopyFrom(parameter.Start); | ||
} | ||
|
||
public void CopyTo(IStartParameter parameter) | ||
{ | ||
parameter.Start.CopyFrom(Start); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
SinTachiePlugin/LayerValueListController/Extra/TransitionSharedData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Commons; | ||
|
||
namespace SinTachiePlugin.LayerValueListController.Extra | ||
{ | ||
internal class TransitionSharedData | ||
{ | ||
public Animation Speed { get; } = new Animation(0, 0, 9999); | ||
|
||
public TransitionSharedData() { } | ||
|
||
public TransitionSharedData(ITransitionParameter parameter) | ||
{ | ||
Speed.CopyFrom(parameter.Transition); | ||
} | ||
|
||
public void CopyTo(ITransitionParameter parameter) | ||
{ | ||
parameter.Transition.CopyFrom(Speed); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
SinTachiePlugin/LayerValueListController/LayerAnimationModeEx.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using SinTachiePlugin.LayerValueListController.Extra; | ||
using SinTachiePlugin.LayerValueListController.Extra.Parameter; | ||
using SinTachiePlugin.Parts.LayerValueListController; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using YukkuriMovieMaker.Plugin.Community.Effect.Video.ZoomPixel.Size; | ||
|
||
namespace SinTachiePlugin.LayerValueListController | ||
{ | ||
internal static class LayerAnimationModeEx | ||
{ | ||
public static LayerValueExtraBase Convert(this LayerAnimationMode mode, LayerValueExtraBase current) | ||
{ | ||
var store = current.GetSharedData(); | ||
LayerValueExtraBase param = mode switch | ||
{ | ||
LayerAnimationMode.CerrarPlusAbrir => new NoExtra(store), | ||
LayerAnimationMode.CerrarTimesAbrir => new NoExtra(store), | ||
LayerAnimationMode.Sin => new NoExtra(store), | ||
LayerAnimationMode.VoiceVolume => new NoExtra(store), | ||
LayerAnimationMode.PeriodicShuttle => new PeriodicParameter(store), | ||
LayerAnimationMode.PeriodicLoop => new PeriodicParameter(store), | ||
_ => throw new ArgumentOutOfRangeException(nameof(mode)), | ||
}; | ||
if (param.GetType() != current.GetType()) | ||
return param; | ||
return current; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.