Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 03-09-2017, 04:37 PM   #41
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by rjlwest View Post

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.
Xenakios is offline   Reply With Quote
Old 03-09-2017, 05:14 PM   #42
rjlwest
Human being with feelings
 
Join Date: Nov 2016
Posts: 14
Default

Quote:
Originally Posted by Xenakios View Post
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.
rjlwest is offline   Reply With Quote
Old 03-09-2017, 05:22 PM   #43
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by rjlwest View Post
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.
Xenakios is offline   Reply With Quote
Old 03-10-2017, 06:38 AM   #44
rjlwest
Human being with feelings
 
Join Date: Nov 2016
Posts: 14
Default

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.
rjlwest is offline   Reply With Quote
Old 03-10-2017, 06:46 AM   #45
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by rjlwest View Post
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.
Xenakios is offline   Reply With Quote
Old 06-07-2019, 03:12 AM   #46
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

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.
nikolalkc is offline   Reply With Quote
Old 06-11-2019, 05:41 AM   #47
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Anyone?
nikolalkc is offline   Reply With Quote
Old 06-11-2019, 06:42 AM   #48
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by nikolalkc View Post
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.)
cfillion is offline   Reply With Quote
Old 06-11-2019, 07:25 AM   #49
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Quote:
Originally Posted by cfillion View Post
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.)
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.
nikolalkc is offline   Reply With Quote
Old 06-11-2019, 07:43 AM   #50
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

This may be an alternative (not tried myself):
https://forum.cockos.com/showthread.php?p=2130870
nofish is offline   Reply With Quote
Old 06-12-2019, 02:15 AM   #51
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Quote:
Originally Posted by nofish View Post
This may be an alternative (not tried myself):
https://forum.cockos.com/showthread.php?p=2130870
Thanks for guiding me there.
I think that will be really helpful.
nikolalkc is offline   Reply With Quote
Old 06-12-2019, 04:43 AM   #52
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by nikolalkc View Post
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.
Xenakios is offline   Reply With Quote
Old 06-12-2019, 05:11 AM   #53
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Quote:
Originally Posted by Xenakios View Post
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
nikolalkc is offline   Reply With Quote
Old 04-09-2020, 07:05 AM   #54
DanSwizer
Human being with feelings
 
DanSwizer's Avatar
 
Join Date: Sep 2019
Posts: 42
Default

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?
DanSwizer is offline   Reply With Quote
Old 04-09-2020, 10:55 AM   #55
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Nice thread, didn't know yet, that it exists. Added it to the list of community tutorials in the Reaper Internals-Thread.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-09-2020, 12:28 PM   #56
DanSwizer
Human being with feelings
 
DanSwizer's Avatar
 
Join Date: Sep 2019
Posts: 42
Default

Yeah, it's a cool thread! But it's probably abandoned.
DanSwizer is offline   Reply With Quote
Old 04-09-2020, 12:57 PM   #57
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 302
Default

DanSwizer,use

Code:
nfo.fType = MFT_SEPARATOR;
nappies is offline   Reply With Quote
Old 04-09-2020, 01:19 PM   #58
DanSwizer
Human being with feelings
 
DanSwizer's Avatar
 
Join Date: Sep 2019
Posts: 42
Default

Quote:
Originally Posted by nappies View Post
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!
DanSwizer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.