Skip to content

Commit

Permalink
Merge pull request #70 from silveur/develop
Browse files Browse the repository at this point in the history
v1.3.5 fixed reset feature
  • Loading branch information
silveur committed Sep 15, 2014
2 parents c2423d3 + 75c542a commit 18c70e7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Binary file modified Other/StepsRaw.dmg
Binary file not shown.
9 changes: 1 addition & 8 deletions Source/Randomiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,7 @@ void Randomiser::buttonClicked(Button* button)
}
else if (button == theResetAllButton)
{
FileInputStream inputStream(theDefaultPreset);
ValueTree treeToLoad = ValueTree::readFromStream(inputStream);
for (int i=0; i<theSequencerTree.getNumChildren(); i++)
{
ValueTree sourceChild = treeToLoad.getChild(i);
ValueTree destinationChild = theSequencerTree.getChild(i);
destinationChild.copyPropertiesFrom(sourceChild, nullptr);
}
theSequencerView->resetAll();
}
}

Expand Down
12 changes: 12 additions & 0 deletions Source/SequencerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,18 @@ void SequencerView::randomiseAll()
}
}

void SequencerView::resetAll()
{
for (int i=0;i<theSequencerTree.getNumChildren();i++)
{
ValueTree child = theSequencerTree.getChild(i);
if (theSequencerTree.getProperty("RandPitch")) child.setProperty("Pitch", 0, theUndoManager);
if (theSequencerTree.getProperty("RandState")) child.setProperty("State", ON, theUndoManager);
if (theSequencerTree.getProperty("RandVelocity")) child.setProperty("Velocity", 127, theUndoManager);
if (theSequencerTree.getProperty("RandDecay")) child.setProperty("Decay", 40, theUndoManager);
}
}

void SequencerView::setAllLeds(bool state)
{
for (int i=0;i<theLEDs.size();i++)
Expand Down
5 changes: 3 additions & 2 deletions Source/SequencerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SequencerView: public Component, SliderListener, public ButtonListener, As
void handleAsyncUpdate();
void updateSelectedMidiOut(String& midiOut);
void randomiseAll();
void resetAll();
bool keyPressed(const KeyPress &key, Component *originatingComponent)
{
if (key.isKeyCode(82)) randomiseAll();
Expand All @@ -69,8 +70,8 @@ class SequencerView: public Component, SliderListener, public ButtonListener, As
g.drawText("Division", widthDiv * 26, heigthDiv * 3, widthDiv * 5, heigthDiv * 2, Justification::centred, 1);
g.drawText("Shuffle", widthDiv * 33, heigthDiv * 3, widthDiv * 10, heigthDiv * 2, Justification::centred, 1);
g.drawText("Range", widthDiv * 45, heigthDiv * 3, widthDiv * 6, heigthDiv * 2, Justification::centred, 1);
g.drawText("Offset", widthDiv * 53, heigthDiv * 3, widthDiv * 4, heigthDiv * 2, Justification::centred, 1);
g.drawText("Length", widthDiv * 57, heigthDiv * 3, widthDiv * 4, heigthDiv * 2, Justification::centred, 1);
g.drawText("Offset", widthDiv * 52, heigthDiv * 3, widthDiv * 4, heigthDiv * 2, Justification::centred, 1);
g.drawText("Length", widthDiv * 55.5f, heigthDiv * 3, widthDiv * 4, heigthDiv * 2, Justification::centred, 1);
g.drawText("Midi output", widthDiv * 102, heigthDiv * 3, widthDiv * 12, heigthDiv * 2, Justification::centred, 1);
g.drawText("Channel", widthDiv * 114, heigthDiv * 3, widthDiv * 5, heigthDiv * 2, Justification::centred, 1);

Expand Down
2 changes: 1 addition & 1 deletion Steps.jucer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="i0GMhV" name="Steps" projectType="guiapp" version="1.3.4"
<JUCERPROJECT id="i0GMhV" name="Steps" projectType="guiapp" version="1.3.5"
bundleIdentifier="com.nummer.steps" includeBinaryInAppConfig="1"
jucerVersion="3.1.0" companyWebsite="www.nummermusic.com" companyEmail="[email protected]"
companyName="Nummer">
Expand Down

0 comments on commit 18c70e7

Please sign in to comment.