Player

The BluffTitler executable accepts the following arguments:

[<PATH>] [/X=<CONTENT>] [/F] [/L] [/S] [/Q] [/W=<HWND>] [/O=<ORDER>] [/C=<CPU USAGE>]
[/WIDTH=<WIDTH>] [/HEIGHT=<HEIGHT>] [/PAR=<PAR>] [/V=<VIEW>] [/QUALITY=<QUALITY>] [/T]
[/R=<LIMITTEXTURERES>]
[/FPS=<FPS>] [/ENCODER=<ENCODER>] [/E=<PATH>] [/D=<DURATION>] [/A=<ANTIALIASING>]
[/SS=<SCREENSHOTS>] [/M=<MOTIONBLUR>] [/G=<AUDIO FORMAT>]
[/?]
<PATH>The .bt show file or .btpl playlist
/X=<CONTENT>Plays the show with this content file
/FFullscreen
/LLooping
/SSuppress error messages
/QQuit after playing
/W=<HWND>Plays the show in a child window of <HWND> (unsigned decimal number)
/O=RPlays all shows in the show folder in a loop, in random order
/O=APlays all shows in the show folder in a loop, in alphabetical order
/C=<CPU USAGE>Use a value of 0 for maximum animation speed (default), use 1 or higher to give more CPU time to other processes
/WIDTH=<WIDTH>Sets the horizontal resolution
/HEIGHT=<HEIGHT>Sets the vertical resolution
/PAR=<PAR>Sets the pixel aspect ratio
/V=<VIEW>Sets the view. A view of 2 means that the show is displayed at half size
/QUALITY=<QUALITY>Sets the quality. (1 for low, 2 for high)
/TIn this mode BluffTitler does not open files in share mode
/R=<LIMITTEXTURERES>Limit texture resolution to show resolution (0 for off, 1 for on)
/?Displays all options
  
The following commands require an iTV license
/FPS=<FPS>Sets the export frames per second
/ENCODER=<ENCODER>Sets the export encoder filter name
/E=<PATH>Sets the export path. When using the extension AVI, a video is generated. When using the extension BMP, PNG, TGA, JPG or TIF, single frames are generated. The export progress % is printed in the window title.
/D=<DURATION>Sets the maximum export duration in seconds
/A=<ANTIALIASING>Sets the antialiasing method and quality:
 1 software AA: low quality
 2 software AA: medium quality
 3 software AA: high quality
 4 software AA: super high quality
 5 hardware AA: make screengrabs
 6 shader AA: low quality
 7 shader AA: medium quality
 8 shader AA: high quality
 9 shader AA: super high quality
/SS=<SCREENSHOTS>Sets the number of frames that must be exported using the /E option
/M=<MOTIONBLUR>Sets motion blur (0 for off, 1 for on)
/G=<AUDIO FORMAT>Sets the export audio format (0 for no sound, 1 for 14100 Hz, 16 bit stereo)

The /W option is very powerful because it allows you to play BluffTitler shows in your own window. This way you can seamlessly integrate BluffTitler into your own application.

IPC Messages

BluffTitler sends a "BluffTitlerStart" message to the parent window when the animation starts and a "BluffTitlerStop" message when the animation stops. The window pointer (HWND) of BluffTitler's render window is sent in the WPARAM parameter.

You can also send those messages yourself, to BluffTitler to start and stop shows.

You can send a "BluffTitlerReloadDynamicContent" message to reload all XML data.

You can open a new BluffTitler show by sending a WM_COPYDATA message to BluffTitler with the ID 10000 (dwData member of the COPYDATASTRUCT struct). BluffTitler accepts both byte per char (multibyte) and 2 bytes per char (unicode) strings.

Below you can find code snippets in C++, C#, VB.NET and VB.

All code examples implement the following key functions:

Oopen BluffTitler
Pplay the current show
Sstop the current show
Lload a new show
Cclose BluffTitler

If you need help integrating BluffTitler into your own system please do not hesitate to contact us at:

info@outerspace-software.com

BluffTitler player code snippets in C++

#include <stdio.h>
#include <shellapi.h>

UINT  BT_Start=0;
UINT  BT_Stop=0;
HWND  BT_Window=NULL;


BT_Start = RegisterWindowMessage("BluffTitlerStart");
BT_Stop  = RegisterWindowMessage("BluffTitlerStop");


if(message==BT_Start){
	OutputDebugString("BluffTitlerStart message received!\n");
	BT_Window=(HWND)wParam;
}
if(message==BT_Stop){
	OutputDebugString("BluffTitlerStop message received!\n");
}


case WM_KEYDOWN:
switch(wParam){
	case 'O':
		if(!BT_Window){
			char* PathExe  = "X:\\blufftitler\\blufftitler.exe";
			char* PathShow = "X:\\temp\\BroadcastGraphics.bt";
			char	Parameters[500];
			sprintf(Parameters,"%s /Q /W=%i",PathShow,(int)hWnd);

			ShellExecute(NULL,"open", PathExe, Parameters, NULL, SW_SHOWNORMAL);
		}
		break;
	case 'P':
		if(BT_Window){
			SendMessage(BT_Window,BT_Start,0,0);
		}
		break;
	case 'S':
		if(BT_Window){
			SendMessage(BT_Window,BT_Stop,0,0);
		}
		break;
	case 'L':
		if(BT_Window){
			char* PathShow="X:\\temp\\Blob.bt";

			COPYDATASTRUCT Data;
			Data.dwData=10000;
			Data.cbData=strlen(PathShow)+1;
			Data.lpData=(PVOID)PathShow;

			SendMessage(BT_Window,WM_COPYDATA,(WPARAM)hWnd,(LPARAM)(&Data));
		}
		break;
	case 'C':
		if(BT_Window){
			SendMessage(BT_Window,WM_CLOSE,0,0);
		}
		break;
}
break;

BluffTitler player code snippets in C#

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Diagnostics;

public partial class Form1 : Form
{
public const int WM_COPYDATA = 0x4a;
public const int WM_CLOSE = 0x10;
public struct COPYDATASTRUCT
{
    public IntPtr dwData;
    public int cbData;
    [MarshalAs(UnmanagedType.LPStr)]
    public string lpData;
}

[DllImport("user32.dll")]
public static extern int RegisterWindowMessage(string lpString);

[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);

[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, ref COPYDATASTRUCT lParam);


public Form1()
{
    InitializeComponent();

    BT_Start = RegisterWindowMessage("BluffTitlerStart");
    BT_Stop  = RegisterWindowMessage("BluffTitlerStop");

    this.KeyPress += new KeyPressEventHandler(KeyPressed);
}

void KeyPressed(object sender, KeyPressEventArgs e)
{
    switch (e.KeyChar)
    {
        case 'o':
            if (BT_Window == IntPtr.Zero)
            {
                String PathExe = "X:\\blufftitler\\blufftitler.exe";
                String PathShow = "X:\\temp\\BroadcastGraphics.bt";
                String Parameters = PathShow + " /Q /W=" + this.Handle;

                System.Diagnostics.Process myProcess = new Process();
                myProcess.StartInfo.FileName = PathExe;
                myProcess.StartInfo.Verb = "open";
                myProcess.StartInfo.Arguments = Parameters;
                myProcess.Start();
            }
            break;
        case 'p':
            if (BT_Window != IntPtr.Zero)
            {
                SendMessage(BT_Window, BT_Start, IntPtr.Zero, IntPtr.Zero);
            }
            break;
        case 's':
            if (BT_Window != IntPtr.Zero)
            {
                SendMessage(BT_Window, BT_Stop, IntPtr.Zero, IntPtr.Zero);
            }
            break;
        case 'l':
            if (BT_Window != IntPtr.Zero)
            {
                const string PathShow = "X:\\temp\\Blob.bt";

                COPYDATASTRUCT s;
                s.dwData = (IntPtr)10000;
                s.cbData = PathShow.Length * 2 + 2;
                s.lpData = PathShow;

                SendMessage(BT_Window, WM_COPYDATA, this.Handle, ref s);
            }
            break;
        case 'c':
            if (BT_Window != IntPtr.Zero)
            {
                SendMessage(BT_Window, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
            }
            break;
    }
}

protected override void WndProc(ref Message m)
{
    if (m.Msg == BT_Start)
    {
        BT_Window = m.WParam;
        System.Diagnostics.Debug.WriteLine("BluffTitlerStart message received!");
    }
    if (m.Msg == BT_Stop)
    {
        System.Diagnostics.Debug.WriteLine("BluffTitlerStop message received!");
    }
    base.WndProc(ref m);
}

private int BT_Start = 0;
private int BT_Stop = 0;
private IntPtr BT_Window = IntPtr.Zero;
}

BluffTitler player code snippets in VB.NET

Public Class Form1

    Const WM_COPYDATA As Integer = 74
    Const WM_CLOSE As Integer = 16
    Private Structure COPYDATASTRUCT
        Public dwData As Long
        Public cbData As Long
        Public lpData As IntPtr
    End Structure

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Integer, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
    Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Integer
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    Private Sub MyKeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress

        If e.KeyChar = "o" Then
            BT_Start = RegisterWindowMessage("BluffTitlerStart")
            BT_Stop = RegisterWindowMessage("BluffTitlerStop")

            Dim PathExe As String = "X:\\blufftitler\\BluffTitler.exe"
            Dim PathShow As String = "X:\\temp\BroadcastGraphics.BT"
            Dim Parameters As String = PathShow + " /Q /W=" + Me.Handle.ToString

            ShellExecute(Me.Handle, "open", PathExe, Parameters, "", 1)
        End If
        If e.KeyChar = "p" Then
            SendMessage(BT_Window, BT_Start, 0, 0)
        End If
        If e.KeyChar = "s" Then
            SendMessage(BT_Window, BT_Stop, 0, 0)
        End If
        If e.KeyChar = "l" Then
            REM ???
        End If
        If e.KeyChar = "c" Then
            SendMessage(BT_Window, WM_CLOSE, 0, 0)
        End If
    End Sub

    Protected Overrides Sub WndProc(ByRef m As Message)
        If (m.Msg = BT_Start) Then
            REM            MessageBox.Show("BluffTitlerStart message received!")
            BT_Window = m.WParam
        End If
        If (m.Msg = BT_Stop) Then
            REM            MessageBox.Show("BluffTitlerStop message received!")
        End If
        MyBase.WndProc(m)
    End Sub

    Dim BT_Start As Integer
    Dim BT_Stop As Integer
    Dim BT_Window As IntPtr

End Class

BluffTitler player code snippets in VB

' [add this to module]

Public Declare Function ShellExecute Lib "shell32.dll" Alias _
      "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As _
      String, ByVal lpszFile As String, ByVal lpszParams As String, _
      ByVal lpszDir As String, ByVal fsShowCmd As Long) As Long

Public Function Execute_Program(ByVal strFilePath As String, ByVal strParms
As String, ByVal strDir As String) As Integer

    Dim hwndProgram As Integer

    hwndProgram = ShellExecute(0, "Open", strFilePath, strParms, strDir, 5)

    Execute_Program = hwndProgram

End Function

' [add this to form]

Public Sub Start_BluffTitler()

    Dim ok As Long

    path_to_exe = "X:\blufftitler\"
    name_of_exe = "BluffTitler.exe"
    name_of_show = "X:\temp\BroadcastGraphics.BT"

    commandline = "\F"

    ok = Execute_Program(path_to_exe & name_of_exe, name_of_show & " " & commandline, path_to_exe)

End Sub

' [add a button to your form]

Public Sub Command1_Click()

	Start_BluffTitler

End Sub