justin = { blog , askjf , music + brainal , pics , twitter , sadbikesofnewyork , code , pubkey , cockos = { reaper , wdl , ninjam , js } };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.

Name: Ask: Human (enter yes):
[unreplied] | [replied] | [all]
[older questions]

Question: Was winamp your first win32 app ever? What approach did you take to learning the API? MSDN? Petzold? Looking at other source code? Did you ever have thoughts on scrapping the project? [permalink]
Asked by Will (24.234.85.x) on April 24 2014, 12:13am

Question: pastebin.com/01UbVZct still doesn't work. To get displayed text this seems to work: pastebin.com/GGE84sAL However, that's only one conversion less and requires separate UTF8 functions (something I try to circumvent by using only char*) [permalink]
Asked by Martin (93.139.103.x) on April 23 2014, 5:43pm
Reply on April 23 2014, 8:21pm:
    Send me an email with this (and include the langpack you're using), thanks!

Question: I see that REAPER MIDI editor now has some fancy shadows... what do you use to render them? [permalink]
Asked by Rodrigo (187.112.75.x) on April 23 2014, 3:27pm
Reply on April 23 2014, 8:21pm:
    Hmm probably just LICE with an image, I think.

Question: With Reaper localized there are some quirks when it comes to things Windows display: i.imgur.com/yMonxdi.png (notice how čć become cc) Sometimes we search for hwnds by name and this can become a pain.This is what I've come up with to deal with it: bit.ly/1poiTf7 But I don't like that things are getting reconverted 4 times! Being old Being old win32 guy, do you have any idea how to make this a bit more nicer? [permalink]
Asked by Martin (93.136.59.x) on April 22 2014, 3:05pm
Reply on April 23 2014, 1:40pm (edited at April 23 2014, 1:44pm):
    You should convert the string you're searching for from UTF-8 to UTF16 (MultiByteToWideChar(CP_UTF8)), then search for the windows and call GetWindowTextW(), and compare the UTF16 strings.

    Edit: or, as Jeffos points out, making a FindWindowUTF8() which calls MultiByteToWideChar(CP_UTF8) and FindWindowW() would be the nicest way to go about this...

Question: Couldn't you do your own memory management then rather than using the CRT malloc/free and coordinate memory allocation requests/frees among the subsystems? [permalink]
Asked by Will (24.234.85.x) on April 21 2014, 9:08pm
Reply on April 22 2014, 12:47am:
    You can call the appropriate version of free(), or a function that calls it, yes... but in general best to just avoid that issue (and for objects, use virtual destructors).

Question: Why are you concerned with download size now anyway? Our internet is fast! Static link that bitch and be happy. [permalink]
Asked by Will (24.234.85.x) on April 21 2014, 5:29pm
Reply on April 21 2014, 9:04pm:
    Just try to keep the whole experience ideal at every step of the way -- not just for end-users, but for us developers too. Static linking the various plug-ins only really added about 300kB to the Windows build anyway, so no big deal. The gotcha would be if you had code which malloc()'d objects in one module and free()'d them in others, but we've been static linking on win64 for a while so it would be an issue there too.

Question: Re libc: I tried a few times linking to DDK msvcrt.dll, things looked "good" if the .lib matched the OS version. So are you going to incorporate static linking "policy" to ffmpeg too? You can dig C99-to-C89 for more info, I think it would be better for performance too. [permalink]
Asked by gio (94.66.68.x) on April 20 2014, 5:53pm
Reply on April 21 2014, 1:16pm:
    I think what it comes down to is that msvcrt.dll shouldn't really be relied on, as you might get different versions with different quirks.

Question: Re libc: Just noticed at the latest changelog the avoidance of msvcrt.dll dependency and thought to ask what made you change your mind? [permalink]
Asked by gio (79.131.47.x) on April 19 2014, 7:19pm
Reply on April 20 2014, 1:50am:
Question: Faster load times lead to static linking the C library or something else? Bench: vc13 x86 build on K10 Deneb don't look that good in comparison with the release build, didn't do any extensive testing though. :) [permalink]
Asked by gio (94.66.27.x) on April 18 2014, 9:15am
Reply on April 19 2014, 4:22pm:
    Hmm not sure what the question is here.

Question: Do you find yourself git commit -am often or do you find value in staging changes? [permalink]
Asked by Will (24.234.85.x) on April 15 2014, 8:24pm
Reply on April 16 2014, 12:51am:
    Depends, sometimes I commit everything on a temp branch then revise later, other times I add -p (when I want to add a fix but not a ton of debug messages, etc). I almost always diff at length before I push, though.

Question: Do you use github much/at all? What are your thoughts? [permalink]
Asked by Will (24.234.85.x) on April 15 2014, 6:13pm
Reply on April 16 2014, 12:52am:
    Occasionally, it's a pretty good service, I like it, but I also like hosting my own.

Question: Regarding healthy vs. unhealthy: www.cnn.com/2010/HEALTH/11/08/twinkie.diet.professor/... [permalink]
Asked by Will (68.104.121.x) on April 14 2014, 3:58am
Reply on April 16 2014, 12:52am:
    Yeah, I sort of think that a normal diet is one that hedges a lot, if something ends up being really bad, at least you get mostly good things elsewhere.

Question: Have you ever met JeffOS in real life ? [permalink]
Asked by Ubik (62.235.212.x) on April 13 2014, 3:55pm
Reply on April 13 2014, 4:56pm:
    Not yet, we've had some Skype though.

Question: Why did the world settle on this shitty 1366x768 resolution? [permalink]
Asked by Will (68.104.121.x) on April 12 2014, 10:37pm
Reply on April 13 2014, 4:55pm:
    I sure haven't! I love my Retina Macbook Pro (especially in Win7).

Question: Can we reliably tell in-project MIDI take is opened in inline editor with PCM_source->Extended(PCM_SOURCE_EXT_INLINEEDITOR). Or will it lie when take is open in another ext. editor ? (I can't open MIDI take in ext. editor (bug?) so I can't test it...) [permalink]
Asked by Martin (93.139.79.x) on April 12 2014, 7:43pm
Reply on April 13 2014, 4:55pm:
    Yes PCM_SOURCE_EXT_INLINEEDITOR(0) will return greater than 0 if and only if the inline editor is open. It will return -1 if inline editing is supported but not currently open.

Question: If you recall, what was the most challenging part of creating shoutcast? [permalink]
Asked by Will (68.104.121.x) on April 11 2014, 6:47am
Reply on April 11 2014, 11:37pm:
    Hmm just learning a lot of new stuff, and documentation wasn't as good back then.

Question: Why did you decide to remove the playtime counter in Winamp? I'm pretty sure my jams time is phenomenal now but I of course have no way of confirming. [permalink]
Asked by John (172.251.73.x) on April 11 2014, 5:44am
Reply on April 11 2014, 11:37pm:
    I don't remember sorry =) I'd imagine it didn't work reliably enough or something.

Question: I don't even have to open GUI, just effOpen, effClose and it crashes. Just like it is somehow not loaded correctly. I've already removed unloading as well. [permalink]
Asked by Franci (109.182.159.x) on April 9 2014, 2:59pm
Reply on April 10 2014, 2:51am:
    Try checking your audioMasterCallback to see if it is being called, and if so, handle that call appropriately.

Question: Programming my own VST2 host OSX x64 - having big trouble with Nebula VST plugin, GUI stuck, crashing with effClose etc. Do you remember any special treatment fot this plugin in Reaper, which btw. works perfect. Other tested plugins work here. Thanks! [permalink]
Asked by Franci (89.142.247.x) on April 8 2014, 7:08am
Reply on April 9 2014, 2:54pm:
    I don't think there was anything specific I've had to deal with it. Since you are on OSX x64, make sure you're closing the configuration window correctly (effEditClose, then close your parent NSView probably). Probably good to put all of that in an autorelease pool. Also you should never really unload the VST, because of autorelease pools and system retained objects...

Question: is there an example of how to use virtwnd out there? [permalink]
Asked by olilarkin (81.100.230.x) on April 7 2014, 7:14am
Reply on April 7 2014, 1:38pm (edited at April 7 2014, 1:40pm):
    Most of the examples I can point you to are pretty specific to the application in which they are used:
    • SnapEase uses it (uses a WDL_VWnd per image, plus a bunch of WDL_VWnd children for the image controls).
    • SWS extension use a and b (via JeffOS)
    (all from memory, function names may be slightly wrong): WDL_VWnd is a class for simple lightweight composited view hierarchies. To use, other than creating the class and using SetRealParent() for the root WDL_VWnd, you'd call WDL_VWnd::OnMouse*() on the relevant WM_ mouse messages, and WDL_VWnd::OnPaint in WM_PAINT, etc. There is also a WDL_VWnd_Painter to help with painting, though its use is not strictly necessary (I believe you can just draw to any LICE_IBitmap with the right tweaks to logic). Hope this helps... I suppose I could put together a simple example in the LICE test app, or something too.
[unreplied] | [replied] | [all]
[older questions]
Copyright 2014 Justin Frankel. | RSS