Saturday, 2016-09-17

*** ricardocrudo has quit IRC00:01
*** frinknet has quit IRC01:18
*** Spark[01] has joined #lv201:44
*** trebmuh has quit IRC01:46
*** falktx has joined #lv203:18
*** falktx` has quit IRC03:22
*** Spark[01] has quit IRC06:54
*** Spark[01] has joined #lv207:56
*** trebmuh has joined #lv209:09
*** dsheeler has quit IRC09:16
*** ricardocrudo has joined #lv209:47
*** dsheeler has joined #lv210:11
*** rncbc has joined #lv211:19
*** unclechu-audio_ has quit IRC11:53
*** edogawa has joined #lv213:28
*** drobilla has joined #lv215:11
drobillaRandom fantasyland thoughts: I think it was a mistake to make the type of all atoms dynamic17:05
drobillaNeeding access to dynamic mapped URID state makes things like making wrappers super annoying17:06
drobillaI'm halfway tempted to add a URID feature that reserves a range for predefined URIDs which always map to a given static value17:06
drobillaSo current things continue to work, but we can retroactively just define enums for things like atom types and future code can just use that17:07
rgareusgood idea17:25
rgareussaving custom state is more complicated than it needs to be.17:25
drobillaYou mentioned that earlier, wasn't sure really what could be done about that17:27
drobillaBut I suppose the URIDs are a part of it17:27
drobillaThough you need them to process the RT messages anyway, and they're typically the same17:28
drobillafor the keys, that is17:28
drobillaProbably was a questionable idea to use a URID key for the state interface at all, I suppose17:29
drobillaNot like the performance particularly matters there17:29
rgareusthe current API is fine as low-level API17:32
drobillaYeah, it can't get much simpler, really.  Your save gets called, you're passed a function where you store(key, value, type, flags).17:32
rgareusbut it takes a 5 or 6 LOC for a to save or load a single key/value pair  incl mapping URIs for the key and the type(s)17:33
drobillaThe potential for variable size things makes having some shiny State wrapper object in C pretty difficult17:33
rgareussave/restore arrays is even more cubmersome17:33
drobillaThe key is kind of unavoidable, type could go away, yes17:34
drobillaIt's a lot less cumbersome if you just store them as atoms always17:34
rgareusyet, I don't see how it could easily be abstracted in a general way.17:35
drobillaIf you have a state dict thingie that *points* to the values elsewhere, you could do it17:36
rgareusplugin code can just use   #define MYKEY(K)  PLUGIN_URI "#" K     etc17:36
drobillaThough magically handling RT messages that set strings is tricky17:36
drobillaWell, if you consider a plugin that uses old stuff and just uses state to save and has no message interface, the burden seems like it's on state17:37
drobillaWhich you do, so you see it that way17:37
drobillaThey were deliberately designed to mesh, though, and mapping keys is just necessary for RT changes17:38
rgareusactually I do try to only use standard ports whenever possible,  so there's no need for a custom state IF17:38
drobillaThe way to make this easy is to have a state utility thingie that you use in both/all cases17:39
drobillaTrouble there is I'm not sure you can do it without a key lookup being everywhere17:39
rgareusspeaking of state: is there a spec for GUI state?17:39
drobillaMaybe define some probably-standard-questionable struct format State { LV2_URID key, LV2_Atom* value, ...}17:39
drobillargareus: Conceptually you can just use the same stuff.  Not established / well defined / tested / supported, though17:40
drobillaeg-parms has its own thing trying to get close to save/restore being terse17:46
drobillaIt's not clever enough to magically know the key and be reducible to a for loop though17:46
drobillaIf there were such a structure, there could also be an easy one-call "map all these URIs" for it, which would be great17:47
drobillaBut I don't think that's possible without the actual contents being stored elsewhere, and I can't think of how to make that not a PITA17:47
drobillaMaybe two structs, one for actual state, one for keys17:49
drobillaStateKeys { { uri, urid, atom* } ... }17:49
drobillaBut I don't think *that* can be set up without a line per key17:49
drobilla(Though that's maybe not so bad since currently you have a line per URId map anyway, so it's a net reduction in PITA)17:50
* drobilla wonders if it's standard to iterate over a struct with the same element type17:56
drobillaor cast to an array of that element type17:56
drobillaYou can do something like this: http://pastebin.com/WEZF5rrn18:06
drobillaState save/restore could loop similarly.  It has URIDs and pointers to the actual values18:06
drobillaDitto for handling messages if you don't care about special logic for whenever a particular thing changes, but that's O(n)18:07
drobillaSomething along these lines is definitely needed.  Sort it by URId and you can get log(n) which lets you implement patch:Get with good enough efficiency (currently a ton of boilerplate in params.c)18:12
drobillaAutomagic mapping of the type would also be good, but adding type there bloats it a bit.18:13
drobilla'course you don't get to actually use brace syntax since C rather annoyingly doesn't let you do that18:15
*** Spark[01] has quit IRC18:21
drobillaSpeaking of saving state being a PITA, trying to remember why the plugin is responsible for path mapping... if there even is a reason...18:36
*** oofus has joined #lv218:38
drobillaOh, right.  Avoidable in the simple case, but if you store paths, you need to recursively map them anyway19:10
drobillargareus: ... curse you and your digressions :P19:43
drobillaThe size is also a bit of a PITA19:43
drobillaMacros to the rescue: http://pastebin.com/nbfdk41K20:50
drobillaI've distilled the plugin down quite a bit with this, which is nice, but there's a few problems20:50
drobillaThe key URIs get mapped, but you don't have access to them via an easy static identifier, which can be trouble when e.g. you want to send updates (or use them for whatever)20:51
drobillaGeneral concept of state is split into two things which makes swapping them more trouble if you consider dynamicism20:51
drobilla(Not if you don't because the actual values are only in the second thing)20:51
rgareusdrobilla: nice and concise21:01
drobillargareus: Yeah, it's not bad.  If you're willing to pay O(lg(n)), you can handle Set and Get messages with very little code, too21:04
drobillaTrying to wrap up the tricks for this in more general utility headers.  The trick is to use a forge writing method as the "store" callback so you can use the same code to save state or write a message21:05
drobillaIt's conceptually super elegant, but wee differences and lack of a sensible header for such things...21:05
drobillaThen again conceptually super elegant and also a giant pain in the ass in practice is pretty much the creed of LV2 :D21:06
drobillaI suppose the other way around is another trick I should implement: a retrieve callback that lets restore() be used to restire from an atom message21:14
drobillaSo the host can atomically set a bunch of properties, or the entire plugin state, in one message21:15
* drobilla notes we're getting kind of close to the state extension not actually being necessary here21:15
drobillaHm... the groups stuff (just posted to ML) throws a wrench in this, though22:01
drobillaI think I need to bake that in at ground level for this stuff to be prime time ready22:03
*** rncbc has quit IRC22:11
*** ricardocrudo has quit IRC22:14
rgareusdrobilla: is there some kind of abstraction to use existing/widespread translation utils (.po, gettext) for .ttl ?   some extract + replace mechnanism for port-name etc22:29
drobillargareus: Not that I know of22:30
drobillargareus: Translating via replacing for a format that has built-in multilingual capabilities is a bit odd22:31
drobillargareus: It'd be pretty easy to write one, though22:31
drobillaWell, depending on how easy it is to read .po and so on, I don't know that part22:31
rgareusdrobilla: it'd be nice to translate the a-* plugins bundled with Ardour.22:32
rgareusprokoudine might manage to edit .ttl  - but he's probably the only one from all contributing translators22:32
drobillaIt's not exactly rocket science, but yeah, same workflow would be nice22:33
rgareusand labels like "Gain"  etc are already translated and could just be re-used22:33
rgareusbut don't bother.22:33
rgareusI thought there might already be something exiting that you know about.22:34
drobillaThe part I don't know is a get_translated_strings(in_str) function22:34
drobillaGiven that, the tool is basically foreach(s, p, literal) { strings = get_translated_strings(literal.str); write_translated_strings(s, p, strings) }22:35
drobillaMaybe easier in Python even though rdflib is terrible22:35
drobilla(or just replace if you're intent on one-language bundles but that seems to not work in any reasonable case)22:37
drobillaYou could turn off lilv's built-in i18n and just do it runtime with gettext() like other things, but that would break translated bundles22:40
drobilladgettext() will get you it for a specific domain, reducing the problem to figuring out all the domains that are defined22:43
drobillalilv_get_lang() has code for converting to ttl format language tags22:43
drobillaHm, no, domain != language22:46
drobillaIn conclusion: no22:46
drobilla:)22:46
rgareusdrobilla: stash it.22:47
rgareusdrobilla: I didn't mean to side-track you.22:47
rgareusjust keep it in mind for next time when you're bored or low on battery on a plane or something...22:48
drobillaIdling anyway22:48
drobillaJust pointing out the core issue that needs doing that I won't do22:48
drobillaGiven that, I can write the actual ttl tool easily/quickly22:49
rgareusdrobilla: file a feature request.22:49
drobillaBut I'm not wading around in gettext22:49
drobillaBack on (my) topic, what's the status of other plugin APIs and dynamic parameters anyway?22:51
drobillaCan plugins add/remove parameters in response to external changes?  e.g. a n_envelopes parameter...22:51
drobillaI might be getting design featureitis here, but it seems silly to have such a dynamic mechanism logistically and not actually have a dynamic number of twiddleable things22:52
*** drobilla has quit IRC23:05
*** edogawa has quit IRC23:05
*** drobilla has joined #lv223:05
*** oofus has quit IRC23:51
*** oofus has joined #lv223:52

Generated by irclog2html.py 2.13.0 by Marius Gedminas - find it at mg.pov.lt!