Sync clips between edits

I am looking for a method to “synchronize” two clips.
Let me explain : I would like to implement an editor of the audio clips.
Such an editor lives in a context where there is a preview Edit ( different from the main edit ) that I use precisely to have an independent transport and perform the preview.
In such a clip editor I would like to implement all the manipulation functions of the audio clip : loop start/end , warp markers etc…
When I select an audio clip from the main editor through the selection manager I create a preview edit that creates me a new audio clip from the selected clip file.
Two questions :

  1. How can I quickly set all the properties of the selected clip to the new clip created in the preview editor ?
  2. When I change some properties of the new audio clip how can I then update the one in the main edit ( thus creating a synchronization mechanism ) ?

I really like how such a mechanism was implemented in Waveform and would like to get to something similar.
I hope someone can help me.
Thanks again.

Copy and paste using the Clipboard?

Not exactly sure if it’s between two different Edits but you might wan to look at Clip::setLinkGroupID, that links two clips contained in a single Edit.

What exact feature of Waveform are you referring to though? You might want to check out Edit::createEditForPreviewingClip, that’s what we use when you double click a clip in Waveform.

Yes, this.
When I double-click a clip in the main edit, I create a previewEditForClip…
The problem is:
The previewEditForClip will create a new audio clip ( NEW_CLIP ) from the past one ( OLD_CLIP ), so in the editor I change the NEW_CLIP.
But if, for example, I set the numerator of the NEW_CLIP from 4 to 5, the numerator of the OLD_CLIP must also be changed with the new value, so I have to synchronize the two clips, otherwise if I double-click again on the OLD_CLIP a NEW_CLIP will be created with numerator = 4 and not 5.
In general I would like to know if there is a method to constantly keep 2 clips belonging therefore to different edits synchronized

No, not like that. You’d have to do it manually, in a similar way to the linked clips in the Engine I imagine.

How do you do in Waveform to keep them sync ? Do you sync it manually ?
Thx for response !!

It’s only synced when the clip preview is started. If you change a property, the preview will stop.

So each time a clip in the preview engine is modified, i need to bring that change manually in the clip in the main edit and viceversa ?

I think so, but I don’t fully understand what you’re trying to achieve and how it’s different to our previewing… Does it have to be two different Edits, could you just temporarily mute all the other tracks whilst you’re previewing a single clip?

The problem is not the preview.
In general when i double click on a wave click on the main edit i create a preview edit with a new clip starting from the clip in main edit.
So now i have 2 different clips ( one in the main edit and the other one in the preview edit ).
When i change some properties in the clip in the preview edit ( for example i change the loop start/end ) i want that even the clip in main edit reflects these changes, so i want to keep them sync between each other.

But I’m not sure why you need to create a new Edit for this? Just play back the main Edit with everything else muted? That’s probably what I’d do now in Waveform if we were doing the feature again.

Looking at Waveform we noticed that, for example, by modifying the WARP Points we have a different behavior between the editing clip and that of the main arrangement. In particular, on the first it seems that the use of the Proxy is disabled while on the second it doesn’t… hence the idea of ​​using two different objects

I’m not quite sure what you mean? The use of a proxy file is a setting setUsesProxy (...). If you want live updates, you can disable the proxy use.

Taking a look at Waveform :
This is the main clip in the arrangement.

Double click on it will open the audio editor.

What is the relationship between this two clips ?

As I could see, these are two different clips, the first in the main edit (Photo 1) and the second in the preview edit (Photo 2).
In fact, if you edit a warp marker in the audio editor, the clip in the audio editor will perform the warp in real time, while the one in the main edit will use a proxy.

So I would like to understand if these are two different clips (one with proxy = false and the other with proxy = true) or if they are the same clip.

Ok, I thought you were referring to the preview that happens when you double click a clip and you get two arrows playing back just that clip.

Your screenshot just shows a visual editor, there’s no playback synronisation there, it just directly edits the clip’s warp markers and draws the waveform.

Yes, but when i move a warp marker in the visual edit, it triggers the proxy regeneration on the first clip ( the one in the main edit ) while updating in real-time the clip in visual editor.

So, forgetting about the playback , in the arrangement and in the visual editor i’m watching the same clip ? or are they two different clips?

The second one (in the lower properties panel) isn’t a clip at all, it’s just a UI editor. It just takes a reference to the Clip in the Edit and allows you to edit the warp markers. We just redraw the thumbnail as the state changes, no proxies or anything, just directly using the warp markers.