It’s been a while since my last update. In this post, I will describe the work I have done up until now in Phase Three of the coding period.

This phase, I worked on making the subtitles displayed on the timeline editable.

Since the text and end positions are both values for the Subtitle model item of a subtitle at a particular start position, I wrote a function that deals with customizing the text as well as the end positions.

void editSubtitle (GenTime startPos, QString newSubtitleText, GenTime endPos);

For editing the subtitle text displayed on the subtitle clips in the timeline, I have made use of the TextEdit item of QML.

Editing Subtitle Text in timeline

I made use of MouseArea item of QML to enable resizing of the subtitle clips from the timeline by dragging the clip ends.

Editing end position of subtitles

Next, adjusting the start position of a subtitle clip involved removing the Subtitle model item from the previous position and adding the model item values like the text and end time position associated with the previous start position to the new start position.

For this, I wrote two functions:

  • A function to delete the model item, i.e., a subtitle at a particular position in the timeline.

void removeSubtitle (GenTime pos);

  • A function to enable the movement of subtitles within the timeline. This function first deletes the subtitle at the old start position of the subtitle (oldPos) through the removeSubtitle() function and then adds a new subtitle to the model list at the new start position (newPos).

void moveSubtitle (GenTime oldPos, GenTime newPos);

My work can be viewed here.

With these basic editing functionalities of the subtitle clips working, the next step will be to create a separate track for containing these subtitle clips. Also, at present, the Subtitle model takes in a default subtitle file. So, functions will have to be added to accept the subtitle file from the user, modify it according to the user’s preferences and apply the Subtitle effect on this modified file.

Until the next update :D,

~Sashmita Raghav