SendMessage
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
SendMessage
Hi,
I want to write an Add-on for freestyler, I've read the SendMessage documentation.
I'm using freestyler 3.3.9 and develop using whe C# class written by matotone (thanks for the code).
I can test any code of the SendMessage documentation, Freestyler reacts to nothing ....
The only reaction that I have is when I send the WM_CLOSE, which confirms that my SendMessage code works.
Is there something special to do/activate in Freestyler to be able to use the SendMessage ?
Is SendMessage the only way to develop Add-ons ?
Thanks for your help,
Patrick
I want to write an Add-on for freestyler, I've read the SendMessage documentation.
I'm using freestyler 3.3.9 and develop using whe C# class written by matotone (thanks for the code).
I can test any code of the SendMessage documentation, Freestyler reacts to nothing ....
The only reaction that I have is when I send the WM_CLOSE, which confirms that my SendMessage code works.
Is there something special to do/activate in Freestyler to be able to use the SendMessage ?
Is SendMessage the only way to develop Add-ons ?
Thanks for your help,
Patrick
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
i believe you have to compile code specifically for x86 for it to work. If you submit your code il go through it.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
Here is the code :
Communicator Class, which is your code put in a C# project compiled for x86
Test program : VB Program that uses the Class above, compiled for x86
When executing the last line which should Toggle Black out, nothing happens.
Here is the code :
Communicator Class, which is your code put in a C# project compiled for x86
Code: Select all
using System;
using System.Runtime.InteropServices;
namespace FSCommunicator
{
public class FreeStylerCommunicator
{
//COMPILE AS X86 otherwise pointers need changing
//For use with WM_COPYDATA and COPYDATASTRUCT
[DllImport("User32.dll")]
public static extern int SendMessage(int hWnd, int Msg, int wParam, ref COPYDATASTRUCT lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd, int Msg, int wParam, int LParam);
[DllImport("user32.dll")]
static extern int FindWindow(string lpClassName, string lpWindowName);
private const int WM_USER = 0x400;
private const int WM_COPY = 0x4A;
private const int WM_CLOSE = 0x0010;
private int freestylerConnected()
{
int ihandle = FindWindow(null, "FreeStyler 512");
return ihandle;
}
private static Int32 VarPtr(object o)
{
GCHandle GC = GCHandle.Alloc(o, GCHandleType.Pinned);
IntPtr ptr = GC.AddrOfPinnedObject();
GC.Free();
return ptr.ToInt32();
}
public struct COPYDATASTRUCT
{
public Int32 dwData;
public Int32 cbData;
[MarshalAs(UnmanagedType.I4)]
public Int32 lpData;
}
public void sendCHMessageFunction(byte[] DMXvalues, int functionCode)
{
COPYDATASTRUCT cds;
cds.dwData = functionCode;
cds.lpData = VarPtr(DMXvalues);
cds.cbData = DMXvalues.Length;
int hWnd = freestylerConnected();
if (hWnd != 0)
{
SendMessage(hWnd, WM_COPY, 0, ref cds);
}
}
public void sendMessageFunction(int command, int value)
{
int iHandle = freestylerConnected();
if (freestylerConnected() != 0)
{
SendMessage(iHandle, WM_USER, command, value);
}
}
}
}
Code: Select all
Public Class Form1
Private oFS As FSCommunicator.FreestylerCommunicator
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
oFS = New FSCommunicator.FreeStylerCommunicator()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim encoding As System.Text.UTF8Encoding = New System.Text.UTF8Encoding()
Dim bt(2) As Byte
oFS.sendMessageFunction(2, 1)
End Sub
End Class
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
if your using VB ask raph for a sample copy of the sendmessage documentation. it has VB examples included and will be much easy / neater
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Ok but who is raph ? How can I join him ?
If you cant I can post you the same code in C# instead of VB.
If you cant I can post you the same code in C# instead of VB.
- LJ_krede.dk
- Moderator
- Posts: 1028
- Joined: October 29th, 2007, 8:01 pm
- FreeStyler Version: 3.3.7
- I Use FreeStyler for: Where do I start?
Re: SendMessage
lj_raphstbg74 wrote:Ok but who is raph ? How can I join him ?
The one and only Freestyler developer
/LJ_krede.dk
Aalborg, Denmark
Moderator, Supporter and Bug report manager for the FreeStyler community
Found a bug? Submit a Bug Report
Aalborg, Denmark
Moderator, Supporter and Bug report manager for the FreeStyler community
Found a bug? Submit a Bug Report
-
- Starting to get to grips with FreeStyler
- Posts: 16
- Joined: July 26th, 2010, 3:23 pm
Re: SendMessage
Same problem here!
Using the dll in .NET i get my application working, I send the mask and then the values but in FS no changes seem to happen...
I'm using the code above to send data and this is the main code:
I'm asking firstly you, Mattotone, what's wrong there?
App is x86 compiled.
Thanks
Using the dll in .NET i get my application working, I send the mask and then the values but in FS no changes seem to happen...
I'm using the code above to send data and this is the main code:
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FSCommunicator
{
public partial class Form1 : Form
{
FreeStylerCommunicator fsc = new FreeStylerCommunicator();
byte[] mask = new byte[512];
byte[] vals = new byte[512];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < mask.Length-1; i++)
{
mask[i] = 0;
vals[i] = 127;
}
fsc.sendCHMessageFunction(mask, 4);
}
private void button1_Click(object sender, EventArgs e)
{
fsc.sendCHMessageFunction(vals, 1);
}
}
}
App is x86 compiled.
Thanks
-
- Starting to get to grips with FreeStyler
- Posts: 16
- Joined: July 26th, 2010, 3:23 pm
Re: SendMessage
No news about?
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
Personnaly I never arrived to use the SendMessage.
Finally I've decided to write my own program because I needed a cue based on a timeline editor.
Personnaly I never arrived to use the SendMessage.
Finally I've decided to write my own program because I needed a cue based on a timeline editor.
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
Iv tested your code and i have no problems?
Strange: FreeStylerCommunicator() this part is different from the class i wrote so im assuming you have changed this part your self.
Ensure that in configuration manager platform is set to x86.
EDIT: you sendmessage class should read:
private int freestylerConnected()
{
int ihandle = FindWindow(null, "FS");
return ihandle;
}
and Not Freestyler 512
Strange: FreeStylerCommunicator() this part is different from the class i wrote so im assuming you have changed this part your self.
Ensure that in configuration manager platform is set to x86.
EDIT: you sendmessage class should read:
private int freestylerConnected()
{
int ihandle = FindWindow(null, "FS");
return ihandle;
}
and Not Freestyler 512
You do not have the required permissions to view the files attached to this post.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
Thanks for your answer, you're right I've changed your code and turned 'FS' into 'Fresstyler 512' because it didn't work.
Now with your original code it works, the only change i have done is that I have upgraded to latest version of freestyler and I have started Sound2light once which told me that SendMessage isn't enabled in Freestyler ... strange, is there any option to activate SendMessage for freestyler ???
Anyway as I said it in previous post I wrote my own application because I really need the idea of a timeline editor. Now My project is very advanced.
To give you an idea here is a screenshot of it :
Thanks to mattotone for all your help.
Thanks for your answer, you're right I've changed your code and turned 'FS' into 'Fresstyler 512' because it didn't work.
Now with your original code it works, the only change i have done is that I have upgraded to latest version of freestyler and I have started Sound2light once which told me that SendMessage isn't enabled in Freestyler ... strange, is there any option to activate SendMessage for freestyler ???
Anyway as I said it in previous post I wrote my own application because I really need the idea of a timeline editor. Now My project is very advanced.
To give you an idea here is a screenshot of it :
Thanks to mattotone for all your help.
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
is the above currently working or just a mockup?
it looks exactly what the users are after.
it looks exactly what the users are after.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
The screen shot is the result of a working application, i've started it 1-2 months ago.
Of course there are some limitation and still some bug in it but the main functionnality are working.
For the moment the application is only compatible with the enttec open dmx interface. For the fixture definition i'm using the freestyler files.
For the sequence I used the same approach than the one in Freestyler, you can programme static scene and dynamic scene. Static scene are only values for some DMX channels there are no steps possible.
The dynamic scenes use the time line editor in which you can add keyframes per channel with the possibility to use fade or snap between keyframes.
The live usage is quite the same as in freestyler but all the fixtures in the screen are updated in real time (color, gobo, ...). For exemple when you play a dynamic scene, you will see all the colors changing on the screen.
The screen shot is the result of a working application, i've started it 1-2 months ago.
Of course there are some limitation and still some bug in it but the main functionnality are working.
For the moment the application is only compatible with the enttec open dmx interface. For the fixture definition i'm using the freestyler files.
For the sequence I used the same approach than the one in Freestyler, you can programme static scene and dynamic scene. Static scene are only values for some DMX channels there are no steps possible.
The dynamic scenes use the time line editor in which you can add keyframes per channel with the possibility to use fade or snap between keyframes.
The live usage is quite the same as in freestyler but all the fixtures in the screen are updated in real time (color, gobo, ...). For exemple when you play a dynamic scene, you will see all the colors changing on the screen.
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
Looks impressive.
So im i right in the understanding that this is not a freestyler addon but separate work.
You may need to have a word with raph in using his fixture file format, as they may be breach of intellectual copy right.
But i will be watching this project with anticipation, IF you could also include a similar addons interface that would be usefull too.
So im i right in the understanding that this is not a freestyler addon but separate work.
You may need to have a word with raph in using his fixture file format, as they may be breach of intellectual copy right.
But i will be watching this project with anticipation, IF you could also include a similar addons interface that would be usefull too.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Thanks,
You are right it's not a freestyler Add on but a completely new software started from scratch.
At this time I'm using the freestyler files but it was only to speed up the developpment, if Raph is ok I will keep this file format, if not I will write a new fixture editor in the future.
A this time I didn't ask Raph as I use this software only for me there is no available copy on the net.
For the moment there is also no AddOns interface as I started this project for our use, we have a concert in october where this software will be used.
You are right it's not a freestyler Add on but a completely new software started from scratch.
At this time I'm using the freestyler files but it was only to speed up the developpment, if Raph is ok I will keep this file format, if not I will write a new fixture editor in the future.
A this time I didn't ask Raph as I use this software only for me there is no available copy on the net.
For the moment there is also no AddOns interface as I started this project for our use, we have a concert in october where this software will be used.
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: SendMessage
it would be a shame for this not to be released, perhaps you and Raph could work together to produce Freestyler2.
From the ground up it will be much easier to add the features that have been asked for then rather to make existing code fit.
Examples:
Live scene apply: (*or someother name) Works like this.
So when busking a live show. usually the changes you make appear live gobos colour position but for different types fixtures you usually have to do these separately as colours and gobos will be on different channels or parameters.
now using live scene apply* you have the option to setup a complete scene and apply it to the output using the same snap fade and timeing options of creating a pre made show.
Other features required for live:
Live Palletes/presets
gobo and colour groups. ( As the above problem before different fixtures files will usually have similar colours gobos but on the same attribute I.e fixture one may have stars on ch3 200 where as fixture two may have ch3 127.
So if both fixtures are selected and you press stars its likely to send ch3 200 to both fixtures.
What id like to suggest is that fixture creator has a set of predefined groups for colours and gobos. So when creating a fixture and you add a colour you can assign which group the colour should belong too. and the same with the gobo. You select or create an image for your gobo assign channel number and attribute value, but then you also sellect the most likely group it falls into.
so back to the previous example when you now press the image of the stars assigned to the starsGoboGroup in one fixture it will now send the value 200 to fixture 1 and 127 to fixture 2 as they both have a gobo which appears in the starsGoboGroup.)
From the ground up it will be much easier to add the features that have been asked for then rather to make existing code fit.
Examples:
Live scene apply: (*or someother name) Works like this.
So when busking a live show. usually the changes you make appear live gobos colour position but for different types fixtures you usually have to do these separately as colours and gobos will be on different channels or parameters.
now using live scene apply* you have the option to setup a complete scene and apply it to the output using the same snap fade and timeing options of creating a pre made show.
Other features required for live:
Live Palletes/presets
gobo and colour groups. ( As the above problem before different fixtures files will usually have similar colours gobos but on the same attribute I.e fixture one may have stars on ch3 200 where as fixture two may have ch3 127.
So if both fixtures are selected and you press stars its likely to send ch3 200 to both fixtures.
What id like to suggest is that fixture creator has a set of predefined groups for colours and gobos. So when creating a fixture and you add a colour you can assign which group the colour should belong too. and the same with the gobo. You select or create an image for your gobo assign channel number and attribute value, but then you also sellect the most likely group it falls into.
so back to the previous example when you now press the image of the stars assigned to the starsGoboGroup in one fixture it will now send the value 200 to fixture 1 and 127 to fixture 2 as they both have a gobo which appears in the starsGoboGroup.)
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
I understand your point of view about this software, but a this time I'm not sure that I will have the time required to release the software and be able to add all functionnality required.
You Live scene apply is a good idea, but at the moment as I'm working with freestyler fixtures files I have the same problem. To be able to do what you want, it would be necessary to write a new fixture creator.
I had the same problem when just selecting a color with a PAR LED and a moving head, when you select the color on the PAR i search the nearest color in the gobo colors of the moving head.
I understand your point of view about this software, but a this time I'm not sure that I will have the time required to release the software and be able to add all functionnality required.
You Live scene apply is a good idea, but at the moment as I'm working with freestyler fixtures files I have the same problem. To be able to do what you want, it would be necessary to write a new fixture creator.
I had the same problem when just selecting a color with a PAR LED and a moving head, when you select the color on the PAR i search the nearest color in the gobo colors of the moving head.
-
- Just started using FS
- Posts: 12
- Joined: January 15th, 2011, 2:18 pm
- FreeStyler Version: 3.3.6
- I Use FreeStyler for: Church
Re: SendMessage
Hi,
At this time the software is in a usable state, to give you an idea of what can be done with it, here is a small video of a show on which all lights were handled with my software.
http://www.dailymotion.com/video/xjkt5m ... schello_tv
At this time the software is in a usable state, to give you an idea of what can be done with it, here is a small video of a show on which all lights were handled with my software.
http://www.dailymotion.com/video/xjkt5m ... schello_tv