About Us

HOME EXAMPLES DOWNLOAD HOW TO BUY SUPPORT USER GUIDE FAQS GALLERY

Player

The BluffTitler executable accepts the following arguments:

[<PATH>] [/X=<CONTENT>] [/F] [/L] [/S] [/Q] [/W=<HWND>] [/O=<ORDER>] [/C=<CPU USAGE>] [/?] 
<PATH> the .bt show file or .btpl playlist
/X=<CONTENT> plays the show with this content file
/F fullscreen
/L looping
/S suppress error messages
/Q quit after playing
/W=<HWND> plays the show in a child window of <HWND> (unsigned decimal number)
/O=R plays all shows in the show folder in a loop, in random order
/O=A plays 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
/? displays all options

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 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# and VB.NET.

All code examples implement the following key functions:

O open BluffTitler
P play the current show
S stop the current show
L load a new show
C close 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 recieved!\n");
	BT_Window=(HWND)wParam;
}
if(message==BT_Stop){
	OutputDebugString("BluffTitlerStop message recieved!\n");
}


case WM_KEYDOWN:
switch(wParam){
	case 'O':
		if(!BT_Window){
			char* PathExe  = "c:\\blufftitler\\blufftitler.exe";
			char* PathShow = "c:\\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="c:\\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 = "c:\\blufftitler\\blufftitler.exe";
                String PathShow = "c:\\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 = "c:\\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 recieved!");
    }
    if (m.Msg == BT_Stop)
    {
        System.Diagnostics.Debug.WriteLine("BluffTitlerStop message recieved!");
    }
    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 = "c:\blufftitler\BluffTitler.exe"
            Dim PathShow As String = "c:\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 recieved!")
            BT_Window = m.WParam
        End If
        If (m.Msg = BT_Stop) Then
            REM            MessageBox.Show("BluffTitlerStop message recieved!")
        End If
        MyBase.WndProc(m)
    End Sub

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

End Class