diff --git a/sources/custom/Global.cs b/sources/custom/Global.cs new file mode 100644 index 0000000000..640ddd2f28 --- /dev/null +++ b/sources/custom/Global.cs @@ -0,0 +1,40 @@ +// Copyright (C) 2017 Thibault Saunier +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301 USA + +namespace Gst { + using System; + using System.Runtime.InteropServices; + + partial class Global + { + public static string TimeFormat(ulong time) { + return (time / (Gst.Constants.SECOND * 60 * 60)) + ":" + + (time / (Gst.Constants.SECOND * 60)) % 60 + ":" + + (time / (Gst.Constants.SECOND)) % 60 + ":" + + (time % 60); + } + + public static string TimeFormat(long time) { + return (time / (Gst.Constants.SECOND * 60 * 60)) + ":" + + (time / (Gst.Constants.SECOND * 60)) % 60 + ":" + + (time / (Gst.Constants.SECOND)) % 60 + ":" + + (time % 60); + } + + } +} + diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata index 2b0a85f750..a9b447ec9b 100644 --- a/sources/gstreamer-sharp.metadata +++ b/sources/gstreamer-sharp.metadata @@ -2,7 +2,7 @@