Spacers between parameters

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
hive8
Is seriously in love with Resolume. Met the parents and everything
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Spacers between parameters

Post by hive8 »

I wrote a quick plugin so i can position the input texture 4 times one the composition. I can just apply this to a clip, layer or whole composition without using 4 layers. I was wondering if it is possible to add spaces in between the parameters. So it does not become so cluttered, please let me know any suggestions.

Find attached a screenshot.

I will be adding more functions to it later, like cropping, rotation, anchor point movements of the texture only, zooming of the texture only. I just wrote this up in an hour quick as a test, currently WIN only till i get my OSX machine from repair back.
Attachments
res5plug10.png
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Spacers between parameters

Post by Joris »

Nice idea!

I'm afraid there's no extra UI elements to use.

I made a very similar plugin about 2 years ago (except it did 24 copies and had 10 params each, for a whopping total of 240 and then some params), and we ran into the same problem. We went with a string input param at the beginning of the block, showing the name of the copy, to help show the user where he or she was in the list.

It worked, but in the end it was still a workaround. Having this many parameters is just not a good way to work in a plugin for a variety of reasons.

hive8
Is seriously in love with Resolume. Met the parents and everything
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Spacers between parameters

Post by hive8 »

Thank you for the quick reply, could you give me a quick example of how to add that string parameter between 2 blocks of sliders.

I am assuming i will need to use the

SetParamInfo(FFPARAM_S1MOVEX, "S1 Move X", FF_TYPE_STANDARD, 0.5f);
s1_moveX = 1.0f;

With zero values, any help is appreciated ;)
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Spacers between parameters

Post by Joris »

Not sure what you mean by zero values, but a string param is defined by FF_TYPE_TEXT

SetParamInfo is overloaded, so when you call it with a char pointer and FF_TYPE_TEXT, it knows it needs to create a string param.

Code: Select all

/// This method is called by a plugin subclass, derived from this class, to specify name, type, and default 
	/// value of the plugin parameter whose index is passed as parameter to the method. This method is usually 
	/// called when a plugin object is instantiated (i.e., in the plugin subclass contructor). This version of 
	/// the SetParamInfo function (DefaultValue of type char*) should be called for plugin parameters of type text.
	///
	/// \param	dwIndex			Index of the plugin parameter whose data are specified.
	///							It should be in the range [0, Number of plugin parameters).
	/// \param	pchName			A string containing the name of the plugin parameter.
	///							According to the FreeFrame specification it should be at most 16 1-byte ASCII 
	///							characters long. Longer strings will be truncated at the 16th character.
	/// \param	dwType			The type of the plugin parameter. Codes for allowed types are defined in FreeFrame.h.
	/// \param	pchDefaultValue	A string to be used as the default value of the plugin parameter.
	void SetParamInfo(unsigned int index, const char* pchName, unsigned int type, const char* pchDefaultValue);

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Spacers between parameters

Post by Joris »

Btw, in your example, you set the default value of the param to 0.5, and then you initialise the variable probably connected to the param with 1.0.

This means that when you first run the plugin, the slider and the actual value won't match. It's not really bad to do this, because Resolume reads out the params on every frame, so it will update the variable after the first frame of rendering.

Other software might be smarter in their FFGL implementation, and only read out values when they change. So that could lead to mismatching values until you actually change the slider.

Hope that helps!

hive8
Is seriously in love with Resolume. Met the parents and everything
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Spacers between parameters

Post by hive8 »

Thank you for pointing that out, I fixed those.
I noticed one little problem, when i put the plugin on a layer, clip or composition all works as it supposed too, but when i exit resolume, resolume crashes. I ran the plugin in the delphihost and it gave me one error

DeInstantiate Plugin ERROR
DeInitalise Plugin OK

Any idea what that could be?

//unbind the texture
glBindTexture(GL_TEXTURE_2D, 0);

//disable texturemapping
glDisable(GL_TEXTURE_2D);

return FF_SUCCESS;


Also could you give me a example for the text only param

right now i have this

.h file
//Others
char m_ScreenName;

.cpp file
#define FFPARAM_SCREEN (16)

SetParamInfo(FFPARAM_SCREEN, "Screen 1", FF_TYPE_TEXT, "");
m_ScreenName;
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Spacers between parameters

Post by Joris »

Any idea what that could be?
Hard to say without seeing the rest of your code. Is there actually a bound texture to unbind at that point?
Also could you give me a example for the text only param
What you have should work. I think a text param expects you to at least implement GetTextParameter, otherwise it will try to call it and crash. I don't think implementing SetTextParameter is actually necessarry.

Personally, I would call the param name "Name 1", and then give it the value "Screen 1". That way you make a clear distinction between the name of the param and the value of the param (ie what it does and what it's set to). But I'm pedantic like that ;)

The function expects you to work with a char pointer, and you're working with a char. But if you're not actually using the text anywhere, there's no need for the variable m_ScreenName at all. That variable is only used to get the data from the param and make it accessible to the rest of your code.

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Spacers between parameters

Post by Joris »

Is there actually a bound texture to unbind at that point?
Scratch that. That's silly. A call to glBindTexture should always work. I think ;)

It's kind of late to only unbind your texture when the plugin gets cleaned up. That means you're using GPU memory, even when the plugin is not visible. With a lot of instances of the plugin, that can add up real quick.

Ideally, you would bind and unbind the incoming texture at the beginning and end of the draw call.

hive8
Is seriously in love with Resolume. Met the parents and everything
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Spacers between parameters

Post by hive8 »

I think version 1.000 is finished... :)

More to come in the next version probably end of week
Can someone test for me and see if it works on other machines, win only as of now till the mac comes back.

Suggestions for more features are welcome, please let me know and I will try to add them.

Thx Joris for the help i got everything figured out :)

To note for this version the string to show the pixels and % on the slider is currently hard coded to a resolution of 1920 x 1080 will change later.
Attachments
H8_FFGL4ScreenV1-000.zip
(9.16 KiB) Downloaded 576 times
HIVE 8 | Quantum Laser | http://www.hive8.com

damstraversaz
Hasn't felt like this about software in a long time
Posts: 77
Joined: Tue Mar 01, 2011 09:39
Location: france

Re: Spacers between parameters

Post by damstraversaz »

great ! I will try it as soon as possible
digital arts:
http://www.damientraversaz.com/#!art-numerique/c1s43
music for dance, documentary and digital arts:
http://www.damientraversaz.com/

Post Reply