| @@ -253,7 +253,7 @@ static bool keyDown (const int keycode) throw() | |||||
| static const int extendedKeyModifier = 0x10000000; | static const int extendedKeyModifier = 0x10000000; | ||||
| bool KeyPress::isKeyCurrentlyDown (int keyCode) | |||||
| bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() | |||||
| { | { | ||||
| int keysym; | int keysym; | ||||
| @@ -72,7 +72,7 @@ static ComponentPeer* juce_currentMouseTrackingPeer = 0; | |||||
| //============================================================================== | //============================================================================== | ||||
| static VoidArray keysCurrentlyDown; | static VoidArray keysCurrentlyDown; | ||||
| bool KeyPress::isKeyCurrentlyDown (int keyCode) | |||||
| bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() | |||||
| { | { | ||||
| if (keysCurrentlyDown.contains ((void*) keyCode)) | if (keysCurrentlyDown.contains ((void*) keyCode)) | ||||
| return true; | return true; | ||||
| @@ -443,7 +443,7 @@ void ModifierKeys::updateCurrentModifiers() | |||||
| currentModifierFlags = currentModifiers; | currentModifierFlags = currentModifiers; | ||||
| } | } | ||||
| bool KeyPress::isKeyCurrentlyDown (int keyCode) | |||||
| bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() | |||||
| { | { | ||||
| SHORT k = (SHORT) keyCode; | SHORT k = (SHORT) keyCode; | ||||
| @@ -346,6 +346,41 @@ void AudioSampleBuffer::addFrom (const int destChannel, | |||||
| } | } | ||||
| } | } | ||||
| void AudioSampleBuffer::addFromWithRamp (const int destChannel, | |||||
| const int destStartSample, | |||||
| const float* source, | |||||
| int numSamples, | |||||
| float startGain, | |||||
| const float endGain) throw() | |||||
| { | |||||
| jassert (destChannel >= 0 && destChannel < numChannels); | |||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != 0); | |||||
| if (startGain == endGain) | |||||
| { | |||||
| addFrom (destChannel, | |||||
| destStartSample, | |||||
| source, | |||||
| numSamples, | |||||
| startGain); | |||||
| } | |||||
| else | |||||
| { | |||||
| if (numSamples > 0 && (startGain != 0.0f || endGain != 0.0f)) | |||||
| { | |||||
| const float increment = (endGain - startGain) / numSamples; | |||||
| float* d = channels [destChannel] + destStartSample; | |||||
| while (--numSamples >= 0) | |||||
| { | |||||
| *d++ += startGain * *source++; | |||||
| startGain += increment; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| void AudioSampleBuffer::copyFrom (const int destChannel, | void AudioSampleBuffer::copyFrom (const int destChannel, | ||||
| const int destStartSample, | const int destStartSample, | ||||
| const AudioSampleBuffer& source, | const AudioSampleBuffer& source, | ||||
| @@ -230,6 +230,24 @@ public: | |||||
| int numSamples, | int numSamples, | ||||
| const float gainToApplyToSource = 1.0f) throw(); | const float gainToApplyToSource = 1.0f) throw(); | ||||
| /** Adds samples from an array of floats, applying a gain ramp to them. | |||||
| @param destChannel the channel within this buffer to add the samples to | |||||
| @param destStartSample the start sample within this buffer's channel | |||||
| @param source the source data to use | |||||
| @param numSamples the number of samples to process | |||||
| @param startGain the gain to apply to the first sample (this is multiplied with | |||||
| the source samples before they are added to this buffer) | |||||
| @param endGain the gain to apply to the final sample. The gain is linearly | |||||
| interpolated between the first and last samples. | |||||
| */ | |||||
| void addFromWithRamp (const int destChannel, | |||||
| const int destStartSample, | |||||
| const float* source, | |||||
| int numSamples, | |||||
| float startGain, | |||||
| float endGain) throw(); | |||||
| /** Copies samples from another buffer to this one. | /** Copies samples from another buffer to this one. | ||||
| @param destChannel the channel within this buffer to copy the samples to | @param destChannel the channel within this buffer to copy the samples to | ||||
| @@ -72,9 +72,7 @@ Button::~Button() | |||||
| if (commandManagerToUse != 0) | if (commandManagerToUse != 0) | ||||
| commandManagerToUse->removeListener (this); | commandManagerToUse->removeListener (this); | ||||
| if (repeatTimer != 0) | |||||
| delete repeatTimer; | |||||
| delete repeatTimer; | |||||
| clearShortcuts(); | clearShortcuts(); | ||||
| } | } | ||||
| @@ -104,7 +102,7 @@ const String Button::getTooltip() | |||||
| for (int i = 0; i < keyPresses.size(); ++i) | for (int i = 0; i < keyPresses.size(); ++i) | ||||
| { | { | ||||
| String key (keyPresses.getUnchecked(i).getTextDescription()); | |||||
| const String key (keyPresses.getUnchecked(i).getTextDescription()); | |||||
| if (key.length() == 1) | if (key.length() == 1) | ||||
| tt << " [shortcut: '" << key << "']"; | tt << " [shortcut: '" << key << "']"; | ||||
| @@ -118,7 +116,7 @@ const String Button::getTooltip() | |||||
| return SettableTooltipClient::getTooltip(); | return SettableTooltipClient::getTooltip(); | ||||
| } | } | ||||
| void Button::setConnectedEdges (const int connectedEdgeFlags_) | |||||
| void Button::setConnectedEdges (const int connectedEdgeFlags_) throw() | |||||
| { | { | ||||
| if (connectedEdgeFlags != connectedEdgeFlags_) | if (connectedEdgeFlags != connectedEdgeFlags_) | ||||
| { | { | ||||
| @@ -580,7 +578,7 @@ void Button::clearShortcuts() | |||||
| parentHierarchyChanged(); | parentHierarchyChanged(); | ||||
| } | } | ||||
| bool Button::isShortcutPressed() const | |||||
| bool Button::isShortcutPressed() const throw() | |||||
| { | { | ||||
| if (! isCurrentlyBlockedByAnotherModalComponent()) | if (! isCurrentlyBlockedByAnotherModalComponent()) | ||||
| { | { | ||||
| @@ -332,7 +332,7 @@ public: | |||||
| LookAndFeel can choose to ignore it if it's not relevent for this type of | LookAndFeel can choose to ignore it if it's not relevent for this type of | ||||
| button. | button. | ||||
| */ | */ | ||||
| void setConnectedEdges (const int connectedEdgeFlags); | |||||
| void setConnectedEdges (const int connectedEdgeFlags) throw(); | |||||
| /** Returns the set of flags passed into setConnectedEdges(). */ | /** Returns the set of flags passed into setConnectedEdges(). */ | ||||
| int getConnectedEdgeFlags() const throw() { return connectedEdgeFlags; } | int getConnectedEdgeFlags() const throw() { return connectedEdgeFlags; } | ||||
| @@ -491,7 +491,7 @@ private: | |||||
| Timer& getRepeatTimer() throw(); | Timer& getRepeatTimer() throw(); | ||||
| ButtonState updateState (const MouseEvent* const e) throw(); | ButtonState updateState (const MouseEvent* const e) throw(); | ||||
| bool isShortcutPressed() const; | |||||
| bool isShortcutPressed() const throw(); | |||||
| void turnOffOtherButtonsInGroup (const bool sendChangeNotification); | void turnOffOtherButtonsInGroup (const bool sendChangeNotification); | ||||
| void flashButtonState() throw(); | void flashButtonState() throw(); | ||||
| @@ -94,9 +94,11 @@ bool KeyPress::operator!= (const KeyPress& other) const throw() | |||||
| return ! operator== (other); | return ! operator== (other); | ||||
| } | } | ||||
| bool KeyPress::isCurrentlyDown() const | |||||
| bool KeyPress::isCurrentlyDown() const throw() | |||||
| { | { | ||||
| int modsMask = ModifierKeys::commandModifier | ModifierKeys::ctrlModifier | ModifierKeys::altModifier; | |||||
| int modsMask = ModifierKeys::commandModifier | |||||
| | ModifierKeys::ctrlModifier | |||||
| | ModifierKeys::altModifier; | |||||
| if (keyCode == KeyPress::downKey | if (keyCode == KeyPress::downKey | ||||
| || keyCode == KeyPress::upKey | || keyCode == KeyPress::upKey | ||||
| @@ -153,7 +155,7 @@ static const KeyNameAndCode keyNameTranslations[] = | |||||
| static const tchar* const numberPadPrefix = T("numpad "); | static const tchar* const numberPadPrefix = T("numpad "); | ||||
| //============================================================================== | //============================================================================== | ||||
| const KeyPress KeyPress::createFromDescription (const String& desc) | |||||
| const KeyPress KeyPress::createFromDescription (const String& desc) throw() | |||||
| { | { | ||||
| int modifiers = 0; | int modifiers = 0; | ||||
| @@ -238,7 +240,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) | |||||
| return KeyPress (key, ModifierKeys (modifiers), 0); | return KeyPress (key, ModifierKeys (modifiers), 0); | ||||
| } | } | ||||
| const String KeyPress::getTextDescription() const | |||||
| const String KeyPress::getTextDescription() const throw() | |||||
| { | { | ||||
| String desc; | String desc; | ||||
| @@ -294,4 +296,5 @@ const String KeyPress::getTextDescription() const | |||||
| return desc; | return desc; | ||||
| } | } | ||||
| END_JUCE_NAMESPACE | END_JUCE_NAMESPACE | ||||
| @@ -143,7 +143,7 @@ public: | |||||
| @see getTextDescription | @see getTextDescription | ||||
| */ | */ | ||||
| static const KeyPress createFromDescription (const String& textVersion); | |||||
| static const KeyPress createFromDescription (const String& textVersion) throw(); | |||||
| /** Creates a textual description of the key combination. | /** Creates a textual description of the key combination. | ||||
| @@ -152,7 +152,7 @@ public: | |||||
| To store a keypress in a file, use this method, along with createFromDescription() | To store a keypress in a file, use this method, along with createFromDescription() | ||||
| to retrieve it later. | to retrieve it later. | ||||
| */ | */ | ||||
| const String getTextDescription() const; | |||||
| const String getTextDescription() const throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Checks whether the user is currently holding down the keys that make up this | /** Checks whether the user is currently holding down the keys that make up this | ||||
| @@ -162,14 +162,14 @@ public: | |||||
| down - e.g. if the keypress is CTRL+X and the user is actually holding CTRL+ALT+x | down - e.g. if the keypress is CTRL+X and the user is actually holding CTRL+ALT+x | ||||
| then it will be false. | then it will be false. | ||||
| */ | */ | ||||
| bool isCurrentlyDown() const; | |||||
| bool isCurrentlyDown() const throw(); | |||||
| /** Checks whether a particular key is held down, irrespective of modifiers. | /** Checks whether a particular key is held down, irrespective of modifiers. | ||||
| The values for key codes can either be one of the special constants defined in | The values for key codes can either be one of the special constants defined in | ||||
| this class, or an 8-bit character code. | this class, or an 8-bit character code. | ||||
| */ | */ | ||||
| static bool isKeyCurrentlyDown (int keyCode); | |||||
| static bool isKeyCurrentlyDown (int keyCode) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| // Key codes | // Key codes | ||||