-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add regex support in Auto Color for track, marker, region name filters #1291
base: master
Are you sure you want to change the base?
Conversation
I can also look into #1257 since it's about similar feature. |
✅ Build sws 202-master completed (commit cb66149b07 by @daleonov) Environment: APPVEYOR_BUILD_WORKER_IMAGE=Ubuntu1804, ARCH=aarch64Environment: APPVEYOR_BUILD_WORKER_IMAGE=Ubuntu1804, ARCH=i686Environment: APPVEYOR_BUILD_WORKER_IMAGE=Ubuntu1804, ARCH=armv7lEnvironment: APPVEYOR_BUILD_WORKER_IMAGE=Ubuntu1804, ARCH=x86_64Environment: APPVEYOR_BUILD_WORKER_IMAGE=Visual Studio 2019, ARCH=x86Environment: APPVEYOR_BUILD_WORKER_IMAGE=Visual Studio 2019, ARCH=x64 |
I was unaware of this either until shortly ago but since SWS targets macOS 10.5. the C++11 regex features are not available for the Mac version, so we can't use them unfortunately (afaik). edit: edit2; |
In addition to the above, the Currently it bricks the REAPER install by making it crash on startup until the bad regex is manually removed from I find the Additional concerns I'm not sure about (needs testing/research):
#1257 (and the related #1119) could be done by reusing ReaPack's filter implementation (but with its use of the C++17 stdlib removed) as discussed here. |
Can't use them at all or still can use as a platform-specific feature? The code is easy to isolate so I can do something like
...if such thing is acceptable here, of course.
Fair enough. No elegant way to address it other than catching it? Good news is
Good idea!
Fair enough. It's a lower priority concern than the rest of those. But if I go with regex exception handling (as I discussed above) then I'll have one more reason to move it outside the loop.
Possible... But it's their DAW, right? I think it's up to them to decide how complex is too complex :)
There was something I didn't like, so I always used the extended one. Don't remember exactly, I'll check later. As long as it can do what's on screenshot in first post, I'm happy.
And I think it should. What I had in mind is stuff like Also, I've hardcoded it to be case insensitive, not quite happy with it. I don't recall anything in actual regex syntax to specify case sensitivity, and I don't see any elegant way to specify it in the sws enviroment. Other than adding another meta language thing to filter string, but that's clunky too. Okay, so let's first decide if it's possible at all to add this feature (since there are some macOS compatibility issues) and if it is, I'll proceed with addressing the points above. Hopefully I won't have to fork it just for that little feature :) |
It wouldn't be the first platform-specific feature in SWS (there are some Windows-only ones). It would be a shame to have this everywhere except on macOS though...
Pretty much. Regexes in auto color would be a pretty niche feature so I don't think it's enough to warrant bundling an entire regex library. From what I could find (ignoring compatibility concerns regarding the regex flavor, which would have to be addressed), Apple's Foundation framework added regexes in v10.7 and libpcre is bundled with the OS since 10.6. 10.5 doesn't seem to ship with one.
That's correct.
If they can accidentally brick their DAW (eg. freeze at startup), it might become an issue. (I haven't looked into it so it might be very hard/impossible to so non-intentionally. In which case this is a non-issue.)
That would cause issues when using an existing config one a computer that happens to have a different locale than the one it was tested on (eg. cool Auto Color regex tips shared on the forum mysteriously doesn't work right, portable install on a thumb drive appears broken at the studio's PC...).
How about Alternatively, instead of regular expressions, perhaps using a REAPER Action List-like syntax would be helpful in Auto Color? It defaults to AND matching, has It's not a very useful alternative with patterns such as |
Using simpler syntax would be great! I agree, regex is a bit too geeky even for reaper users. |
In that case this PR, along with #1119 (where it was originally suggested), #1257 and #1285 could all be solved by adding ReaPack's implementation of REAPER's filter syntax into SWS (with minor tweaks to remove uses of |
Any chance of getting this thing to work? This could be a really powerful addition |
Unfortunately, my C++ is not good enaugh to resolve the conflicts. But I would really like to have this feature, as it's very handy if you have track names that have the description in the front and a labelling in the back, for example: "FX: A", "FX: B" etc. With Regex, one could assign track icons like FX:A, FX:B, ignoring the role name. |
Exact matching didn't really work for track names for me. So I added regex support to define a pattern, and keywords like "gtr", "bass", "synth" won't conflict with "lead", "rhythm", "double" etc and each combo would be able to have its own color.