avidemux2
avidemux2 copied to clipboard
Compact GUI design, new features, combined widgets, editable text fields, movable docks, and more...
Hello, I'll be really grateful to anyone who could give me some feedback about this design.
Thank you ;)
Summary
-
Can undock, dock, and move Navigation, Codec, and Tool Bar.
-
Custom title bar in dock windows with mnemonic shortcuts to dock, undock.
-
Integrates smart buttons in editable text fields. Can edit times directly.
-
Buttons to open a dialog to edit Current Time, Marker A and B.
-
Buttons to Save Script and Run Project/Script.
-
Also buttons to Jump/Reset Marker A/B, Append Media, Cut, Copy, Paste, Undo, Redo.
-
Grayed out Reset Marker A/B buttons suggest when a marker is reset, and vice versa.
-
Can hide sets of components and save their visible state as preferences.
-
Views->Toolbars is accessible as context menu on Menu Bar, Tool Bar, Navigation, and Codec widgets to hide components.
-
And tooltips all the way...
NEW GUI
CURRENT GUI
Notice how the Selection Duration is truncated... Which is what pushed me to modify the GUI and add new features...
IMHO this is a no-go, as a whole
what i really like:
- the idea of undocking the widget, but very dislike the added Float and Close buttons.
- the editable time entries (without the many icons)
what i really dislike:
- changes so much, i can't use the application
- feels cluttered
- light theme is ugly
- new icons looks incompatible with the existing ones
found bug:
- when app is minimized, it looses the codec and navigation widgets
Did you try to run it, did you look at the code and the new features?
all my oppinion are based on trying the built app meanwhile found an another bug: if you click on Marker B box, then somewhere else, Marker B will change on its own if i select a time entry, i cannot leave it by any key (i would prefer Esc) the UI minimum vertical size prohibit it to fit on still common 1368x768 laptop displays
Thanks for taking the time to review the new features ;)
meanwhile found an another bug: if you click on Marker B box, then somewhere else, Marker B will change on its own
Can you be more precise, please? I can't reproduce that... I did this:
- open a video (keep it paused);
- just select the Marker B text field;
- w/o changing a thing in B, click another field, or hit Tab, or hit Enter.
As of now, working keys are Enter to confirm the text field edit staying on the field, and Tab to confirm but changing focus right after.
if i select a time entry, i cannot leave it by any key (i would prefer Esc)
Your suggestion to use Esc is a pretty good idea... leave the field right? What do you think?
What really happens in the backhand is that the time you enter is processed to find a time matching a frame (the "real" time). Hence, the time you set is not the final time. When you confirm, with Enter, Tab, or by changing focus, the real time is then set (replacing the edited time if that doesn't match any frame). This is like when going to the next frame with the button Go to next frame
.
I bet you already know that to have frame cuts, rather than keyframe ones, you need to select encoders. I was going mad without realizing I didn't set the encoding options to have precise cuts...
the UI minimum vertical size prohibit it to fit on still common 1368x768 laptop displays
I guess the sizing can be optimized, and, in extremis, the docks can be detached to gain some space.
Components are also hideable, like the status bar, taking some space on the vertical axis.
meanwhile found an another bug: if you click on Marker B box, then somewhere else, Marker B will change on its own
Can you be more precise, please? I can't reproduce that...
- select the Marker B text field
- then select the Marker A text field
this changes Marker B here
Your suggestion to use Esc is a pretty good idea... leave the field right? What do you think?
it should leave the widget on pressing Esc, otherwise can't use any keyboard shortcuts
taking a baby step, something like this should be done first (mockup screenshot)
(btw i'm just a nobody here, so i can only give my opinion ;) )
select the Marker B text field
then select the Marker A text field
this changes Marker B here
I can't reproduce the problem... I tried with the mouse cursor and by hitting tab... Would you take a video too, please?
https://user-images.githubusercontent.com/6450450/227369640-f0553343-d810-45b4-8587-3250658056bc.mov
https://user-images.githubusercontent.com/50839734/227371860-9e7b0385-2b2d-4854-972d-81bb27e9b04f.mp4
Thanks. I'm trying with different videos... maybe I can get the same behavior...
What system are you using? Have you tried disabling/enabling the Swap markers
option?
Thank you for the huge amount of thought put into this POC. Making the time display editable was on my wishlist for quite a while.
The code doesn't build with Qt6 and renaming navButtonsLayout has broken compilation on macOS specifically, but fixing all the obsolete QRegExp stuff, gone since Qt6, was luckily straightforward, so that now I am able to play with it.
I need to spend some time with the new concept to evaluate it beyond the immediate knee-jerk rejection (I don't like cramped interfaces filled with small hit targets).
Below the build fix for reference.
index d1b33286f..3f52795ec 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
@@ -143,7 +143,13 @@ static bool uiIsMaximized=false;
static bool needsResizing=false;
-static QRegExp timeRegExp("^([0-9]{2}):([0-5][0-9]):([0-5][0-9])\\.([0-9]{3})$");
+static
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ timeRegExp("^([0-9]{2}):([0-5][0-9]):([0-5][0-9])\\.([0-9]{3})$");
static QAction *findAction(std::vector<MenuEntry> *list, Action action);
static QAction *findActionInToolBar(QToolBar *tb, Action action);
@@ -714,7 +720,7 @@ MainWindow::MainWindow(const vector<IScriptEngine*>& scriptEngines) : _scriptEng
#endif
#ifdef __APPLE__
- ui.navButtonsLayout->setSpacing(2);
+ ui.controlsWidgetLayout->setSpacing(2);
// Qt upscales 2x sized icons in the toolbar, making them huge and pixelated in HiDPI conditions, WTF?
ui.toolBar->setIconSize(QSize(24,24));
#endif
@@ -780,7 +786,11 @@ MainWindow::MainWindow(const vector<IScriptEngine*>& scriptEngines) : _scriptEng
connect(ui.spinBox_TimeValue,SIGNAL(valueChanged(int)),this,SLOT(timeChanged(int)));
connect(ui.spinBox_TimeValue, SIGNAL(editingFinished()), this, SLOT(timeChangeFinished()));
#if 1 /* disable if read-only */
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
QRegExpValidator *timeValidator = new QRegExpValidator(timeRegExp, this);
+#else
+ QRegularExpressionValidator *timeValidator = new QRegularExpressionValidator(timeRegExp, this);
+#endif
ui.currentTime->setValidator(timeValidator);
ui.currentTime->setInputMask("99:99:99.999");
ui.selectionMarkerA->setValidator(timeValidator);
@@ -3727,14 +3737,29 @@ admUITaskBarProgress *UI_getTaskBarProgress()
*/
bool UI_getCurrentTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
{
- QRegExp rx(timeRegExp);
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ rx(timeRegExp);
// Previous state
uint64_t pts = admPreview::getCurrentPts();
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
if(rx.exactMatch(WIDGET(currentTime)->text()))
+#else
+ QRegularExpressionMatch match = rx.match(WIDGET(currentTime)->text());
+ if(match.hasMatch())
+#endif
{
- QStringList results = rx.capturedTexts();
+ QStringList results =
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ rx.capturedTexts();
+#else
+ match.capturedTexts();
+#endif
*hh = results.at(1).toInt(NULL, 10);
*mm = results.at(2).toInt(NULL, 10);
@@ -3763,15 +3788,30 @@ bool UI_getCurrentTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
*/
bool UI_getMarkerA(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
{
- QRegExp rx(timeRegExp);
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ rx(timeRegExp);
// Previous state
uint64_t ptsA = video_body->getMarkerAPts();
uint64_t ptsB = video_body->getMarkerBPts();
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
if(rx.exactMatch(WIDGET(selectionMarkerA)->text()))
+#else
+ QRegularExpressionMatch match = rx.match(WIDGET(selectionMarkerA)->text());
+ if(match.hasMatch())
+#endif
{
- QStringList results = rx.capturedTexts();
+ QStringList results =
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ rx.capturedTexts();
+#else
+ match.capturedTexts();
+#endif
*hh = results.at(1).toInt(NULL, 10);
*mm = results.at(2).toInt(NULL, 10);
@@ -3800,15 +3840,30 @@ bool UI_getMarkerA(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
*/
bool UI_getMarkerB(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
{
- QRegExp rx(timeRegExp);
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ rx(timeRegExp);
// Previous state
uint64_t ptsA = video_body->getMarkerAPts();
uint64_t ptsB = video_body->getMarkerBPts();
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
if(rx.exactMatch(WIDGET(selectionMarkerB)->text()))
+#else
+ QRegularExpressionMatch match = rx.match(WIDGET(selectionMarkerB)->text());
+ if(match.hasMatch())
+#endif
{
- QStringList results = rx.capturedTexts();
+ QStringList results =
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ rx.capturedTexts();
+#else
+ match.capturedTexts();
+#endif
*hh = results.at(1).toInt(NULL, 10);
*mm = results.at(2).toInt(NULL, 10);
@@ -3837,15 +3892,30 @@ bool UI_getMarkerB(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
*/
bool UI_getSelectionTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
{
- QRegExp rx(timeRegExp);
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ rx(timeRegExp);
// Previous state
uint64_t ptsA = video_body->getMarkerAPts();
uint64_t ptsB = video_body->getMarkerBPts();
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
if(rx.exactMatch(WIDGET(selectionDuration)->text()))
+#else
+ QRegularExpressionMatch match = rx.match(WIDGET(selectionDuration)->text());
+ if(match.hasMatch())
+#endif
{
- QStringList results = rx.capturedTexts();
+ QStringList results =
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ rx.capturedTexts();
+#else
+ match.capturedTexts();
+#endif
*hh = results.at(1).toInt(NULL, 10);
*mm = results.at(2).toInt(NULL, 10);
@@ -3875,14 +3945,29 @@ bool UI_getSelectionTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
bool UI_getTotalTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms)
{
bool status = true;
- QRegExp rx(timeRegExp);
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ QRegExp
+#else
+ QRegularExpression
+#endif
+ rx(timeRegExp);
// Previous state
uint64_t tot = video_body->getVideoDuration();
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
if(rx.exactMatch(WIDGET(totalTime)->text()))
+#else
+ QRegularExpressionMatch match = rx.match(WIDGET(totalTime)->text());
+ if(match.hasMatch())
+#endif
{
- QStringList results = rx.capturedTexts();
+ QStringList results =
+#if QT_VERSION < QT_VERSION_CHECK(5,1,0)
+ rx.capturedTexts();
+#else
+ match.capturedTexts();
+#endif
*hh = results.at(1).toInt(NULL, 10);
*mm = results.at(2).toInt(NULL, 10);
The code doesn't build with Qt6 and renaming navButtonsLayout has broken compilation on macOS specifically, but fixing all the obsolete QRegExp stuff, gone since Qt6, was luckily straightforward, so that now I am able to play with it.
I feel sorry to hear that. Currently I'm working with Qt 5.15.8 on Gentoo GNU/Linux. Tell me if I can be of any help.
I need to spend some time with the new concept to evaluate it beyond the immediate knee-jerk rejection (I don't like cramped interfaces filled with small hit targets).
I was trying to sort out a configuration giving some visual hints and control over tedious tuning and adjustments, with the objective of rearrangeable widgets and togglable features.
I'm debugging a problem highlighted by @szlldm right now, I hope to get it fixed soon.
Below the build fix for reference
Thanks.
By the way, icons, buttons, styles, etc. are just a mean to focus on the infrastructure, pushing to implement useful features that then can be expressed and used in any other creative/conceptual way.
select the Marker B text field
then select the Marker A text field
this changes Marker B here
@szlldm I've an insight on the problem now, thank you so much for your help ;)
@eumagga0x2a Hi, there are different fixes in the latest commits. The direct editing feature of the time fields got more precision. There's a new class overloading QLineEdit
to manage the time fields and to confine regular expressions to one location only. I sincerely hope that you could enjoy some of the new additions ;) Let me know, thanks.
Editing the total time prepares a selection to cut a video to a specific length, the marker A is placed at the new length, and B after the last frame.
Editing the selection duration will narrow the selection from A to B, moving B toward A, to the left.
Thank you, I've finally found a few hours to spend with the new GUI on Linux and on Windows 10, but unfortunately didn't have time to debug the functional issues, mainly the direct time input being broken (probably regressed by the newly added changes). I wonder how the new concept works with multiple displays, with detached dock widgets placed on a different display than the main window, something I cannot test at all. Everything below reflects just my impression and is entirely IMHO:
- Multiple similar / uniform input fields strain the eye which has to identify the right one quickly. The brain has to process quite subtle visual cues, causing each time a brief but persistent moment of confusion.
- The font imitating an LCD clock, used on Linux and macOS (but not on Windows) for time display was forced by me over the heads of users protesting against its poor legibility for the specific reason of avoiding high frequency shifting of the digits during playback. With multiple fields, used for static or very seldom changing time values, the poor legibility of this font bites myself.
- I don't like the very idea of allowing "ordinary" users to set selection start and end to arbitrary time values (I understand that advanced users can do exactly that via scripting). Accepting input and then immediately replacing it with a corrected value feels very confusing and may be outright infuriating.
- Tweaking QPalette::Window color results in the "Light" theme being much darker than the default theme on Windows, makes the application look immediately alien in a desktop environment.
- Short mouse travel distances come at a cost of a very unbalanced / purely utilitarian appearance.
- I discourage using preferences for stuff specific to Qt GUI, there are QSettings for that.
- The huge scope of changes makes it hard to isolate desired modifications and additions and would shift the focus for long time to Qt GUI structure and features while IMVHO the real burning GUI-related issues exist below, like...
- OpenGL being finally totally broken on Linux after recent Qt6 updates and OpenGL performance greatly worsened since Qt 5.12 IIRC
- Wayland support missing
- OpenGL being deprecated and phased out on macOS and Avidemux losing the only accelerated video display on that platform
- Right and bottom part of video display is cut off if screen size is insufficient, the complete picture cannot be accessed at 100% zoom in such circumstances (make the video frame scrollable?)
- Identifying and solving issues running Avidemux in multi-screen setups.
@eumagga0x2a Hi, thank you very much for all your considerations. I'm currently implementing a way to allow docking to a diffrent area and undocking w/o showing a title bar when a widget is docked, if it is possible, and I'll read your points one by one thoroughly as soon as my mind is at ease. May I ask you for pictures showing interface differences from a GNU/Linux platform? I you prefer to use an email, my address is in the commits.
Thank you, I've finally found a few hours to spend with the new GUI on Linux and on Windows 10, but unfortunately didn't have time to debug the functional issues, mainly the direct time input being broken (probably regressed by the newly added changes).
I see that now there are merge conflicts. I still have to look into what have been changed since my PR. I did a lot of labeling on gui2.ui
, and I don't know if is this the problem... Right now, I'm focusing my energies to fine-tune new features, hoping that they could be helpful to the community in any way possible, looking back at what I based my work on may put a strain on this. I'm sure that you understand that going on refining the PR is easier than over thinking about what is changed since then. Anyway, I'm open to suggestions on what could be a better direction to take.
I wonder how the new concept works with multiple displays, with detached dock widgets placed on a different display than the main window, something I cannot test at all.
Allow to make use of multiple displays is one of my aims. I opened the PR as soon as I had something to start a discussion. I can modify my perspective only by sharing concepts, and for this I thank you. The interface needs a lot of polishing, I'm building a TODO list while coding. For instance, dock widgets decoration when floating and keeping them streamline when docked.
Expect new commits soon to this PR. I believe that first-hand experience is by comparison the best way to conceptualize and give birth to new ideas. Some issues may be just aesthetic related, and easy addressable once the infrastructure they build on is solid.
Can you still compile this PR?
I see that now there are merge conflicts.
I'm sorry for the inconvenience, the work on the status bar added by szlldm prior to this PR needs to be continued until it has reached some presentable shape and official nightly builds can be offered to the public. I would like to avoid blocking the project for a prolonged period of time beyond the already unsightly state of affairs following the move to FFmpeg 5.x which has left VA-API hw accel support in a half-broken state.
May I ask you for pictures showing interface differences from a GNU/Linux platform?
Will do soon.
I keep your PR locally on a separate branch, so it compiles, yes. It just doesn't pick up any ongoing work in other areas of the application.
@eumagga0x2a Hi, the context menu and dock widgets decoration are almost done. Rotating a custom title bar properly was not so easy to tweak...
FYI: here are some of the promised screenshots of the new GUI on non-Linux platforms, here showing an empty Avidemux window on Windows 10 and on macOS Monterey with the corresponding default theme.