VizToolkit Controls Library – What’s new? by Hormon
I’ve made some updates to my VizToolkit Controls Library. Mostly I focused on fixing bugs and implementing new features to existing controls that in my opinion were missing. Like before new version of VizToolkit dll is avaible for download along with documentation. Let’s take a quick look on what has changed since last release.
What’s new
I’ll start with the most relevant update I made which is related to VizActionButton and VizManager. In previous release you weren’t able to link those two controls so they could work together. Now you can :-). To to this simly choose your VizManager control from dropdown list in VizActionButton’s Manager property.
Let me tell you how it works. When you click VizActionButton it invokes method in VizManager corresponding to selected ActionType. You could of course do this manually by handling Click event, but why bother when it could be done for us. Below you can see the list of ActionTypes and corresponding VizManager methods:
- Load – VizManager.PutInRenderer()
- Start – VizManager.SceneStart()
- Continue – VizManager.SceneContinue()
- Back – VizManager.SceneContinue(true)
- Stop – VizManager.SceneStop()
- Clear – VizManager.RendererClear()
- OnAir – VizManager.SwitchToOnAir()
I’ve also rewritten almost all methods in VizManager component. To ensure naming pattern is consistent I had to get rid of LoadScene() method and replaced it with SceneLoad(). I added a number of methods to manage scenes, but also renderer. If you want to know more, plase check out the documentation.
Recently I was writing a small application to manage both 2.8 and 3.2 viz|engines. It was meant to send viz commands to 2.8, and change shared memory variables in 3.2. I had to determine what is the version of viz|engine I’m connecting to. I felt the lack of a simple parameter in VizConnection component which would tell me what I want to know. Thus I decided to implement it. From now on VizConnection has a parameter called VizVersion. The object is of type VizEngineVersion and consists of following parameters:
- Version – (String) contains full version string aquired from viz|engine
- Major – (String) contains major version number (i.e. 2.8 or 3.2)
- Minor – (String) contains minor version number (i.e. pl5 or 2)
- Build – (String) contains build number (i.e. hf3 or 5559)
VizConnection component has now additional method called SendBufferSequentially. This method is a quick solution for a bug pointed out by Gavry. In certain conditions when command buffer was populated with several commands and we wanted to get response to each of them, sending buffer with SendBuffer method resulted in OnVizResponse event firing for first command only. The solution for this is SendBufferSequentially method. What it does is it sends command from command buffer, waits for viz response, and then moves to next command. And so on. If you have more questions about this matter, please don’t hasitate to ask. I’ll do my best answering them.
This release of VizToolkit Controls Library includes also quite a number of minor bug fixes. Most of them were related to visual side of controls.
And a cherry on top… :-)
I use VizToolkit Controls Library in my every-day development and recently I needed new themes for VizActionButtons. They are called Black and Gray. You can have a quick look how they appear on the form.
And that’s basically it. Feel free to download VizToolkit Controls Library from Download section. If you have any requests on future controls or questions about existing ones please feel free to post a comment below this article or send me message via our Contact Form. Have fun.
GHTime Code(s): 8c64e


Great job buddy. I’ll give it a good once over and get back to you with anything else I find. :)
Hormon,
I can’t seem to get this build working at all.
I’m using the following code:
#region Viz Connection
#region Viz Connection Method delegates
public delegate void UpdateGUICallback(SocketConnectionState state);
public delegate void UpdateLogCallback(String message);
#endregion
// Viz Connection
private void bConnectViz_Click(object sender, EventArgs e) {
remoteVizConnection.VizMachine = txtVizIPAddress.Text;
remoteVizConnection.VizPort = 6100;
if (!remoteVizConnection.IsConnected) {
remoteVizConnection.Connect();
} else {
remoteVizConnection.Disconnect();
remoteVizConnection.Dispose();
}
}
private void bLoadScene_Click(object sender, EventArgs e) {
remoteVizConnection.ClearBuffer();
remoteVizConnection.AddToBuffer(“1 RENDERER SET_OBJECT SCENE*01_ticker”, true);
remoteVizConnection.AddToBuffer(“2 RENDERER*STAGE SHOW 0.0″, true);
remoteVizConnection.AddToBuffer(“20 RENDERER*STAGE*DIRECTOR*Default START”, true);
remoteVizConnection.SendBufferSequentially();
}
public void UpdateLog(String message) {
txtVizLog.Text += message;
txtVizLog.Text += Environment.NewLine;
}
public void UpdateGUI(SocketConnectionState state) {
String caption = “Connect”;
switch (state) {
case SocketConnectionState.Disconnected:
caption = “CONNECT”;
bLoadScene.Enabled = false;
break;
case SocketConnectionState.Connecting:
caption = “CONNECTING…”;
bLoadScene.Enabled = false;
break;
case SocketConnectionState.Connected:
caption = “DISCONNECT”;
bLoadScene.Enabled = true;
break;
}
bConnectViz.Text = caption;
}
private void remoteVizConnection_OnConnect(object sender, VizConnectionEventArgs e) {
this.Invoke(new UpdateGUICallback(UpdateGUI), e.ConnectionState);
}
private void remoteVizConnection_OnConnecting(object sender, VizConnectionEventArgs e) {
this.Invoke(new UpdateGUICallback(UpdateGUI), e.ConnectionState);
}
private void remoteVizConnection_OnDisconnect(object sender, VizConnectionEventArgs e) {
this.Invoke(new UpdateGUICallback(UpdateGUI), e.ConnectionState);
}
private void remoteVizConnection_OnVizResponse(object sender, VizConnectionEventArgs e) {
// when response from viz arrives put it in log
this.Invoke(new UpdateLogCallback(UpdateLog), e.VizResponse);
}
#endregion
When I click the bLoadScene button the first command is sent to Viz, and then it just goes out to lunch. No response is ever returned and the additional two commands are never sent. Furthermore, the disconnect part of the code doesn’t work any more either.
Is there something I’m missing?
I can see only one mistake you’re making. You shouldn’t dispose your VizConnection object. The Disconnect() method should be enough to close the connection. Otherwise the second time your button it will throw an exception because your object is no longer there. Btw. Try using VizConnectionButton to manage connection. This way you won’t need to put any code for this to work.
As for the sending commands part I really don’t know what’s wrong. I run your code and it worked fine in my environment. I’ll look into it in the morning because now its 1AM and I may not think clearly.
[update] Are you running viz|artist or viz|engine? If you are running viz|artist you should switch it to control mode (OnAir) but you probably know that.
Strange.
Can I send my very basic project to you and you have a look?
Of course. I sent you an email with my direct address. Feel free to contact me.