COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 01-08-2012, 05:52 AM   #81
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

OK, shame I can't test myself.

Anyway, is there any way to have a processing function that outputs mono only if the input is mono?
A_SN is offline   Reply With Quote
Old 01-08-2012, 08:07 AM   #82
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

You could check which input channels are connected. If your plug-in's PLUG_CHANNEL_IO is "1-1 2-2", and the 2nd channel is not connected, then you have mono input:

Code:
void MyPlug::ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames)
{
	bool isMono = !IsInChannelConnected(1);
	if (isMono)
	{
		// Mono processing
	}
	else
	{
		// Stereo processing
	}
}
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack

Last edited by Tale; 01-09-2012 at 03:31 PM. Reason: Oops, fixed curly brackets
Tale is offline   Reply With Quote
Old 01-28-2012, 11:51 AM   #83
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by Tale View Post
You could check which input channels are connected. If your plug-in's PLUG_CHANNEL_IO is "1-1 2-2", and the 2nd channel is not connected, then you have mono input:
Thanks that does the trick!

Now I have a user complaining about how the plugin 'steals' key strokes, I personally don't have any keyboard-related code, I don't use any keys at all, can you help me with that? This is what they say:
Quote:
First, it steal space button shortcut in FL Studio and studio one. In FL studio, I can hit the "don't allow keyboard shorcut" on plugin wrapper settings, but if I do that, I will lose mousewheel support. In studio one, it just steal it, there is no way to fix it. You need to fix it on your code and so on..
Thanks!
A_SN is offline   Reply With Quote
Old 01-30-2012, 09:23 AM   #84
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

Quote:
Originally Posted by A_SN View Post
Now I have a user complaining about how the plugin 'steals' key strokes, I personally don't have any keyboard-related code, I don't use any keys at all, can you help me with that? This is what they say:

Quote:
First, it steal space button shortcut in FL Studio and studio one. In FL studio, I can hit the "don't allow keyboard shorcut" on plugin wrapper settings, but if I do that, I will lose mousewheel support. In studio one, it just steal it, there is no way to fix it. You need to fix it on your code and so on..
With my WDL edition, when you activate the GUI by clicking in it using the mouse, IPlug indeed "steals" the keyboard focus the ensure mouse wheel support. You could disable this (just comment out the SetFocus under WM_MOUSEACTIVATE in IGraphicsWin.cpp), which will probably fix the issue with FL Studio, but then you'd end up with poor mouse wheel support in most other Windows hosts. I don't really know how to fix this, although in theory you could detect FL Studio, and then decide not to SetFocus only for that specific host.

As for Studio One: I haven't tested my plug-ins in Studio One, nor have I had any feedback (good or bad) from my userbase. Perhaps I will download the demo one of these days, but I don't have the time right now. Sorry!
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 01-30-2012, 09:25 AM   #85
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: UK
Posts: 1,164
Default

FWIW, I have the same issue in wdl-ol. Also if you google it, other plugins also steal the keyboard in FL
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 02-01-2012, 02:46 AM   #86
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

Thanks, Oli.

Meanwhile I have tried Studio One (2.3.2021), and it reacts exactly like FL Studio. When you click inside the plug-in GUI the keyboard focus is transferred there, so global hotkeys (like spacebar to start playback) no longer work. However, as soon as you click outside the plug-in GUI, global hotkeys start working again. Not really I problem IMHO.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 02-01-2012, 12:33 PM   #87
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

Quote:
Originally Posted by Tale View Post
Well, in theory you should be able to build a 64-bit VST on Mac with my WDL version. However, thusfar I haven't actually tried this myself, so I don't really know what kind of trouble you might run into (if any).
Update: I have just added a VST_x64 target to the IPlugExample Xcode project in my WDL repository, and it works like a charm.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 03-07-2012, 02:04 PM   #88
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

OK, looks like that's not a real issue then. And thanks for the 64-bit build, I'll check it out later.

I just realised I think I have a problem with latency reporting. I have a couple of knobs that can change the latency to report, and that causes a few problems it seems. When I initialise my plug in my class constructor function thing (i.e. SplineEQ::SplineEQ) I initialise my knobs to their default values, then report a latency with SetLatency(), then from OnParamChange() I get the new values for those knobs from the host and change the latency with SetLatency() again, only the problem is a lot of hosts don't take that new latency into account, so the latency that's being compensated for isn't the right one anymore. Any idea how to deal with that?
A_SN is offline   Reply With Quote
Old 03-07-2012, 02:21 PM   #89
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

I believe the traditional solution for this is to initially report the maximum amount of latency your plug-in will ever need, and then report the lower actual latency for hosts that support on the fly latency changes.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 03-07-2012, 02:26 PM   #90
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by Tale View Post
I believe the traditional solution for this is to initially report the maximum amount of latency your plug-in will ever need, and then report the lower actual latency for hosts that support on the fly latency changes.
Oh okay. The thing is, the maximum it may need (given those maximum parameters of the two knobs that decide the latency) is around 1.4 seconds, so what if the host doesn't support further changes? Any precise hosts that may have problems with that so I can test them? Thanks.

Also how does it work? All by calling SetLatency() with the max value at initialisation, then setting a new lower value any other time?
A_SN is offline   Reply With Quote
Old 03-08-2012, 12:33 AM   #91
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

Quote:
Originally Posted by A_SN View Post
Oh okay. The thing is, the maximum it may need (given those maximum parameters of the two knobs that decide the latency) is around 1.4 seconds, so what if the host doesn't support further changes? Any precise hosts that may have problems with that so I can test them? Thanks.
Sorry, but I don't really know... Cubase?

Quote:
Originally Posted by A_SN View Post
Also how does it work? All by calling SetLatency() with the max value at initialisation, then setting a new lower value any other time?
Not exactly. You define the initial, maximum latency in your resource.h, see http://forum.cockos.com/showthread.php?t=86305#37.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 05-18-2013, 11:08 AM   #92
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Is there any way to open URLs from the plugin include with WDL? I'd like for users to be taken to the plugin's webpage when clicking the logo for instance.
A_SN is offline   Reply With Quote
Old 05-18-2013, 12:29 PM   #93
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 343
Default

Code:
pGraphics->AttachControl(new IURLControl(this, IRECT(2, 2, 2 + 94, 2 + 24), "http://lvcaudio.com"));
..but you probably don't want them to link to my site.

I am using WDL-OL, so I don't know if this control is unique or not to all WDL "styles".
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-20-2013, 07:56 AM   #94
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by random_id View Post
Code:
pGraphics->AttachControl(new IURLControl(this, IRECT(2, 2, 2 + 94, 2 + 24), "http://lvcaudio.com"));
..but you probably don't want them to link to my site.

I am using WDL-OL, so I don't know if this control is unique or not to all WDL "styles".
Works for me (also using WDL-OL), thanks a lot!
A_SN is offline   Reply With Quote
Old 05-23-2013, 02:20 PM   #95
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

How does anyone saves preferences on Mac OS X for their plugin? In Windows it's trivial enough I just get the %appdata% path with SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szAppData); and save my "plugin_name preferences.dat" file there, but in Mac OS X it's much more complicated it seems, you need to save it in "/Users/<user name, which you have to somehow get>/Library/Application Support/<your plugin name so you have to make sure this folder exists>/" so err... I'm sure I'm not the only one who saves preferences, so how do you do it?
A_SN is offline   Reply With Quote
Old 05-24-2013, 12:51 AM   #96
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

This is more or less what I do (assuming Mac OS X 10.5+):

Code:
// WDL_String* pPath;

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
if ([dirs count] < 1)
{
	// Error
	pPath->SetLen(0);
	return false;
}
NSString* path = [[dirs objectAtIndex:0] stringByAppendingPathComponent:@"MyPlugin"];
pPath->Set([path UTF8String]);

NSFileManager* fm = [NSFileManager defaultManager];
BOOL mkdir = [fm createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
if (mkdir != YES)
{
	// Error
	pPath->SetLen(0);
	return false;
}

[pool release];
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 05-26-2013, 01:11 PM   #97
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by Tale View Post
This is more or less what I do (assuming Mac OS X 10.5+):
Thanks! Based on the logic of your code I did kind of the same thing except the POSIX way (as it's usually more past-proof and future-proof than whatever other way Apple provides), plus it's C:

Code:
#include <glob.h>

char *make_mac_path(char *name)
{
	glob_t globbuf;
	const char *origpath = "~/Library/Application Support/", *plugdir = "Spiral/";
	char *path;

	if (glob(origpath, GLOB_TILDE | GLOB_MARK, NULL, &globbuf)==0)	// globbuf.gl_pathv[0] is the path
	{
		path = calloc (strlen(globbuf.gl_pathv[0]) + strlen(plugdir) + strlen(name) + 1, sizeof(char));

		sprintf(path, "%s%s", globbuf.gl_pathv[0], plugdir);

		mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR);		// create the folder

		sprintf(path, "%s%s%s", globbuf.gl_pathv[0], plugdir, name);

		globfree(&globbuf);
	}

	return path;
}
In case anyone might want to use it, it takes the name of the file to be accessed as an argument and returns the full absolute path of that file in the plugin's own folder.
A_SN is offline   Reply With Quote
Old 09-27-2013, 10:52 AM   #98
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,006
Default

Quote:
Originally Posted by A_SN View Post
There is one minor detail, if you don't enter a new value and just press return it sets the value to 0.0 no matter what.
Aha, got it! (Better late than never...) I was testing in REAPER, where this doesn't happen, but it does happen in FL Studio and VSTHost. Fixed in commit a0c83985b5 (fixed enter clearing selected text) in my WDL.git repository.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale 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 11:57 PM.


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