RasmusBroborg / DotnetTimecode

Dotnet Timecode is a C# class library for working with SMPTE Timecodes defined by the Society of Motion Picture and Television Engineers in the SMPTE 12M specification.
MIT License
8 stars 6 forks source link

[FEATURE] Add operator overloading for += and -= #47

Closed RasmusBroborg closed 1 year ago

RasmusBroborg commented 2 years ago

Is your feature request related to a problem? Please describe. You are currently not able to use the operators += and -= when performing arithmetic operations on timecode objects.

hiteshbhavsar commented 2 years ago

Hi @RasmusBroborg I have tested this feature at my end there is no new development needed for the same I can show you the sample code I used for testing.

 var tc1 = new Timecode(10, 0, 0, 0, DotnetTimecode.Enums.Framerate.fps23_976); //10:00:00:000
 var tc2 = new Timecode(1, 0, 0, 0, DotnetTimecode.Enums.Framerate.fps23_976); //01:00:00:000
tc1+=tc2; //Example for += operation
Console.WriteLine(tc1); //11:00:00:00
tc1-=tc2; //Example for -= operation
Console.WriteLine(tc1); //10:00:00:00

I think the operations are working perfectly. Let me know if there is some other development that needs to be done.

RasmusBroborg commented 2 years ago

Hi @hiteshbhavsar,

Thank you for confirming that the operations work as intended. We should confirm the behaviour by writing unit tests.

Would you be interested in writing said tests? There are references of similar test cases in the test folder if you need guidance on how to write the tests.

If not let me know and I will fix the tests shortly.

Best, Rasmus

hiteshbhavsar commented 2 years ago

Hi, @RasmusBroborg,

Yes, I would be interested in writing the test. Please assign it to me.

Regards. Hitesh

RasmusBroborg commented 1 year ago

Fixed in #51