COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 06-08-2016, 05:23 PM   #1
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default LiveEditing DEMO 1

Hi guys, here is my live editing DEMO. This will make making GUI layout much more easier. Currently it doesn't support automatics code update, but it is not that hard to update it manually. For automatic update there will be a lot of work, and there should be some kind of standard of declaring controls...

Anyways, this live mode currently works like:

Just clicking with mouse - everything is normal.
Ctrl + LMouse move controls snapped to grid.
+ Shift enables snap feature.
+ Alt disables the grid.
+ RMouse enables slow moving.

Youlean is offline   Reply With Quote
Old 06-08-2016, 09:50 PM   #2
unevens
Human being with feelings
 
Join Date: Apr 2016
Posts: 5
Default

wow!
that's gorgeous, man.
unevens is offline   Reply With Quote
Old 06-09-2016, 12:50 AM   #3
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 279
Default

Cool
stw is offline   Reply With Quote
Old 06-09-2016, 10:05 AM   #4
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Thanks. Here is the update.

Now it works like this:

Click on "E" key to toggle between edit and normal mode.
Click on CTRL to enable snap to other controls.
Click on ALT to disable grid snapping.
Click on Shift and then left mouse on control to get it's info.

Youlean is offline   Reply With Quote
Old 06-11-2016, 06:07 AM   #5
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

I just wanted to say - this is really a cool idea!
If this could be paired with users loading their own knob images, it would allow people to totally customize the GUI.

Are you currently serializing the positions so that it is saved between states?
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 06-11-2016, 06:16 AM   #6
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Quote:
Originally Posted by random_id View Post
I just wanted to say - this is really a cool idea!
If this could be paired with users loading their own knob images, it would allow people to totally customize the GUI.

Are you currently serializing the positions so that it is saved between states?
Thanks. I think that I don't understand what you mean by "serializing" part...
Anyways, for now this doesn't do anything to code automatically. It is intended to move and resize controls and get it's position and size and then you can manually type in the values inside you project. Making this automatically is not impossible but it will be a huge work and it will require some standardization how control position and size is declared.

For now it will stay like this (I won't work any more on it), but in the future I have idea to make GUI fully editable with adding/removing controls etc. (This will be way better implemented than JUCE imo...)
Youlean is offline   Reply With Quote
Old 06-11-2016, 06:19 AM   #7
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

I did this mainly because making GUI layout was really pain in the ass because you needed to set position, then compile, then if it is not OK do it again.....
Youlean is offline   Reply With Quote
Old 06-11-2016, 11:02 AM   #8
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Yes, a very cool thing. So far I've been lucky that my first plugin had a simple interface. The next two are recreations of (my own) existing plugins, so the GUI was copied. I was thinking I'd want to be able to do something like you've done, so thanks.

("Serializing"—google "serialization". "Chunks" are a way of serializing a plugin's parameters and saving it as a preset, for instance, and restoring.))
earlevel is offline   Reply With Quote
Old 06-11-2016, 11:12 AM   #9
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by earlevel View Post

("Serializing"—google "serialization". "Chunks" are a way of serializing a plugin's parameters and saving it as a preset, for instance, and restoring.))
Yeah, I was just thinking that a loop could be setup to serialize all of the control positions and save them, then it could be recreated on load.

The truth is, your modifications to the GUI make a lot of things possible - which is really cool.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 06-11-2016, 11:21 AM   #10
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Quote:
serialize all of the control positions and save them, then it could be recreated on load.
Thanks guys.

This could be actually easy to do, BUT, in that way we will have two sets of controls sizes and positions, one will be hidden in edit file and one will be in constructor which might confuse some people, and it will get in conflict with my GUI resize... I will think what can I done...
Youlean is offline   Reply With Quote
Old 06-11-2016, 04:43 PM   #11
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Here is the update. This is a prototype of what you where asking for...

Youlean is offline   Reply With Quote
Old 06-12-2016, 05:27 PM   #12
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Another update. Now class automatically generates another class that will hold all edited values. In this way all values are updated at compile time. No need for external files to store and load the values...

Youlean is offline   Reply With Quote
Old 06-14-2016, 04:05 PM   #13
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

New update. Added changing control layers position + other improvements.
This is now working nicely, I just need to connect it with my GUIResize class...
Anyways, if someone have some wish, now is the time...

Youlean is offline   Reply With Quote
Old 06-23-2016, 12:44 AM   #14
MidiN
Human being with feelings
 
Join Date: Jul 2015
Posts: 14
Default

Absolutely stunning work, purely amazing!

Please keep us updated on when and how this will be available
MidiN is offline   Reply With Quote
Old 06-23-2016, 03:38 AM   #15
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Quote:
Originally Posted by MidiN View Post
Absolutely stunning work, purely amazing!

Please keep us updated on when and how this will be available
Thanks. I am currently working on undo/redo function, when I finish that I think that it will be ready (for testing)..
Youlean is offline   Reply With Quote
Old 06-23-2016, 01:41 PM   #16
Mimo
Human being with feelings
 
Join Date: Apr 2015
Posts: 68
Default

Thanks for this!!!

(I hope to know enough to contribute )
Mimo is offline   Reply With Quote
Old 07-05-2016, 10:56 AM   #17
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Here is another demo. Now there is undo/redo and selection. That is it, I think that I will not add anything more...
Youlean is offline   Reply With Quote
Old 07-19-2016, 09:42 AM   #18
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Lol, I forgot that there could be situations where draw rect and target rect is not the same...
Here is the updated version that will handle this...

Code:
USE:

Press E key to activate;
Press B to change editing mode to include both draw and terget rect;
Press D to change editing mode to include both draw;
Press T to change editing mode to include terget rect;
Press ALT while moving control to unsnap from grid;
Press SHIFT while moving control to snap to other controls;
Press SHIFT + B to force snapping to controls that have same draw and target rect;
Press SHIFT + D to force snapping to controls to draw rect;
Press SHIFT + T to force snapping to controls to target rect;
Press CTRL + LEFT MOUSE BUTTON and drag to make a selection;
Youlean is offline   Reply With Quote
Old 07-19-2016, 10:02 AM   #19
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

And for people that don't understand what is going on here is example how to use it on IPlugMultiTargets.

You need to add this code after last include in your plugin cpp file:
Code:
#include "LiveEditLayout.h"

LiveEditLayout liveLayout;
Then you need to add after "AttachGraphics(pGraphics);"
Code:
  liveLayout.SetDefaultViewLayout(pGraphics);
  pGraphics->LiveEditing(16);
Then you need to create LiveEditLayout.h, or copy it from somewhere to your plugin folder. Here is a blank example.
Code:
// Do not edit. All of this is generated automatically 
// Copyright Youlean 2016 

#ifndef _LIVEEDITLAYOUT_
#define _LIVEEDITLAYOUT_

#include <vector>
#include "IGraphics.h" 
#include "IPlugGUIResize.h" 

class LiveEditLayout 
{ 
public: 
	LiveEditLayout() {} 
 
	~LiveEditLayout() {} 
 
	void SetDefaultViewLayout(IGraphics* pGraphics) 
	{ 
	}

	void SetGUIResizeLayout(IGraphics* pGraphics, IPlugGUIResize* pGUIResize)
	{
    }

private:
	std::vector <IControl*> originalPointers;
};
 #endif
And that's it! Enjoy GUI live edit!

NOTE: The only API difference from my branch to WDL-OL is that you are loading bitmap pointer instead of bitmap. This is because of bitmap GUI resizing...

Here is the example how you should load the bitmap:
Code:
IBitmap *tube = pGraphics->LoadPointerToBitmap(BACKGROUND_ID, BACKGROUND_FN);
Youlean is offline   Reply With Quote
Old 07-20-2016, 06:13 PM   #20
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

Cool, I noticed a small crash bug caused by 32 vs 64 bit stuff in RetrieveOldLayoutChanges. I've change the unsigned variables to size_t...
Code:
size_t start_index = oldCode.find(findStart.Get());
size_t next_start_index = oldCode.find("        // class", start_index);
size_t end_index = oldCode.find(findEnd.Get());
... because unsigned was storing a different value for not found than oldCode.npos on 64 bit which made oldCode.substr go way out of range because of the difference, causing the crash. 32 bit was the same value so didn't go out of range.

Thanks for all the work here!
snooks is offline   Reply With Quote
Old 07-20-2016, 06:24 PM   #21
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Quote:
Originally Posted by snooks View Post
Cool, I noticed a small crash bug caused by 32 vs 64 bit stuff in RetrieveOldLayoutChanges. I've change the unsigned variables to size_t...
Code:
size_t start_index = oldCode.find(findStart.Get());
size_t next_start_index = oldCode.find("        // class", start_index);
size_t end_index = oldCode.find(findEnd.Get());
... because unsigned was storing a different value for not found than oldCode.npos on 64 bit which made oldCode.substr go way out of range because of the difference, causing the crash. 32 bit was the same value so didn't go out of range.

Thanks for all the work here!
Thanks for the bug fix! This is still working version of the code. Currently if is full of mess, and I plan to make it more readable soon... The most important thing is that it works..
Youlean is offline   Reply With Quote
Old 07-21-2016, 04:13 AM   #22
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

When I try to use IPlugGUIResize with one of my own plugins I get a knob that isn't displayed correctly.


When I use the knob in IPlugGUILiveEdit I get a similar result. I've uploaded it to the Stash....

https://stash.reaper.fm/v/28118/main-...115x115x51.png

.... in case you have any ideas. It works in wdl-ol.

Oh and I attach a background image the size of the GUI (1200x800 in this case). Resizing isn't perfect when running standalone until you wiggle the resize control.
Attached Images
File Type: png knob-error.PNG (55.7 KB, 405 views)
snooks is offline   Reply With Quote
Old 07-21-2016, 04:25 AM   #23
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

This graphical glitch is probably caused by LICE_MemBitmap line align. Did you put some custom value here?

I will take look at this. What did you mean by "Resizing isn't perfect"?
Youlean is offline   Reply With Quote
Old 07-21-2016, 04:28 AM   #24
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

OK, I can reproduce graphical glitch. I will take care of it...
Youlean is offline   Reply With Quote
Old 07-21-2016, 04:42 AM   #25
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

Thanks, maybe the resize glitch is related.

The resize issue I am seeing is that the window is opened at default size with the controls at default positions, but the images are all scaled to the last scale. Wiggling the resize control gets everything to the right scale again.

This does not happen with your test plugin.
snooks is offline   Reply With Quote
Old 07-21-2016, 04:46 AM   #26
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Can you post a screenshot, or better video? Mac/PC? For now render your knob to 116 pixel to play with the GUI resize if you want...
Youlean is offline   Reply With Quote
Old 07-21-2016, 04:48 AM   #27
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

OK, I think I know. For graphical glitch at start copy app_wrapper folder from my test plugin to your plugin...
Youlean is offline   Reply With Quote
Old 07-21-2016, 05:12 AM   #28
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

Woot!! Yup, the app folder fixed the resize on start issue and rendering to 116 fixed the knob rendering. Thanks!
snooks is offline   Reply With Quote
Old 07-22-2016, 01:05 PM   #29
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

I have pushed a bugfix for this. Now it should work perfectly...
Youlean is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.