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

timeline delete / add [clips, track] #61

Open
wang-edward opened this issue Nov 23, 2024 · 3 comments
Open

timeline delete / add [clips, track] #61

wang-edward opened this issue Nov 23, 2024 · 3 comments
Assignees

Comments

@wang-edward
Copy link
Owner

see te::Edit::deleteTrack() and te::Edit::insertNewAudioTrack()

@wang-edward
Copy link
Owner Author

wang-edward commented Nov 23, 2024

depends on a lot of stuff (delete clip, automatically move to next clip)

x - should delete the section the cursor is on
d - should delete a clip

  • for now just delete the entire, thing. figure out the prefix stuff later
    d - should delete a track when it has no clip

also depends on having undoManager working

                if (APP->tracks_[APP->current_track_]->base_.getClips().size() == 0)
                {
                      edit.deleteTrack() // or something
                }

aside

it would be cool to create a clip and then record into it?

@wang-edward wang-edward self-assigned this Nov 23, 2024
@wang-edward wang-edward changed the title timeline delete / add track timeline delete / add [clips, track] Dec 8, 2024
@wang-edward
Copy link
Owner Author

notes

how to delete a clip

  • find out which clip is active based on cursor range
deleteButton.onClick = [this]
{
    auto sel = selectionManager.getSelectedObject (0);
    if (auto clip = dynamic_cast<te::Clip*> (sel))
    {
        clip->removeFromParent();
    }
    else if (auto track = dynamic_cast<te::Track*> (sel))
    {
        if (! (track->isMasterTrack() || track->isMarkerTrack() || track->isTempoTrack() || track->isChordTrack()))
            edit->deleteTrack (track);
    }
};

@wang-edward
Copy link
Owner Author

wang-edward commented Dec 20, 2024

clip slot list?

getting clip at cursor pos

    int getIndexOfNextTrackItemAt (TimePosition) override;
    TrackItem* getNextTrackItemAt (TimePosition) override;
- get next trackitem
- check if downcasts to te::Clip
- remove from parent

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

No branches or pull requests

1 participant