question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I edit start-end time of a region using button.

See original GitHub issue

I’ve been trying to make some button that allows the user to edit the already created region through input fields.

Edit region

Something looks like the image above.

So what I want to do, whenever the user creates a region, he can set a new end/start time and press edit, so the region get edited to the new values.

Note: 1- if there are multiple regions, the user should be able to select anyone of them and edit it’s start/end time. 2- I tried to think of removing/deleting the selected region, and re-create the a new one with the new inputs, but I couldn’t remove a selected region using the button. (I tried clearRegions(), but it removes all the regions not a specific one)

I’m using ReactJS.

This is the code I’m using:

wavesurferConfigure = {
        ...wavesurferConfigure,
        plugins: [
          RegionsPlugin.create({
            dragSelection: {
              slop: 5, // slop
            },
          }),
          TimelinePlugin.create({
            container: "#timeline", // the element in which to place the timeline, or a CSS selector to find it
            primaryColor: "blue", // the color of the modulo-ten notch lines (e.g. 10sec, 20sec). The default is '#000'.
            secondaryColor: "blue", // the color of the non-modulo-ten notch lines. The default is '#c0c0c0'.
            primaryFontColor: "#000", // the color of the non-modulo-ten time labels (e.g. 10sec, 20sec). The default is '#000'.
            secondaryFontColor: "#000",
          }),
          CursorPlugin.create({
            wrapper: this.$waveform,
            showTime: true,
            opacity: 1,
          }),
        ],
      };
    }

    this.wavesurfer = WaveSurfer.create(wavesurferConfigure);

And this is the button I have where I don’t know what should be the input of onClick fn

                <Button style={{ marginLeft: '15px' }}
                  onClick={() => {
                  }}
                > Edit Region</Button>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Winchester37commented, May 31, 2021

@lxtadhamnawito https://wavesurfer-js.org/example/annotation/index.html

This example solves its job, and it will be useful for you.

1reaction
Winchester37commented, May 30, 2021

I’m thinking 😃 But I have to get it done today and tomorrow. I will definitely share it here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Steps to Trim Regions Start/End in Logic Pro From The ...
3 Steps to Trim Regions Start/End in Logic Pro From The Keyboard ... This guide assumes you are using the Logic Keyboard Ninja...
Read more >
Object (Region) Editing - Mixbus v6 - 1 - Harrison Consoles
Click in the waveform area to drag the region in time or across tracks. Start/End Trim, Near the start/end of a region, the...
Read more >
Use Step Sequencer edit modes in Logic Pro - Apple Support
To choose a different edit mode, click the up and down arrows on the right side of the selector and choose the edit...
Read more >
Add, remove, or change time zones - Microsoft Support
At any time, you can change the time zone in Outlook so that it matches your current geographic location. Changing the time zone...
Read more >
The Playlist - FL Studio
Any Change to name or color will ripple through this chain. Playlist tracks linked this way are known as Instrument or Audio Tracks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found