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