Autocommit in the edit box

Old news related to Aegisub.

Autocommit in the edit box

Unread postby Plorkyeran » Mon Oct 01, 2012 3:29 am

TL;DR: It's currently not disableable. If you dislike it, give detailed examples of cases where the new behavior is worse and I'll do my best to resolve them.

Autocommit was originally a solution to two problems in Aegisub: the behavior of Undo when there were uncommitted changes in the edit box, and how to add an Apply button to the color picker dialog that'd immediately update the video preview. I realized that both of these problems only existed because of the weird concept of having to commit changes made to the file, and decided to try just making the edit box commit after every change. It quickly became clear why this wasn't always done, as Aegisub became unusably slow once the file had more than a few lines in it. I also found that I liked the autocommit workflow so much better than the old one that it was worth it to spend a bunch of time copying and pasting lines between files to avoid the performance problems. A good chunk of the work done on 3.0.0 was optimizations to make autocommit usable; committing changes is now over one hundred times faster in 3.0.0 than in 2.1.9.

My initial plan was to make autocommit optional and just accept that some things were broken with it off, but it turned out that removing the concept of pending changes from the code entirely fixed a surprising number of issues. As a result, I made it always on and waited to see if anyone would complain about a problem with it that couldn't be fixed. This never ended up happening prior to release. The feedback on it was on the whole quite positive, and all of the specific issues that people brought up were solvable, so I never saw a reason to add a way to make it act more like the old behavior.

One specific case that people have brought up since release is that with manual committing it was possible to see both the line that you are working on and the original state of the line in the grid, which is useful for editing and translating existing subtitles into another language. This is pretty much exactly what the Translation Assistant dialog is intended for, and in 3.0.0 it's not as clunky as it used to be, as you can actually interact with the rest of the program while it's open. It's still definitely imperfect, though. One idea for a better solution that I had was to integrate something like it into the main edit box with a split view that shows the initial and current states of the active line, and some hotkeys and buttons for reverting the line to the initial state, saving the initial state as a comment in the line, and so on.

The other complaint I've heard is that undo doesn't undo enough at a time and doesn't go back far enough. The number of undo levels is adjustable in the preferences dialog, and raising it will make undo go back further. How much to undo at a time is a surprisingly hard problem, and one that I'm looking to improve our handling of in future versions.
User avatar
Plorkyeran
Developer
 
Posts: 126
Joined: Fri Oct 22, 2010 6:23 pm

Re: Autocommit in the edit box

Unread postby TheFireRed » Mon Oct 01, 2012 5:19 pm

Hi Plorky, I'm already testing out this new version and getting used to it. I have a question, though. You said...
This is pretty much exactly what the Translation Assistant dialog is intended for, and in 3.0.0 it's not as clunky as it used to be, as you can actually interact with the rest of the program while it's open.

but that is not currently possible, it's working as usual (disabling clicks outside the Translation assistant window).
TheFireRed
Comic Sans MS
Comic Sans MS
 
Posts: 2
Joined: Fri Mar 02, 2012 8:14 pm

Re: Autocommit in the edit box

Unread postby Plorkyeran » Mon Oct 01, 2012 6:00 pm

Huh. I clearly remember spending some time on making the translation assistant modeless, but it seems that I never actually finished.
User avatar
Plorkyeran
Developer
 
Posts: 126
Joined: Fri Oct 22, 2010 6:23 pm

Re: Autocommit in the edit box

Unread postby Shimapan » Tue Oct 02, 2012 4:36 pm

Plorkyeran wrote:One specific case that people have brought up since release is that with manual committing it was possible to see both the line that you are working on and the original state of the line in the grid, which is useful for editing and translating existing subtitles into another language.


That's exactly how I'm translating my subs into German.

Plorkyeran wrote:This is pretty much exactly what the Translation Assistant dialog is intended for, and in 3.0.0 it's not as clunky as it used to be, as you can actually interact with the rest of the program while it's open. It's still definitely imperfect, though.


I've tried out the Translation Assistant, but found it more cumbersome than helpful. If it really were modeless, that might be better (but still far from ideal), but as TheFireRed pointed out, that's obviously not the case.

Plorkyeran wrote:One idea for a better solution that I had was to integrate something like it into the main edit box with a split view that shows the initial and current states of the active line, and some hotkeys and buttons for reverting the line to the initial state, saving the initial state as a comment in the line, and so on.


Having a vertical split in the edit box, where the upper half shows the original line and you can type your translation in the lower half, would be great! ;D
It would be even better when, for every new line, the original line appears in the upper box, the lower half is automatically blanked, and you can start typing your translation right away. As it's now, for every line in the script, you have to press Ctrl-A and Backspace first to blank it manually.
When you're done with the translation and switch to the next line by hitting Enter, discard the original line. No point in saving it as a comment or such - that would just bloat the script.

Thus I'd say, forget about that Translation Assistant, which isn't really useful anyway, and get to work on that split edit box, which would be a great deal more useful ;D

Questions about how Autocommit works:
  • How do you switch to a new line? In 2.1.9, hitting Enter/Return (or clicking "Apply") commits the line and also switches to the next line below it. How is the behaviour now with Autocommit? Do you also switch to the next line by hitting Enter?
  • When is Autocommit triggered? After a fixed period of time, or after a certain time after the last key stroke? The latter would certainly be a great deal more useful. Also, it would be great if you could configure the time in seconds (or even milliseconds) after the last keystroke that Autocommit should be triggered. If it happens to fast, you'll end up with a lot of commits for every line, and undoing the translation of a line would require pressing Undo a lot of times, which would be extremely cumbersome. I think 5 seconds would be a sensible value to prevent too much commits per line, but let people configure it to their tastes. What's the time here before Autocommit becomes active?

btw, as we're already talking about the edit box: One thing that always annoys me about the edit box is that you can't set its background colour. You can set all sorts of colours for the edit box, but not the background colour. Only the grid and the waveform display are fully configurable colour-wise.
Has finally been fixed in version 3.0, so that you can set the background colour for the edit box now?
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby Plorkyeran » Tue Oct 02, 2012 5:12 pm

Shimapan wrote:Having a vertical split in the edit box, where the upper half shows the original line and you can type your translation in the lower half, would be great! ;D It would be even better when, for every new line, the original line appears in the upper box, the lower half is automatically blanked, and you can start typing your translation right away. As it's now, for every line in the script, you have to press Ctrl-A and Backspace first to blank it manually. When you're done with the translation and switch to the next line by hitting Enter, discard the original line. No point in saving it as a comment or such - that would just bloat the script.

Whether or not to initially populate the lower half is an interesting question. For retranslating subs leaving it blank is obviously better, but for editing it's worse. In any case, there'll hotkeys to revert to the initial state and to clear the line so it'll at least be only one keystroke. Adding the original version as a comment is something a few people have said they want, but I don't think it'd make sense to do it automatically.

Shimapan wrote:How do you switch to a new line? In 2.1.9, hitting Enter/Return (or clicking "Apply") commits the line and also switches to the next line below it. How is the behaviour now with Autocommit? Do you also switch to the next line by hitting Enter?

Yes, Enter and the "commit" button just move to the next line (creating it if needed), and ctrl-enter does nothing.

Shimapan wrote:When is Autocommit triggered? After a fixed period of time, or after a certain time after the last key stroke? The latter would certainly be a great deal more useful. Also, it would be great if you could configure the time in seconds (or even milliseconds) after the last keystroke that Autocommit should be triggered. If it happens to fast, you'll end up with a lot of commits for every line, and undoing the translation of a line would require pressing Undo a lot of times, which would be extremely cumbersome. I think 5 seconds would be a sensible value to prevent too much commits per line, but let people configure it to their tastes. What's the time here before Autocommit becomes active?

Changes are committed on every keypress. Scintilla's undo grouping functionality is used, which means that sustained typing only results in one undo step rather than one per character.

Shimapan wrote:btw, as we're already talking about the edit box: One thing that always annoys me about the edit box is that you can't set its background colour. You can set all sorts of colours for the edit box, but not the background colour. Only the grid and the waveform display are fully configurable colour-wise.
Has finally been fixed in version 3.0, so that you can set the background colour for the edit box now?

No.
User avatar
Plorkyeran
Developer
 
Posts: 126
Joined: Fri Oct 22, 2010 6:23 pm

Re: Autocommit in the edit box

Unread postby jfs » Tue Oct 02, 2012 8:27 pm

Plorkyeran wrote:Whether or not to initially populate the lower half is an interesting question. For retranslating subs leaving it blank is obviously better, but for editing it's worse. In any case, there'll hotkeys to revert to the initial state and to clear the line so it'll at least be only one keystroke. Adding the original version as a comment is something a few people have said they want, but I don't think it'd make sense to do it automatically.

One of those UI ideas I've been throwing around for years and never done anything about: A modeful main editing area.
It can start in a creation mode, where you mainly have tools suitable for creating new subtitles from scratch (i.e. easy video playback controls, entering new lines with rough timing).
Then have fine timing mode, which is really the only place the audio display appears.
An editing/typesetting mode where you get formatting controls, and a read-only "previous version".
A re-translation mode, working mostly as the translation assistant.
Maybe some sort of "mastering mode", for preparing subtitles for special export formats (such as legacy TV subtitle formats, or bitmap subtitles for DVD or BD.)
Do not PM me asking for help with Aegisub, Automation, karaoke or anything like that, I won't reply.
Ask your questions in the public forums. Use the Search function, somebody probably asked the same question before.
All rights reserved to call you insults if you ask poorly thought out or redundant questions.
Experimenting is free and is a great way to learn things.
User avatar
jfs
Developer
 
Posts: 2904
Joined: Mon Dec 19, 2005 8:18 pm
Location: Somewhere else

Re: Autocommit in the edit box

Unread postby FichteFoll » Wed Oct 03, 2012 12:14 pm

I like what I'm reading but I can imagine that this'll take some decent amount of time.

For the split subeditbox I'd like the idea of different modes (UI selectable and hotkeyable) where the first is for translation erasing the previous content for the lower half, the second is for editing/typesetting maintaining the previous content and the third is for those retranslators who like to have the old line as a comment (and another mode for the current single editbox for e.g. timing). I don't need the comment thing but the first two would be pretty nice imo. This goes into the same direction as jfs' idea but it's a more simple and can make a step into that direction since it's "less work" but still provides much usability.
FichteFoll
{\b1}
{\b1}
 
Posts: 11
Joined: Thu Oct 21, 2010 10:28 am

Re: Autocommit in the edit box

Unread postby Shimapan » Wed Oct 03, 2012 4:38 pm

Plorkyeran wrote:Whether or not to initially populate the lower half is an interesting question. For retranslating subs leaving it blank is obviously better, but for editing it's worse. In any case, there'll hotkeys to revert to the initial state and to clear the line so it'll at least be only one keystroke. Adding the original version as a comment is something a few people have said they want, but I don't think it'd make sense to do it automatically.

I think you should start out simple. For now, it would be enough to add an option like "Split edit box" which does only that, splitting the edit box with a blank lower box. For people who want the lower box to show a duplicate of the upper box, you could add a sub-option like "Lower box shows duplicate of upper box".
That's it. Once you've got that done, you could add additional features like buttons (and keystrokes) for duplicating the upper half into the lower half (for resetting the lower half), blanking the lower half etc.

Plorkyeran wrote:
Shimapan wrote:Has this finally been fixed in version 3.0, so that you can set the background colour for the edit box now?

No.

Could you please implement that, so you can set the background colour of the edit box? (Currently, the white background stick out like a sore thumb.)
Linux x64 packages for Aegisub 3 (3.2.0 final - 2014-07-29)
http://erokawaii.org/linux
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby Plorkyeran » Sun Oct 28, 2012 10:21 pm

The latest build at http://plorkyeran.com/aegisub/ now has a pretty basic initial take on the split editbox - when it's enabled, the top half of the edit box shows the text the line had when it was first selected, and there's buttons to clear the line and to revert the line to what's shown in the top half (there's currently no default hotkeys for these buttons, but you can add your own). I'm looking for feedback on whether or not something along these general lines is something people would find useful, and what needs to be added to make it work well for you.
User avatar
Plorkyeran
Developer
 
Posts: 126
Joined: Fri Oct 22, 2010 6:23 pm

Re: Autocommit in the edit box

Unread postby Shimapan » Tue Oct 30, 2012 6:13 pm

Plorkyeran wrote:The latest build at http://plorkyeran.com/aegisub/ now has a pretty basic initial take on the split editbox - when it's enabled, the top half of the edit box shows the text the line had when it was first selected, and there's buttons to clear the line and to revert the line to what's shown in the top half (there's currently no default hotkeys for these buttons, but you can add your own). I'm looking for feedback on whether or not something along these general lines is something people would find useful, and what needs to be added to make it work well for you.


I'd like to try it out, but Windumb or Mac builds are useless for me. If you don't want to provide Linux builds, could you at least provide the source package you did build from? I could then build it and provide packages for others (ordinary packages at least, rather than distribution packages).
Linux x64 packages for Aegisub 3 (3.2.0 final - 2014-07-29)
http://erokawaii.org/linux
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby Plorkyeran » Tue Oct 30, 2012 7:06 pm

https://github.com/tgoyne/aegisub/tags

All of the recent builds are built from a clean checkout of the relevant tag.
User avatar
Plorkyeran
Developer
 
Posts: 126
Joined: Fri Oct 22, 2010 6:23 pm

Re: Autocommit in the edit box

Unread postby Shimapan » Wed Oct 31, 2012 3:18 am

Done! ;D
Linux x64 build of the latest dev release 7144 is here:
viewtopic.php?f=10&t=65594

I've also built packages for Aegisub 2.1.9 and wxWidgets 2.9 (required for Aegisub 3).
I've modified the Aegisub 3 installation so it can be installed alongside the Aegisub 2 package. I've also changed the Aegisub 3 icons (all sizes) as well as the scalable svg icon for better distinction and added the icon sizes 128x128 and 256x256 (see below for the latter).
Here's the desktop folder with the changes and the new icons.
http://www42.zippyshare.com/v/86352175/file.html

Additionally required changes in the configure script:
Line 14785: change "aegisub.desktop" to "aegisub3.desktop"
Line 15496: same here (two times)

Image
Linux x64 packages for Aegisub 3 (3.2.0 final - 2014-07-29)
http://erokawaii.org/linux
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby Shimapan » Thu Nov 01, 2012 12:31 am

Tried out the split editbox in r7144 now ;D
Good so far, but there are some things to note:

  • The "Delete" button would be much more useful if it would only delete the translateable text, leaving anything in curly braces {...} alone, rather than deleting anything.
  • It would be great if there was a checkbox that, when checked, automatically deletes the translateable text in the lower box upon selecting a line in the grid. You could place that checkbox to the right of the "Insert original" button.
  • The "Revert" button is untranslated. It should be "Wiederherstellen" in German.
btw: During my first try, I had video and audio already loaded and had selected a line in the grid, but when I checked the "Split" checkbox, Aegisub instantly crashed. Crashlog is below. When I restarted Aegisub right after that, loaded the same audio and video again and then checked the "Split" checkbox, it worked fine.

Code: Select all
VER - r7144
FTL - Beginning stack dump for "Fatal exception":
000 - 0x7f120f0ce0bc:
001 - 0x7f120ca66cb0:
002 - 0x7f120befb41b:
003 - 0x7f120bf172d4:
004 - 0x7f120bef8176:
005 - 0x7f120b843140: g_closure_invoke
006 - 0x7f120b854550:
007 - 0x7f120b85c4af: g_signal_emit_valist
008 - 0x7f120b85cb50: g_signal_emit_by_name
009 - 0x7f120bf1cae2:
010 - 0x7f120b84a644: g_object_set_valist
011 - 0x7f120bf025fa: gtk_text_buffer_create_tag
012 - 0x7f120fae49fa:
013 - 0x7f120fae51ca: wxTextCtrl::DoSetValue(wxString const&, int)
014 - 0x5ba439:
015 - 0x586251:
016 - 0x7f120ef9b47f: wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
017 - 0x7f120f0e7122: wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
018 - 0x7f120f0e74b6: wxEvtHandler::SearchDynamicEventTable(wxEvent&)
019 - 0x7f120f0e7536: wxEvtHandler::TryHereOnly(wxEvent&)
020 - 0x7f120f0e75f3: wxEvtHandler::ProcessEventLocally(wxEvent&)
021 - 0x7f120f0e7655: wxEvtHandler::ProcessEvent(wxEvent&)
022 - 0x7f120f0e73c7: wxEvtHandler::SafelyProcessEvent(wxEvent&)
023 - 0x7f120faae9ff:
024 - 0x7f120b843407:
025 - 0x7f120b85bdf6: g_signal_emit_valist
026 - 0x7f120b85c642: g_signal_emit
027 - 0x7f120bf2ea83:
028 - 0x7f120b843407:
029 - 0x7f120b85bdf6: g_signal_emit_valist
030 - 0x7f120b85c642: g_signal_emit
031 - 0x7f120bf2e3dd:
032 - 0x7f120b843407:
033 - 0x7f120b85bdf6: g_signal_emit_valist
034 - 0x7f120b85c642: g_signal_emit
035 - 0x7f120bdc1869:
036 - 0x7f120be6a599:
037 - 0x7f120b843140: g_closure_invoke
038 - 0x7f120b8542d0:
039 - 0x7f120b85c0cb: g_signal_emit_valist
040 - 0x7f120b85c642: g_signal_emit
041 - 0x7f120bf8395e:
042 - 0x7f120be68934: gtk_propagate_event
043 - 0x7f120be68c8b: gtk_main_do_event
044 - 0x7f120baddd7c:
045 - 0x7f120ade0ab5: g_main_context_dispatch
046 - 0x7f120ade0de8:
047 - 0x7f120ade11e2: g_main_loop_run
048 - 0x7f120be67c77: gtk_main
049 - 0x7f120fa5d02a: wxGUIEventLoop::Run()
050 - 0x7f120ef9f121: wxAppConsoleBase::MainLoop()
051 - 0x585b78:
052 - 0x7f120f01b205: wxEntry(int&, wchar_t**)
053 - 0x43bfd2:
054 - 0x7f120c6b976d: __libc_start_main
055 - 0x43d959:
End of stack dump.
Linux x64 packages for Aegisub 3 (3.2.0 final - 2014-07-29)
http://erokawaii.org/linux
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby Shimapan » Thu Nov 01, 2012 3:06 pm

Just had another Aegisub crash when trying to turn on the split editbox with video and audio already loaded. Crash log is identical to the one above, so it's probably the same bug.
Linux x64 packages for Aegisub 3 (3.2.0 final - 2014-07-29)
http://erokawaii.org/linux
User avatar
Shimapan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 143
Joined: Tue Oct 02, 2012 3:38 pm
Location: Germany

Re: Autocommit in the edit box

Unread postby innocenat » Thu Nov 08, 2012 3:36 pm

You probably have heard this millions of time in #aegisub, but if the splitted box is styled the same as the main box (or better, allow us to style it differently). And config option to either enable collapsing of ASS tag in splitted box would be useful too.

Not really related to split box, but if it is possible to load second file into splitted box (the time are all matched of course) would be useful for TLCing against source language too.
innocenat
Comic Sans MS
Comic Sans MS
 
Posts: 3
Joined: Thu Nov 08, 2012 3:33 pm

Next

Return to Announcements

Who is online

Users browsing this forum: No registered users and 2 guests