|
|
|
03-09-2017, 04:37 PM
|
#41
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by rjlwest
Also, the only bits of non library code I still use from the example project are
execute_in_main_thread
start_or_stop_main_thread_executor
mtetimerproc
I was wondering if this code is from Reaper or if I would be ripping off someones hard work? The Reaper plugin I'm making os a very lightweight part of something far deeper and will be comercially available so I'm just investigating whether or not I should take it out.
also one more question
_timer = SetTimer(0, 1000, 333, Proc);
the third parameter is UINT rate, I Was wondering are these milliseconds? I'm having a terrible problem with performance and can't pin it down, I think I investigated this already and found them to be milliseconds and that it sleeps for that time after the function has run until its called again.
|
That timer etc code was done by me. You can do whatever you want with it, but obviously I don't offer any support or warranties it works correctly. Use at your own risk. I am not responsible for any problems you may encounter. It might be wiser to use something else since that code was, if I recall right, just some experimental stuff I tried. What do you actually need to be able to do?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
03-09-2017, 05:14 PM
|
#42
|
Human being with feelings
Join Date: Nov 2016
Posts: 14
|
Quote:
Originally Posted by Xenakios
That timer etc code was done by me. You can do whatever you want with it, but obviously I don't offer any support or warranties it works correctly. Use at your own risk. I am not responsible for any problems you may encounter. It might be wiser to use something else since that code was, if I recall right, just some experimental stuff I tried. What do you actually need to be able to do?
|
thanks. I'm using reaper as a server, it both listens and broadcasts to and from a socket. it queries reaper for things like media clips, fx info, packages it all up into my data type and sends it via osc to my standalone program. then i change things in the standalone program and send it back to reset the reaper objects. I liked your way of doing it as it just worked straight away and put things on the main thread, however I need to turn the frame rate all the way down so I need to investigate what's taking so long, no doubt it's how I'm communicating with my osc library, its a multi threaded dynamic library loaded at runtime that both reaper and the standalone app have instances of, listening and sending to each others designated socket. I'll be doing something silly somewhere.
|
|
|
03-09-2017, 05:22 PM
|
#43
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by rjlwest
however I need to turn the frame rate all the way down so I need to investigate what's taking so long
|
The code was probably never tested with heavy load etc...It isn't that ideal anyway since it uses mutex locking during adding the tasks and during the execution of them. (So the non-GUI threads adding the tasks may get blocked for a quite long time, depending on how much work the timer callback on the GUI thread takes etc...) There probably is some other solution around, I didn't find anything ready to use though, which is why I tried doing that solution of my own. (I dunno, maybe the Windows API PostMessage function could be leveraged but if I recall right, that has problems of its own if one wants to execute arbitrary tasks.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
03-10-2017, 06:38 AM
|
#44
|
Human being with feelings
Join Date: Nov 2016
Posts: 14
|
I'm on mac so maybe there's some kind of mac specific objective-c dispatch queue function I can look into. Also we had a talk on spinlocks at work, maybe I can implement something there and avoid the locking. I actually think the locking wouldn't be a problem for me at the moment, the call just comes from an update from my osc lib, it would only hang up similar function calls which is fine for me.
|
|
|
03-10-2017, 06:46 AM
|
#45
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by rjlwest
I'm on mac so maybe there's some kind of mac specific objective-c dispatch queue function I can look into
|
Apple's Grand Central Dispatch (aka libdispatch) has a way to put tasks into the GUI thread.
If you are only on Mac, you should definitely use something else than my code, as on OS-X it depends on the Swell library which is overkill to just be able to use SetTimer and KillTimer.
Anyway this is getting way off topic for this thread.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Last edited by Xenakios; 03-10-2017 at 07:06 AM.
|
|
|
06-07-2019, 03:12 AM
|
#46
|
Human being with feelings
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
|
Is this tutorial still valid with the latest version of REAPER (5.978) and with the Visual Studio Express 2017? I can't get it to compile the plugin.
|
|
|
06-11-2019, 05:41 AM
|
#47
|
Human being with feelings
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
|
Anyone?
|
|
|
06-11-2019, 06:42 AM
|
#48
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by nikolalkc
I can't get it to compile the plugin.
|
What's the problem?
(If you're getting started with REAPER extensions, you might be interested in this minimal example of one: https://gist.github.com/cfillion/f32...63abb1eda41400.)
|
|
|
06-11-2019, 07:25 AM
|
#49
|
Human being with feelings
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
|
Quote:
Originally Posted by cfillion
|
The problem with building MyReaperPlugin
This is the eroor I get when I start building the plugin, and a bunch of warnings.
The problem with using barebone example
Yes I am starting with REAPER extension development.
How do I build your example?
Here's what I did.
I created this structure, like in your instructions.
I started VS2015 x86 Cross Tools Command Prompt and typed
Code:
cl /nologo /O2 /Z7 /Zo /DUNICODE main.cpp /link /DEBUG /OPT:REF /PDBALTPATH:%_PDB% /DLL /OUT:reaper_barebone.dll
But this is the message I get:
Code:
'cl' is not recognized as an internal or external command,
operable program or batch file.
I have no idea how to build stuff using VS CMD, never did anything like that.
My C++ and VS experience is also pretty lame.
|
|
|
06-11-2019, 07:43 AM
|
#50
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
|
|
|
06-12-2019, 02:15 AM
|
#51
|
Human being with feelings
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
|
Quote:
Originally Posted by nofish
|
Thanks for guiding me there.
I think that will be really helpful.
|
|
|
06-12-2019, 04:43 AM
|
#52
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by nikolalkc
But this is the message I get:
Code:
'cl' is not recognized as an internal or external command,
operable program or batch file.
|
Your Visual Studio installation is probably messed up somehow if cl doesn't work with the command line environment. You could maybe try installing a newer version of Visual Studio.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
06-12-2019, 05:11 AM
|
#53
|
Human being with feelings
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
|
Quote:
Originally Posted by Xenakios
Your Visual Studio installation is probably messed up somehow if cl doesn't work with the command line environment. You could maybe try installing a newer version of Visual Studio.
|
I managed to resolve this problem.
I have an Express version of VS which seems to not have Comand Promt menu command in tools.
https://community.dynamics.com/nav/b...-visual-studio
I solved it using this article and succedeed in building cfillion's example.
Thanks everyone
|
|
|
04-09-2020, 07:05 AM
|
#54
|
Human being with feelings
Join Date: Sep 2019
Posts: 42
|
Thanks Argitoth and Xenakios for so great example/framework for starters!It`s really helps!
I have one question: It is possible to add separators to popupmenu?
|
|
|
04-09-2020, 10:55 AM
|
#55
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Nice thread, didn't know yet, that it exists. Added it to the list of community tutorials in the Reaper Internals-Thread.
|
|
|
04-09-2020, 12:28 PM
|
#56
|
Human being with feelings
Join Date: Sep 2019
Posts: 42
|
Yeah, it's a cool thread! But it's probably abandoned.
|
|
|
04-09-2020, 12:57 PM
|
#57
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
DanSwizer,use
Code:
nfo.fType = MFT_SEPARATOR;
|
|
|
04-09-2020, 01:19 PM
|
#58
|
Human being with feelings
Join Date: Sep 2019
Posts: 42
|
Quote:
Originally Posted by nappies
DanSwizer,use
Code:
nfo.fType = MFT_SEPARATOR;
|
Thank you! Thank you! And how do you make a specific place to put it? I'm very stupid, please!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:20 AM.
|