# setSpeakerArrangement - get

**URL:** <https://forum.juce.com/t/setspeakerarrangement-get/8455>\
**Category:** Audio Plugins\
**Created:** [April 12, 2012, 7:32am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455 "2012-04-12T07:32:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 12, 2012, 7:32am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/1 "2012-04-12T07:32:50Z")

</div>

In a plugin i need to access the (VST-secific) speakerArranment, more specific: i need the “speakerIn/speakerOut” combination which was successfully set by the host, this is very important but i don’t want to hack juce source tree.  
Could you simply implement attribute like speakerArrangementIn, speakerArrangementOut in AudioProcessor, Next to numInputChannels, numOutputChannels, sampleRate , blockSize.

To be more platform interdependent this could be a white-space separated string.

And this would be the translation function in the VSTWrapper (other PluginFormats could just give String::empty if its not supported)

```auto
String getSpeakerString(VstSpeakerArrangementType t)
	{
		switch (t)
		{
			case	kSpeakerArrMono: return	"M";
			case	kSpeakerArrStereo: return "L R";
			case	kSpeakerArrStereoSurround:	return "Ls Rs";
			case	kSpeakerArrStereoCenter:	return "Lc Rc";
			case	kSpeakerArrStereoSide: return "Sl Sr";
			case	kSpeakerArrStereoCLfe: return "C Lfe";
			case	kSpeakerArr30Cine: return	"L R C";
			case	kSpeakerArr30Music: return "L R S";
			case	kSpeakerArr31Cine: return "L R C Lfe";
			case	kSpeakerArr31Music: return "L R Lfe S";
			case	kSpeakerArr40Cine: return "L R C S";
			case	kSpeakerArr40Music: return "L R Ls Rs";
			case	kSpeakerArr41Cine: return	"L R C Lfe S";
			case	kSpeakerArr41Music: return "L R Lfe Ls Rs";
			case	kSpeakerArr50: return "L R C Ls Rs" ;
			case	kSpeakerArr51: return "L R C Lfe Ls Rs";
			case	kSpeakerArr60Cine: return "L R C Ls Rs Cs";
			case	kSpeakerArr60Music: return "L R Ls Rs Sl Sr ";
			case	kSpeakerArr61Cine: return	"L R C Lfe Ls Rs Cs";
			case	kSpeakerArr61Music: return "L R Lfe Ls Rs Sl Sr";
			case	kSpeakerArr70Cine: return "L R C Ls Rs Lc Rc ";
			case	kSpeakerArr70Music: return "L R C Ls Rs Sl Sr";
			case	kSpeakerArr71Cine: return "L R C Lfe Ls Rs Lc Rc";
			case	kSpeakerArr71Music: return "L R C Lfe Ls Rs Sl Sr";
			case	kSpeakerArr80Cine: return	"L R C Ls Rs Lc Rc Cs";
			case	kSpeakerArr80Music: return "L R C Ls Rs Cs Sl Sr";
			case	kSpeakerArr81Cine: return "L R C Lfe Ls Rs Lc Rc Cs";
			case	kSpeakerArr81Music: return "L R C Lfe Ls Rs Cs Sl Sr" ;
			case	kSpeakerArr102: return "L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2";
		};
		return String::empty;
	}
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 12, 2012, 9:06am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/2 "2012-04-12T09:06:58Z")

</div>

Wouldn’t it be better to use bitwise-or of some flags rather than a string? Would be much easier and faster to check the results that way…

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 12, 2012, 9:21am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/3 "2012-04-12T09:21:52Z")

</div>

-anything which make it possible to read the speaker per channel would be cool.  
Bitwise is a little bit too unclear, because you need the speakertype (which could be different from host to host) so a enum flag which can be extended in future versions would be better

```auto
Array<SpeakerType> inputSpeaker;
Array<SpeakerType> outputSpeaker;
```

// enums-vals are like steinberg skd bit this is not mandantory

`enum SpeakerType { 
								unknown = -1,
								M = 0, ///< Mono (M)
								L, ///< Left (L)
								R, ///< Right (R)
								C, ///< Center (C)
								Lfe, ///< Subbass (Lfe)
								Ls, ///< Left Surround (Ls)
								Rs, ///< Right Surround (Rs)
								Lc, ///< Left of Center (Lc)
								Rc, ///< Right of Center (Rc)
								S, ///< Surround (S)
		// Cs = S, ///< Center of Surround (Cs) = Surround (S)
								Sl, ///< Side Left (Sl)
								Sr, ///< Side Right (Sr)
								Tm, ///< Top Middle (Tm)
								Tfl, ///< Top Front Left (Tfl)
								Tfc, ///< Top Front Center (Tfc)
								Tfr, ///< Top Front Right (Tfr)
								Trl, ///< Top Rear Left (Trl)
								Trc, ///< Top Rear Center (Trc)
								Trr, ///< Top Rear Right (Trr)
								Lfe2, ///< Subbass 2 (Lfe2) 
								LAST };`

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 12, 2012, 9:27am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/4 "2012-04-12T09:27:13Z")

</div>

?

Surely this is an ideal situation for a bitwise-or, because each speaker type can only be used once, and their order is unimportant, right? I can’t see the point in using an array.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 12, 2012, 9:46am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/5 "2012-04-12T09:46:33Z")

</div>

```auto
NO!!!!!!!!! :wink: 
I want to know which channel contains which speaker, that's the most important information for me!
For example, if a plugin does special processing to the Lfe-Channel, it want to know which channel it is.
```

NO!!! 😉  
I want to know which channel contains which speaker, that’s the most important information for me!  
For example, if a plugin does special processing to the Lfe-Channel, it want to know which channel it is.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 12, 2012, 9:53am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/6 "2012-04-12T09:53:03Z")

</div>

Ah, I see! Sorry! Well in that case the original string idea does seem like the best plan!

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 20, 2012, 12:04pm UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/7 "2012-04-20T12:04:08Z")

</div>

cool

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2012, 10:01am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/8 "2012-04-30T10:01:45Z")

</div>

Hi Jules,

because i implement this functionality in my plugin right now, it would be nice to know, if you do it that way, to avoid unnecessary work…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 1, 2012, 2:41pm UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/9 "2012-05-01T14:41:01Z")

</div>

I’ve checked some stuff in - let me know if it works ok for you.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [May 15, 2012, 8:25am UTC](https://forum.juce.com/t/setspeakerarrangement-get/8455/10 "2012-05-15T08:25:06Z")

</div>

Thanks, seems to work nice!
