diff --git a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index b8e62c288d..a65c3855d8 100644 --- a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -506,7 +506,7 @@ public: } if (setup.maxNumInputChannels > 0 - && setup.minNumOutputChannels < setup.manager->getCurrentAudioDevice()->getInputChannelNames().size()) + && setup.minNumInputChannels < setup.manager->getCurrentAudioDevice()->getInputChannelNames().size()) { if (inputChanList == 0) { @@ -936,12 +936,14 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& const int minOutputChannels_, const int maxOutputChannels_, const bool showMidiInputOptions, - const bool showMidiOutputSelector) + const bool showMidiOutputSelector, + const bool showChannelsAsStereoPairs_) : deviceManager (deviceManager_), minOutputChannels (minOutputChannels_), maxOutputChannels (maxOutputChannels_), minInputChannels (minInputChannels_), maxInputChannels (maxInputChannels_), + showChannelsAsStereoPairs (showChannelsAsStereoPairs_), deviceTypeDropDown (0), deviceTypeDropDownLabel (0), audioDeviceSettingsComp (0) @@ -1110,7 +1112,7 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*) details.maxNumInputChannels = maxInputChannels; details.minNumOutputChannels = minOutputChannels; details.maxNumOutputChannels = maxOutputChannels; - details.useStereoPairs = true; + details.useStereoPairs = showChannelsAsStereoPairs; audioDeviceSettingsComp = new AudioDeviceSettingsPanel (type, details); diff --git a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.h b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.h index 12133ba14d..d511d286bc 100644 --- a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.h +++ b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.h @@ -66,6 +66,8 @@ public: @param maxAudioOutputChannels the maximum number of audio output channels that the application needs @param showMidiInputOptions if true, the component will allow the user to select which midi inputs are enabled @param showMidiOutputSelector if true, the component will let the user choose a default midi output device + @param showChannelsAsStereoPairs if true, channels will be treated as pairs; if false, channels will be + treated as a set of separate mono channels. */ AudioDeviceSelectorComponent (AudioDeviceManager& deviceManager, const int minAudioInputChannels, @@ -73,7 +75,8 @@ public: const int minAudioOutputChannels, const int maxAudioOutputChannels, const bool showMidiInputOptions, - const bool showMidiOutputSelector); + const bool showMidiOutputSelector, + const bool showChannelsAsStereoPairs); /** Destructor */ ~AudioDeviceSelectorComponent(); @@ -99,6 +102,7 @@ private: Component* audioDeviceSettingsComp; String audioDeviceSettingsCompType; const int minOutputChannels, maxOutputChannels, minInputChannels, maxInputChannels; + const bool showChannelsAsStereoPairs; MidiInputSelectorComponentListBox* midiInputsList; Label* midiInputsLabel; diff --git a/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h b/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h index e0619e11cf..fd0fddfda9 100644 --- a/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h +++ b/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h @@ -220,6 +220,12 @@ public: */ void shareWith (OpenGLContext* contextToShareListsWith); + /** Returns the context that this component is sharing with. + @see shareWith + */ + OpenGLContext* getShareContext() const throw() { return contextToShareListsWith; } + + //============================================================================== /** Flips the openGL buffers over. */ void swapBuffers(); diff --git a/src/juce_core/io/juce_OutputStream.cpp b/src/juce_core/io/juce_OutputStream.cpp index 51520ef0ec..09640b9707 100644 --- a/src/juce_core/io/juce_OutputStream.cpp +++ b/src/juce_core/io/juce_OutputStream.cpp @@ -196,6 +196,8 @@ void OutputStream::printf (const char* pf, ...) const int num = CharacterFunctions::vprintf (buf, bufSize, pf, list); + va_end (list); + if (num > 0) { write (buf, num);