Current page, active tab ?

Discuss problems and solutions.
Post Reply
mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25
Current page, active tab ?

Post by mbncp » 19 May 2013 17:44

How do you figure out on which page you are and also on which page is a given control ?
Same question for tabs within a container, and objects within these tabs.

And beside getting the attribute list count and attributes names, is there a better way to know which type of control you are dealing with ?

thanks

btw, lemur is crashing when calling getattributelist with the interface object ( top parent object)

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Current page, active tab ?

Post by Softcore » 20 May 2013 07:27

For the page, I believe you are looking for the built in current_interface variable (Lemur manual, page 125)

As for container tabs, the fact that there is no way to access which one is visible, and lots of other limitations have convinced me that the BEST way to deal with tabbed containers is to hide the tab bar and select-choose tabs only with scripted switches - pads. This way you can build some way to detect the currently visible tab around the current status of the button.

More about this here:
http://forum.liine.net/viewtopic.php?f=34&t=3022

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Current page, active tab ?

Post by mbncp » 20 May 2013 11:24

Thanks, totally missed the interface internal variable :oops:

Using a menu or switches does the trick, but how could they miss something so basic?

I've been fooling around with getfirst, getnext and all these indirect obj function, warning, easy to crash lemur, but a few things are leaving me a bit speechless. First there's no way to figure out what type of object you get ( there are some workarounds), then there is no way to figure out on which page is a given control, same thing for containers pages.

Also it's a bit funny that the template keeps running while in the edit mode or did I just enter the twilight zone ?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Current page, active tab ?

Post by Softcore » 20 May 2013 11:56

Its true, container tabs arer some form of a "invisible" thing for the parser. Even the getnext scripts will get you the next object in a container regardless of the tab hierarchy. For example if you have

tab1 - AAAobject
tab1 - BBBobject
tab2 - AAobject

The next object of AAAobject will be AAobject NOT BBBobject (alphabetical order, regardless of tabs hierarchy)

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Current page, active tab ?

Post by mbncp » 20 May 2013 13:41

A few basic functions are missing. I also noticed that everything runs at about a 1/60 sec which is a bit slow, at least if you want to run a midi clock.

I guess I'll end using xcode, my dream is to create some utility app that deals with all the midi stuff, probably still using lemur for the interface, but also an app that can communicate with all my ipads as this is getting a bit on my nerves.

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Current page, active tab ?

Post by mbncp » 21 May 2013 22:12

Got "my" first ios app running, it took 1 minute to run it in the simulator and almost an hour to get it running on an iPad , ok once I did read the doc I was just a few minutes ago, but still.
And it's nice, it compiles the app directly to the iPad, run it, while debugging it on your laptop 8-)
Objective C looks a bit weird sometimes, but the MIDI stuff sounds familiar, found a library called pgmidi which handles most stuff, it looks even easier than in Lemur ;)

Problem is a bit to learn all these core libraries (never coded on osx), but I will probably do all the dirty MIDI job in the app and still use Lemur as an interface, it sounds like a good combo.

Post Reply