Skip to content

Project (segments, cut points) import as a text with custom syntax (currently only from file?) #2947

Description

@slrslr

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Description

That is a lot of operations. Maybe one day, there will be a function to import cut times in a custom format (like "15.12-15.46 19.27-19.49") or a "speech to AI" which would set the segments automatically after i say: one minute fifty one seconds to one minute fifty five seconds and/then [segment2times].
#2941

Hello, currently it takes around 17 operations (mouse clicks, keyboard keys pushed) to create one segment (based on above linked discussion). Losslesscut allows to reduce this to 3 operations by importing .csv file with a segments/cut points definition https://github.com/mifi/lossless-cut/blob/master/docs/index.md#csv-files but to create the CSV file it also needs some operations on your computer (3-4) + remembering and typing all the syntactical characters.

It would reduce number of operations if user can paste or drag & drop cut points definitions as a text from their text editor/clipboard. Sample definition/syntax one may like to paste:

12:45-15:13 1:15:18-01:22:16
12.45-15.13(segment 1) 1.15.18-01.22.16(segment 2)
12m45.900s-15m13s[scene1] 1h15m18s-01h22m16s

Someone is used for separating minutes and seconds using : other using .
Someone uses space around "-"

Maybe LC "Segments" menu and/or File>"Import project" menu entry can launch a new window, where user would be able to

  1. select predefined syntax they would like to use (last used syntax remembered)

  2. create new syntax:
    Hours (n digits)
    Separator: input field here
    Minutes (1-2 digits)
    Separator: input field here
    Milliseconds (1-3 digits)
    Separator: input field here (optional)
    Segment label (optional)

It may be handy if above defined syntax may generate preview so user knows he entered it according to their plan:
12:45-15:13 1:15:18-01:22:16
12.45-15.13 1.15.18-01.22.16 segment label

  1. paste (using button and or Ctrl+V, or even drag & drop the text?) into the input box (which would be focused with typing cursor so user does not click into the field in order to make it accept Ctrl+V content) their definition of a segments to create (e.g. 12:45-15:13 1:15:18-01:22:16). Validation of input either instant with highlighting where is the error or after the window closes (which would require user to again open the import window and again paste the input and then attempt to fix it).

Notes to internal syntax validator:

  • can tolerate additional spaces around separators and at the end and the beginning of the user input.
  • if user enters 99 as milliseconds, LC would round consider it as 990 so the matching is less strict.
  • user is not forced to enter milliseconds (000 or 999 is used)
  • 01 and 1 would both translate to 01
  • if user omits hours, 00 hours would be used for less strict matching

General notes:
It would be handy if the import window is assigned a shortcut. Workflow would be like:
Ctrl+i, Ctrl+v, Enter, LC jumps to a first segment start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions