| @@ -70,7 +70,7 @@ public: | |||
| Justification::centredLeft, true); | |||
| } | |||
| const var getDragSourceDescription (const SparseSet<int>& selectedRows) | |||
| var getDragSourceDescription (const SparseSet<int>& selectedRows) | |||
| { | |||
| // for our drag desctription, we'll just make a list of the selected | |||
| // row numbers - this will be picked up by the drag target and displayed in | |||
| @@ -35,16 +35,12 @@ public: | |||
| { | |||
| } | |||
| ~TreeViewDemoItem() | |||
| { | |||
| } | |||
| int getItemWidth() const | |||
| { | |||
| return xml.getIntAttribute ("width", -1); | |||
| } | |||
| const String getUniqueName() const | |||
| String getUniqueName() const | |||
| { | |||
| return xml.getTagName(); | |||
| } | |||
| @@ -98,7 +94,7 @@ public: | |||
| } | |||
| } | |||
| const var getDragSourceDescription() | |||
| var getDragSourceDescription() | |||
| { | |||
| return "TreeView Items"; | |||
| } | |||
| @@ -1089,7 +1089,6 @@ bool AudioProcessorGraph::addConnection (const uint32 sourceNodeId, | |||
| connections.addSorted (sorter, new Connection (sourceNodeId, sourceChannelIndex, | |||
| destNodeId, destChannelIndex)); | |||
| triggerAsyncUpdate(); | |||
| return true; | |||
| } | |||
| @@ -1115,7 +1114,6 @@ bool AudioProcessorGraph::removeConnection (const uint32 sourceNodeId, const int | |||
| { | |||
| removeConnection (i); | |||
| doneAnything = true; | |||
| triggerAsyncUpdate(); | |||
| } | |||
| } | |||
| @@ -1134,7 +1132,6 @@ bool AudioProcessorGraph::disconnectNode (const uint32 nodeId) | |||
| { | |||
| removeConnection (i); | |||
| doneAnything = true; | |||
| triggerAsyncUpdate(); | |||
| } | |||
| } | |||
| @@ -1164,7 +1161,6 @@ bool AudioProcessorGraph::removeIllegalConnections() | |||
| { | |||
| removeConnection (i); | |||
| doneAnything = true; | |||
| triggerAsyncUpdate(); | |||
| } | |||
| } | |||
| @@ -1172,14 +1168,22 @@ bool AudioProcessorGraph::removeIllegalConnections() | |||
| } | |||
| //============================================================================== | |||
| static void deleteRenderOpArray (Array<void*>& ops) | |||
| { | |||
| for (int i = ops.size(); --i >= 0;) | |||
| delete static_cast<GraphRenderingOps::AudioGraphRenderingOp*> (ops.getUnchecked(i)); | |||
| } | |||
| void AudioProcessorGraph::clearRenderingSequence() | |||
| { | |||
| const ScopedLock sl (renderLock); | |||
| Array<void*> oldOps; | |||
| for (int i = renderingOps.size(); --i >= 0;) | |||
| delete static_cast<GraphRenderingOps::AudioGraphRenderingOp*> (renderingOps.getUnchecked(i)); | |||
| { | |||
| const ScopedLock sl (renderLock); | |||
| renderingOps.swapWithArray (oldOps); | |||
| } | |||
| renderingOps.clear(); | |||
| deleteRenderOpArray (oldOps); | |||
| } | |||
| bool AudioProcessorGraph::isAnInputTo (const uint32 possibleInputId, | |||
| @@ -1237,8 +1241,6 @@ void AudioProcessorGraph::buildRenderingSequence() | |||
| numMidiBuffersNeeded = calculator.getNumMidiBuffersNeeded(); | |||
| } | |||
| Array<void*> oldRenderingOps (renderingOps); | |||
| { | |||
| // swap over to the new rendering sequence.. | |||
| const ScopedLock sl (renderLock); | |||
| @@ -1252,11 +1254,11 @@ void AudioProcessorGraph::buildRenderingSequence() | |||
| while (midiBuffers.size() < numMidiBuffersNeeded) | |||
| midiBuffers.add (new MidiBuffer()); | |||
| renderingOps = newRenderingOps; | |||
| renderingOps.swapWithArray (newRenderingOps); | |||
| } | |||
| for (int i = oldRenderingOps.size(); --i >= 0;) | |||
| delete static_cast<GraphRenderingOps::AudioGraphRenderingOp*> (oldRenderingOps.getUnchecked(i)); | |||
| // delete the old ones.. | |||
| deleteRenderOpArray (newRenderingOps); | |||
| } | |||
| void AudioProcessorGraph::handleAsyncUpdate() | |||
| @@ -91,7 +91,7 @@ void Button::setTooltip (const String& newTooltip) | |||
| generateTooltip = false; | |||
| } | |||
| const String Button::getTooltip() | |||
| String Button::getTooltip() | |||
| { | |||
| if (generateTooltip && commandManagerToUse != nullptr && commandID != 0) | |||
| { | |||
| @@ -299,7 +299,7 @@ public: | |||
| void setTooltip (const String& newTooltip); | |||
| // (implementation of the TooltipClient method) | |||
| const String getTooltip(); | |||
| String getTooltip(); | |||
| //============================================================================== | |||
| @@ -80,7 +80,6 @@ class FileListItemComponent : public Component, | |||
| public AsyncUpdater | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| FileListItemComponent (FileListComponent& owner_, TimeSliceThread& thread_) | |||
| : owner (owner_), thread (thread_), index (0), highlighted (false) | |||
| { | |||
| @@ -226,11 +225,9 @@ Component* FileListComponent::refreshComponentForRow (int row, bool isSelected, | |||
| } | |||
| DirectoryContentsList::FileInfo fileInfo; | |||
| if (fileList.getFileInfo (row, fileInfo)) | |||
| comp->update (fileList.getDirectory(), &fileInfo, row, isSelected); | |||
| else | |||
| comp->update (fileList.getDirectory(), nullptr, row, isSelected); | |||
| comp->update (fileList.getDirectory(), | |||
| fileList.getFileInfo (row, fileInfo) ? &fileInfo : nullptr, | |||
| row, isSelected); | |||
| return comp; | |||
| } | |||
| @@ -34,7 +34,6 @@ class FileListTreeItem : public TreeViewItem, | |||
| public ChangeListener | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| FileListTreeItem (FileTreeComponent& owner_, | |||
| DirectoryContentsList* const parentContentsList_, | |||
| const int indexInContentsList_, | |||
| @@ -70,10 +69,10 @@ public: | |||
| //============================================================================== | |||
| bool mightContainSubItems() { return isDirectory; } | |||
| const String getUniqueName() const { return file.getFullPathName(); } | |||
| String getUniqueName() const { return file.getFullPathName(); } | |||
| int getItemHeight() const { return 22; } | |||
| const var getDragSourceDescription() { return owner.getDragAndDropDescription(); } | |||
| var getDragSourceDescription() { return owner.getDragAndDropDescription(); } | |||
| void itemOpennessChanged (bool isNowOpen) | |||
| { | |||
| @@ -133,12 +132,11 @@ public: | |||
| thread.addTimeSliceClient (this); | |||
| } | |||
| owner.getLookAndFeel() | |||
| .drawFileBrowserRow (g, width, height, | |||
| file.getFileName(), | |||
| &icon, fileSize, modTime, | |||
| isDirectory, isSelected(), | |||
| indexInContentsList, owner); | |||
| owner.getLookAndFeel().drawFileBrowserRow (g, width, height, | |||
| file.getFileName(), | |||
| &icon, fileSize, modTime, | |||
| isDirectory, isSelected(), | |||
| indexInContentsList, owner); | |||
| } | |||
| void itemClicked (const MouseEvent& e) | |||
| @@ -179,8 +177,7 @@ private: | |||
| bool isDirectory; | |||
| TimeSliceThread& thread; | |||
| Image icon; | |||
| String fileSize; | |||
| String modTime; | |||
| String fileSize, modTime; | |||
| void updateIcon (const bool onlyUpdateIfCached) | |||
| { | |||
| @@ -44,7 +44,7 @@ public: | |||
| virtual ~TooltipClient() {} | |||
| /** Returns the string that this object wants to show as its tooltip. */ | |||
| virtual const String getTooltip() = 0; | |||
| virtual String getTooltip() = 0; | |||
| }; | |||
| @@ -73,7 +73,7 @@ public: | |||
| virtual void setTooltip (const String& newTooltip) { tooltipString = newTooltip; } | |||
| /** Returns the tooltip assigned to this object. */ | |||
| virtual const String getTooltip() { return tooltipString; } | |||
| virtual String getTooltip() { return tooltipString; } | |||
| protected: | |||
| SettableTooltipClient() {} | |||
| @@ -84,7 +84,6 @@ DECLARE_JNI_CLASS (ComponentPeerView, "com/juce/ComponentPeerView"); | |||
| class AndroidComponentPeer : public ComponentPeer | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| AndroidComponentPeer (Component* const component, const int windowStyleFlags) | |||
| : ComponentPeer (component, windowStyleFlags), | |||
| view (android.activity.callObjectMethod (JuceAppActivity.createNewView, component->isOpaque())), | |||
| @@ -350,7 +350,7 @@ public: | |||
| /** @internal */ | |||
| void handleAsyncUpdate(); | |||
| /** @internal */ | |||
| const String getTooltip() { return label->getTooltip(); } | |||
| String getTooltip() { return label->getTooltip(); } | |||
| /** @internal */ | |||
| void mouseDown (const MouseEvent&); | |||
| /** @internal */ | |||
| @@ -126,7 +126,7 @@ public: | |||
| customComponent->setBounds (getLocalBounds()); | |||
| } | |||
| const String getTooltip() | |||
| String getTooltip() | |||
| { | |||
| if (owner.getModel() != nullptr) | |||
| return owner.getModel()->getTooltipForRow (row); | |||
| @@ -944,8 +944,8 @@ void ListBoxModel::selectedRowsChanged (int) {} | |||
| void ListBoxModel::deleteKeyPressed (int) {} | |||
| void ListBoxModel::returnKeyPressed (int) {} | |||
| void ListBoxModel::listWasScrolled() {} | |||
| const var ListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||
| const String ListBoxModel::getTooltipForRow (int) { return String::empty; } | |||
| var ListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||
| String ListBoxModel::getTooltipForRow (int) { return String::empty; } | |||
| END_JUCE_NAMESPACE | |||
| @@ -145,12 +145,12 @@ public: | |||
| @see DragAndDropContainer::startDragging | |||
| */ | |||
| virtual const var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows); | |||
| virtual var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows); | |||
| /** You can override this to provide tool tips for specific rows. | |||
| @see TooltipClient | |||
| */ | |||
| virtual const String getTooltipForRow (int row); | |||
| virtual String getTooltipForRow (int row); | |||
| }; | |||
| @@ -190,7 +190,7 @@ public: | |||
| owner.getModel()->cellDoubleClicked (row, columnId, e); | |||
| } | |||
| const String getTooltip() | |||
| String getTooltip() | |||
| { | |||
| const int columnId = owner.getHeader().getColumnIdAtX (getMouseXYRelative().getX()); | |||
| @@ -480,7 +480,7 @@ void TableListBoxModel::returnKeyPressed (int) {} | |||
| void TableListBoxModel::listWasScrolled() {} | |||
| const String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) { return String::empty; } | |||
| const var TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||
| var TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||
| Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component* existingComponentToUpdate) | |||
| { | |||
| @@ -183,7 +183,7 @@ public: | |||
| @see getDragSourceCustomData, DragAndDropContainer::startDragging | |||
| */ | |||
| virtual const var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows); | |||
| virtual var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows); | |||
| }; | |||
| @@ -303,7 +303,7 @@ public: | |||
| owner.itemsChanged(); | |||
| } | |||
| const String getTooltip() | |||
| String getTooltip() | |||
| { | |||
| Rectangle<int> pos; | |||
| TreeViewItem* const item = findItemAt (getMouseXYRelative().getY(), pos); | |||
| @@ -1150,7 +1150,7 @@ TreeViewItem::~TreeViewItem() | |||
| { | |||
| } | |||
| const String TreeViewItem::getUniqueName() const | |||
| String TreeViewItem::getUniqueName() const | |||
| { | |||
| return String::empty; | |||
| } | |||
| @@ -1311,12 +1311,12 @@ void TreeViewItem::itemSelectionChanged (bool) | |||
| { | |||
| } | |||
| const String TreeViewItem::getTooltip() | |||
| String TreeViewItem::getTooltip() | |||
| { | |||
| return String::empty; | |||
| } | |||
| const var TreeViewItem::getDragSourceDescription() | |||
| var TreeViewItem::getDragSourceDescription() | |||
| { | |||
| return var::null; | |||
| } | |||
| @@ -190,7 +190,7 @@ public: | |||
| If you're not going to store the state, then it's ok not to bother implementing | |||
| this method. | |||
| */ | |||
| virtual const String getUniqueName() const; | |||
| virtual String getUniqueName() const; | |||
| /** Called when an item is opened or closed. | |||
| @@ -333,7 +333,7 @@ public: | |||
| /** The item can return a tool tip string here if it wants to. | |||
| @see TooltipClient | |||
| */ | |||
| virtual const String getTooltip(); | |||
| virtual String getTooltip(); | |||
| //============================================================================== | |||
| /** To allow items from your treeview to be dragged-and-dropped, implement this method. | |||
| @@ -351,7 +351,7 @@ public: | |||
| @see DragAndDropContainer::startDragging | |||
| */ | |||
| virtual const var getDragSourceDescription(); | |||
| virtual var getDragSourceDescription(); | |||
| /** If you want your item to be able to have files drag-and-dropped onto it, implement this | |||
| method and return true. | |||
| @@ -280,7 +280,7 @@ public: | |||
| { | |||
| } | |||
| const String getUniqueName() const { return String ((int) commandID) + "_id"; } | |||
| String getUniqueName() const { return String ((int) commandID) + "_id"; } | |||
| bool mightContainSubItems() { return false; } | |||
| int getItemHeight() const { return 20; } | |||
| @@ -306,7 +306,7 @@ public: | |||
| { | |||
| } | |||
| const String getUniqueName() const { return categoryName + "_cat"; } | |||
| String getUniqueName() const { return categoryName + "_cat"; } | |||
| bool mightContainSubItems() { return true; } | |||
| int getItemHeight() const { return 28; } | |||
| @@ -367,7 +367,7 @@ public: | |||
| } | |||
| bool mightContainSubItems() { return true; } | |||
| const String getUniqueName() const { return "keys"; } | |||
| String getUniqueName() const { return "keys"; } | |||
| void changeListenerCallback (ChangeBroadcaster*) | |||
| { | |||
| @@ -484,7 +484,7 @@ bool KeyMappingEditorComponent::isCommandReadOnly (const CommandID commandID) | |||
| return ci != nullptr && (ci->flags & ApplicationCommandInfo::readOnlyInKeyEditor) != 0; | |||
| } | |||
| const String KeyMappingEditorComponent::getDescriptionForKeyPress (const KeyPress& key) | |||
| String KeyMappingEditorComponent::getDescriptionForKeyPress (const KeyPress& key) | |||
| { | |||
| return key.getTextDescription(); | |||
| } | |||
| @@ -87,7 +87,7 @@ public: | |||
| method, be sure to let the base class's method handle keys you're not | |||
| interested in. | |||
| */ | |||
| virtual const String getDescriptionForKeyPress (const KeyPress& key); | |||
| virtual String getDescriptionForKeyPress (const KeyPress& key); | |||
| //============================================================================== | |||
| /** A set of colour IDs to use to change the colour of various aspects of the editor. | |||