slider skew factor and other things...

Discuss topics relating to the Introjucer (or Jucer) application

slider skew factor and other things...

Postby kraken » Sun Jan 28, 2007 10:22 pm

would be gr8 to add slider skew factor selection as property...

ah just to notice, i've lost a lot of user code (the one that go in the sliderListener), by changing the name of the slider after it was set... when resaving the jucer file, the user code that i wrote desappeared ! ouch :/
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby jules » Mon Jan 29, 2007 11:54 am

yep, I'll add that at some point.

I've also lost code by adding it to jucer files without thinking.. It's annoying, but just too hard to make it figure out which bits are user-code.
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby kraken » Mon Jan 29, 2007 2:46 pm

yeah skewFactor and enableUnboundedMovement could be gr8 to have in the jucer ( doing them manually atm... with hundreds of sliders ! a pain :/ )

anyway about the user code, an example:

1. put a slider in, then name this to XXX
2. save the component to the cpp files
3. modify manually the user code for slider XXX listener
4. open up again the component in jucer...

does that assign the user code XXX to slider named XXX ?

yes cause if i save again the component, i do not loose the code.

but if i rename the slider, and save it, the user code desappears.
can't that user code be reassigned to the same slider with the new name (only the name is changing afterall) ?
just to know...
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby jules » Mon Jan 29, 2007 3:43 pm

ah sorry, I see what you mean now. Hmm. Tricky. The user code isn't actually loaded when you open a jucer document - instead when you save, it first loads the orginal file, and copies across any bits of user code to the new version. So at that point it has no way of knowing what the slider was originally called.

Something I'm doing at the moment is adding a fixed ID for each component, so it could use that to label the user code sections. But of course if I change that, it'll lose the code from any existing files that people have.
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby kraken » Mon Jan 29, 2007 4:22 pm

ah, i thought that when opening the file, it will scan for user code sections and assign them to every control they belong to... i was wrong !

never saw fluid editor for fltk ? (i know fltk SUCKS) it is a piece of crap but have only one good things in it: the ability to write user code directly inside it, with syntax higlight (so you have under control which pieces of code you have wrote before, without losing them)...
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby jules » Mon Jan 29, 2007 4:59 pm

The word is "lose", not "loose"!!

Yes, adding an ability to edit code in the jucer would be good one day!
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby kraken » Mon Jan 29, 2007 5:08 pm

jules wrote:The word is "lose", not "loose"!!


oops, my english is like poor and goose-egg :)
anyway if only i can speak english like i'm speaking venetian dialect... eh !
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby Karbon L. Forms » Mon Jan 29, 2007 5:46 pm

kraken wrote:
jules wrote:The word is "lose", not "loose"!!


oops, my english is like poor and goose-egg :)
anyway if only i can speak english like i'm speaking venetian dialect... eh !


Nah, theres plenty native english speakers manage to write "lose" as "loose" on the web. dunno what the fuck thats all about. its a jules irritant, i know that! lol
.................................
"Hell is other People" J.P.Sartre
.................................
Karbon L. Forms
JUCE UberWeenie
 
Posts: 368
Joined: Sat Sep 04, 2004 8:16 am
Location: Aberdeen, Scotland

Postby mdsp » Sun Mar 18, 2007 9:49 pm

by the way instead of skew factor it could be great to specify the middle point and let the Slider choose the skew factor automatically.

I have code to do that somewhere on my HD if necessary
mdsp
JUCE UberWeenie
 
Posts: 277
Joined: Fri Oct 29, 2004 12:00 pm
Location: Paris

Postby jules » Mon Mar 19, 2007 11:26 am

mdsp wrote:by the way instead of skew factor it could be great to specify the middle point and let the Slider choose the skew factor automatically.

I have code to do that somewhere on my HD if necessary


Yes, that'd be neat. Would love to see the code, as my maths abilities aren't so hot!
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby mdsp » Mon Mar 19, 2007 10:35 pm

as the mapping is done as followed

Code: Select all
proportion = ((value-min)/(max-min))^skewFactor



then by introducing value=mid mappped to proportion = 0.5 and taking the log it comes that

Code: Select all
log(0.5) = skewFactor * ( (mid-min) / (max-min) )


and thus:

Code: Select all
float skewFactor = log(0.5f) / log((mid-min)/(max-min));
mdsp
JUCE UberWeenie
 
Posts: 277
Joined: Fri Oct 29, 2004 12:00 pm
Location: Paris

Postby jules » Tue Mar 20, 2007 1:33 pm

Cool. Thanks for that, I'll add it in there.
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK


Return to The Introjucer/Jucer

Who is online

Users browsing this forum: No registered users and 1 guest