Exemple #1
0
        internal void OnCallback(XtStream stream, object input, object output, int frames,
                                 double time, ulong position, bool timeValid, ulong error, object user)
        {
            if (error != 0)
            {
                onError(() => "Stream callback error: " + XtPrint.ErrorToString(error));
                return;
            }

            XtFormat format      = stream.GetFormat();
            bool     interleaved = stream.IsInterleaved();

            OnCallback(format, interleaved, stream.IsRaw(), input, output, frames);
            processed += frames;
            if (processed < format.mix.rate * 3)
            {
                return;
            }

            processed = 0;
            XtLatency latency      = stream.GetLatency();
            string    formatString = "Stream {1}:{0}\tinput latency:{2}{0}\toutput latency:{3}{0}\t" +
                                     "buffer frames:{4}{0}\tcurrent frames:{5}{0}\ttime:{6}{0}\tposition:{7}{0}\ttimeValid:{8}{0}\tuser:{9}.";

            OnMessage(() => string.Format(formatString, Environment.NewLine, name, latency.input,
                                          latency.output, stream.GetFrames(), frames, time, position, timeValid, user));
        }
Exemple #2
0
        public XtLatency GetLatency()
        {
            XtLatency latency = new XtLatency();

            XtNative.HandleError(XtNative.XtStreamGetLatency(s, latency));
            return(latency);
        }
Exemple #3
0
 internal static extern ulong XtStreamGetLatency(IntPtr s, [In, Out] XtLatency latency);
Exemple #4
0
 internal static extern IntPtr XtPrintLatencyToString(XtLatency latency);
Exemple #5
0
 static extern ulong XtStreamGetLatency(IntPtr s, out XtLatency latency);