Hi Youlean,
Diving further into the code I found that you chose to use structs of vectors for the layoutContainer and the viewContainer.
I find this design a bit unfortunate since in practice you will almost never iterate over single vector elements. I think a better choice would be to use a vector of structs (layoutItems / viewItems) instead.
This has some advantages:
- smaller number of pointers to dereferences.
- much bigger chance to have data that is used together in the same cache line (64 byte on current CPUs). This is potentially a great performace booster.
- Code is (IMO) easier to understand and to maintain. (check IPlugGUIResize::AttachGUIResize)

I have refactored the files IPlugGUIResize.h and IPlugGUIResize.cpp accordingly. If you like my changes feel free to pull them into your repository.
Andreas

Hi Youlean,
Have you considered using vcpkg to include the cairo libraries and further dependencies? This is by far the easiest and most powerful way to do it that I have seen for the windows platform. vcpkg is a package manager created by microsoft. It is designed to give you a user experience similar to the best packet managers on the linux and osx platforms (like apt and homebrew)
Setting it up is a breeze and usage is very straightforward.
Here is a link:https://github.com/Microsoft/vcpkg
and an introduction video (straight from the nerd zone)https://channel9.msdn.com/Shows/C9-G...ction-To-Vcpkg

I'm having a crashing problem with my test project. When I exit the host (Reaper) with the plugin loaded, a crash message appears. When I debug the program with Visual Studio, it says "Unhandled exception thrown: read access violation. this was 0xCDCDCDCD." and points to ycairo.cpp line 87. Which is "cairo_destroy(cr);".

There is no gui in this plugin, nor I'm doing anything with cairo in my project.

Hi Youlean,
Diving further into the code I found that you chose to use structs of vectors for the layoutContainer and the viewContainer.
I find this design a bit unfortunate since in practice you will almost never iterate over single vector elements. I think a better choice would be to use a vector of structs (layoutItems / viewItems) instead.
This has some advantages:
- smaller number of pointers to dereferences.
- much bigger chance to have data that is used together in the same cache line (64 byte on current CPUs). This is potentially a great performace booster.
- Code is (IMO) easier to understand and to maintain. (check IPlugGUIResize::AttachGUIResize)

I have refactored the files IPlugGUIResize.h and IPlugGUIResize.cpp accordingly. If you like my changes feel free to pull them into your repository.
Andreas

Hi Youlean,
Have you considered using vcpkg to include the cairo libraries and further dependencies? This is by far the easiest and most powerful way to do it that I have seen for the windows platform. vcpkg is a package manager created by microsoft. It is designed to give you a user experience similar to the best packet managers on the linux and osx platforms (like apt and homebrew)
Setting it up is a breeze and usage is very straightforward.
Here is a link:https://github.com/Microsoft/vcpkg
and an introduction video (straight from the nerd zone)https://channel9.msdn.com/Shows/C9-G...ction-To-Vcpkg

I will check this out, though I was thinking to make visual studio and xcode projects to build cairo in the future...

I'm having a crashing problem with my test project. When I exit the host (Reaper) with the plugin loaded, a crash message appears. When I debug the program with Visual Studio, it says "Unhandled exception thrown: read access violation. this was 0xCDCDCDCD." and points to ycairo.cpp line 87. Which is "cairo_destroy(cr);".

There is no gui in this plugin, nor I'm doing anything with cairo in my project.

May this be a bug in the framework?

You are using ycairo_base somewhere and you are not calling ycairo_base::bind_to_lice. That's why you have this bug. Can you check this out?

You are using ycairo_base somewhere and you are not calling ycairo_base::bind_to_lice. That's why you have this bug. Can you check this out?

I'm using the "IPlugEffect" from examples folder as a template. If ycairo has been used, it must be in the framework itself. In fact ycairo_base is used in "IPlug_include_in_plug_src.h" at line 27. The "ycairo->bind_to_lice(pGraphics);" appears in IPlugBase.

I'm using the "IPlugEffect" from examples folder as a template. If ycairo has been used, it must be in the framework itself. In fact ycairo_base is used in "IPlug_include_in_plug_src.h" at line 27. The "ycairo->bind_to_lice(pGraphics);" appears in IPlugBase.

However it does not seem to accept an integer as return type. It wants mtrAId to be a pointer. Is this behavior changed with IPlug Youlean? The wdl-ol version returns a regular integer.

Yes, it gives you pointer because in that way you can rearrange layers and still having correct control position number. This was implemented mainly because of GUI live edit but it can get handy if you want to rearrange control layers in your plugin...

Yes, it gives you pointer because in that way you can rearrange layers and still having correct control position number. This was implemented mainly because of GUI live edit but it can get handy if you want to rearrange control layers in your plugin...

Ok thanks, I guess that explains it. I have an issue with this, though:

GetGUI()->SetControlFromPlug(id, val);

SetControlFromPlug needs an integer variable id. But now I have a pointer. Is there a way to overcome this?

I apologize if this is a stupid question, but has there been any changes with SetControlFromPlug compared to wdl-ol?

It's a peculiar thing, I can't get my meter to update.

in ProcessDoubleReplacing:

if (GetGUI()) {
GetGUI()->SetControlFromPlug(*mtrAId, mtrConvA);
}

It updates only when I click and move any control on the gui, but stops updating when I release the control. The meter just freezes to the last position.
The problem could be elsewhere as well, but this is the first time I encounter this issue. The same method worked before with wdl-ol.

I apologize if this is a stupid question, but has there been any changes with SetControlFromPlug compared to wdl-ol?

It's a peculiar thing, I can't get my meter to update.

in ProcessDoubleReplacing:

if (GetGUI()) {
GetGUI()->SetControlFromPlug(*mtrAId, mtrConvA);
}

It updates only when I click and move any control on the gui, but stops updating when I release the control. The meter just freezes to the last position.
The problem could be elsewhere as well, but this is the first time I encounter this issue. The same method worked before with wdl-ol.

New API change. Now you can build cairo by using visual studio solution. You only need to change props files for your projects. For now you need to manually build all libs before using cairo in windows.

Run IPlug-Youlean\YCAIRO\Cairo_Graphics\projects\cairo.sln

Change 14 line in .props from
<ADDITIONAL_INCLUDES>$(ProjectDir)\..\..\..\MyDSP\ ;..\..\YCAIRO\;..\..\YCAIRO\Cairo_Graphics\Include-Win\cairo;..\..\YCAIRO\Cairo_Graphics\Include-Win;</ADDITIONAL_INCLUDES>

Hi Youlean first of all thank you very much for your work on Cairo and IPlug, i just pullet your repo into my local branch and i was going to experiment with it.

First thing i noticed is that Cairo links against 10.7 sdk on mac i would need 10.6 support since i have some users (mainly PT users) stuck on 10.6.

I tried to build Cairo searching around the net but it's proving to be more complicated than what i thought.

I kindly ask if you have building instructions to build the libraries you ship with your branch so i can try to rebuilt it with the 10.6 sdk

Thank you very much
Saverio

Thanks. I have recently made visual studio projects for Windows to make compiling easier, and I was working on xcode projects too but this happens to be more difficult, but I guess I will figure it out eventually. Anyways, I have build script for mac and I will post it here on Saturday, if it is not too late...

Thanks. I have recently made visual studio projects for Windows to make compiling easier, and I was working on xcode projects too but this happens to be more difficult, but I guess I will figure it out eventually. Anyways, I have build script for mac and I will post it here on Saturday, if it is not too late...

Hi thank you for your help i'm perfectly fine with a shell build script it's just that i get lost in the Cairo dependences.

It's never too late I'm doing fine with WDL-OL at the moment i just want to experiment with Cairo (it's something i was planning to do for some months now and it happens i have to make a plugin for CM in the next month that is perfect as testbed for some new technology) coincidentally you released your IPlug version that is miles ahead of what I had done in this direction.

I don't know if I can contribute something back from my own tree because the moving and resizing of IControls is already done in your tree, i have done some work on the color picker for mac but it's very marginal...

I don't know if I can contribute something back from my own tree because the moving and resizing of IControls is already done in your tree, i have done some work on the color picker for mac but it's very marginal...

It is not the problem, though if you spot something please let me know. My fork is in the works and it will be constantly updated with a things that I need.

Here is the build script. Save it to .sh file and run it from terminal. You will only need to change deployment target and the SDK version.

Thank you for your build script Youlean, I've been able to build Cairo even if I had to make some changes to your scripts, i would share it with you but it's not completely "hands free" right now i have some issue with the zlib headers required for the pnglib. If you run the configure scripts the headers found in the 10.6 sdk differ fomr the system zlib and the pnglib fails to build.
To make it work you have to manually change the version of the zlib headers in the configure generated script by pnglib.

Anyway i completed my first plugin using only Cairo for the UI, i wrote some UI widgets, nothing fancy, a knob, a switch and a dropdown, i can contribute them back.

Thank you for your build script Youlean, I've been able to build Cairo even if I had to make some changes to your scripts, i would share it with you but it's not completely "hands free" right now i have some issue with the zlib headers required for the pnglib. If you run the configure scripts the headers found in the 10.6 sdk differ fomr the system zlib and the pnglib fails to build.
To make it work you have to manually change the version of the zlib headers in the configure generated script by pnglib.

Anyway i completed my first plugin using only Cairo for the UI, i wrote some UI widgets, nothing fancy, a knob, a switch and a dropdown, i can contribute them back.

Saverio

Thanks Saverio. This won't be necessary as I will make some generic cairo controls in the future. I will have to think about strategy how to implement this in a good way though.
Just as a heads up, retina resolution is still working in old way, but I will change this very soon. If you need this urgently, just let me know to up it on my priority list..

Thanks Saverio. This won't be necessary as I will make some generic cairo controls in the future. I will have to think about strategy how to implement this in a good way though.
Just as a heads up, retina resolution is still working in old way, but I will change this very soon. If you need this urgently, just let me know to up it on my priority list..

Thank you Youlean, it's not needed i already had half working retina support in my branch for bitmaps but never actually used because of the results of a survey I run through my customers that did not deemed retina support essential.

Btw while working on this new plugin I remembered that i have built the midi CC support for the VST3 wrapper some years ago, when i did that it was missing from WDL-OL but I don't know if it's been added since then... if it's still missing i can create a pull request on github (once i understand how to cherry pick those changes alone)

Thank you Youlean, it's not needed i already had half working retina support in my branch for bitmaps but never actually used because of the results of a survey I run through my customers that did not deemed retina support essential.

Btw while working on this new plugin I remembered that i have built the midi CC support for the VST3 wrapper some years ago, when i did that it was missing from WDL-OL but I don't know if it's been added since then... if it's still missing i can create a pull request on github (once i understand how to cherry pick those changes alone)

Saverio

Is this sending midi notes? If so, that would be awesome. I have implement that on AU so VST3 implementation is only missing..