예제 #1
0
    RenderStatus DoRender(RenderArgs args)
    {
        RenderStatus status = myVegas.Render(args);

        switch (status)
        {
        case RenderStatus.Complete:
        case RenderStatus.Canceled:
            break;

        case RenderStatus.Failed:
        default:
            StringBuilder msg = new StringBuilder("Render failed:\n");
            msg.Append("\n    file name: ");
            msg.Append(args.OutputFile);
            msg.Append("\n    Template: ");
            msg.Append(args.RenderTemplate.Name);
            throw new ApplicationException(msg.ToString());
        }
        return(status);
    }
예제 #2
0
    // perform the render.  The Render method returns a member of the
    // RenderStatus enumeration.  If it is anything other than OK,
    // exit the loops.  This will throw an error message string if the
    // render does not complete successfully.
    RenderStatus DoRender(String filePath, RenderItem renderItem, Timecode start, Timecode length)
    {
        ValidateFilePath(filePath);

        // make sure the file does not already exist
        if (!OverwriteExistingFiles && File.Exists(filePath))
        {
            throw new ApplicationException("File already exists: " + filePath);
        }

        // perform the render.  The Render method returns
        // a member of the RenderStatus enumeration.  If
        // it is anything other than OK, exit the loops.
        RenderStatus status = myVegas.Render(filePath, renderItem.Template, start, length);

        switch (status)
        {
        case RenderStatus.Complete:
        case RenderStatus.Canceled:
            break;

        case RenderStatus.Failed:
        default:
            StringBuilder msg = new StringBuilder("Render failed:\n");
            msg.Append("\n    file name: ");
            msg.Append(filePath);
            msg.Append("\n    Renderer: ");
            msg.Append(renderItem.Renderer.FileTypeName);
            msg.Append("\n    Template: ");
            msg.Append(renderItem.Template.Name);
            msg.Append("\n    Start Time: ");
            msg.Append(start.ToString());
            msg.Append("\n    Length: ");
            msg.Append(length.ToString());
            throw new ApplicationException(msg.ToString());
        }
        return(status);
    }