Skip to content

Commit

Permalink
osc: make punchIn and punchOut act similar to repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
kdejaeger committed Mar 6, 2018
1 parent 35616b8 commit 70084c7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,13 @@ public void changePosition (final boolean increase, final boolean slow)
this.transport.incPosition (increase ? frac : -frac, false);
}

/** {@inheritDoc} */
@Override
public void setPunchIn (final boolean on)
{
this.transport.isPunchInEnabled ().set (on);
}


/** {@inheritDoc} */
@Override
Expand All @@ -425,7 +432,6 @@ public void togglePunchIn ()
this.transport.isPunchInEnabled ().toggle ();
}


/** {@inheritDoc} */
@Override
public boolean isPunchInEnabled ()
Expand All @@ -434,6 +440,13 @@ public boolean isPunchInEnabled ()
}


/** {@inheritDoc} */
@Override
public void setPunchOut (final boolean on)
{
this.transport.isPunchOutEnabled ().set (on);
}

/** {@inheritDoc} */
@Override
public void togglePunchOut ()
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/de/mossgrabers/framework/daw/ITransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ void record ();
void changePosition (final boolean increase, final boolean slow);


/**
* Dis-/enable the arranger Punch-in.
*
* @param on True if on
*/
void setPunchIn (final boolean on);


/**
* Toggle punch-in enabled in the transport.
*/
Expand All @@ -328,6 +336,14 @@ void record ();
boolean isPunchInEnabled ();


/**
* Dis-/enable the arranger Punch-out.
*
* @param on True if on
*/
void setPunchOut (final boolean on);


/**
* Is punch-out enabled in the transport?
*/
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/de/mossgrabers/osc/protocol/OSCParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,15 @@ public void handle (final OscConnection source, final OscMessage message)
case "punchIn":
if (value == null)
this.transport.togglePunchIn ();
else
this.transport.setPunchIn (numValue > 0);
break;

case "punchOut":
if (value == null)
this.transport.togglePunchOut ();
else
this.transport.setPunchOut (numValue > 0);
break;

case "click":
Expand Down

0 comments on commit 70084c7

Please sign in to comment.