Closed RasmusBroborg closed 2 years ago
@RasmusBroborg I would like to work on this issue. Could you please assign on my name.
I have clarification as well, Do we need to change all the methods to static or you would need all the methods as another copy with static?
Hi @GopinathRakkiyannan, I will assign you to the issue.
It is good that you ask for clarification. The static methods should mirror the instance methods (ie copy as you say). The intent for this is to enable more flexible workflows for the end users.
Please let me know if this answer is sufficient, or if you would like me provide examples.
@RasmusBroborg
Could you please update some examples here. That would help me lot. Thanks in advance
@GopinathRakkiyannan Please see below for more examples:
Example 1:
using DotnetTimecode;
using DotnetTimecode.Enums;
// Static method call
string inputString = "10:00:00:00";
int numberOfHoursToAdd = 2;
string result = Timecode.AddHours(inputString, numberOfHoursToAdd); // result will be the string value "12:00:00:00"
// Instance method call
Timecode timecode = new Timecode("10:00:00:00", Framerate.fps24);
timecode.AddHours(2);
string result = timecode.ToString(); // result will be the string value "12:00:00:00"
Example 2:
using DotnetTimecode;
using DotnetTimecode.Enums;
// Static method call
string inputString = "10:00:00:00";
int numberOfMinutesToAdd = -2;
string result = Timecode.AddMinutes(inputString, numberOfMinutesToAdd ); // result will be the string value "09:58:00:00"
// Instance method call
Timecode timecode = new Timecode("10:00:00:00", Framerate.fps24);
timecode.AddMinutes(-2);
string result = timecode.ToString(); // result will be the string value "09:58:00:00"
Example 3:
using DotnetTimecode;
using DotnetTimecode.Enums;
// Static method call
string inputString = "10:00:00:00";
int numberOfFramesToAdd = 25;
Framerate framerate = Framerate.fps24
string result = Timecode.AddFrames(inputString, numberOfFramesToAdd, framerate); // result will be the string value "10:00:01:01"
// Instance method call
Timecode timecode = new Timecode("10:00:00:00", Framerate.fps24);
timecode.AddFrames(25);
string result = timecode.ToString(); // result will be the string value "10:00:01:01"
@RasmusBroborg Thanks for the info. This will help me more!. I will let you know once I done with the implementation as soon
@GopinathRakkiyannan Happy coding!
Hello, @RasmusBroborg is there anywhere I can help in this issue?
Fixed in #35
All methods in the Timecode.cs class should also be available as static methods.
Example use case: