Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New functions: seekAndCenter, toggleScroll. Implemented regions. Marks g... #182

Merged
merged 2 commits into from
May 12, 2014

Conversation

drount
Copy link

@drount drount commented May 7, 2014

  • New functions:
    • seekAndCenter
    • toggleScroll
  • Removed handlerSize from parameters.
  • Fire selection-updated with selection clear with null parameter.
  • Mute while seeking paused to avoid noise.
  • changed handler elements to handlers DOM tag with wavesurfer_handler class.
  • Fixed bug where marks had handlers.
  • Added wavesurfer parameter to drawer.
  • Added regions with events (region-created, region-in, region-out).
  • Added mark-updated, mark-removed events.
  • Updated readme

cursor: 'col-resize',
width: '12px',
height: '15px',
});
this.style(handler, {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe join these two style calls?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed to set width first is order to later center the element using
left css property.
El 08/05/2014 08:35, "katspaugh" notifications@github.com escribió:

In src/drawer.canvas.js:

             cursor: 'col-resize',
  •            width: '12px',
    
  •            height: '15px',
         });
         this.style(handler, {
    

Maybe join these two style calls?

Reply to this email directly or view it on GitHubhttps://github.com//pull/182/files#r12416717
.

@katspaugh
Copy link
Owner

Thanks so much, this is great! While I've skimmed through, I will check it out tomorrow when back from holidays.

@drount
Copy link
Author

drount commented May 8, 2014

Im traveling today too so I won't be able to make any correction :)
El 08/05/2014 09:13, "katspaugh" notifications@github.com escribió:

Thanks so much, this is great! While I've skimmed through, I will check it
out tomorrow when back from holidays.

Reply to this email directly or view it on GitHubhttps://github.com//pull/182#issuecomment-42519662
.

…s generate events.

Fixed noise while seeking.

Handlers are now handler DOM element.
@drount
Copy link
Author

drount commented May 12, 2014

I have updated the pull request removing the coupling between the drawer and the wavesurfer object. In addition add added a bit more documentation.

@katspaugh
Copy link
Owner

Thanks, looks OK! Before I merge it, I would like to ask @pitrackster, if it's all right for his use-case to remove the marksDraggable option and introduce individual marks' option draggable.

@drount
Copy link
Author

drount commented May 12, 2014

I was actually checking the same. I tested it, and works for me. But better if the commiter checks it!

@pitrackster
Copy link

Hi !

No problems for me ! still suitable for my use-cases !

@drount
Copy link
Author

drount commented May 12, 2014

@pitrackster I think there is a problem here:
f55a978#diff-4661d6bcf4ba307b2071080d540b7bc3L139

This parameter does not exist.

In addition, after this pull request is merged, I think it is better to bind the event by default (given that each mark has its own configuration).

Maybe refactor to bind by default:

this.drawer.on('drag-mark', function (drag, mark) {
if (mark.type === 'selMark') {
my.updateSelectionByMark(drag, mark);
} else if (mark.type !== 'selMark') {
my.moveMarker(drag, mark);
}
});

and remove the other conditional bindings.

@katspaugh
Copy link
Owner

To avoid checking the type on each drag event, maybe we should fire a move event for each mark, and subscribe the selection to update itself if one of its marks is moved.

@drount
Copy link
Author

drount commented May 12, 2014

Will add this to this pull request.

@pitrackster
Copy link

@drount : you're right... a forgotten line... sorry ! should i correct it and create a pull request or you can include the correction in your pull request ?

@drount
Copy link
Author

drount commented May 12, 2014

Just updated the pull request:

There are no more type for marks. Marks are bound to the corresponding events. Thanks @katspaugh for the suggestion.

Also added a missing default parameter, changed the function "moveMarker" to move "moveMark" for consistency with other functions.

katspaugh added a commit that referenced this pull request May 12, 2014
New functions: seekAndCenter, toggleScroll. Implemented regions. Marks g...
@katspaugh katspaugh merged commit 14f81ec into katspaugh:master May 12, 2014
@katspaugh
Copy link
Owner

Thank you very much!

@drount
Copy link
Author

drount commented May 12, 2014

When do you update the build? When upgrading version?

@katspaugh
Copy link
Owner

Well, I used to run make before each commit. But, yeah, let's build on version updates, it seems more reasonable.

@drount
Copy link
Author

drount commented May 12, 2014

I wondered because I realized I did not executed make before the pull
request so after you merged it the build is outdated.
El 12/05/2014 18:41, "katspaugh" notifications@github.com escribió:

Well, I used to run make before each commit. But, yeah, let's build on
version updates, it seems more reasonable.

Reply to this email directly or view it on GitHubhttps://github.com//pull/182#issuecomment-42856198
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants