Beispiel #1
0
            public bool Play()
            {
                error = null;

                try {
                    if (!File.Exists(path))
                    {
                        error = string.Format("File '{0}' does not exist.", path);
                        return(false);
                    }

                    var           fileIOHandler = FileIOHelper.GetByExtension(path);
                    EventSequence sequence      = fileIOHandler.OpenSequence(path);
                    numberOfChannels = sequence.FullChannelCount;

                    object executionIfaceObj;
                    if (!Interfaces.Available.TryGetValue("IExecution", out executionIfaceObj))
                    {
                        error = "IExecution interface not available.";
                        return(false);
                    }

                    executionInterface = (IExecution)executionIfaceObj;
                    contextHandle      = executionInterface.RequestContext(true, false, null);
                    executionInterface.SetSynchronousContext(contextHandle, sequence);

                    executionInterface.ExecutePlay(contextHandle, 0, 0);

                    return(true);
                }
                catch (Exception e) {
                    error = e.Message;
                    return(false);
                }
            }