Skip to content

Commit

Permalink
Merge pull request #435 from 0x0f0f0f/ale/insertFile
Browse files Browse the repository at this point in the history
Add insertFile command to OSC to insert a custom file path
  • Loading branch information
git-moss authored Dec 30, 2024
2 parents d191efc + 6ed65f8 commit 8d190e3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ public void duplicate ()
this.slot.duplicateClip ();
}

/** {@inheritDoc} */
@Override
public void insertFile (String path)
{
this.slot.replaceInsertionPoint ().insertFile (path);
}


/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public abstract class AbstractModule implements IModule
protected static final String TAG_SELECTED = "selected";
protected static final String TAG_SELECT = "select";
protected static final String TAG_DUPLICATE = "duplicate";
protected static final String TAG_INSERT_FILE = "insertFile";
protected static final String TAG_REMOVE = "remove";
protected static final String TAG_VOLUME = "volume";
protected static final String TAG_PAGE = "page";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ private void parseClipValue (final ITrack track, final LinkedList<String> path,
case "create":
this.model.createNoteClip (track, slot, toInteger (value), true);
break;
case TAG_INSERT_FILE:
slot.insertFile (toString (value));
break;
case TAG_DUPLICATE:
slot.duplicate ();
break;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/mossgrabers/framework/daw/data/ISlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public interface ISlot extends IItem
*/
void duplicate ();

/**
* Insert a file in a clip.
* @param path the file path
*/
void insertFile (String path);

/**
* Past the content of the given slot into this slot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ public void duplicate ()
}


/** {@inheritDoc} */
@Override
public void insertFile (String path)
{
// Intentionally empty
}


/** {@inheritDoc} */
@Override
public void paste (final ISlot slot)
Expand Down

0 comments on commit 8d190e3

Please sign in to comment.