diff --git a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp index 9e26ffec35..d3489a7dce 100644 --- a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp +++ b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp @@ -154,6 +154,26 @@ void UI_SetCurrentFormat( uint32_t f ) { cliFormat=f; } +bool UI_getCurrentTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + return false; +} +bool UI_getMarkerA(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + return false; +} +bool UI_getMarkerB(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + return false; +} +bool UI_getSelectionTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + return false; +} +bool UI_getTotalTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + return false; +} void UI_setCurrentTime(uint64_t x) { diff --git a/avidemux/common/ADM_commonUI/DIA_gototime.cpp b/avidemux/common/ADM_commonUI/DIA_gototime.cpp index 94aeb6a4e1..76df1c6556 100644 --- a/avidemux/common/ADM_commonUI/DIA_gototime.cpp +++ b/avidemux/common/ADM_commonUI/DIA_gototime.cpp @@ -25,7 +25,7 @@ * @param ms * @return */ -uint8_t DIA_gotoTime(uint32_t *hh, uint32_t *mm, uint32_t *ss,uint32_t *ms) +uint8_t DIA_gotoTime(uint32_t *hh, uint32_t *mm, uint32_t *ss,uint32_t *ms, const char *title) { uint32_t v=(*hh)*3600*1000+(*mm)*60*1000+(*ss)*1000+*ms; uint32_t max=(uint32_t)(video_body->getVideoDuration()/1000); @@ -33,11 +33,15 @@ uint32_t max=(uint32_t)(video_body->getVideoDuration()/1000); diaElemTimeStamp eh(&v,QT_TRANSLATE_NOOP("adm","TimeStamp:"),0,max); diaElem *allWidgets[]={&eh}; - if(!diaFactoryRun(QT_TRANSLATE_NOOP("adm","Go to Time"),1,allWidgets)) return 0; + if(!diaFactoryRun(QT_TRANSLATE_NOOP("adm", title),1,allWidgets)) return 0; // ms2time(v,hh,mm,ss,ms); return 1; +} +uint8_t DIA_gotoTime(uint32_t *hh, uint32_t *mm, uint32_t *ss,uint32_t *ms) +{ + return DIA_gotoTime(hh, mm, ss, ms, "Go to Time"); } // EOF diff --git a/avidemux/common/ADM_commonUI/DIA_prefs.cpp b/avidemux/common/ADM_commonUI/DIA_prefs.cpp index 1d4e58036a..14d992a0a4 100644 --- a/avidemux/common/ADM_commonUI/DIA_prefs.cpp +++ b/avidemux/common/ADM_commonUI/DIA_prefs.cpp @@ -48,6 +48,14 @@ uint32_t olddevice,newdevice; uint32_t render; bool useSwap=0; +bool showExtraButtons=0; +bool showPTSToolTips=0; + +bool isCurrentTimeFieldEditable=0; +bool isTotalTimeFieldEditable=0; +bool isSelectionTimeFieldEditable=0; +bool isMarkerATimeFieldEditable=0; +bool isMarkerBTimeFieldEditable=0; uint32_t lavcThreads=0; uint32_t encodePriority=2; @@ -261,6 +269,20 @@ std::string currentSdlDriver=getSdlDriverName(); // SWAP A&B if A>B if(!prefs->get(FEATURES_SWAP_IF_A_GREATER_THAN_B, &useSwap)) useSwap=0; + if(!prefs->get(FEATURES_TIME_FIELDS_EXTRA_BUTTONS, &showExtraButtons)) + showExtraButtons=0; + if(!prefs->get(FEATURES_PTS_TIMINGS_TOOLTIPS, &showPTSToolTips)) + showPTSToolTips=0; + if(!prefs->get(FEATURES_CURRENT_TIME_FIELD_EDITABLE, &isCurrentTimeFieldEditable)) + isCurrentTimeFieldEditable=0; + if(!prefs->get(FEATURES_TOTAL_TIME_FIELD_EDITABLE, &isTotalTimeFieldEditable)) + isTotalTimeFieldEditable=0; + if(!prefs->get(FEATURES_SELECTION_TIME_FIELD_EDITABLE, &isSelectionTimeFieldEditable)) + isSelectionTimeFieldEditable=0; + if(!prefs->get(FEATURES_MARKER_A_TIME_FIELD_EDITABLE, &isMarkerATimeFieldEditable)) + isMarkerATimeFieldEditable=0; + if(!prefs->get(FEATURES_MARKER_B_TIME_FIELD_EDITABLE, &isMarkerBTimeFieldEditable)) + isMarkerBTimeFieldEditable=0; // Get level of message verbosity prefs->get(MESSAGE_LEVEL,&msglevel); // Downmix default @@ -279,6 +301,22 @@ std::string currentSdlDriver=getSdlDriverName(); diaElemToggle swapMarkers(&useSwap,QT_TRANSLATE_NOOP("adm","_Swap markers if marker A is set past marker B or marker B before A in video")); diaElemToggle checkForUpdate(&doAutoUpdate,QT_TRANSLATE_NOOP("adm","_Check for new release")); + // Time Fields + diaElemFrame frameTimeFields(QT_TRANSLATE_NOOP("adm","Time Fields")); + diaElemToggle extraButtons(&showExtraButtons,QT_TRANSLATE_NOOP("adm","Show e_xtra buttons in time fields")); + diaElemToggle ptsToolTips(&showPTSToolTips,QT_TRANSLATE_NOOP("adm","Show _precision timings in time fields tooltips")); + diaElemToggle currentTimeFieldEdits(&isCurrentTimeFieldEditable,QT_TRANSLATE_NOOP("adm","Allow to keyboard edit the c_urrent time field")); + diaElemToggle totalTimeFieldEdits(&isTotalTimeFieldEditable,QT_TRANSLATE_NOOP("adm","Allow to keyboard edit the t_otal time field")); + diaElemToggle selectionTimeFieldEdits(&isSelectionTimeFieldEditable,QT_TRANSLATE_NOOP("adm","Allow to keyboard edit the selection _duration field")); + diaElemToggle markerATimeFieldEdits(&isMarkerATimeFieldEditable,QT_TRANSLATE_NOOP("adm","Allow to keyboard edit the Marker _A time field")); + diaElemToggle markerBTimeFieldEdits(&isMarkerBTimeFieldEditable,QT_TRANSLATE_NOOP("adm","Allow to keyboard edit the Marker _B time field")); + frameTimeFields.swallow(&extraButtons); + frameTimeFields.swallow(&ptsToolTips); + frameTimeFields.swallow(¤tTimeFieldEdits); + frameTimeFields.swallow(&totalTimeFieldEdits); + frameTimeFields.swallow(&selectionTimeFieldEdits); + frameTimeFields.swallow(&markerATimeFieldEdits); + frameTimeFields.swallow(&markerBTimeFieldEdits); diaElemFrame frameSimd(QT_TRANSLATE_NOOP("adm","SIMD")); @@ -539,7 +577,7 @@ std::string currentSdlDriver=getSdlDriverName(); //-- #define NB_ELEM(x) sizeof(x)/sizeof(diaElem *) /* User Interface */ - diaElem *diaUser[]={&menuMessage, &menuLanguage, &resetEncoder, &enableAltShortcuts, &swapUpDownKeys, &swapMouseWheel, &swapMarkers, &checkForUpdate}; + diaElem *diaUser[]={&menuMessage, &menuLanguage, &resetEncoder, &enableAltShortcuts, &swapUpDownKeys, &swapMouseWheel, &swapMarkers, &checkForUpdate, &frameTimeFields}; diaElemTabs tabUser(QT_TRANSLATE_NOOP("adm","User Interface"),NB_ELEM(diaUser),diaUser); /* Automation */ @@ -812,6 +850,21 @@ std::string currentSdlDriver=getSdlDriverName(); // Auto swap A/B vs reset the other marker prefs->set(FEATURES_SWAP_IF_A_GREATER_THAN_B, useSwap); + // Show extra buttons in time fields + prefs->set(FEATURES_TIME_FIELDS_EXTRA_BUTTONS, showExtraButtons); + // Show precision timings in time fields tooltips + prefs->set(FEATURES_PTS_TIMINGS_TOOLTIPS, showPTSToolTips); + // Allow to keyboard edit the current time field + prefs->set(FEATURES_CURRENT_TIME_FIELD_EDITABLE, isCurrentTimeFieldEditable); + // Allow to keyboard edit the total time field + prefs->set(FEATURES_TOTAL_TIME_FIELD_EDITABLE, isTotalTimeFieldEditable); + // Allow to keyboard edit the selection duration field + prefs->set(FEATURES_SELECTION_TIME_FIELD_EDITABLE, isSelectionTimeFieldEditable); + // Allow to keyboard edit the Marker A time field + prefs->set(FEATURES_MARKER_A_TIME_FIELD_EDITABLE, isMarkerATimeFieldEditable); + // Allow to keyboard edit the Marker B time field + prefs->set(FEATURES_MARKER_B_TIME_FIELD_EDITABLE, isMarkerBTimeFieldEditable); + // prefs->set(MESSAGE_LEVEL,msglevel); // Discard changes to output config on video load diff --git a/avidemux/common/ADM_commonUI/GUI_ui.h b/avidemux/common/ADM_commonUI/GUI_ui.h index 0293a7d064..2c5e9c4d89 100644 --- a/avidemux/common/ADM_commonUI/GUI_ui.h +++ b/avidemux/common/ADM_commonUI/GUI_ui.h @@ -5,6 +5,11 @@ void UI_updateFrameCount(uint32_t curFrame); void UI_setFrameCount(uint32_t curFrame,uint32_t total); +bool UI_getCurrentTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); +bool UI_getMarkerA(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); +bool UI_getMarkerB(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); +bool UI_getSelectionTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); +bool UI_getTotalTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); void UI_setCurrentTime(uint64_t pts); void UI_setTotalTime(uint64_t curTime); void UI_setSegments(uint32_t numOfSegs, uint64_t * segPts); diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h index acfdba9e6b..55ad3947a7 100644 --- a/avidemux/common/ADM_commonUI/myOwnMenu.h +++ b/avidemux/common/ADM_commonUI/myOwnMenu.h @@ -34,7 +34,7 @@ typedef struct #ifdef MENU_DECLARE static const MenuEntry _myMenuFile[] = { {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Open"), NULL,ACT_OPEN_VIDEO, MKICON(fileopen),"Ctrl+O",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Append"), NULL,ACT_APPEND_VIDEO, NULL,"Ctrl+A",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Append"), NULL,ACT_APPEND_VIDEO, MKICON(append),"Ctrl+A",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Save"), NULL,ACT_SAVE_VIDEO, MKICON(filesave),"Ctrl+S",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Queue"), NULL,ACT_SAVE_QUEUE, NULL,"Ctrl+U",0}, {MENU_SUBMENU,QT_TRANSLATE_NOOP("adm","Save as Image"), NULL,ACT_DUMMY, NULL,NULL,0}, @@ -65,22 +65,24 @@ static const MenuEntry _myMenuRecent[] = { std::vector myMenuRecent(_myMenuRecent, _myMenuRecent + sizeof(_myMenuRecent) / sizeof(_myMenuRecent[0])); static const MenuEntry _myMenuEdit[] = { - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Undo"), NULL,ACT_Undo, NULL,"Ctrl+Z",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Redo"), NULL,ACT_Redo, NULL,"Ctrl+Y",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Undo"), NULL,ACT_Undo, MKICON(undo),"Ctrl+Z",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Redo"), NULL,ACT_Redo, MKICON(redo),"Ctrl+Y",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Edit"), NULL,ACT_ResetSegments, NULL,NULL,0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Cut"), NULL,ACT_Cut, NULL,"Ctrl+X",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Copy"), NULL,ACT_Copy, NULL,"Ctrl+C",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"), NULL,ACT_Paste, NULL,"Ctrl+V",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Cut"), NULL,ACT_Cut, MKICON(cut),"Ctrl+X",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Copy"), NULL,ACT_Copy, MKICON(copy),"Ctrl+C",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"), NULL,ACT_Paste, MKICON(paste),"Ctrl+V",0}, #ifdef __APPLE__ - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete, NULL,"Backspace",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete, MKICON(delete_selection),"Backspace",0}, #else - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete, NULL,"Delete",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete, MKICON(delete_selection),"Delete",0}, #endif {MENU_SEPARATOR,"-",NULL,ACT_DUMMY,NULL,NULL,1}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"), NULL,ACT_MarkA, MKICON(markA), "Ctrl+PgUp",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"), NULL,ACT_MarkB, MKICON(markB), "Ctrl+PgDown",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Marker A"), NULL,ACT_ResetMarkerA, NULL,"Ctrl+Shift+PgUp",0}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Marker B"), NULL,ACT_ResetMarkerB, NULL,"Ctrl+Shift+PgDown",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Edit Marker A"), NULL,ACT_SelectMarkerA, MKICON(time), "Ctrl+Alt+PgUp",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Edit Marker B"), NULL,ACT_SelectMarkerB, MKICON(time), "Ctrl+Alt+PgDown",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Marker A"), NULL,ACT_ResetMarkerA, MKICON(reset_markA),"Ctrl+Shift+PgUp",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Marker B"), NULL,ACT_ResetMarkerB, MKICON(reset_markB),"Ctrl+Shift+PgDown",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Markers"), NULL,ACT_ResetMarkers, NULL,"Ctrl+Home",0}, {MENU_SEPARATOR,"-",NULL,ACT_DUMMY,NULL,NULL,1}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Pr&eferences"), NULL,ACT_PREFERENCES, NULL,NULL,0}, @@ -146,7 +148,7 @@ static const MenuEntry _myMenuGo[] = { {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Go To Marker A"), NULL,ACT_GotoMarkA, MKICON(goMarkA), "PgUp",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Go To Marker B"), NULL,ACT_GotoMarkB, MKICON(goMarkB), "PgDown",0}, {MENU_SEPARATOR,"-",NULL,ACT_DUMMY, NULL,NULL,1}, - {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Go To Time"), NULL,ACT_SelectTime, NULL, "Ctrl+T",0}, + {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Go To Time"), NULL,ACT_SelectTime, MKICON(time), "Ctrl+T",0}, {MENU_SEPARATOR,"-",NULL,ACT_DUMMY, NULL,NULL,1}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Backward 1 second"), NULL,ACT_Back1Second, MKICON(backward1s), "Shift+Left",0}, {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Forward 1 second"), NULL,ACT_Forward1Second, MKICON(forward1s), "Shift+Right",0}, diff --git a/avidemux/common/gui_action.names b/avidemux/common/gui_action.names index 428ae884be..515c8ccfdf 100644 --- a/avidemux/common/gui_action.names +++ b/avidemux/common/gui_action.names @@ -12,7 +12,14 @@ ACT(StopAvi) ACT(STAGED_BEGIN) ACT(SetHDRConfig) ACT(SetPostProcessing) +ACT(GetTime) +ACT(GetMarkerA) +ACT(GetMarkerB) +ACT(GetSelection) +ACT(GetTotal) ACT(SelectTime) +ACT(SelectMarkerA) +ACT(SelectMarkerB) ACT(STAGED_END) //----- SAVE ----- @@ -48,6 +55,8 @@ ACT(Goto) ACT(GotoTime) ACT(Begin) ACT(End) +ACT(ChangeMarkerA) +ACT(ChangeMarkerB) ACT(GotoMarkA) ACT(GotoMarkB) ACT(Scale) diff --git a/avidemux/common/gui_navigate.cpp b/avidemux/common/gui_navigate.cpp index 96491d5c10..f3c628e3be 100644 --- a/avidemux/common/gui_navigate.cpp +++ b/avidemux/common/gui_navigate.cpp @@ -35,14 +35,20 @@ #include "ADM_vidMisc.h" #include "ADM_preview.h" +#include "prefs.h" + static ADMCountdown NaggingCountDown(5000); // Wait 5 sec before nagging again for cannot seek static void A_timedError(bool *first, const char *s); +extern uint8_t DIA_gotoTime(uint32_t *hh, uint32_t *mm, uint32_t *ss,uint32_t *ms, const char *title); extern uint8_t DIA_gotoTime(uint32_t *hh, uint32_t *mm, uint32_t *ss,uint32_t *ms); extern void A_setHDRConfig(void); extern void A_setPostproc(void); -static uint32_t jumpTarget[4] = {0}; +// hh:mm:ss.ms,us +static uint32_t jumpTarget[5] = {0}; +static uint32_t jumpMarkerA[5] = {0}; +static uint32_t jumpMarkerB[5] = {0}; bool GUI_infiniteForward(uint64_t pts); bool GUI_lastFrameBeforePts(uint64_t pts); @@ -65,6 +71,15 @@ void HandleAction_Staged(Action action) case ACT_SetPostProcessing: A_setPostproc(); break; + case ACT_GetTime: + { + stagedActionSuccess = 0; + // Read the time set in the UI, not the real PTS + uint32_t *t = jumpTarget; + if(UI_getCurrentTime(t,t+1,t+2,t+3,t+4)) + stagedActionSuccess = 1; + } + break; case ACT_SelectTime: { stagedActionSuccess = 0; @@ -72,10 +87,110 @@ void HandleAction_Staged(Action action) uint64_t pts = admPreview::getCurrentPts(); uint32_t *t = jumpTarget; ms2time((uint32_t)(pts/1000),t,t+1,t+2,t+3); + t[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; if (DIA_gotoTime(t,t+1,t+2,t+3)) stagedActionSuccess = 1; } break; + case ACT_GetMarkerA: + { + stagedActionSuccess = 0; + // Read the time set in the UI, not the real PTS + uint32_t *t = jumpMarkerA; + if(UI_getMarkerA(t,t+1,t+2,t+3,t+4)) + { + // Never leave the other marker uninitialized + uint64_t pts = video_body->getMarkerBPts(); + t = jumpMarkerB; + ms2time((uint32_t)(pts/1000),t,t+1,t+2,t+3); + t[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + stagedActionSuccess = 1; + } + } + break; + case ACT_GetMarkerB: + { + stagedActionSuccess = 0; + // Read the time set in the UI, not the real PTS + uint32_t *t = jumpMarkerB; + if(UI_getMarkerB(t,t+1,t+2,t+3,t+4)) + { + // Never leave the other marker uninitialized + uint64_t pts = video_body->getMarkerAPts(); + t = jumpMarkerA; + ms2time((uint32_t)(pts/1000),t,t+1,t+2,t+3); + t[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + stagedActionSuccess = 1; + } + } + break; + case ACT_SelectMarkerA: + case ACT_SelectMarkerB: + { + uint64_t pts; + uint32_t *t; + const char *DIA_title = "Set Marker A Time"; + stagedActionSuccess = 0; + // Get current marker A time + pts = video_body->getMarkerAPts(); + t = jumpMarkerA; + ms2time((uint32_t)(pts/1000),t,t+1,t+2,t+3); + t[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + // Get current marker B time + pts = video_body->getMarkerBPts(); + t = jumpMarkerB; + ms2time((uint32_t)(pts/1000),t,t+1,t+2,t+3); + t[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + // Always initialize both, but select only one + if(action == ACT_SelectMarkerA) + t = jumpMarkerA; + else + DIA_title = "Set Marker B Time"; + if (DIA_gotoTime(t,t+1,t+2,t+3,DIA_title)) + stagedActionSuccess = 1; + } + break; + case ACT_GetSelection: + { + stagedActionSuccess = 0; + // Read the time set in the UI, not the real PTS + uint32_t time[5] = {0}, *t = time; + if(UI_getSelectionTime(t,t+1,t+2,t+3,t+4)) + { + // Never leave the markers uninitialized + uint64_t ptsA = video_body->getMarkerAPts(); + uint64_t ptsB, delta = (((uint64_t)t[0]*3600+t[1]*60+t[2])*1000+t[3])*1000+t[4]; + t = jumpMarkerA; + ms2time((uint32_t)(ptsA/1000),t,t+1,t+2,t+3); + t[4] = ptsA - (uint64_t)((uint32_t)(ptsA/1000))*1000; + t = jumpMarkerB; + ptsB = ptsA + delta; + ms2time((uint32_t)(ptsB/1000),t,t+1,t+2,t+3); + t[4] = ptsB - (uint64_t)((uint32_t)(ptsB/1000))*1000; + stagedActionSuccess = 1; + } + } + break; + case ACT_GetTotal: + { + stagedActionSuccess = 0; + // Read the time set in the UI, not the real PTS + uint32_t time[5] = {0}, *t = time; + if(UI_getTotalTime(t,t+1,t+2,t+3,t+4)) + { + // Never leave the markers uninitialized + uint64_t ptsA = (((uint64_t)t[0]*3600+t[1]*60+t[2])*1000+t[3])*1000+t[4]; + uint64_t ptsB = video_body->getVideoDuration(); + t = jumpMarkerA; + ms2time((uint32_t)(ptsA/1000),t,t+1,t+2,t+3); + t[4] = ptsA - (uint64_t)((uint32_t)(ptsA/1000))*1000; + t = jumpMarkerB; + ms2time((uint32_t)(ptsB/1000),t,t+1,t+2,t+3); + t[4] = ptsB - (uint64_t)((uint32_t)(ptsB/1000))*1000; + stagedActionSuccess = 1; + } + } + break; default:break; } } @@ -86,6 +201,7 @@ void HandleAction_Staged(Action action) void HandleAction_Navigate(Action action) { static int ignore_change=0; + switch (action) { @@ -297,15 +413,146 @@ static int ignore_change=0; if(playing) break; if(!stagedActionSuccess) break; uint32_t *t = jumpTarget; - uint32_t hh,mm,ss,ms; + uint32_t hh,mm,ss,ms,us; hh = *t++; mm = *t++; ss = *t++; ms = *t; - A_jumpToTime(hh,mm,ss,ms); + us = *t+1; + A_jumpToTime(hh,mm,ss,ms); // FIXME: missing us stagedActionSuccess = 0; } break; + case ACT_ChangeMarkerA: + case ACT_ChangeMarkerB: + if(!playing && stagedActionSuccess) + { + // Selected marker A/B time + uint32_t *t = jumpMarkerA; + uint32_t *tB = jumpMarkerB; + uint32_t hh,mm,ss,ms,us; + uint64_t ptsA, ptsB; + + // Selected marker A/B time chooser + uint64_t *sel = &ptsA; + + // Total time (beyond the last frame) + uint64_t tot = video_body->getVideoDuration(); + + // Current marker A/B to verify changes + uint64_t preA = ptsA = video_body->getMarkerAPts(); + uint64_t preB = ptsB = video_body->getMarkerBPts(); + + // Backup the current time to restore it later + uint32_t time[5] = {0}; + uint64_t pts = admPreview::getCurrentPts(); + ms2time((uint32_t)(pts/1000),time,time+1,time+2,time+3); + time[4] = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + + // Jump to time to find the correct marker A/B time, then + // restore the previous current time after procesing. + while(t) + { + hh = t[0]; + mm = t[1]; + ss = t[2]; + ms = t[3]; + us = t[4]; + + // Check if outside boundaries when jumping to A/B + if(sel) + { + uint64_t x = (((uint64_t)hh*3600+mm*60+ss)*1000+ms)*1000+us; + + if(x == 0) + *sel = 0; + else if(x >= tot) + *sel = tot; + else if(x != *sel) + sel = NULL; + } + + // Inside boundaries or restoring previous time + if(!sel) + { + // FIXME: Don't jump to find the correct marker + // A/B time, rather find the closest frame then + // frame2time. + A_jumpToTime(hh,mm,ss,ms); // FIXME: missing us + } + + // Exit the loop after restoring previous time + if(!tB) + { + break; + } + else if(t != tB) + { + // When inside boundaries find marker A time + if(!sel) + ptsA = admPreview::getCurrentPts(); + + // Switch to marker B + t = tB; + sel = &ptsB; + continue; + } + else + { + // When inside boundaries find marker B time + if(!sel) + ptsB = admPreview::getCurrentPts(); + + // Swap marker A and B when necessary + if(ptsA > ptsB) + { + bool swapit = false; + + if(!prefs->get(FEATURES_SWAP_IF_A_GREATER_THAN_B, &swapit)) + swapit = true; + + if(swapit) // auto swap + { + uint64_t y = ptsA; + ptsA = ptsB; + ptsB = y; + } + else + { + if(action == ACT_ChangeMarkerA) + ptsB = tot; // reset B + else + ptsA = 0; // reset A + } + } + + // Restore the previous time breaking the loop + t = time; + tB = NULL; + sel = NULL; + } + } + + // Check if any marker A/B has been changed + if(preA != ptsA || preB != ptsB) + { + video_body->addToUndoQueue(); + video_body->setMarkerAPts(ptsA); + video_body->setMarkerBPts(ptsB); + } + // Always refresh the time fields text, even if the are no + // changes in marker A/B. The fields may have been edited + // directly by changing the text. Avoiding a refresh will + // leave a value that may not match the real position. + UI_setMarkers(ptsA, ptsB); + // Refresh the total time field too. It is used to select + // from A to B starting from the end of the video to set a + // cut range to redure the duration of the video. + UI_setTotalTime(tot); + + stagedActionSuccess = 0; + } + break; case ACT_Refresh: { // Flush cache and seek to the current picture if(playing) break; diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.cpp new file mode 100644 index 0000000000..702a6aac79 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.cpp @@ -0,0 +1,396 @@ +/*************************************************************************** + \file ADM_QLineEditPTS + \brief Custom QLineEdit to store the time pointer (precision timing) + \author Matthew White + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include "ADM_misc.h" +#include "ADM_QLineEditPTS.h" + +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) +#include +#include +#else +#include +#include +#include +#endif + +ADM_CORE6_EXPORT uint8_t ms2time(uint32_t ms, uint32_t *h, uint32_t *m, uint32_t *s, uint32_t *mms); + +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 +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + QRegExp +#else + QRegularExpression +#endif + PTSRegExp("^(.*)([0-9]{2}):([0-5][0-9]):([0-5][0-9])\\.([0-9]{3})(,([0-9]{3}))?$"); + +/** + * \brief Convert a hh:mm:ss.ms,us string to integer values (",us" is optional). + * \param[in] text string in 00:00:00.000,000 format (",000" is optional). + * \param[out] hh set to hours. + * \param[out] mm set to minutes. + * \param[out] ss set to seconds. + * \param[out] ms set to milliseconds. + * \param[out] us set to microseconds. + * \return true if the string has the right format, otherwise false. + */ +bool text2time(const char *text, uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + QRegExp +#else + QRegularExpression +#endif + rx(PTSRegExp); + +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + if(rx.exactMatch(text)) +#else + QRegularExpressionMatch match = rx.match(text); + if(match.hasMatch()) +#endif + { + QStringList results = +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + rx.capturedTexts(); +#else + match.capturedTexts(); +#endif + + *hh = results.at(2).toInt(NULL, 10); + *mm = results.at(3).toInt(NULL, 10); + *ss = results.at(4).toInt(NULL, 10); + *ms = results.at(5).toInt(NULL, 10); + + if(results.size() > 6) + *us = results.at(7).toInt(NULL, 10); + else + *us = 0; + + return true; + } + + return false; +} + +/** + * \brief Convert time into PTS. + * \param[in] hh hours. + * \param[in] mm minutes. + * \param[in] ss seconds. + * \param[in] ms milliseconds. + * \param[in] us microseconds. + * \return pts time in microseconds (us). + */ +uint64_t time2pts(const uint32_t *hh, const uint32_t *mm, const uint32_t *ss, const uint32_t *ms, const uint32_t *us) +{ + return (((uint64_t)(*hh)*3600+(*mm)*60+(*ss))*1000+(*ms))*1000+(*us); +} + +/** + * \brief Convert PTS to hh:mm:ss.ms,us string. + * \param[in] pts time in microseconds (us). + * \return string in 00:00:00.000,000 format. + */ +QString pts2text(const uint64_t &pts) +{ + char text[80]; + uint32_t hh, mm, ss, ms, us; + + us = pts - (uint64_t)((uint32_t)(pts/1000))*1000; + ms2time((uint32_t)(pts/1000), &hh, &mm, &ss, &ms); + snprintf(text, 79, "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ".%03" PRIu32 ",%03" PRIu32, hh, mm, ss, ms, us); + + return text; +} + +/** + * \brief Append/Replace PTS string to/in a text. + * \param[in,out] text string to modify. + * \param[in] pts string in 00:00:00.000,000 format (",000" is optional). + * \return reference to text. + */ +QString &appendPTS(QString &text, const QString &pts) +{ + QString check = pts; + + // Verify the format of the PTS string + if(!truncatePTS(check).isEmpty()) + return text; + + // Remove any appended PTS string + if(!truncatePTS(text).isEmpty()) + text.append(" "); + + // Append the PTS string + return text.append(pts); +} + +/** + * \brief Append/Replace PTS string to/in a text. + * \param[in,out] text string to modify. + * \param[in] pts time in microseconds (us). + * \return reference to text. + */ +QString &appendPTS(QString &text, const uint64_t &pts) +{ + return appendPTS(text, pts2text(pts)); +} + +/** + * \brief Remove appended PTS string from a text. + * \param[in,out] text string to modify. + * \return reference to text. + */ +QString &truncatePTS(QString &text) +{ +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + QRegExp +#else + QRegularExpression +#endif + rx(PTSRegExp); + +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + if(rx.exactMatch(text)) +#else + QRegularExpressionMatch match = rx.match(text); + if(match.hasMatch()) +#endif + { + QStringList results = +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + rx.capturedTexts(); +#else + match.capturedTexts(); +#endif + text = results.at(1).trimmed(); + } + + return text; +} + +/** + * \brief Initialize PTS to the given value. + * \param[in] pts time in microseconds (us). + * \param[in] parent sent to the QWidget constructor. + * \sa ADM_QLineEditPTS::setPTS(const uint64_t&) + */ +ADM_QLineEditPTS::ADM_QLineEditPTS(const uint64_t &pts, QWidget *parent /* = nullptr */) : QLineEdit(parent) +{ +#if QT_VERSION < QT_VERSION_CHECK(5,1,0) + QRegExpValidator *timeValidator = new QRegExpValidator(timeRegExp, this); +#else + QRegularExpressionValidator *timeValidator = new QRegularExpressionValidator(timeRegExp, this); +#endif + setInputMask("99:99:99.999"); + setValidator(timeValidator); + setPTS(pts); +} + +/** + * \brief Initialize PTS to 0 microseconds (us). + * \param[in] parent sent to the QWidget constructor. + * \sa ADM_QLineEditPTS::setPTS(const uint64_t&) + */ +ADM_QLineEditPTS::ADM_QLineEditPTS(QWidget *parent /* = nullptr */) : ADM_QLineEditPTS(0, parent) +{ +} + +ADM_QLineEditPTS::~ADM_QLineEditPTS() +{ +} + +/** + * \brief Internally used to set text(). + * \param[in] text string to use as text(). + * \sa ADM_QLineEditPTS::setPTS(const uint64_t&) + */ +void ADM_QLineEditPTS::setText(const QString &text) +{ + QLineEdit::setText(text); +} + +/** + * \brief Internally used to set a hardcoded value. + * \param[in] validator content validator, pass 0 to disable. + * \sa ADM_QLineEditPTS::setInputMask(const QString&) + */ +void ADM_QLineEditPTS::setValidator(const QValidator *validator) +{ + QLineEdit::setValidator(validator); +} + +/** + * \brief Internally used to set a hardcoded value. + * \param[in] mask input mask, pass an empty string to disable. + * \sa ADM_QLineEditPTS::setValidator(const QValidator*) + */ +void ADM_QLineEditPTS::setInputMask(const QString &mask) +{ + QLineEdit::setInputMask(mask); +} + +/** + * \brief Set PTS to 0 microseconds (us). + * \sa ADM_QLineEditPTS::resetEdit(void) + */ +void ADM_QLineEditPTS::clear(void) +{ + setPTS(0); +} + +/** + * \brief Reset to the original PTS. + * \sa ADM_QLineEditPTS::isTextEdited(void) + */ +void ADM_QLineEditPTS::resetEdit(void) +{ + setText(_uneditedText); +} + +/** + * \brief Set PTS to the given value. + * \param[in] pts time in microseconds (us). + * \sa ADM_QLineEditPTS::PTS(void) + * \sa ADM_QLineEditPTS::uneditedPTS(void) + */ +void ADM_QLineEditPTS::setPTS(const uint64_t &pts) +{ + _pts = pts; + // Remove microseconds from conversion to text + setText(pts2text(_pts).chopped(4)); + _uneditedText = text(); +} + +/** + * \brief Return the current PTS. + * \return time in microseconds (us). + * \sa ADM_QLineEditPTS::isTextEdited(void) + */ +uint64_t ADM_QLineEditPTS::PTS(void) +{ + uint32_t hh, mm, ss, ms, us; + return PTS(&hh, &mm, &ss, &ms, &us); +} + +/** + * \brief Return the current PTS. + * \param[out] hh set to hours. + * \param[out] mm set to minutes. + * \param[out] ss set to seconds. + * \param[out] ms set to milliseconds. + * \param[out] us set to microseconds. + * \return time in microseconds (us). + * \sa ADM_QLineEditPTS::isTextEdited(void) + */ +uint64_t ADM_QLineEditPTS::PTS(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + // Fail if text() isn't in the right format + assert(text2time(text().toUtf8().constData(), hh, mm, ss, ms, us)); + // Compute microseconds missing from the text + *us = _pts - (uint64_t)((uint32_t)(_pts/1000))*1000; + return time2pts(hh, mm, ss, ms, us); +} + +/** + * \brief Return the original PTS. + * \return time in microseconds (us). + * \sa ADM_QLineEditPTS::isTextEdited(void) + */ +uint64_t ADM_QLineEditPTS::uneditedPTS(void) +{ + return _pts; +} + +/** + * \brief Return the original PTS. + * \param[out] hh set to hours. + * \param[out] mm set to minutes. + * \param[out] ss set to seconds. + * \param[out] ms set to milliseconds. + * \param[out] us set to microseconds. + * \return time in microseconds (us). + * \sa ADM_QLineEditPTS::isTextEdited(void) + */ +uint64_t ADM_QLineEditPTS::uneditedPTS(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + // Compute microseconds missing from the text + *us = _pts - (uint64_t)((uint32_t)(_pts/1000))*1000; + ms2time((uint32_t)(_pts/1000), hh, mm, ss, ms); + return _pts; +} + +/** + * \brief Return the current PTS as hh:mm:ss.ms string. + * \return string in 00:00:00.000 format. + * \sa ADM_QLineEditPTS::PTS(void) + */ +QString ADM_QLineEditPTS::text(void) +{ + return QLineEdit::text(); +} + +/** + * \brief Return the original PTS as hh:mm:ss.ms string. + * \return string in 00:00:00.000 format. + * \sa ADM_QLineEditPTS::uneditedPTS(void) + */ +QString ADM_QLineEditPTS::uneditedText(void) +{ + return _uneditedText; +} + +/** + * \brief Return true if the PTS has been edited by the user (via GUI). + * \return true if text() has been modified, otherwise false. + * \sa ADM_QLineEditPTS::resetEdit(void) + */ +bool ADM_QLineEditPTS::isTextEdited(void) +{ + return (text() != _uneditedText); +} + +/** + * \brief Append/Replace PTS string to/in tooltip. + * \sa ADM_QLineEditPTS::setPTS(const uint64_t&) + */ +void ADM_QLineEditPTS::appendPTSToolTip(void) +{ + QString tt = toolTip(); + // Append whole PTS to tooltip + setToolTip(appendPTS(tt, _pts)); +} + +/** + * \brief Remove appended PTS string from tooltip. + * \sa ADM_QLineEditPTS::setPTS(const uint64_t&) + */ +void ADM_QLineEditPTS::removePTSToolTip(void) +{ + QString tt = toolTip(); + // Remove any appended PTS from tooltip + setToolTip(truncatePTS(tt)); +} diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.h b/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.h new file mode 100644 index 0000000000..f9aff18475 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_QLineEditPTS.h @@ -0,0 +1,51 @@ +#ifndef ADM_QLineEditPTS_h +#define ADM_QLineEditPTS_h + +#include + +bool text2time(const char *text, uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); +uint64_t time2pts(const uint32_t *hh, const uint32_t *mm, const uint32_t *ss, const uint32_t *ms, const uint32_t *us); +QString pts2text(const uint64_t &pts); +QString &appendPTS(QString &text, const uint64_t &pts); +QString &appendPTS(QString &text, const QString &pts); +QString &truncatePTS(QString &text); + +/** + * \brief Add properties and methods to give timing precision. + */ +class ADM_QLineEditPTS : public QLineEdit +{ + Q_OBJECT + +public: + ADM_QLineEditPTS(const uint64_t &pts, QWidget *parent = nullptr); + ADM_QLineEditPTS(QWidget *parent = nullptr); + virtual ~ADM_QLineEditPTS(); + + void clear(void); + void resetEdit(void); + void setPTS(const uint64_t &pts); + uint64_t PTS(); + uint64_t PTS(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); + uint64_t uneditedPTS(void); + uint64_t uneditedPTS(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us); + QString text(void); + QString uneditedText(void); + bool isTextEdited(void); + void appendPTSToolTip(void); + void removePTSToolTip(void); + +private: + uint64_t _pts; + QString _uneditedText; + + // Do not set the text directly, use setPTS(), unless setText() is + // designed to hold the us too (i.e. not cutting the real time). + void setText(const QString &text); + + // These use hardcoded values, don't move them from here. + void setValidator(const QValidator *validator); + void setInputMask(const QString &mask); +}; + +#endif // ADM_QLineEditPTS_h diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt b/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt index 838e31edbc..dbbc0c3988 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt @@ -1,7 +1,7 @@ SET(ADM_LIB ADM_gui${QT_LIBRARY_EXTENSION}) INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/../common/ADM_icons/") -ADM_QT_WRAP_UI(${ADM_LIB}_header gui2.ui ) -ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_gui2.h ADM_mwNavSlider.h T_preview.h T_vumeter.h T_thumbSlider.h ADM_qtray.h FileAction.h) +ADM_QT_WRAP_UI(${ADM_LIB}_header gui2.ui titleBar.ui ) +ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_gui2.h Q_titleBar.h ADM_QLineEditPTS.h ADM_mwNavSlider.h T_preview.h T_vumeter.h T_thumbSlider.h ADM_qtray.h FileAction.h) IF(APPLE) ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_osx.qrc) ELSEIF(WIN32) @@ -31,6 +31,8 @@ ENDIF(WIN32) SET(${ADM_LIB}_SRCS Q_gui2.cpp Q_gui2GL.cpp Q_gui2_menu.cpp + Q_titleBar.cpp + ADM_QLineEditPTS.cpp T_preview.cpp T_vumeter.cpp #stubs.cpp diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp index 38467f4d57..80c4c1f3f3 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp @@ -40,6 +40,8 @@ #include "ADM_cpp.h" #define MENU_DECLARE #include "Q_gui2.h" +#include "Q_titleBar.h" +#include "ADM_QLineEditPTS.h" #ifdef BROKEN_PALETTE_PROPAGATION #include @@ -420,7 +422,7 @@ void MainWindow::volumeChange( int u ) _upd_in_progres++; - int vol = ui.horizontalSlider_2->value(); + int vol = ui.volumeSlider->value(); AVDM_setVolume(vol); _upd_in_progres--; @@ -429,7 +431,7 @@ void MainWindow::volumeChange( int u ) void MainWindow::audioToggled(bool checked) { if (checked) - AVDM_setVolume(ui.horizontalSlider_2->value()); + AVDM_setVolume(ui.volumeSlider->value()); else AVDM_setVolume(0); } @@ -457,9 +459,59 @@ void MainWindow::timeChangeFinished(void) void MainWindow::currentTimeChanged(void) { - sendAction(ACT_GotoTime); + // Workaroud to reject a weird editingFinished event that triggers + // even when this element was already readonly. This happens just + // one time when switching focus away from the readonly element or + // not readonly. + if(WIDGET(currentTime)->isReadOnly()) + return; - this->setFocus(Qt::OtherFocusReason); + sendAction(ACT_GetTime); + + // NOTE: QLineEdit::editingFinished() is emitted when Enter is + // pressed or the focus is lost. Pressing Enter alone doesn't + // change focus. Hence, changing focus programmatically after + // pressing Enter will emit the signal one more time. This is + // like pressing Enter followed by pressing Tab (two signals). + // Pressing Tab alone will send only one signal while changing + // focus. Keep this in mind when you expect to receive only 1 + // signal after pressing Enter. + + // Disabling to stay on the field after pressing Enter, the user + // may want to try different edits. To change field use Tab. + //this->setFocus(Qt::OtherFocusReason); +} + +void MainWindow::markerAChanged(void) +{ + // Workaroud: see above. + if(WIDGET(selectionMarkerA)->isReadOnly()) + return; + sendAction(ACT_GetMarkerA); +} + +void MainWindow::markerBChanged(void) +{ + // Workaroud: see above. + if(WIDGET(selectionMarkerB)->isReadOnly()) + return; + sendAction(ACT_GetMarkerB); +} + +void MainWindow::selectionDurationChanged(void) +{ + // Workaroud: see above. + if(WIDGET(selectionDuration)->isReadOnly()) + return; + sendAction(ACT_GetSelection); +} + +void MainWindow::totalTimeChanged(void) +{ + // Workaroud: see above. + if(WIDGET(totalTime)->isReadOnly()) + return; + sendAction(ACT_GetTotal); } /** @@ -485,6 +537,77 @@ void MainWindow::setRefreshCap(void) prefs->get(FEATURES_CAP_REFRESH_VALUE,&refreshCapValue); } +/** + \brief Update time fields keyboard editing ability. + + Read preferences to detect which time field accepts direct + keyboard editing. +*/ +void MainWindow::updateTimeFieldsReadOnly(void) +{ + isCurrentTimeFieldEditable = false; + isTotalTimeFieldEditable = false; + isSelectionTimeFieldEditable = false; + isMarkerATimeFieldEditable = false; + isMarkerBTimeFieldEditable = false; + + prefs->get(FEATURES_CURRENT_TIME_FIELD_EDITABLE, &isCurrentTimeFieldEditable); + prefs->get(FEATURES_TOTAL_TIME_FIELD_EDITABLE, &isTotalTimeFieldEditable); + prefs->get(FEATURES_SELECTION_TIME_FIELD_EDITABLE, &isSelectionTimeFieldEditable); + prefs->get(FEATURES_MARKER_A_TIME_FIELD_EDITABLE, &isMarkerATimeFieldEditable); + prefs->get(FEATURES_MARKER_B_TIME_FIELD_EDITABLE, &isMarkerBTimeFieldEditable); + + ui.currentTime->setReadOnly(!isCurrentTimeFieldEditable); + ui.totalTime->setReadOnly(!isTotalTimeFieldEditable); + ui.selectionDuration->setReadOnly(!isSelectionTimeFieldEditable); + ui.selectionMarkerA->setReadOnly(!isMarkerATimeFieldEditable); + ui.selectionMarkerB->setReadOnly(!isMarkerBTimeFieldEditable); +} + +/** + \brief Update time fields actions buttons. + + Read preference to add only the default button or all buttons to + time fields. +*/ +void MainWindow::updateWidgetActionButtons(void) +{ + showExtraButtons = false; + prefs->get(FEATURES_TIME_FIELDS_EXTRA_BUTTONS, &showExtraButtons); + + currentTimeAddActionButons(showExtraButtons); + totalTimeAddActionButons(showExtraButtons); + selectionDurationAddActionButons(showExtraButtons); + selectionMarkerAAddActionButons(showExtraButtons); + selectionMarkerBAddActionButons(showExtraButtons); +} + +/** + \fn updatePTSToolTips +*/ +void MainWindow::updatePTSToolTips(void) +{ + showPTSToolTips = false; + prefs->get(FEATURES_PTS_TIMINGS_TOOLTIPS,&showPTSToolTips); + + if (!showPTSToolTips) + { + ui.currentTime->removePTSToolTip(); + ui.totalTime->removePTSToolTip(); + ui.selectionMarkerA->removePTSToolTip(); + ui.selectionMarkerB->removePTSToolTip(); + ui.selectionDuration->removePTSToolTip(); + } + else if(avifileinfo) + { + ui.currentTime->appendPTSToolTip(); + ui.totalTime->appendPTSToolTip(); + ui.selectionMarkerA->appendPTSToolTip(); + ui.selectionMarkerB->appendPTSToolTip(); + ui.selectionDuration->appendPTSToolTip(); + } +} + /** \fn busyTimerTimeout */ @@ -524,9 +647,20 @@ void MainWindow::actionSlot(Action a) case ACT_SetPostProcessing: a = ACT_Refresh; break; + case ACT_GetTime: case ACT_SelectTime: a = ACT_GotoTime; break; + case ACT_GetMarkerA: + case ACT_GetTotal: + case ACT_SelectMarkerA: + a = ACT_ChangeMarkerA; + break; + case ACT_GetMarkerB: + case ACT_GetSelection: + case ACT_SelectMarkerB: + a = ACT_ChangeMarkerB; + break; default:break; } } @@ -653,7 +787,7 @@ MainWindow::MainWindow(const vector& 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 @@ -674,7 +808,7 @@ MainWindow::MainWindow(const vector& scriptEngines) : _scriptEng connect( ui.comboBoxAudio,SIGNAL(activated(int)),this,SLOT(comboChanged(int))); // Slider - slider=ui.horizontalSlider; + slider=ui.navigationSlider; ADM_mwNavSlider *qslider=(ADM_mwNavSlider *)slider; slider->setMinimum(0); slider->setMaximum(ADM_LARGE_SCALE); @@ -696,12 +830,12 @@ MainWindow::MainWindow(const vector& scriptEngines) : _scriptEng ui.toolButtonForwardOneMinute->installEventFilter(this); // Thumb slider - ui.sliderPlaceHolder->installEventFilter(this); - thumbSlider = new ThumbSlider(ui.sliderPlaceHolder); + ui.thumbSliderHolder->installEventFilter(this); + thumbSlider = new ThumbSlider(ui.thumbSliderHolder); connect(thumbSlider, SIGNAL(valueEmitted(int)), this, SLOT(thumbSlider_valueEmitted(int))); // Volume slider - QSlider *volSlider=ui.horizontalSlider_2; + QSlider *volSlider=ui.volumeSlider; volSlider->setMinimum(0); volSlider->setMaximum(100); connect(volSlider,SIGNAL(valueChanged(int)),this,SLOT(volumeChange(int))); @@ -718,25 +852,39 @@ MainWindow::MainWindow(const vector& scriptEngines) : _scriptEng connect(ui.checkBox_TimeShift,SIGNAL(stateChanged(int)),this,SLOT(checkChanged(int))); connect(ui.spinBox_TimeValue,SIGNAL(valueChanged(int)),this,SLOT(timeChanged(int))); connect(ui.spinBox_TimeValue, SIGNAL(editingFinished()), this, SLOT(timeChangeFinished())); -#if 0 /* it is read-only */ - QRegExp timeRegExp("^[0-9]{2}:[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}$"); - QRegExpValidator *timeValidator = new QRegExpValidator(timeRegExp, this); - ui.currentTime->setValidator(timeValidator); - ui.currentTime->setInputMask("99:99:99.999"); -#endif - // set the size of the current time display to fit the content - QString text = "00:00:00.000"; // Don't translate this. + #ifdef USE_CUSTOM_TIME_DISPLAY_FONT ui.currentTime->setFont(QFont("ADM7SEG")); + ui.totalTime->setFont(QFont("ADM7SEG")); + ui.selectionDuration->setFont(QFont("ADM7SEG")); + ui.selectionMarkerA->setFont(QFont("ADM7SEG")); + ui.selectionMarkerB->setFont(QFont("ADM7SEG")); #endif - ui.currentTime->setText(text); // Override ui translations to make sure we use point as decimal separator. - QRect ctrect = ui.currentTime->fontMetrics().boundingRect(text); - ui.currentTime->setFixedSize(1.15 * ctrect.width(), ui.currentTime->height()); + ui.currentTime->setPTS(0); + ui.totalTime->setPTS(0); + ui.selectionMarkerA->setPTS(0); + ui.selectionMarkerB->setPTS(0); + ui.selectionDuration->setPTS(0); + + // Disabling to not cut off the text when adding action buttons + //QRect ctrect = ui.currentTime->fontMetrics().boundingRect(text); + //ui.currentTime->setFixedSize(1.15 * ctrect.width(), ui.currentTime->height()); + + // initialize time fields action buttons + updateWidgetActionButtons(); + + // Get the time the user sets directly in the text element + connect(ui.currentTime, SIGNAL(editingFinished()), this, SLOT(currentTimeChanged())); + + // Get the time the user sets directly in the text elements + connect(ui.selectionMarkerA, SIGNAL(editingFinished()), this, SLOT(markerAChanged())); + connect(ui.selectionMarkerB, SIGNAL(editingFinished()), this, SLOT(markerBChanged())); - text = QString("/ ") + text; - ui.totalTime->setText(text); // Override ui translations here too. + // Get the time the user sets directly in the text element + connect(ui.selectionDuration, SIGNAL(editingFinished()), this, SLOT(selectionDurationChanged())); - //connect(ui.currentTime, SIGNAL(editingFinished()), this, SLOT(currentTimeChanged())); + // Get the time the user sets directly in the text element + connect(ui.totalTime, SIGNAL(editingFinished()), this, SLOT(totalTimeChanged())); // Build file,... menu addScriptEnginesToFileMenu(myMenuFile); @@ -780,6 +928,23 @@ MainWindow::MainWindow(const vector& scriptEngines) : _scriptEng ui.menuToolbars->addSeparator(); ui.menuToolbars->addAction(restoreDefaults); + // Workaround to set checkboxes when changing the visibility elsewhere + connect(ui.toolBar, SIGNAL(visibilityChanged(bool)), this, SLOT(toolBarVisibilityChanged(bool))); + connect(ui.codecWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(codecVisibilityChanged(bool))); + connect(ui.navigationWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(navigationVisibilityChanged(bool))); + + // On visibility change by connected checkboxes update preferences + connect(ui.actionViewToolBar, SIGNAL(toggled(bool)), this, SLOT(toolBarVisibilityChanged(bool))); + connect(ui.actionViewStatusBar, SIGNAL(toggled(bool)), this, SLOT(statusBarVisibilityChanged(bool))); + connect(ui.actionViewCodecOptions, SIGNAL(toggled(bool)), this, SLOT(codecVisibilityChanged(bool))); + connect(ui.actionViewNavigation, SIGNAL(toggled(bool)), this, SLOT(navigationVisibilityChanged(bool))); + connect(ui.actionViewAudioMeter, SIGNAL(toggled(bool)), this, SLOT(audioMeterVisibilityChanged(bool))); + connect(ui.actionViewVolume, SIGNAL(toggled(bool)), this, SLOT(volumeVisibilityChanged(bool))); + connect(ui.actionViewControls, SIGNAL(toggled(bool)), this, SLOT(controlsVisibilityChanged(bool))); + connect(ui.actionViewSelection, SIGNAL(toggled(bool)), this, SLOT(selectionVisibilityChanged(bool))); + connect(ui.actionViewTime, SIGNAL(toggled(bool)), this, SLOT(timeVisibilityChanged(bool))); + connect(ui.actionViewSlider, SIGNAL(toggled(bool)), this, SLOT(sliderVisibilityChanged(bool))); + connect(ui.menuToolbars->actions().last(),SIGNAL(triggered(bool)),this,SLOT(restoreDefaultWidgetState(bool))); defaultThemeAction = NULL; @@ -829,22 +994,20 @@ MainWindow::MainWindow(const vector& scriptEngines) : _scriptEng connect(ui.toolBar, SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(toolbarOrientationChangedSlot(Qt::Orientation))); //connect(ui.toolBar_2,SIGNAL(actionTriggered ( QAction *)),this,SLOT(searchToolBar(QAction *))); - QWidget* dummy0 = new QWidget(); - QWidget* dummy1 = new QWidget(); - QWidget* dummy2 = new QWidget(); - QWidget* dummy3 = new QWidget(); - QWidget* dummy4 = new QWidget(); + TitleBar *codecTitleBar = new TitleBar(ui.codecWidget->windowTitle()); + ui.codecWidget->setTitleBarWidget(codecTitleBar); - ui.codecWidget->setTitleBarWidget(dummy0); - ui.navigationWidget->setTitleBarWidget(dummy1); - ui.selectionWidget->setTitleBarWidget(dummy2); - ui.volumeWidget->setTitleBarWidget(dummy3); - ui.audioMetreWidget->setTitleBarWidget(dummy4); + TitleBar *navigationTitleBar = new TitleBar(ui.navigationWidget->windowTitle()); + ui.navigationWidget->setTitleBarWidget(navigationTitleBar); widgetsUpdateTooltips(); this->adjustSize(); ui.currentTime->setTextMargins(0,0,0,0); // some Qt themes mess with text margins + ui.totalTime->setTextMargins(0,0,0,0); // some Qt themes mess with text margins + ui.selectionDuration->setTextMargins(0,0,0,0); // some Qt themes mess with text margins + ui.selectionMarkerA->setTextMargins(0,0,0,0); // some Qt themes mess with text margins + ui.selectionMarkerB->setTextMargins(0,0,0,0); // some Qt themes mess with text margins threshold = RESIZE_THRESHOLD; actZoomCalled = false; @@ -1040,6 +1203,12 @@ bool MainWindow::buildMenu(QMenu *root,MenuEntry *menu, int nb) case ACT_MarkB: prefs->get(KEYBOARD_SHORTCUTS_ALT_MARK_B,sc); break; + case ACT_SelectMarkerA: + prefs->get(KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_A,sc); + break; + case ACT_SelectMarkerB: + prefs->get(KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_B,sc); + break; case ACT_ResetMarkerA: prefs->get(KEYBOARD_SHORTCUTS_ALT_RESET_MARK_A,sc); break; @@ -1083,6 +1252,18 @@ bool MainWindow::buildMenu(QMenu *root,MenuEntry *menu, int nb) return true; } +/** + \fn createPopupMenu + \brief Override the application default context menu. +*/ +QMenu *MainWindow::createPopupMenu() +{ + QMenu *menu = QMainWindow::createPopupMenu(); + menu->clear(); + menu->addActions(ui.menuToolbars->actions()); + return menu; +} + /** buildFileMenu */ @@ -1290,14 +1471,6 @@ void MainWindow::buildButtonLists(void) #define ADD_PUSHBUTTON_LOADED(x) PushButtonsAvailableWhenFileLoaded.push_back(ui.x); #define ADD_PUSHBUTTON_PLAYBACK(x) PushButtonsDisabledOnPlayback.push_back(ui.x); - ADD_PUSHBUTTON_LOADED(pushButtonTime) - ADD_PUSHBUTTON_LOADED(pushButtonJumpToMarkerA) - ADD_PUSHBUTTON_LOADED(pushButtonJumpToMarkerB) - - ADD_PUSHBUTTON_PLAYBACK(pushButtonTime) - ADD_PUSHBUTTON_PLAYBACK(pushButtonJumpToMarkerA) - ADD_PUSHBUTTON_PLAYBACK(pushButtonJumpToMarkerB) - ADD_PUSHBUTTON_PLAYBACK(pushButtonDecoderConf) ADD_PUSHBUTTON_PLAYBACK(pushButtonVideoConf) ADD_PUSHBUTTON_PLAYBACK(pushButtonVideoFilter) @@ -1312,6 +1485,24 @@ void MainWindow::buildButtonLists(void) */ void MainWindow::setMenuItemsEnabledState(void) { + bool engines = false; + bool tinyPy = false; + + // Implementation of getPythonScriptEngine() + if(_scriptEngines.size() > 0) + { + engines = true; + + for(int i = 0; i < _scriptEngines.size(); i++) + { + if (!_scriptEngines[i]->defaultFileExtension().compare("py")) + { + tinyPy = true; + break; + } + } + } + if(playing || (navigateWhilePlayingState != 0)) // this actually doesn't work as it should { int n=ActionsDisabledOnPlayback.size(); @@ -1335,6 +1526,28 @@ void MainWindow::setMenuItemsEnabledState(void) if(ADM_PREVIEW_NONE != admPreview::getPreviewMode()) slider->setEnabled(false); + ui.currentTime->setReadOnly(true); + ui.selectionMarkerA->setReadOnly(true); + ui.selectionMarkerB->setReadOnly(true); + ui.selectionDuration->setReadOnly(true); + ui.totalTime->setReadOnly(true); + pushButtonTime->setEnabled(false); + pushButtonSaveScript->setEnabled(false); + pushButtonRunScript->setEnabled(false); + pushButtonAppend->setEnabled(false); + pushButtonUndo->setEnabled(false); + pushButtonRedo->setEnabled(false); + pushButtonCut->setEnabled(false); + pushButtonCopy->setEnabled(false); + pushButtonPaste->setEnabled(false); + pushButtonEditMarkerA->setEnabled(false); + pushButtonEditMarkerB->setEnabled(false); + pushButtonJumpToMarkerA->setEnabled(false); + pushButtonJumpToMarkerB->setEnabled(false); + pushButtonResetMarkerA->setEnabled(false); + pushButtonResetMarkerB->setEnabled(false); + pushButtonResetMarkers->setEnabled(false); + return; } @@ -1374,6 +1587,8 @@ void MainWindow::setMenuItemsEnabledState(void) ENABLE(Edit, ACT_Redo, redo) ENABLE(Edit, ACT_ResetSegments, vid) // TODO: Detect that segment layout matches the default one and disable "Reset Edit" then too. + ENABLE(Edit, ACT_SelectMarkerA, vid) + ENABLE(Edit, ACT_SelectMarkerB, vid) ENABLE(Edit, ACT_ResetMarkerA, resetA) ENABLE(Edit, ACT_ResetMarkerB, resetB) ENABLE(Edit, ACT_ResetMarkers, (resetA || resetB)) @@ -1399,7 +1614,27 @@ void MainWindow::setMenuItemsEnabledState(void) ENABLE(Recent, ACT_CLEAR_RECENT, haveRecentItems) ENABLE(Recent, ACT_RESTORE_SESSION, A_checkSavedSession(false)) - ui.selectionDuration->setEnabled(vid); + ui.currentTime->setReadOnly(!vid || !isCurrentTimeFieldEditable); + ui.selectionMarkerA->setReadOnly(!vid || !isMarkerATimeFieldEditable); + ui.selectionMarkerB->setReadOnly(!vid || !isMarkerBTimeFieldEditable); + ui.selectionDuration->setReadOnly(!vid || !isSelectionTimeFieldEditable); + ui.totalTime->setReadOnly(!vid || !isTotalTimeFieldEditable); + pushButtonTime->setEnabled(vid); + pushButtonSaveScript->setEnabled(vid && tinyPy); + pushButtonRunScript->setEnabled(engines); + pushButtonAppend->setEnabled(vid); + pushButtonUndo->setEnabled(undo); + pushButtonRedo->setEnabled(redo); + pushButtonCut->setEnabled(canDelete); + pushButtonCopy->setEnabled(vid); + pushButtonPaste->setEnabled(paste); + pushButtonEditMarkerA->setEnabled(vid); + pushButtonEditMarkerB->setEnabled(vid); + pushButtonJumpToMarkerA->setEnabled(vid); + pushButtonJumpToMarkerB->setEnabled(vid); + pushButtonResetMarkerA->setEnabled(resetA); + pushButtonResetMarkerB->setEnabled(resetB); + pushButtonResetMarkers->setEnabled(resetA || resetB); slider->setEnabled(vid); updateCodecWidgetControlsState(); @@ -1408,8 +1643,6 @@ void MainWindow::setMenuItemsEnabledState(void) // or loading a video with small dimensions, so ignore just this one resize event ignoreResizeEvent = true; // en passant reset frame type label if no video is loaded - if(!vid) - ui.label_8->setText(QT_TRANSLATE_NOOP("qgui2","?")); } /** @@ -1540,6 +1773,8 @@ void MainWindow::updateActionShortcuts(void) case ACT_Delete: case ACT_MarkA: case ACT_MarkB: + case ACT_SelectMarkerA: + case ACT_SelectMarkerB: case ACT_ResetMarkerA: case ACT_ResetMarkerB: case ACT_ResetMarkers: @@ -1586,6 +1821,12 @@ void MainWindow::updateActionShortcuts(void) case ACT_MarkB: prefs->get(KEYBOARD_SHORTCUTS_ALT_MARK_B,sc); break; + case ACT_SelectMarkerA: + prefs->get(KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_A,sc); + break; + case ACT_SelectMarkerB: + prefs->get(KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_B,sc); + break; case ACT_ResetMarkerA: prefs->get(KEYBOARD_SHORTCUTS_ALT_RESET_MARK_A,sc); break; @@ -1706,13 +1947,82 @@ void MainWindow::widgetsUpdateTooltips(void) tt += SHORTCUT(ACT_End,Go) ui.toolButtonLastFrame->setToolTip(tt); - tt = QT_TRANSLATE_NOOP("qgui2","Go to marker A"); + tt = QT_TRANSLATE_NOOP("qgui2","Go to Time"); + tt += SHORTCUT(ACT_SelectTime,Go) + pushButtonTime->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Edit Marker A"); + tt += SHORTCUT(ACT_SelectMarkerA,Edit) + pushButtonEditMarkerA->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Edit Marker B"); + tt += SHORTCUT(ACT_SelectMarkerB,Edit) + pushButtonEditMarkerB->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Go to Marker A"); tt += SHORTCUT(ACT_GotoMarkA,Go) - ui.pushButtonJumpToMarkerA->setToolTip(tt); + pushButtonJumpToMarkerA->setToolTip(tt); - tt = QT_TRANSLATE_NOOP("qgui2","Go to marker B"); + tt = QT_TRANSLATE_NOOP("qgui2","Go to Marker B"); tt += SHORTCUT(ACT_GotoMarkB,Go) - ui.pushButtonJumpToMarkerB->setToolTip(tt); + pushButtonJumpToMarkerB->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Reset Marker A (time 0)"); + tt += SHORTCUT(ACT_ResetMarkerA,Edit) + pushButtonResetMarkerA->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Reset Marker B (total time)"); + tt += SHORTCUT(ACT_ResetMarkerB,Edit) + pushButtonResetMarkerB->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Reset Markers"); + tt += SHORTCUT(ACT_ResetMarkers,Edit) + pushButtonResetMarkers->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Save tinyPy script"); + pushButtonSaveScript->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Run script/project"); + pushButtonRunScript->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Append media"); + tt += SHORTCUT(ACT_APPEND_VIDEO,File) + pushButtonAppend->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Undo action"); + tt += SHORTCUT(ACT_Undo,Edit) + pushButtonUndo->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Redo action"); + tt += SHORTCUT(ACT_Redo,Edit) + pushButtonRedo->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Cut selection"); + tt += SHORTCUT(ACT_Cut,Edit) + pushButtonCut->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Copy selection"); + tt += SHORTCUT(ACT_Copy,Edit) + pushButtonCopy->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Paste clipboard"); + tt += SHORTCUT(ACT_Paste,Edit) + pushButtonPaste->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Current time"); + ui.currentTime->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Total time"); + ui.totalTime->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Time from Marker A to B"); + ui.selectionDuration->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Marker A"); + ui.selectionMarkerA->setToolTip(tt); + + tt = QT_TRANSLATE_NOOP("qgui2","Marker B"); + ui.selectionMarkerB->setToolTip(tt); QString backtext, forwardtext, hint = "\n"; Action actBack, actForward; @@ -1772,6 +2082,188 @@ void MainWindow::widgetsUpdateTooltips(void) tt += SHORTCUT(actForward,Go) tt += hint; ui.toolButtonForwardOneMinute->setToolTip(tt); + + if(avifileinfo && showPTSToolTips) + { + ui.currentTime->appendPTSToolTip(); + ui.totalTime->appendPTSToolTip(); + ui.selectionMarkerA->appendPTSToolTip(); + ui.selectionMarkerB->appendPTSToolTip(); + ui.selectionDuration->appendPTSToolTip(); + } +} + +/** + \brief Add actions to a QLineEdit widget. + \param[out] widget element where to add actions. + \param[in] actions list of actions for the element (can be empty). + \param[in] all if true add all actions, otherwise add only the first one. + \param[in] first default action to use instead of the first one in actions list (can be NULL). + \return true if the widget's actions list has been modified, otherwise false. + + Add the list of actions to the widget when all is true. + + If all is false, add the first in the actions list to the widget, + or if the parameter first isn't NULL, add that instead. + + Each call to this function will first remove all actions from the + widget. To leave the widget with no actions, set all to true and + give an empty actions list. If all is set to false, to leave the + widget with no actions, in addition to an empty list pass NULL as + the parameter first. + + You may want to call adjustSize(), or setTextMargins(), when this + function returns true. +*/ +static bool enableWidgetActionButtons(QLineEdit *widget, const QList &actions, bool all, QAction* first = NULL) +{ + if(!widget) + return false; + + first = first ? first : actions.first(); + + QListIterator a(widget->actions()); + bool changed = a.hasNext() || (all && actions.first()) || first; + + while(a.hasNext()) + widget->removeAction(a.next()); + + a = actions; + + if(all) + while(a.hasNext()) + widget->addAction(a.next(), QLineEdit::LeadingPosition); + else if(first) + widget->addAction(first, QLineEdit::LeadingPosition); + + return changed; +} + +/** + \brief Add action buttons to the current time field. + \param[in] all if true add all buttons, otherwise add only the default button. +*/ +void MainWindow::currentTimeAddActionButons(bool all) +{ + if(currentTimeActionButtons.isEmpty()) + { + pushButtonTime = new QAction(QIcon(MKICON(time)), "Go to Time", ui.currentTime); + pushButtonSaveScript = new QAction(QIcon(MKICON(savescript)), "Save tinyPy script", ui.currentTime); + pushButtonRunScript = new QAction(QIcon(MKICON(runscript)), "Run script/project", ui.currentTime); + + connect(pushButtonTime,SIGNAL(triggered()),this,SLOT(seekTime())); + connect(pushButtonSaveScript,SIGNAL(triggered()),this,SLOT(saveScriptAction())); + connect(pushButtonRunScript,SIGNAL(triggered()),this,SLOT(runScriptAction())); + + currentTimeActionButtons.append(pushButtonTime); + currentTimeActionButtons.append(pushButtonSaveScript); + currentTimeActionButtons.append(pushButtonRunScript); + } + + if(enableWidgetActionButtons(ui.currentTime, currentTimeActionButtons, all)) + ui.currentTime->setTextMargins(0,0,0,0); +} + +/** + \brief Add action buttons to the total time field. + \param[in] all if true add all buttons, otherwise add only the default button. +*/ +void MainWindow::totalTimeAddActionButons(bool all) +{ + if(totalTimeActionButtons.isEmpty()) + { + pushButtonAppend = new QAction(QIcon(MKICON(append)), "Append media", ui.totalTime); + pushButtonUndo = new QAction(QIcon(MKICON(undo)), "Undo action", ui.totalTime); + pushButtonRedo = new QAction(QIcon(MKICON(redo)), "Redo action", ui.totalTime); + + connect(pushButtonAppend,SIGNAL(triggered()),this,SLOT(appendAction())); + connect(pushButtonUndo,SIGNAL(triggered()),this,SLOT(undoAction())); + connect(pushButtonRedo,SIGNAL(triggered()),this,SLOT(redoAction())); + + totalTimeActionButtons.append(pushButtonAppend); + totalTimeActionButtons.append(pushButtonUndo); + totalTimeActionButtons.append(pushButtonRedo); + } + + if(enableWidgetActionButtons(ui.totalTime, totalTimeActionButtons, all)) + ui.totalTime->setTextMargins(0,0,0,0); +} + +/** + \brief Add action buttons to the selection duration field. + \param[in] all if true add all buttons, otherwise add only the default button. +*/ +void MainWindow::selectionDurationAddActionButons(bool all) +{ + if(selectionDurationActionButtons.isEmpty()) + { + pushButtonCut = new QAction(QIcon(MKICON(cut)), "Cut selection", ui.selectionDuration); + pushButtonCopy = new QAction(QIcon(MKICON(copy)), "Copy selection", ui.selectionDuration); + pushButtonPaste = new QAction(QIcon(MKICON(paste)), "Paste clipboard", ui.selectionDuration); + pushButtonResetMarkers = new QAction(QApplication::style()->standardIcon(QStyle::SP_TrashIcon), "Reset Markers)", ui.selectionDuration); + + connect(pushButtonCut,SIGNAL(triggered()),this,SLOT(cutSelection())); + connect(pushButtonCopy,SIGNAL(triggered()),this,SLOT(copySelection())); + connect(pushButtonPaste,SIGNAL(triggered()),this,SLOT(pasteClipboard())); + connect(pushButtonResetMarkers,SIGNAL(triggered()),this,SLOT(resetMarkers())); + + selectionDurationActionButtons.append(pushButtonCut); + selectionDurationActionButtons.append(pushButtonCopy); + selectionDurationActionButtons.append(pushButtonPaste); + } + + if(enableWidgetActionButtons(ui.selectionDuration, selectionDurationActionButtons, all, pushButtonResetMarkers)) + ui.selectionDuration->setTextMargins(0,0,0,0); +} + +/** + \brief Add action buttons to the marker A field. + \param[in] all if true add all buttons, otherwise add only the default button. +*/ +void MainWindow::selectionMarkerAAddActionButons(bool all) +{ + if(selectionMarkerAActionButtons.isEmpty()) + { + pushButtonEditMarkerA = new QAction(QIcon(MKICON(time)), "Edit Marker A", ui.selectionMarkerA); + pushButtonJumpToMarkerA = new QAction(QIcon(MKICON(goMarkA)), "Go to Marker A", ui.selectionMarkerA); + pushButtonResetMarkerA = new QAction(QIcon(MKICON(reset_markA)), "Reset Marker A (time 0)", ui.selectionMarkerA); + + connect(pushButtonEditMarkerA,SIGNAL(triggered()),this,SLOT(editMarkerA())); + connect(pushButtonJumpToMarkerA,SIGNAL(triggered()),this,SLOT(gotoMarkerA())); + connect(pushButtonResetMarkerA,SIGNAL(triggered()),this,SLOT(resetMarkerA())); + + selectionMarkerAActionButtons.append(pushButtonEditMarkerA); + selectionMarkerAActionButtons.append(pushButtonJumpToMarkerA); + selectionMarkerAActionButtons.append(pushButtonResetMarkerA); + } + + if(enableWidgetActionButtons(ui.selectionMarkerA, selectionMarkerAActionButtons, all, pushButtonJumpToMarkerA)) + ui.selectionMarkerA->setTextMargins(0,0,0,0); +} + +/** + \brief Add action buttons to the marker B field. + \param[in] all if true add all buttons, otherwise add only the default button. +*/ +void MainWindow::selectionMarkerBAddActionButons(bool all) +{ + if(selectionMarkerBActionButtons.isEmpty()) + { + pushButtonEditMarkerB = new QAction(QIcon(MKICON(time)), "Edit Marker B", ui.selectionMarkerB); + pushButtonJumpToMarkerB = new QAction(QIcon(MKICON(goMarkB)), "Go to Marker B", ui.selectionMarkerB); + pushButtonResetMarkerB = new QAction(QIcon(MKICON(reset_markB)), "Reset Marker B (total time)", ui.selectionMarkerB); + + connect(pushButtonEditMarkerB,SIGNAL(triggered()),this,SLOT(editMarkerB())); + connect(pushButtonJumpToMarkerB,SIGNAL(triggered()),this,SLOT(gotoMarkerB())); + connect(pushButtonResetMarkerB,SIGNAL(triggered()),this,SLOT(resetMarkerB())); + + selectionMarkerBActionButtons.append(pushButtonEditMarkerB); + selectionMarkerBActionButtons.append(pushButtonJumpToMarkerB); + selectionMarkerBActionButtons.append(pushButtonResetMarkerB); + } + + if(enableWidgetActionButtons(ui.selectionMarkerB, selectionMarkerBActionButtons, all, pushButtonJumpToMarkerB)) + ui.selectionMarkerB->setTextMargins(0,0,0,0); } /** @@ -1780,14 +2272,10 @@ void MainWindow::widgetsUpdateTooltips(void) */ void MainWindow::restoreDefaultWidgetState(bool b) { - ui.codecWidget->setVisible(true); - ui.navigationWidget->setVisible(true); - ui.selectionWidget->setVisible(true); - ui.volumeWidget->setVisible(true); - ui.audioMetreWidget->setVisible(true); - ui.toolBar->setVisible(true); + // Set visibility via connected checkboxes + for(int i = ADM_Toolbars_Item::FIRST; i <= ADM_Toolbars_Item::LAST; i++) + ui.menuToolbars->actions().at(i)->setChecked(true); - syncToolbarsMenu(); updateZoomIndicator(); addToolBar(ui.toolBar); @@ -1796,6 +2284,105 @@ void MainWindow::restoreDefaultWidgetState(bool b) setZoomToFit(); } +/** + \fn toolBarVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::toolBarVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_TOOLBAR_VISIBLE, checked); + // Workaround to set/unset the checkbox when changing the + // visibility elsewhere. + ui.menuToolbars->actions().at(ADM_Toolbars_Item::TOOLBAR)->setChecked(checked); +} + +/** + \fn statusBarVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::statusBarVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_STATUSBAR_VISIBLE, checked); +} + +/** + \fn codecVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::codecVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_CODEC_VISIBLE, checked); + // Workaround to set/unset the checkbox when changing the + // visibility elsewhere. + ui.menuToolbars->actions().at(ADM_Toolbars_Item::CODEC)->setChecked(checked); +} + +/** + \fn navigationVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::navigationVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_NAVIGATION_VISIBLE, checked); + // Workaround to set/unset the checkbox when changing the + // visibility elsewhere. + ui.menuToolbars->actions().at(ADM_Toolbars_Item::NAVIGATION)->setChecked(checked); +} + +/** + \fn audioMeterVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::audioMeterVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_AUDIOMETER_VISIBLE, checked); +} + +/** + \fn volumeVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::volumeVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_VOLUME_VISIBLE, checked); +} + +/** + \fn controlsVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::controlsVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_CONTROLS_VISIBLE, checked); +} + +/** + \fn selectionVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::selectionVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_SELECTION_VISIBLE, checked); +} + +/** + \fn timeVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::timeVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_TIME_VISIBLE, checked); +} + +/** + \fn sliderVisibilityChanged + \brief On checkbox state change save preferences. +*/ +void MainWindow::sliderVisibilityChanged(bool checked) +{ + prefs->set(TOOLBARS_SLIDER_VISIBLE, checked); +} + /** \fn setDefaultThemeSlot \brief Set default theme and update settings. @@ -1808,6 +2395,10 @@ void MainWindow::setDefaultThemeSlot(bool b) QApplication::setStyle(defaultStyle); ui.currentTime->setTextMargins(0,0,0,0); + ui.totalTime->setTextMargins(0,0,0,0); + ui.selectionDuration->setTextMargins(0,0,0,0); + ui.selectionMarkerA->setTextMargins(0,0,0,0); + ui.selectionMarkerB->setTextMargins(0,0,0,0); QPalette pal = style()->standardPalette(); qApp->setPalette(pal); @@ -1816,6 +2407,10 @@ void MainWindow::setDefaultThemeSlot(bool b) ui.checkBox_TimeShift->setPalette(x); \ ui.spinBox_TimeValue->setPalette(x); \ ui.currentTime->setPalette(x); \ + ui.totalTime->setPalette(x); \ + ui.selectionDuration->setPalette(x); \ + ui.selectionMarkerA->setPalette(x); \ + ui.selectionMarkerB->setPalette(x); \ ui.menuFile->setPalette(x); \ ui.menuRecent->setPalette(x); \ ui.menuEdit->setPalette(x); \ @@ -1866,6 +2461,12 @@ void MainWindow::setLightTheme(void) { QApplication::setStyle(BASIC_QT_STYLE); QPalette pal = style()->standardPalette(); + // FIXME: This is a hack to have dock widgets' resize handle more + // visible on light themes. A better solution would be to change + // the resize handle color directly. In the meantime, a slightly + // darker window's color than that of the standard palette is + // applied. + pal.setColor(QPalette::Window, QColor(167,167,167)); qApp->setPalette(pal); #ifdef BROKEN_PALETTE_PROPAGATION PROPAGATE_PALETTE(pal) @@ -1980,6 +2581,134 @@ void MainWindow::timeChanged(int) { sendAction (ACT_TimeShift) ; } +/** + \fn seekTime + \brief Called to seek a position in the player +*/ +void MainWindow::seekTime(void) +{ + sendAction (ACT_SelectTime) ; +} +/** + \fn saveScriptAction + \brief Called to save the project as a script +*/ +void MainWindow::saveScriptAction(void) +{ + sendAction (ACT_SAVE_PY_SCRIPT) ; +} +/** + \fn runScriptAction + \brief Called to run a script (aka project) +*/ +void MainWindow::runScriptAction(void) +{ + sendAction (ACT_RUN_SCRIPT) ; +} +/** + \fn appendAction + \brief Called to append a mendia +*/ +void MainWindow::appendAction(void) +{ + sendAction (ACT_APPEND_VIDEO) ; +} +/** + \fn undoAction + \brief Called to undo the action +*/ +void MainWindow::undoAction(void) +{ + sendAction (ACT_Undo) ; +} +/** + \fn redoAction + \brief Called to redo the action +*/ +void MainWindow::redoAction(void) +{ + sendAction (ACT_Redo) ; +} +/** + \fn cutSelection + \brief Called to cut the selection +*/ +void MainWindow::cutSelection(void) +{ + sendAction (ACT_Cut) ; +} +/** + \fn copySelection + \brief Called to copy the selection +*/ +void MainWindow::copySelection(void) +{ + sendAction (ACT_Copy) ; +} +/** + \fn pasteClipboard + \brief Called to paste the clipboard +*/ +void MainWindow::pasteClipboard(void) +{ + sendAction (ACT_Paste) ; +} +/** + \fn editMarkerA + \brief Called to edit the marker A +*/ +void MainWindow::editMarkerA(void) +{ + sendAction (ACT_SelectMarkerA) ; +} +/** + \fn editMarkerB + \brief Called to edit the marker B +*/ +void MainWindow::editMarkerB(void) +{ + sendAction (ACT_SelectMarkerB) ; +} +/** + \fn gotoMarkerA + \brief Called to jump to the marker A in the player +*/ +void MainWindow::gotoMarkerA(void) +{ + sendAction (ACT_GotoMarkA) ; +} +/** + \fn gotoMarkerB + \brief Called to jump to the marker B in the player +*/ +void MainWindow::gotoMarkerB(void) +{ + sendAction (ACT_GotoMarkB) ; +} +/** + \fn resetMarkerA + \brief Called to reset the marker A +*/ +void MainWindow::resetMarkerA(void) +{ + sendAction (ACT_ResetMarkerA) ; +} +/** + \fn resetMarkerB + \brief Called to reset the marker B +*/ +void MainWindow::resetMarkerB(void) +{ + sendAction (ACT_ResetMarkerB) ; +} +/** + \fn resetMarkers + \brief Called to reset both marker A and B +*/ +void MainWindow::resetMarkers(void) +{ + sendAction (ACT_ResetMarkers) ; +} /** \fn searchMenu */ @@ -2157,10 +2886,10 @@ bool MainWindow::eventFilter(QObject* watched, QEvent* event) adjustZoom(os.width(),os.height()); break; } - if (watched == ui.sliderPlaceHolder) + if (watched == ui.thumbSliderHolder) { - thumbSlider->resize(ui.sliderPlaceHolder->width(), 16); - thumbSlider->move(0, (ui.sliderPlaceHolder->height() - thumbSlider->height()) / 2); + thumbSlider->resize(ui.thumbSliderHolder->width(), 16); + thumbSlider->move(0, (ui.thumbSliderHolder->height() - thumbSlider->height()) / 2); } break; @@ -2466,7 +3195,7 @@ void MainWindow::calcDockWidgetDimensions(uint32_t &width, uint32_t &height) reqh += ui.menubar->height(); if(ui.toolBar->isVisible() && false==ui.toolBar->isFloating() && ui.toolBar->orientation()==Qt::Horizontal) reqh += ui.toolBar->frameSize().height(); - if(ui.navigationWidget->isVisible() || ui.selectionWidget->isVisible() || ui.volumeWidget->isVisible() || ui.audioMetreWidget->isVisible()) + if(ui.navigationWidget->isVisible()) reqh += ui.navigationWidget->frameSize().height(); height = reqh; } @@ -2521,39 +3250,43 @@ void MainWindow::volumeWidgetOperational(void) } /** - \fn syncToolbarsMenu - \brief Make sure only visible widgets have check marks - in the Toolbars submenu of the View menu. + \fn initWidgetsVisibility + \brief Initialize widgets visibility from preferences. */ -void MainWindow::syncToolbarsMenu(void) +void MainWindow::initWidgetsVisibility(void) { -#define EXPAND(x) ui.x ## Widget -#define CHECKMARK(x,y) ui.menuToolbars->actions().at(x)->setChecked(EXPAND(y)->isVisible()); - CHECKMARK(0,audioMetre) - CHECKMARK(1,codec) - CHECKMARK(2,navigation) - CHECKMARK(3,selection) - CHECKMARK(4,volume) - ui.menuToolbars->actions().at(5)->setChecked(ui.toolBar->isVisible()); -#undef CHECKMARK -#undef EXPAND + bool visible; + + // Changing checked state automatically shows/hides the widget, + // there's no need to explicitly set a widget's visibility. +#define PREF_SET_VISIBLE(preference) \ + prefs->get(TOOLBARS_ ## preference ## _VISIBLE, &visible); \ + ui.menuToolbars->actions().at(ADM_Toolbars_Item::preference)->setChecked(visible) + + PREF_SET_VISIBLE(TOOLBAR); + PREF_SET_VISIBLE(STATUSBAR); + PREF_SET_VISIBLE(CODEC); + PREF_SET_VISIBLE(NAVIGATION); + PREF_SET_VISIBLE(AUDIOMETER); + PREF_SET_VISIBLE(VOLUME); + PREF_SET_VISIBLE(CONTROLS); + PREF_SET_VISIBLE(SELECTION); + PREF_SET_VISIBLE(TIME); + PREF_SET_VISIBLE(SLIDER); + +#undef PREF_SET_VISIBLE } /** - \fn addStatusBar - \brief Add status bar to the main window + \fn initStatusBar + \brief Initialize the main window's status bar */ -void MainWindow::addStatusBar(void) +void MainWindow::initStatusBar(void) { - QStatusBar * statusBar = new QStatusBar(this); - statusBar->setSizeGripEnabled(false); - this->statusBarInfo = new QLabel(""); - statusBar->addWidget(this->statusBarInfo); - - statusBar->setContentsMargins(4,0,4,0); - - this->setStatusBar(statusBar); + ui.statusBarWidget->setSizeGripEnabled(false); + ui.statusBarWidget->addWidget(this->statusBarInfo); + ui.statusBarWidget->setContentsMargins(4,0,4,0); updateStatusBarInfo(); } @@ -2569,6 +3302,8 @@ void MainWindow::updateStatusBarInfo(void) s += QString(QT_TRANSLATE_NOOP("qgui2","Input: %1x%2, %3fps | Decoder: %4 | Display: %5 | Zoom: %6%")) .arg(avifileinfo->width).arg(avifileinfo->height).arg(avifileinfo->fps1000/1000.0) .arg(statusBarInfo_Decoder).arg(statusBarInfo_Display).arg(statusBarInfo_Zoom); + if(!statusBarFrame_Type.isEmpty()) + s += QString(QT_TRANSLATE_NOOP("qgui2"," | Frame type: %1")).arg(statusBarFrame_Type); } else { @@ -2734,9 +3469,9 @@ uint8_t initGUI(const vector& scriptEngines) break; default: break; } - mw->ui.horizontalSlider_2->blockSignals(true); - mw->ui.horizontalSlider_2->setValue(qset->value("volume", 100).toInt()); - mw->ui.horizontalSlider_2->blockSignals(false); + mw->ui.volumeSlider->blockSignals(true); + mw->ui.volumeSlider->setValue(qset->value("volume", 100).toInt()); + mw->ui.volumeSlider->blockSignals(false); qset->endGroup(); // Hack: allow to drop other Qt-specific settings on application restart char *dropSettingsOnLaunch = getenv("ADM_QT_DROP_SETTINGS"); @@ -2745,9 +3480,9 @@ uint8_t initGUI(const vector& scriptEngines) delete qset; qset = NULL; // Probing for OpenGL fails if VU meter is hidden, delay hiding it. - vuMeterIsHidden = mw->ui.audioMetreWidget->isHidden(); + vuMeterIsHidden = mw->ui.audioMeterWidget->isHidden(); if(openglEnabled && vuMeterIsHidden) - mw->ui.audioMetreWidget->setVisible(true); + mw->ui.audioMeterWidget->setVisible(true); } QuiMainWindows = (QWidget*)mw; @@ -2794,14 +3529,14 @@ uint8_t initGUI(const vector& scriptEngines) openGLStarted=true; UI_Qt4InitGl(); if(vuMeterIsHidden) - mw->ui.audioMetreWidget->setVisible(false); + mw->ui.audioMeterWidget->setVisible(false); }else { ADM_info("OpenGL not activated, not initialized\n"); } #endif - mw->syncToolbarsMenu(); - mw->addStatusBar(); + mw->initWidgetsVisibility(); + mw->initStatusBar(); return 1; } @@ -2819,7 +3554,7 @@ void UI_closeGui(void) qset->beginGroup("MainWindow"); qset->setValue("windowState", ((QMainWindow *)QuiMainWindows)->saveState()); qset->setValue("showMaximized", QuiMainWindows->isMaximized()); - qset->setValue("volume", WIDGET(horizontalSlider_2)->value()); + qset->setValue("volume", WIDGET(volumeSlider)->value()); qset->endGroup(); delete qset; qset = NULL; @@ -2858,6 +3593,9 @@ void UI_applySettings(void) ((MainWindow *)QuiMainWindows)->updateActionShortcuts(); ((MainWindow *)QuiMainWindows)->volumeWidgetOperational(); ((MainWindow *)QuiMainWindows)->setRefreshCap(); + ((MainWindow *)QuiMainWindows)->updateTimeFieldsReadOnly(); + ((MainWindow *)QuiMainWindows)->updateWidgetActionButtons(); + ((MainWindow *)QuiMainWindows)->updatePTSToolTips(); } /** \fn UI_getCurrentPreview @@ -3149,7 +3887,7 @@ void UI_setFrameType( uint32_t frametype,uint32_t qp) { if(frametype == CLEAR_FRAME_TYPE) { - WIDGET(label_8)->clear(); + ((MainWindow *)QuiMainWindows)->statusBarFrame_Type = ""; return; } @@ -3177,8 +3915,9 @@ void UI_setFrameType( uint32_t frametype,uint32_t qp) sprintf(string,QT_TRANSLATE_NOOP("qgui2","%c-%s"),c,f); else sprintf(string,QT_TRANSLATE_NOOP("qgui2","%c-%s (%02d)"),c,f,qp); - WIDGET(label_8)->setText(string); + ((MainWindow *)QuiMainWindows)->statusBarFrame_Type = QString(string); + ((MainWindow *)QuiMainWindows)->updateStatusBarInfo(); } /** * @@ -3189,20 +3928,97 @@ admUITaskBarProgress *UI_getTaskBarProgress() return QuiTaskBarProgress; } +/** + \fn UI_getCurrentTime + \brief Get currently displayed PTS, this may have been edited by the user and it's not the real PTS +*/ +bool UI_getCurrentTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + if(WIDGET(currentTime)->isTextEdited()) + { + WIDGET(currentTime)->PTS(hh, mm, ss, ms, us); + return true; + } + + WIDGET(currentTime)->resetEdit(); + return false; +} + +/** + \fn UI_getMarkerA + \brief Get currently displayed PTS, this may have been edited by the user and it's not the real PTS +*/ +bool UI_getMarkerA(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + if(WIDGET(selectionMarkerA)->isTextEdited()) + { + WIDGET(selectionMarkerA)->PTS(hh, mm, ss, ms, us); + return true; + } + + WIDGET(selectionMarkerA)->resetEdit(); + return false; +} + +/** + \fn UI_getMarkerB + \brief Get currently displayed PTS, this may have been edited by the user and it's not the real PTS +*/ +bool UI_getMarkerB(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + if(WIDGET(selectionMarkerB)->isTextEdited()) + { + WIDGET(selectionMarkerB)->PTS(hh, mm, ss, ms, us); + return true; + } + + WIDGET(selectionMarkerB)->resetEdit(); + return false; +} + +/** + \fn UI_getSelectionTime + \brief Get currently displayed PTS, this may have been edited by the user and it's not the real PTS +*/ +bool UI_getSelectionTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + if(WIDGET(selectionDuration)->isTextEdited()) + { + WIDGET(selectionDuration)->PTS(hh, mm, ss, ms, us); + return true; + } + + WIDGET(selectionDuration)->resetEdit(); + return false; +} + +/** + \fn UI_getTotalTime + \brief Get currently displayed PTS, this may have been edited by the user and it's not the real PTS +*/ +bool UI_getTotalTime(uint32_t *hh, uint32_t *mm, uint32_t *ss, uint32_t *ms, uint32_t *us) +{ + if(WIDGET(totalTime)->isTextEdited()) + { + WIDGET(totalTime)->PTS(hh, mm, ss, ms, us); + return true; + } + + WIDGET(totalTime)->resetEdit(); + return false; +} + /** \fn UI_setCurrentTime \brief Set current PTS of displayed video */ void UI_setCurrentTime(uint64_t curTime) { - char text[80]; - uint32_t mm,hh,ss,ms; - uint32_t shorty=(uint32_t)(curTime/1000); - - ms2time(shorty,&hh,&mm,&ss,&ms); - sprintf(text, "%02d:%02d:%02d.%03d", hh, mm, ss, ms); - WIDGET(currentTime)->setText(text); - + WIDGET(currentTime)->setPTS(curTime); + if(!avifileinfo) + WIDGET(currentTime)->removePTSToolTip(); + else if(((MainWindow *)QuiMainWindows)->showPTSToolTips) + WIDGET(currentTime)->appendPTSToolTip(); } /** @@ -3211,14 +4027,12 @@ void UI_setCurrentTime(uint64_t curTime) */ void UI_setTotalTime(uint64_t curTime) { - char text[80]; - uint32_t mm,hh,ss,ms; - uint32_t shorty=(uint32_t)(curTime/1000); - - ms2time(shorty,&hh,&mm,&ss,&ms); - sprintf(text, "/ %02d:%02d:%02d.%03d", hh, mm, ss, ms); - WIDGET(totalTime)->setText(text); + WIDGET(totalTime)->setPTS(curTime); slider->setTotalDuration(curTime); + if(!avifileinfo) + WIDGET(totalTime)->removePTSToolTip(); + else if(((MainWindow *)QuiMainWindows)->showPTSToolTips) + WIDGET(totalTime)->appendPTSToolTip(); } /** \fn UI_setSegments @@ -3234,30 +4048,23 @@ void UI_setSegments(uint32_t numOfSegs, uint64_t * segPts) */ void UI_setMarkers(uint64_t a, uint64_t b) { - char text[80]; - uint64_t absoluteA=a,absoluteB=b; - uint32_t hh,mm,ss,ms; - uint32_t timems; - a/=1000; - b/=1000; - - timems=(uint32_t)(a); - ms2time(timems,&hh,&mm,&ss,&ms); - snprintf(text,79,"%02" PRIu32":%02" PRIu32":%02" PRIu32".%03" PRIu32,hh,mm,ss,ms); - WIDGET(pushButtonJumpToMarkerA)->setText(text); - - timems=(uint32_t)(b); - ms2time(timems,&hh,&mm,&ss,&ms); - snprintf(text,79,"%02" PRIu32":%02" PRIu32":%02" PRIu32".%03" PRIu32,hh,mm,ss,ms); - WIDGET(pushButtonJumpToMarkerB)->setText(text); - - timems=(uint32_t)(b-a); - ms2time(timems,&hh,&mm,&ss,&ms); - snprintf(text,79,"%02" PRIu32":%02" PRIu32":%02" PRIu32".%03" PRIu32,hh,mm,ss,ms); - QString duration=QString::fromUtf8(QT_TRANSLATE_NOOP("qgui2","Selection: "))+QString(text); - WIDGET(selectionDuration)->setText(duration); - - slider->setMarkers(absoluteA, absoluteB); + WIDGET(selectionMarkerA)->setPTS(a); + WIDGET(selectionMarkerB)->setPTS(b); + // NOTE: To cut the us use (uint64_t)((uint32_t)(a/1000))*1000 + WIDGET(selectionDuration)->setPTS(b - a); + slider->setMarkers(a, b); + if(!avifileinfo) + { + WIDGET(selectionMarkerA)->removePTSToolTip(); + WIDGET(selectionMarkerB)->removePTSToolTip(); + WIDGET(selectionDuration)->removePTSToolTip(); + } + else if(((MainWindow *)QuiMainWindows)->showPTSToolTips) + { + WIDGET(selectionMarkerA)->appendPTSToolTip(); + WIDGET(selectionMarkerB)->appendPTSToolTip(); + WIDGET(selectionDuration)->appendPTSToolTip(); + } } /** diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.h b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.h index 5792cff0da..080cf804df 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.h +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.h @@ -122,8 +122,8 @@ class MainWindow : public QMainWindow void setActZoomCalledFlag(bool called); void setZoomToFit(void); void updateZoomIndicator(void); - void syncToolbarsMenu(void); - void addStatusBar(void); + void initWidgetsVisibility(void); + void initStatusBar(void); void updateStatusBarInfo(void); void updateStatusBarDisplayInfo(const char * display); void updateStatusBarDecoderInfo(const char * decoder); @@ -133,9 +133,33 @@ class MainWindow : public QMainWindow void setLightTheme(void); void setDarkTheme(void); + void currentTimeAddActionButons(bool all); + void totalTimeAddActionButons(bool all); + void selectionDurationAddActionButons(bool all); + void selectionMarkerAAddActionButons(bool all); + void selectionMarkerBAddActionButons(bool all); + static void updateCheckDone(int version, const std::string &date, const std::string &downloadLink); static MainWindow *mainWindowSingleton; + QString statusBarFrame_Type; + + // Show precision timings in time fields tooltips + void updatePTSToolTips(void); + bool showPTSToolTips; + + // Show extra buttons in time fields + void updateWidgetActionButtons(void); + bool showExtraButtons; + + // Allow time fields editing via keyboard + void updateTimeFieldsReadOnly(void); + bool isCurrentTimeFieldEditable; + bool isTotalTimeFieldEditable; + bool isSelectionTimeFieldEditable; + bool isMarkerATimeFieldEditable; + bool isMarkerBTimeFieldEditable; + #ifdef __APPLE__ void fileOpenWrapper(QList list) { openFiles(list); } #endif @@ -182,6 +206,8 @@ class MainWindow : public QMainWindow QTimer navigateWhilePlayingTimer; const std::vector& _scriptEngines; + QMenu *createPopupMenu(void); + void addScriptDirToMenu(QMenu* scriptMenu, const QString& dir, const QStringList& fileExts); void addScriptEnginesToFileMenu(std::vector& fileMenu); void addScriptShellsToToolsMenu(vector& toolMenu); @@ -219,12 +245,71 @@ class MainWindow : public QMainWindow int statusBarInfo_Zoom; QString statusBarInfo_Display, statusBarInfo_Decoder; + // Reflects the items order set in View->Toolbars + enum ADM_Toolbars_Item + { + FIRST=0, // begin (for iterations) + TOOLBAR=0, // toolBar + STATUSBAR=1, // statusBarWidget + CODEC=2, // codecWidget + NAVIGATION=3, // navigationWidget + // separator + AUDIOMETER=5, // audioMeterWidget + VOLUME=6, // volumeWidget + CONTROLS=7, // controlsWidget + SELECTION=8, // selectionWidget + TIME=9, // timeWidget + SLIDER=10, // sliderWidget + LAST=10 // end (for iterations) + }; + +private: + QList currentTimeActionButtons; + QList totalTimeActionButtons; + QList selectionDurationActionButtons; + QList selectionMarkerAActionButtons; + QList selectionMarkerBActionButtons; + + QAction *pushButtonTime; + QAction *pushButtonSaveScript; + QAction *pushButtonRunScript; + QAction *pushButtonAppend; + QAction *pushButtonUndo; + QAction *pushButtonRedo; + QAction *pushButtonCut; + QAction *pushButtonCopy; + QAction *pushButtonPaste; + QAction *pushButtonEditMarkerA; + QAction *pushButtonEditMarkerB; + QAction *pushButtonJumpToMarkerA; + QAction *pushButtonJumpToMarkerB; + QAction *pushButtonResetMarkerA; + QAction *pushButtonResetMarkerB; + QAction *pushButtonResetMarkers; + private slots: void timeChanged(int); void timeChangeFinished(void); void checkChanged(int); void comboChanged(int z); + void seekTime(void); + void saveScriptAction(void); + void runScriptAction(void); + void appendAction(void); + void undoAction(void); + void redoAction(void); + void cutSelection(void); + void copySelection(void); + void pasteClipboard(void); + void editMarkerA(void); + void editMarkerB(void); + void gotoMarkerA(void); + void gotoMarkerB(void); + void resetMarkerA(void); + void resetMarkerB(void); + void resetMarkers(void); + void buttonPressed(void); void toolButtonPressed(bool z); @@ -232,6 +317,21 @@ private slots: void previewModeChangedFromToolbar(bool status); void currentTimeChanged(void); + void markerAChanged(void); + void markerBChanged(void); + void selectionDurationChanged(void); + void totalTimeChanged(void); + + void toolBarVisibilityChanged(bool); + void statusBarVisibilityChanged(bool); + void codecVisibilityChanged(bool); + void navigationVisibilityChanged(bool); + void audioMeterVisibilityChanged(bool); + void volumeVisibilityChanged(bool); + void controlsVisibilityChanged(bool); + void selectionVisibilityChanged(bool); + void timeVisibilityChanged(bool); + void sliderVisibilityChanged(bool); void sliderValueChanged(int u); void sliderMoved(int value); diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2_menu.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2_menu.cpp index d4676b7edd..3a0e9d1adc 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2_menu.cpp +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2_menu.cpp @@ -58,17 +58,17 @@ void MainWindow::addScriptEnginesToFileMenu(vector& fileMenu) MenuEntry dummyEntry = {MENU_SUBMENU, itemName, NULL, ACT_DUMMY, NULL, NULL, true}; it = fileMenu.insert(it, dummyEntry); - MenuEntry runProjectEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","&Run Project..."), NULL, firstMenuId, NULL, NULL, true}; + MenuEntry runProjectEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","&Run Project..."), NULL, firstMenuId, MKICON(runscript), NULL, true}; it = fileMenu.insert(it + 1, runProjectEntry); if ((this->_scriptEngines[engineIndex]->capabilities() & IScriptEngine::Debugger) == IScriptEngine::Debugger) { - MenuEntry debugEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","&Debug Project..."), NULL, (Action)(firstMenuId + 1), NULL, NULL, true}; + MenuEntry debugEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","&Debug Project..."), NULL, (Action)(firstMenuId + 1), MKICON(debugscript), NULL, true}; it = fileMenu.insert(it + 1, debugEntry); i++; } - MenuEntry saveAsProjectEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","Save &As Project..."), NULL, (Action)(firstMenuId + 2), NULL, NULL, true}; + MenuEntry saveAsProjectEntry = {MENU_SUBACTION, QT_TRANSLATE_NOOP("qgui2menu","Save &As Project..."), NULL, (Action)(firstMenuId + 2), MKICON(savescript), NULL, true}; it = fileMenu.insert(it + 1, saveAsProjectEntry); i += 3; } diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.cpp new file mode 100644 index 0000000000..a92f8f8a4c --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.cpp @@ -0,0 +1,77 @@ +/*************************************************************************** + \file Q_titleBar + \brief Custom QDockWidget title bar + \author Matthew White + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "Q_titleBar.h" + +TitleBar::TitleBar(QString title /* = "" */) +{ + QString tt; + + ui.setupUi(this); + + // Can interpret text mnemonic (&) when a buddy is set (setBuddy). + ui.titleLabel->setText(title); + + tt = QT_TRANSLATE_NOOP("qgui2","Dock"); + ui.dockButton->setToolTip(tt); + ui.dockButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_TitleBarMinButton)); + connect(ui.dockButton,SIGNAL(clicked()),this,SLOT(dockParent())); + + tt = QT_TRANSLATE_NOOP("qgui2","Float"); + ui.floatButton->setToolTip(tt); + ui.floatButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_TitleBarMaxButton)); + connect(ui.floatButton,SIGNAL(clicked()),this,SLOT(floatParent())); + + tt = QT_TRANSLATE_NOOP("qgui2","Close"); + ui.closeButton->setToolTip(tt); + ui.closeButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_TitleBarCloseButton)); + connect(ui.closeButton,SIGNAL(clicked()),this,SLOT(closeParent())); +} + +void TitleBar::showEvent(QShowEvent *e) +{ + QDockWidget *dockWidget = qobject_cast(parentWidget()); + bool floating = dockWidget->isFloating(); + QWidget::showEvent(e); + ui.dockButton->setVisible(floating); + ui.floatButton->setVisible(!floating); + // Interpret text mnemonic (&). + if(floating) + ui.titleLabel->setBuddy(ui.dockButton); + else + ui.titleLabel->setBuddy(ui.floatButton); +} + +void TitleBar::dockParent(void) +{ + QDockWidget *dockWidget = qobject_cast(parentWidget()); + dockWidget->setFloating(false); +} + +void TitleBar::floatParent(void) +{ + QDockWidget *dockWidget = qobject_cast(parentWidget()); + dockWidget->setFloating(true); +} + +void TitleBar::closeParent(void) +{ + QDockWidget *dockWidget = qobject_cast(parentWidget()); + dockWidget->setVisible(false); +} + +TitleBar::~TitleBar() +{ +} diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.h b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.h new file mode 100644 index 0000000000..e269c054aa --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_titleBar.h @@ -0,0 +1,30 @@ +#ifndef Q_titleBar_h +#define Q_titleBar_h + +#include +#include +#include "ui_titleBar.h" + +/** + \class TitleBar +*/ +class TitleBar : public QWidget +{ + Q_OBJECT + +public: + TitleBar(QString title = ""); + virtual ~TitleBar(); + +protected: + void showEvent(QShowEvent *e); + +private: + Ui_TitleBar ui; + +private slots: + void dockParent(void); + void floatParent(void); + void closeParent(void); +}; +#endif // Q_titleBar_h diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/T_vumeter.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/T_vumeter.cpp index 56949bb8dd..658947fe87 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/T_vumeter.cpp +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/T_vumeter.cpp @@ -40,6 +40,8 @@ static ADM_Qvumeter *vuWidget = NULL; #define DRED 0xFFBF0000 #define BLACK 0xFF000000 +#define VU_WIDTH 64 +#define VU_HEIGHT 107 #define VU_BAR_WIDTH 5 #define VU_PEAK_WIDTH 7 #define VU_BOTTOM_SCALE -60.0 // dBFS, must be negative @@ -51,11 +53,11 @@ ADM_Qvumeter::ADM_Qvumeter(QWidget *z, int width, int height) : QWidget(z) z->resize(width + 2, height + 2); rgbDataBuffer = new uint8_t[width * height * 4]; - for(int i=0;i<88;i++) + for(int i=0;ishow(); return true; @@ -158,11 +160,11 @@ bool UI_vuUpdate(int32_t volume[8]) if (activeChannelCount == 0) // just clear { - for(int i=0;i<88;i++) + for(int i=0;i= activeChannelCount) diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux.qrc b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux.qrc index 997ebc685f..290152ce86 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux.qrc +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux.qrc @@ -5,6 +5,10 @@ pics/avidemux_window_icon_linux.png pics/back.png pics/calc.png + pics/append.png + pics/savescript.png + pics/runscript.png + pics/debugscript.png pics/fileopen.png pics/filesave.png pics/filesaveas.png @@ -14,6 +18,14 @@ pics/info.png pics/markA.png pics/markB.png + pics/undo.png + pics/redo.png + pics/cut.png + pics/copy.png + pics/paste.png + pics/reset_markA.png + pics/reset_markB.png + pics/time.png pics/next.png pics/next_black.png pics/next_cut.png @@ -40,6 +52,10 @@ pics/volume_off.png pics/back@2x.png pics/backward1mn@2x.png + pics/append@2x.png + pics/savescript@2x.png + pics/runscript@2x.png + pics/debugscript@2x.png pics/fileopen@2x.png pics/filesave@2x.png pics/forward1mn@2x.png @@ -47,6 +63,14 @@ pics/info@2x.png pics/markA@2x.png pics/markB@2x.png + pics/undo@2x.png + pics/redo@2x.png + pics/cut@2x.png + pics/copy@2x.png + pics/paste@2x.png + pics/reset_markA@2x.png + pics/reset_markB@2x.png + pics/time@2x.png pics/next_black@2x.png pics/next_cut@2x.png pics/player_end@2x.png diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_osx.qrc b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_osx.qrc index eb48cfb407..2f68f3a7f0 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_osx.qrc +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_osx.qrc @@ -5,6 +5,10 @@ pics/avidemux.icns pics/back.png pics/calc.png + pics/append.png + pics/savescript.png + pics/runscript.png + pics/debugscript.png pics/fileopen.png pics/filesave.png pics/filesaveas.png @@ -14,6 +18,14 @@ pics/info.png pics/markA.png pics/markB.png + pics/undo.png + pics/redo.png + pics/cut.png + pics/copy.png + pics/paste.png + pics/reset_markA.png + pics/reset_markB.png + pics/time.png pics/next.png pics/next_black.png pics/next_cut.png @@ -40,6 +52,10 @@ pics/volume_off.png pics/back@2x.png pics/backward1mn@2x.png + pics/append@2x.png + pics/savescript@2x.png + pics/runscript@2x.png + pics/debugscript@2x.png pics/fileopen@2x.png pics/filesave@2x.png pics/forward1mn@2x.png @@ -47,6 +63,14 @@ pics/info@2x.png pics/markA@2x.png pics/markB@2x.png + pics/undo@2x.png + pics/redo@2x.png + pics/cut@2x.png + pics/copy@2x.png + pics/paste@2x.png + pics/reset_markA@2x.png + pics/reset_markB@2x.png + pics/time@2x.png pics/next_black@2x.png pics/next_cut@2x.png pics/player_end@2x.png diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32.qrc b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32.qrc index 6491e4ccb4..cb44ba59f8 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32.qrc +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32.qrc @@ -5,6 +5,10 @@ pics/avidemux_icon_small.png pics/back.png pics/calc.png + pics/append.png + pics/savescript.png + pics/runscript.png + pics/debugscript.png pics/fileopen.png pics/filesave.png pics/filesaveas.png @@ -14,6 +18,14 @@ pics/info.png pics/markA.png pics/markB.png + pics/undo.png + pics/redo.png + pics/cut.png + pics/copy.png + pics/paste.png + pics/reset_markA.png + pics/reset_markB.png + pics/time.png pics/next.png pics/next_black.png pics/next_cut.png @@ -40,6 +52,10 @@ pics/volume_off.png pics/back@2x.png pics/backward1mn@2x.png + pics/append@2x.png + pics/savescript@2x.png + pics/runscript@2x.png + pics/debugscript@2x.png pics/fileopen@2x.png pics/filesave@2x.png pics/forward1mn@2x.png @@ -47,6 +63,14 @@ pics/info@2x.png pics/markA@2x.png pics/markB@2x.png + pics/undo@2x.png + pics/redo@2x.png + pics/cut@2x.png + pics/copy@2x.png + pics/paste@2x.png + pics/reset_markA@2x.png + pics/reset_markB@2x.png + pics/time@2x.png pics/next_black@2x.png pics/next_cut@2x.png pics/player_end@2x.png diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32_custom_font.qrc b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32_custom_font.qrc index ac7b416aac..19c0681b94 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32_custom_font.qrc +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32_custom_font.qrc @@ -5,6 +5,10 @@ pics/avidemux_icon_small.png pics/back.png pics/calc.png + pics/append.png + pics/savescript.png + pics/runscript.png + pics/debugscript.png pics/fileopen.png pics/filesave.png pics/filesaveas.png @@ -14,6 +18,14 @@ pics/info.png pics/markA.png pics/markB.png + pics/undo.png + pics/redo.png + pics/cut.png + pics/copy.png + pics/paste.png + pics/reset_markA.png + pics/reset_markB.png + pics/time.png pics/next.png pics/next_black.png pics/next_cut.png @@ -40,6 +52,10 @@ pics/volume_off.png pics/back@2x.png pics/backward1mn@2x.png + pics/append@2x.png + pics/savescript@2x.png + pics/runscript@2x.png + pics/debugscript@2x.png pics/fileopen@2x.png pics/filesave@2x.png pics/forward1mn@2x.png @@ -47,6 +63,14 @@ pics/info@2x.png pics/markA@2x.png pics/markB@2x.png + pics/undo@2x.png + pics/redo@2x.png + pics/cut@2x.png + pics/copy@2x.png + pics/paste@2x.png + pics/reset_markA@2x.png + pics/reset_markB@2x.png + pics/time@2x.png pics/next_black@2x.png pics/next_cut@2x.png pics/player_end@2x.png diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/gui2.ui b/avidemux/qt4/ADM_userInterfaces/ADM_gui/gui2.ui index cb928e14ed..76c22c7fce 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/gui2.ui +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/gui2.ui @@ -27,22 +27,25 @@ 200 - + + + 0 + + + 9 + + + 9 + + + 9 + + + 9 + - + - 6 - - - 0 - - - 0 - - - 0 - - 0 @@ -65,28 +68,19 @@ QFrame::NoFrame - - QFrame::Raised - 0 - + Qt::Horizontal QSizePolicy::Expanding - - - 13 - 13 - - @@ -102,9 +96,6 @@ 21 - - Qt::PreventContextMenu - &Help @@ -128,12 +119,17 @@ &Toolbars - + + - + + - + + + + @@ -145,12 +141,12 @@ - &Auto + A&uto - &Custom + Cust&om @@ -160,7 +156,7 @@ - &Tools + Too&ls @@ -191,12 +187,18 @@ - - Qt::PreventContextMenu + + &Toolbar + + + true Qt::Horizontal + + false + TopToolBarArea @@ -216,19 +218,19 @@ - QDockWidget::NoDockWidgetFeatures + QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea - Codec O&ptions + &Codec Options - 1 + 2 - - + + 0 @@ -239,28 +241,25 @@ 9 - 0 + 9 9 - + 0 - - QLayout::SetDefaultConstraint - - + <b>Video Decoder</b> - + Qt::Vertical @@ -269,31 +268,19 @@ - 20 + 0 13 - + 0 - - 0 - - - 0 - - - 0 - - - 0 - - + Qt::Horizontal @@ -303,30 +290,18 @@ 13 - 53 + 0 - + 6 - - 0 - - - 0 - - - 0 - - - 0 - - + @@ -334,6 +309,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 0 + + + + @@ -341,6 +332,16 @@ + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + @@ -364,7 +365,7 @@ - + Qt::Vertical @@ -373,36 +374,21 @@ - 20 + 0 13 - - - - 0 - 0 - - - - - 180 - 16777215 - - + <b>Video Output</b> - - Qt::AutoText - - + Qt::Vertical @@ -411,31 +397,19 @@ - 20 + 0 13 - + 0 - - 0 - - - 0 - - - 0 - - - 0 - - + Qt::Horizontal @@ -444,36 +418,21 @@ - 12 + 13 0 - + 6 - - QLayout::SetDefaultConstraint - - - 0 - - - 0 - - - 0 - - - 0 - - + 0 0 @@ -522,7 +481,7 @@ - + Qt::Vertical @@ -531,34 +490,19 @@ - 20 + 0 13 - + - - - - 0 - 0 - - - - - 180 - 16777215 - - + <b>Audio Output</b> - - Qt::AutoText - @@ -568,10 +512,20 @@ + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + - + Qt::Vertical @@ -580,31 +534,19 @@ - 20 + 0 13 - + 0 - - 0 - - - 0 - - - 0 - - - 0 - - + Qt::Horizontal @@ -613,36 +555,21 @@ - 12 + 13 0 - + 6 - - QLayout::SetDefaultConstraint - - - 0 - - - 0 - - - 0 - - - 0 - - + 0 0 @@ -687,25 +614,10 @@ - + 6 - - QLayout::SetDefaultConstraint - - - 0 - - - 0 - - - 0 - - - 0 - @@ -733,18 +645,22 @@ - - - - 0 - 0 - - + ms + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + @@ -752,7 +668,7 @@ - + Qt::Vertical @@ -761,30 +677,21 @@ - 20 + 0 13 - - - - 0 - 0 - - + <b>Output Format</b> - - Qt::AutoText - - + Qt::Vertical @@ -793,19 +700,19 @@ - 20 + 0 13 - + 0 - + Qt::Horizontal @@ -814,21 +721,21 @@ - 12 + 13 0 - + 6 - + 0 0 @@ -858,19 +765,13 @@ - + Qt::Vertical QSizePolicy::Expanding - - - 20 - 10 - - @@ -878,28 +779,16 @@ - + 0 0 - - - 543 - 120 - - - - - 524287 - 120 - - - QDockWidget::NoDockWidgetFeatures + QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable - Qt::BottomDockWidgetArea + Qt::BottomDockWidgetArea|Qt::TopDockWidgetArea &Navigation @@ -907,14 +796,14 @@ 8 - + - + 0 0 - + 0 @@ -922,7 +811,7 @@ 9 - 1 + 9 9 @@ -931,901 +820,993 @@ 9 - - - - 0 - 0 - - - - - 0 - 22 - - - - Qt::Horizontal - - - - - + - 12 - - 0 - - - 0 - - - 0 - - - 0 + + + + 0 + 0 + - - 0 + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + + + + + 0 + 0 + + + + + 64 + 107 + + + + QFrame::NoFrame + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 5 + 0 + + + + + + + + + + + + 0 + 0 + - + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + + + + true + + + + 0 + 0 + + + + + 22 + 22 + + + + ... + + + + :/new/prefix1/pics/volume_off.png + :/new/prefix1/pics/volume.png:/new/prefix1/pics/volume_off.png + + + true + + + true + + + + + + + + 0 + 0 + + + + + 22 + 80 + + + + 100 + + + 100 + + + Qt::Vertical + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 5 + 0 + + + + + + + + + + 0 - - - Play [SPACE] - - - - - - ... - - - - :/new/prefix1/pics/player_play.png:/new/prefix1/pics/player_play.png - - - - 24 - 24 - - - - true - - - - - - - Go to previous frame [LEFT] - - - ... - - - - :/new/prefix1/pics/back.png:/new/prefix1/pics/back.png - - - - 24 - 24 - - - - true - - - - - - - Go to next frame [RIGHT] - - - ... - - - - :/new/prefix1/pics/forward.png:/new/prefix1/pics/forward.png - - - - 24 - 24 - + + + Qt::Vertical - - true + + QSizePolicy::Expanding - + - - - Go to previous keyframe [DOWN] - - - ... - - - - :/new/prefix1/pics/player_rew.png:/new/prefix1/pics/player_rew.png + + + + 0 + 0 + - + - 24 - 24 + 0 + 32 - - true - - - - - - - Go to next keyframe [UP] - - - ... - - - - :/new/prefix1/pics/player_fwd.png:/new/prefix1/pics/player_fwd.png - - - - 24 - 24 - - - - true - - - - - - - Set start marker [CTRL+PAGEUP] - - - ... - - - - :/new/prefix1/pics/markA.png:/new/prefix1/pics/markA.png - - - - 27 - 24 - - - - true - - - - - - - Delete selection [DEL] - - - ... - - - - :/new/prefix1/pics/delete_selection.png:/new/prefix1/pics/delete_selection.png - - - - 24 - 24 - - - - true - - - - - - - Set end marker [CTRL+PAGEDOWN] - - - ... - - - - :/new/prefix1/pics/markB.png:/new/prefix1/pics/markB.png - - - - 27 - 24 - - - - true - - - - - - - Go to previous cut point [SHIFT+DOWN] - - - ... - - - - :/new/prefix1/pics/prev_cut.png:/new/prefix1/pics/prev_cut.png - - - - 24 - 24 - - - - true - - - - - - - Go to next cut point [SHIFT+UP] - - - ... - - - - :/new/prefix1/pics/next_cut.png:/new/prefix1/pics/next_cut.png - - - - 24 - 24 - - - - true - - - - - - - Search previous black frame - - - ... - - - - :/new/prefix1/pics/prev_black.png:/new/prefix1/pics/prev_black.png - - - - 24 - 24 - - - - true - - - - - - - Search next black frame - - - ... - - - - :/new/prefix1/pics/next_black.png:/new/prefix1/pics/next_black.png - - - - 24 - 24 - - - - true - - - - - - - Go to first frame [HOME] - - - ... - - - - :/new/prefix1/pics/player_start.png:/new/prefix1/pics/player_start.png - - - - 24 - 24 - - - - true - - - - - - - Go to last frame [END] - - - ... - - - - :/new/prefix1/pics/player_end.png:/new/prefix1/pics/player_end.png - - - - 24 - 24 - - - - true - - - - - - - Backward one minute [CTRL+DOWN] - - - ... - - - - :/new/prefix1/pics/backward1mn.png:/new/prefix1/pics/backward1mn.png - - - - 24 - 24 - - - - true - - - - - - - Forward one minute [CTRL+UP] - - - Forward one minute - - - ... - - - - :/new/prefix1/pics/forward1mn.png:/new/prefix1/pics/forward1mn.png - - - - 24 - 24 - - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Time: - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - 00:00:00.000 - - - 12 - - - Qt::AlignCenter - - - true - - - - - - - - 0 - 0 - - - - / 00:00:00.000 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 24 - 0 - - - - - - - - - 0 - 0 - - - - Frame type: - - - - - - - - 0 - 0 - - - - ? - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - - - - - - - - 0 - 0 - - - - - 182 - 120 - - - - - 182 - 120 - - - - QDockWidget::NoDockWidgetFeatures - - - Se&lection - - - 8 - - - - - 0 - 0 - - - - - 2 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 160 - 20 - - - - - - - - 9 - - - - - 4 - - - - - A: - - - - - - - B: - - - - - - - - 0 - 0 - - - - Go to marker A [PAGE UP] - - - 000000 - + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Play [SPACE] + + + + + + ... + + + + :/new/prefix1/pics/player_play.png:/new/prefix1/pics/player_play.png + + + + 24 + 24 + + + + true + + + + + + + Go to previous frame [LEFT] + + + ... + + + + :/new/prefix1/pics/back.png:/new/prefix1/pics/back.png + + + + 24 + 24 + + + + true + + + + + + + Go to next frame [RIGHT] + + + ... + + + + :/new/prefix1/pics/forward.png:/new/prefix1/pics/forward.png + + + + 24 + 24 + + + + true + + + + + + + Go to previous keyframe [DOWN] + + + ... + + + + :/new/prefix1/pics/player_rew.png:/new/prefix1/pics/player_rew.png + + + + 24 + 24 + + + + true + + + + + + + Go to next keyframe [UP] + + + ... + + + + :/new/prefix1/pics/player_fwd.png:/new/prefix1/pics/player_fwd.png + + + + 24 + 24 + + + + true + + + + + + + Set start marker [CTRL+PAGEUP] + + + ... + + + + :/new/prefix1/pics/markA.png:/new/prefix1/pics/markA.png + + + + 27 + 24 + + + + true + + + + + + + Delete selection [DEL] + + + ... + + + + :/new/prefix1/pics/delete_selection.png:/new/prefix1/pics/delete_selection.png + + + + 24 + 24 + + + + true + + + + + + + Set end marker [CTRL+PAGEDOWN] + + + ... + + + + :/new/prefix1/pics/markB.png:/new/prefix1/pics/markB.png + + + + 27 + 24 + + + + true + + + + + + + Go to previous cut point [SHIFT+DOWN] + + + ... + + + + :/new/prefix1/pics/prev_cut.png:/new/prefix1/pics/prev_cut.png + + + + 24 + 24 + + + + true + + + + + + + Go to next cut point [SHIFT+UP] + + + ... + + + + :/new/prefix1/pics/next_cut.png:/new/prefix1/pics/next_cut.png + + + + 24 + 24 + + + + true + + + + + + + Search previous black frame + + + ... + + + + :/new/prefix1/pics/prev_black.png:/new/prefix1/pics/prev_black.png + + + + 24 + 24 + + + + true + + + + + + + Search next black frame + + + ... + + + + :/new/prefix1/pics/next_black.png:/new/prefix1/pics/next_black.png + + + + 24 + 24 + + + + true + + + + + + + Go to first frame [HOME] + + + ... + + + + :/new/prefix1/pics/player_start.png:/new/prefix1/pics/player_start.png + + + + 24 + 24 + + + + true + + + + + + + Go to last frame [END] + + + ... + + + + :/new/prefix1/pics/player_end.png:/new/prefix1/pics/player_end.png + + + + 24 + 24 + + + + true + + + + + + + Backward one minute [CTRL+DOWN] + + + ... + + + + :/new/prefix1/pics/backward1mn.png:/new/prefix1/pics/backward1mn.png + + + + 24 + 24 + + + + true + + + + + + + Forward one minute [CTRL+UP] + + + Forward one minute + + + ... + + + + :/new/prefix1/pics/forward1mn.png:/new/prefix1/pics/forward1mn.png + + + + 24 + 24 + + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + - - + + - + 0 0 - - Go to Marker B [PAGE DOWN] - - - 000000 - + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + + 0 + 0 + + + + Go to Marker A [PAGE UP] + + + Qt::AlignCenter + + + false + + + + + + + + 0 + 0 + + + + Go to Marker B [PAGE DOWN] + + + Qt::AlignCenter + + + false + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + 0 + + + + + 0 + + + + + + 0 + 0 + + + + + 160 + 20 + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + false + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + - - + + - + 0 0 - - - 160 - 0 - + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + + + + + + + Qt::Vertical - - Selection: 000000 + + QSizePolicy::Expanding - + - - - - - - - - - 0 - 0 - - - - - 42 - 120 - - - - - 42 - 120 - - - - QDockWidget::NoDockWidgetFeatures - - - Qt::BottomDockWidgetArea - - - Vol&ume - - - 8 - - - - - - - - - true - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - ... - - - - :/new/prefix1/pics/volume_off.png - :/new/prefix1/pics/volume.png:/new/prefix1/pics/volume_off.png - - - true - - - true - - - - - - - - - - - 0 - 0 - - - - - 22 - 50 - - - - - 22 - 16777215 - - - - 100 - - - 100 - + - Qt::Vertical + Qt::Horizontal - + + QSizePolicy::Expanding + + - - - - - - - 0 - 0 - - - - - 82 - 120 - - - - - 82 - 120 - - - - QDockWidget::NoDockWidgetFeatures - - - Qt::BottomDockWidgetArea - - - Audio &Metre - - - 8 - - - - - 0 - 0 - - - - - 9 - - + - + 0 0 - 64 - 88 + 0 + 22 - - - 64 - 16777215 - + + QFrame::NoFrame + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 22 + + + + Qt::Horizontal + + + + + @@ -1971,6 +1952,34 @@ Ctrl+Alt+N + + + true + + + true + + + Status &Bar + + + Ctrl+Alt+B + + + + + true + + + true + + + S&lider + + + Ctrl+Alt+L + + true @@ -1999,6 +2008,34 @@ Ctrl+Alt+V + + + true + + + true + + + Tim&e + + + Ctrl+Alt+T + + + + + true + + + true + + + Cont&rols + + + Ctrl+Alt+O + + true @@ -2013,7 +2050,7 @@ Ctrl+Alt+B - + true @@ -2021,7 +2058,7 @@ true - &Audio Metre + &Audio Meter Ctrl+Alt+M @@ -2070,6 +2107,11 @@ QSlider
ADM_mwNavSlider.h
+ + ADM_QLineEditPTS + QLineEdit +
ADM_QLineEditPTS.h
+
pushButtonDecoderConf @@ -2083,7 +2125,8 @@ spinBox_TimeValue comboBoxFormat pushButtonFormatConfigure - horizontalSlider + toolButtonAudioToggle + volumeSlider toolButtonPlay toolButtonPreviousFrame toolButtonNextFrame @@ -2098,21 +2141,24 @@ toolButtonNextBlackFrame toolButtonFirstFrame toolButtonLastFrame - pushButtonTime + toolButtonBackOneMinute + toolButtonForwardOneMinute + selectionMarkerA + selectionMarkerB + thumbSliderHolder + selectionDuration currentTime - pushButtonJumpToMarkerA - pushButtonJumpToMarkerB - toolButtonAudioToggle - horizontalSlider_2 + totalTime + navigationSlider - actionViewAudioMetre + actionViewAudioMeter toggled(bool) - audioMetreWidget + audioMeterWidget setVisible(bool) @@ -2146,6 +2192,38 @@ toggled(bool) navigationWidget setVisible(bool) + + + -1 + -1 + + + 79 + 274 + + + + + actionViewStatusBar + toggled(bool) + statusBarWidget + setVisible(bool) + + + -1 + -1 + + + 79 + 274 + + + + + actionViewSlider + toggled(bool) + sliderWidget + setVisible(bool) -1 @@ -2189,6 +2267,38 @@ + + actionViewTime + toggled(bool) + timeWidget + setVisible(bool) + + + -1 + -1 + + + 601 + 569 + + + + + actionViewControls + toggled(bool) + controlsWidget + setVisible(bool) + + + -1 + -1 + + + 220 + 569 + + + actionViewToolBar toggled(bool) diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append.png new file mode 100644 index 0000000000..81ae38d7f3 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append@2x.png new file mode 100644 index 0000000000..400a1fe5c8 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/append@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy.png new file mode 100644 index 0000000000..2bc189e287 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy@2x.png new file mode 100644 index 0000000000..7dc5ef7d69 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/copy@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut.png new file mode 100644 index 0000000000..851ea4e272 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut@2x.png new file mode 100644 index 0000000000..d335c9f54a Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/cut@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript.png new file mode 100644 index 0000000000..37637d4804 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript@2x.png new file mode 100644 index 0000000000..c0d6d14e60 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/debugscript@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA.png index cff8f9cb99..243b27e5de 100644 Binary files a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA.png and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA@2x.png index 72cdf208ac..62a1df71ed 100644 Binary files a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA@2x.png and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkA@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB.png index ea1132d17a..666d9bd2bd 100644 Binary files a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB.png and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB@2x.png index e0aa4cdd6d..3083a75bec 100644 Binary files a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB@2x.png and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/goMarkB@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste.png new file mode 100644 index 0000000000..a79f7d0922 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste@2x.png new file mode 100644 index 0000000000..95aae35d06 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/paste@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo.png new file mode 100644 index 0000000000..6c1b834bae Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo@2x.png new file mode 100644 index 0000000000..8df40abaf7 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/redo@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA.png new file mode 100644 index 0000000000..79c2bf25e6 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA@2x.png new file mode 100644 index 0000000000..c20f256d4a Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markA@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB.png new file mode 100644 index 0000000000..dd3872a1e1 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB@2x.png new file mode 100644 index 0000000000..aa6b2419ac Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/reset_markB@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript.png new file mode 100644 index 0000000000..331cac3a2b Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript@2x.png new file mode 100644 index 0000000000..c6c8557c5e Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/runscript@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript.png new file mode 100644 index 0000000000..0e7bd007c9 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript@2x.png new file mode 100644 index 0000000000..605a1661a7 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/savescript@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/append.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/append.svg new file mode 100644 index 0000000000..831ab1626e --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/append.svg @@ -0,0 +1,3254 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/copy.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/copy.svg new file mode 100644 index 0000000000..778668000d --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/copy.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/cut.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/cut.svg new file mode 100644 index 0000000000..6acf09d215 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/cut.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/debugscript.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/debugscript.svg new file mode 100644 index 0000000000..2a2c2a8af3 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/debugscript.svg @@ -0,0 +1,3398 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/goMarkA.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/goMarkA.svg index f74035105e..43b6bd4b35 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/goMarkA.svg +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/goMarkA.svg @@ -7,11 +7,11 @@ viewBox="0 0 100 100" version="1.1" id="svg5" - inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" sodipodi:docname="goMarkA.svg" - inkscape:export-filename="markA2.png" - inkscape:export-xdpi="32.512001" - inkscape:export-ydpi="32.512001" + inkscape:export-filename="goMarkA.png" + inkscape:export-xdpi="6.0959997" + inkscape:export-ydpi="6.0959997" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" @@ -43,11 +43,11 @@ showgrid="true" width="100mm" inkscape:zoom="1.5322563" - inkscape:cx="61.021124" - inkscape:cy="158.91598" - inkscape:window-width="1920" - inkscape:window-height="1027" - inkscape:window-x="0" + inkscape:cx="168.37914" + inkscape:cy="210.80024" + inkscape:window-width="716" + inkscape:window-height="861" + inkscape:window-x="720" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer1" @@ -1285,10 +1285,10 @@ style="color-interpolation-filters:sRGB" inkscape:label="Lightness-Contrast" id="filter7311" - x="0" - y="0" - width="1" - height="1"> + x="-0.010012527" + y="-0.021965465" + width="1.0200251" + height="1.0439309"> + + transform="translate(-37.735644)"> A + transform="matrix(0.81013241,0,0,0.88349737,11.969649,5.2408136)" + clip-path="url(#clipPath1053)">A - + transform="matrix(-1,0,0,1,97.413687,-2.6516693)" + style="display:inline"> + x="-0.010012527" + y="-0.021965465" + width="1.0200251" + height="1.0439309"> + @@ -1232,13 +1244,8 @@ x="41.456036" y="75.35659" id="text6826" - transform="matrix(0.84710934,0,0,0.86445915,12.439162,6.6293162)" - clip-path="url(#clipPath1053-3)">B + transform="matrix(0.84710934,0,0,0.86445915,10.427892,6.6293162)" + clip-path="url(#clipPath1053-3)">B + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/redo.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/redo.svg new file mode 100644 index 0000000000..2b4b7c06a4 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/redo.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markA.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markA.svg new file mode 100644 index 0000000000..188c1aa970 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markA.svg @@ -0,0 +1,459 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markB.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markB.svg new file mode 100644 index 0000000000..f0bf98aa55 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/reset_markB.svg @@ -0,0 +1,459 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/runscript.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/runscript.svg new file mode 100644 index 0000000000..16a7f59106 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/runscript.svg @@ -0,0 +1,3090 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/savescript.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/savescript.svg new file mode 100644 index 0000000000..3c83ae856e --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/savescript.svg @@ -0,0 +1,3103 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/time.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/time.svg new file mode 100644 index 0000000000..b2381d5797 --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/time.svg @@ -0,0 +1,2066 @@ + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/undo.svg b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/undo.svg new file mode 100644 index 0000000000..693e92131b --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/svg/undo.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time.png new file mode 100644 index 0000000000..ae3339ad0f Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time@2x.png new file mode 100644 index 0000000000..79dc6f6c65 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/time@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo.png new file mode 100644 index 0000000000..ffc7990501 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo@2x.png b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo@2x.png new file mode 100644 index 0000000000..ad1a44c4f6 Binary files /dev/null and b/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics/undo@2x.png differ diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/titleBar.ui b/avidemux/qt4/ADM_userInterfaces/ADM_gui/titleBar.ui new file mode 100644 index 0000000000..674bd38fde --- /dev/null +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/titleBar.ui @@ -0,0 +1,94 @@ + + + TitleBar + + + + 0 + 0 + 213 + 36 + + + + + 0 + 0 + + + + Template + + + + 0 + + + + + ... + + + + + + + ... + + + + + + + ... + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 0 + + + + + + + + + 75 + true + false + + + + Title + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/translation_table.h b/avidemux/qt4/ADM_userInterfaces/ADM_gui/translation_table.h index 5cc8fba8a0..3c8f44b939 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/translation_table.h +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/translation_table.h @@ -18,9 +18,6 @@ PROCESS(toolButtonPreviousBlackFrame, ACT_PrevBlackFrame) \ PROCESS(toolButtonNextBlackFrame, ACT_NextBlackFrame) \ PROCESS(toolButtonFirstFrame, ACT_Begin) \ PROCESS(toolButtonLastFrame, ACT_End) \ -PROCESS(pushButtonJumpToMarkerA, ACT_GotoMarkA) \ -PROCESS(pushButtonJumpToMarkerB, ACT_GotoMarkB) \ -PROCESS(pushButtonTime, ACT_SelectTime) \ PROCESS(toolButtonBackOneMinute, ACT_Back1Mn) \ PROCESS(toolButtonForwardOneMinute, ACT_Forward1Mn) \ diff --git a/avidemux_core/ADM_coreUtils/include/prefs2_list.h b/avidemux_core/ADM_coreUtils/include/prefs2_list.h index b46b3dce4c..83abc19944 100644 --- a/avidemux_core/ADM_coreUtils/include/prefs2_list.h +++ b/avidemux_core/ADM_coreUtils/include/prefs2_list.h @@ -1,4 +1,11 @@ VERSION_APIVERSION, //uint32_t +FEATURES_PTS_TIMINGS_TOOLTIPS, //bool +FEATURES_TIME_FIELDS_EXTRA_BUTTONS, //bool +FEATURES_CURRENT_TIME_FIELD_EDITABLE, //bool +FEATURES_TOTAL_TIME_FIELD_EDITABLE, //bool +FEATURES_SELECTION_TIME_FIELD_EDITABLE, //bool +FEATURES_MARKER_A_TIME_FIELD_EDITABLE, //bool +FEATURES_MARKER_B_TIME_FIELD_EDITABLE, //bool FEATURES_SWAP_IF_A_GREATER_THAN_B, //bool FEATURES_SAVEPREFSONEXIT, //bool FEATURES_IGNORESAVEDMARKERS, //bool @@ -27,6 +34,8 @@ KEYBOARD_SHORTCUTS_USE_ALTERNATE_KBD_SHORTCUTS, //bool KEYBOARD_SHORTCUTS_SWAP_UP_DOWN_KEYS, //bool KEYBOARD_SHORTCUTS_ALT_MARK_A, //string KEYBOARD_SHORTCUTS_ALT_MARK_B, //string +KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_A, //string +KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_B, //string KEYBOARD_SHORTCUTS_ALT_RESET_MARK_A, //string KEYBOARD_SHORTCUTS_ALT_RESET_MARK_B, //string KEYBOARD_SHORTCUTS_ALT_RESET_MARKERS, //string @@ -72,3 +81,13 @@ PICTURES_FPS_TYPE, //uint32_t HDR_TONEMAPPING, //uint32_t HDR_TARGET_LUMINANCE, //float HDR_OUT_OF_GAMUT_HANDLING, //uint32_t +TOOLBARS_TOOLBAR_VISIBLE, //bool +TOOLBARS_STATUSBAR_VISIBLE, //bool +TOOLBARS_CODEC_VISIBLE, //bool +TOOLBARS_NAVIGATION_VISIBLE, //bool +TOOLBARS_AUDIOMETER_VISIBLE, //bool +TOOLBARS_VOLUME_VISIBLE, //bool +TOOLBARS_CONTROLS_VISIBLE, //bool +TOOLBARS_SELECTION_VISIBLE, //bool +TOOLBARS_TIME_VISIBLE, //bool +TOOLBARS_SLIDER_VISIBLE, //bool diff --git a/avidemux_core/ADM_coreUtils/src/prefs2.conf b/avidemux_core/ADM_coreUtils/src/prefs2.conf index b17350ff7c..2133032bc0 100644 --- a/avidemux_core/ADM_coreUtils/src/prefs2.conf +++ b/avidemux_core/ADM_coreUtils/src/prefs2.conf @@ -17,6 +17,13 @@ version{ uint32_t:apiVersion, 1, 0, 999 } features{ +bool:pts_timings_tooltips, 1, 0, 1 +bool:time_fields_extra_buttons, 1, 0, 1 +bool:current_time_field_editable, 1, 0, 1 +bool:total_time_field_editable, 1, 0, 1 +bool:selection_time_field_editable, 1, 0, 1 +bool:marker_a_time_field_editable, 1, 0, 1 +bool:marker_b_time_field_editable, 1, 0, 1 bool:swap_if_A_greater_than_B, 1, 0, 1 bool:saveprefsonexit, 1, 0, 1 bool:ignoresavedmarkers, 0, 0, 1 @@ -48,6 +55,8 @@ bool:use_alternate_kbd_shortcuts, 0, 0, 1 bool:swap_up_down_keys, 0, 0, 1 string:alt_mark_a, "I" string:alt_mark_b, "O" +string:alt_edit_mark_a, "Z" +string:alt_edit_mark_b, "X" string:alt_reset_mark_a, "U" string:alt_reset_mark_b, "P" string:alt_reset_markers, "R" @@ -124,6 +133,21 @@ uint32_t:tonemapping, 1, 0, 99 float:target_luminance, 100.0, 0.0, 1000.0 uint32_t:out_of_gamut_handling, 0, 0, 99 } +# Some widgets (toolbar, codec, and navitation, which are dock +# widgets) are automatically saved in QtSettings.ini under the +# 'windowState' preference. We override the visibility here. +toolbars{ +bool:toolbar_visible, 1, 0, 1 +bool:statusbar_visible, 1, 0, 1 +bool:codec_visible, 1, 0, 1 +bool:navigation_visible, 1, 0, 1 +bool:audiometer_visible, 1, 0, 1 +bool:volume_visible, 1, 0, 1 +bool:controls_visible, 1, 0, 1 +bool:selection_visible, 1, 0, 1 +bool:time_visible, 1, 0, 1 +bool:slider_visible, 1, 0, 1 +} # } # diff --git a/avidemux_core/ADM_coreUtils/src/prefs2.h b/avidemux_core/ADM_coreUtils/src/prefs2.h index 1f3df7a8f5..dd52a4eb67 100644 --- a/avidemux_core/ADM_coreUtils/src/prefs2.h +++ b/avidemux_core/ADM_coreUtils/src/prefs2.h @@ -6,6 +6,13 @@ struct { uint32_t apiVersion; }version; struct { + bool pts_timings_tooltips; + bool time_fields_extra_buttons; + bool current_time_field_editable; + bool total_time_field_editable; + bool selection_time_field_editable; + bool marker_a_time_field_editable; + bool marker_b_time_field_editable; bool swap_if_A_greater_than_B; bool saveprefsonexit; bool ignoresavedmarkers; @@ -36,6 +43,8 @@ struct { bool swap_up_down_keys; std::string alt_mark_a; std::string alt_mark_b; + std::string alt_edit_mark_a; + std::string alt_edit_mark_b; std::string alt_reset_mark_a; std::string alt_reset_mark_b; std::string alt_reset_markers; @@ -100,4 +109,16 @@ struct { float target_luminance; uint32_t out_of_gamut_handling; }hdr; +struct { + bool toolbar_visible; + bool statusbar_visible; + bool codec_visible; + bool navigation_visible; + bool audiometer_visible; + bool volume_visible; + bool controls_visible; + bool selection_visible; + bool time_visible; + bool slider_visible; +}toolbars; }my_prefs_struct; diff --git a/avidemux_core/ADM_coreUtils/src/prefs2_desc.cpp b/avidemux_core/ADM_coreUtils/src/prefs2_desc.cpp index 8b858cd202..adc254cbc1 100644 --- a/avidemux_core/ADM_coreUtils/src/prefs2_desc.cpp +++ b/avidemux_core/ADM_coreUtils/src/prefs2_desc.cpp @@ -1,6 +1,13 @@ // automatically generated by admSerialization.py, do not edit! extern const ADM_paramList my_prefs_struct_param[]={ {"version.apiVersion",offsetof(my_prefs_struct,version.apiVersion),"uint32_t",ADM_param_uint32_t}, + {"features.pts_timings_tooltips",offsetof(my_prefs_struct,features.pts_timings_tooltips),"bool",ADM_param_bool}, + {"features.time_fields_extra_buttons",offsetof(my_prefs_struct,features.time_fields_extra_buttons),"bool",ADM_param_bool}, + {"features.current_time_field_editable",offsetof(my_prefs_struct,features.current_time_field_editable),"bool",ADM_param_bool}, + {"features.total_time_field_editable",offsetof(my_prefs_struct,features.total_time_field_editable),"bool",ADM_param_bool}, + {"features.selection_time_field_editable",offsetof(my_prefs_struct,features.selection_time_field_editable),"bool",ADM_param_bool}, + {"features.marker_a_time_field_editable",offsetof(my_prefs_struct,features.marker_a_time_field_editable),"bool",ADM_param_bool}, + {"features.marker_b_time_field_editable",offsetof(my_prefs_struct,features.marker_b_time_field_editable),"bool",ADM_param_bool}, {"features.swap_if_A_greater_than_B",offsetof(my_prefs_struct,features.swap_if_A_greater_than_B),"bool",ADM_param_bool}, {"features.saveprefsonexit",offsetof(my_prefs_struct,features.saveprefsonexit),"bool",ADM_param_bool}, {"features.ignoresavedmarkers",offsetof(my_prefs_struct,features.ignoresavedmarkers),"bool",ADM_param_bool}, @@ -29,6 +36,8 @@ extern const ADM_paramList my_prefs_struct_param[]={ {"keyboard_shortcuts.swap_up_down_keys",offsetof(my_prefs_struct,keyboard_shortcuts.swap_up_down_keys),"bool",ADM_param_bool}, {"keyboard_shortcuts.alt_mark_a",offsetof(my_prefs_struct,keyboard_shortcuts.alt_mark_a),"std::string",ADM_param_stdstring}, {"keyboard_shortcuts.alt_mark_b",offsetof(my_prefs_struct,keyboard_shortcuts.alt_mark_b),"std::string",ADM_param_stdstring}, + {"keyboard_shortcuts.alt_edit_mark_a",offsetof(my_prefs_struct,keyboard_shortcuts.alt_edit_mark_a),"std::string",ADM_param_stdstring}, + {"keyboard_shortcuts.alt_edit_mark_b",offsetof(my_prefs_struct,keyboard_shortcuts.alt_edit_mark_b),"std::string",ADM_param_stdstring}, {"keyboard_shortcuts.alt_reset_mark_a",offsetof(my_prefs_struct,keyboard_shortcuts.alt_reset_mark_a),"std::string",ADM_param_stdstring}, {"keyboard_shortcuts.alt_reset_mark_b",offsetof(my_prefs_struct,keyboard_shortcuts.alt_reset_mark_b),"std::string",ADM_param_stdstring}, {"keyboard_shortcuts.alt_reset_markers",offsetof(my_prefs_struct,keyboard_shortcuts.alt_reset_markers),"std::string",ADM_param_stdstring}, @@ -74,5 +83,15 @@ extern const ADM_paramList my_prefs_struct_param[]={ {"hdr.tonemapping",offsetof(my_prefs_struct,hdr.tonemapping),"uint32_t",ADM_param_uint32_t}, {"hdr.target_luminance",offsetof(my_prefs_struct,hdr.target_luminance),"float",ADM_param_float}, {"hdr.out_of_gamut_handling",offsetof(my_prefs_struct,hdr.out_of_gamut_handling),"uint32_t",ADM_param_uint32_t}, + {"toolbars.toolbar_visible",offsetof(my_prefs_struct,toolbars.toolbar_visible),"bool",ADM_param_bool}, + {"toolbars.statusbar_visible",offsetof(my_prefs_struct,toolbars.statusbar_visible),"bool",ADM_param_bool}, + {"toolbars.codec_visible",offsetof(my_prefs_struct,toolbars.codec_visible),"bool",ADM_param_bool}, + {"toolbars.navigation_visible",offsetof(my_prefs_struct,toolbars.navigation_visible),"bool",ADM_param_bool}, + {"toolbars.audiometer_visible",offsetof(my_prefs_struct,toolbars.audiometer_visible),"bool",ADM_param_bool}, + {"toolbars.volume_visible",offsetof(my_prefs_struct,toolbars.volume_visible),"bool",ADM_param_bool}, + {"toolbars.controls_visible",offsetof(my_prefs_struct,toolbars.controls_visible),"bool",ADM_param_bool}, + {"toolbars.selection_visible",offsetof(my_prefs_struct,toolbars.selection_visible),"bool",ADM_param_bool}, + {"toolbars.time_visible",offsetof(my_prefs_struct,toolbars.time_visible),"bool",ADM_param_bool}, + {"toolbars.slider_visible",offsetof(my_prefs_struct,toolbars.slider_visible),"bool",ADM_param_bool}, {NULL,0,NULL} }; diff --git a/avidemux_core/ADM_coreUtils/src/prefs2_json.cpp b/avidemux_core/ADM_coreUtils/src/prefs2_json.cpp index f9a44a984c..adc8bb9aac 100644 --- a/avidemux_core/ADM_coreUtils/src/prefs2_json.cpp +++ b/avidemux_core/ADM_coreUtils/src/prefs2_json.cpp @@ -9,6 +9,13 @@ json.addNode("version"); json.addUint32("apiVersion",key->version.apiVersion); json.endNode(); json.addNode("features"); +json.addBool("pts_timings_tooltips",key->features.pts_timings_tooltips); +json.addBool("time_fields_extra_buttons",key->features.time_fields_extra_buttons); +json.addBool("current_time_field_editable",key->features.current_time_field_editable); +json.addBool("total_time_field_editable",key->features.total_time_field_editable); +json.addBool("selection_time_field_editable",key->features.selection_time_field_editable); +json.addBool("marker_a_time_field_editable",key->features.marker_a_time_field_editable); +json.addBool("marker_b_time_field_editable",key->features.marker_b_time_field_editable); json.addBool("swap_if_A_greater_than_B",key->features.swap_if_A_greater_than_B); json.addBool("saveprefsonexit",key->features.saveprefsonexit); json.addBool("ignoresavedmarkers",key->features.ignoresavedmarkers); @@ -39,6 +46,8 @@ json.addBool("use_alternate_kbd_shortcuts",key->keyboard_shortcuts.use_alternate json.addBool("swap_up_down_keys",key->keyboard_shortcuts.swap_up_down_keys); json.addString("alt_mark_a",key->keyboard_shortcuts.alt_mark_a); json.addString("alt_mark_b",key->keyboard_shortcuts.alt_mark_b); +json.addString("alt_edit_mark_a",key->keyboard_shortcuts.alt_edit_mark_a); +json.addString("alt_edit_mark_b",key->keyboard_shortcuts.alt_edit_mark_b); json.addString("alt_reset_mark_a",key->keyboard_shortcuts.alt_reset_mark_a); json.addString("alt_reset_mark_b",key->keyboard_shortcuts.alt_reset_mark_b); json.addString("alt_reset_markers",key->keyboard_shortcuts.alt_reset_markers); @@ -103,6 +112,18 @@ json.addUint32("tonemapping",key->hdr.tonemapping); json.addFloat("target_luminance",key->hdr.target_luminance); json.addUint32("out_of_gamut_handling",key->hdr.out_of_gamut_handling); json.endNode(); +json.addNode("toolbars"); +json.addBool("toolbar_visible",key->toolbars.toolbar_visible); +json.addBool("statusbar_visible",key->toolbars.statusbar_visible); +json.addBool("codec_visible",key->toolbars.codec_visible); +json.addBool("navigation_visible",key->toolbars.navigation_visible); +json.addBool("audiometer_visible",key->toolbars.audiometer_visible); +json.addBool("volume_visible",key->toolbars.volume_visible); +json.addBool("controls_visible",key->toolbars.controls_visible); +json.addBool("selection_visible",key->toolbars.selection_visible); +json.addBool("time_visible",key->toolbars.time_visible); +json.addBool("slider_visible",key->toolbars.slider_visible); +json.endNode(); return json.dumpToFile(file); }; bool my_prefs_struct_jdeserialize(const char *file, const ADM_paramList *tmpl,my_prefs_struct *key){ diff --git a/avidemux_core/ADM_coreUtils/src/prefs2_pref.h b/avidemux_core/ADM_coreUtils/src/prefs2_pref.h index 46f4f63ba8..eeb962b806 100644 --- a/avidemux_core/ADM_coreUtils/src/prefs2_pref.h +++ b/avidemux_core/ADM_coreUtils/src/prefs2_pref.h @@ -12,6 +12,13 @@ typedef struct #endif static optionDesc myOptions[]={ { VERSION_APIVERSION,"version.apiVersion" ,ADM_param_uint32_t ,"1", 0, 999}, +{ FEATURES_PTS_TIMINGS_TOOLTIPS,"features.pts_timings_tooltips" ,ADM_param_bool ,"1", 0, 1}, +{ FEATURES_TIME_FIELDS_EXTRA_BUTTONS,"features.time_fields_extra_buttons",ADM_param_bool ,"1", 0, 1}, +{ FEATURES_CURRENT_TIME_FIELD_EDITABLE,"features.current_time_field_editable",ADM_param_bool ,"1", 0, 1}, +{ FEATURES_TOTAL_TIME_FIELD_EDITABLE,"features.total_time_field_editable",ADM_param_bool ,"1", 0, 1}, +{ FEATURES_SELECTION_TIME_FIELD_EDITABLE,"features.selection_time_field_editable",ADM_param_bool ,"1", 0, 1}, +{ FEATURES_MARKER_A_TIME_FIELD_EDITABLE,"features.marker_a_time_field_editable",ADM_param_bool ,"1", 0, 1}, +{ FEATURES_MARKER_B_TIME_FIELD_EDITABLE,"features.marker_b_time_field_editable",ADM_param_bool ,"1", 0, 1}, { FEATURES_SWAP_IF_A_GREATER_THAN_B,"features.swap_if_A_greater_than_B",ADM_param_bool ,"1", 0, 1}, { FEATURES_SAVEPREFSONEXIT,"features.saveprefsonexit" ,ADM_param_bool ,"1", 0, 1}, { FEATURES_IGNORESAVEDMARKERS,"features.ignoresavedmarkers" ,ADM_param_bool ,"0", 0, 1}, @@ -40,6 +47,8 @@ static optionDesc myOptions[]={ { KEYBOARD_SHORTCUTS_SWAP_UP_DOWN_KEYS,"keyboard_shortcuts.swap_up_down_keys",ADM_param_bool ,"0", 0, 1}, { KEYBOARD_SHORTCUTS_ALT_MARK_A,"keyboard_shortcuts.alt_mark_a" ,ADM_param_stdstring ,"I", 0, 0}, { KEYBOARD_SHORTCUTS_ALT_MARK_B,"keyboard_shortcuts.alt_mark_b" ,ADM_param_stdstring ,"O", 0, 0}, +{ KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_A,"keyboard_shortcuts.alt_edit_mark_a",ADM_param_stdstring ,"Z", 0, 0}, +{ KEYBOARD_SHORTCUTS_ALT_EDIT_MARK_B,"keyboard_shortcuts.alt_edit_mark_b",ADM_param_stdstring ,"X", 0, 0}, { KEYBOARD_SHORTCUTS_ALT_RESET_MARK_A,"keyboard_shortcuts.alt_reset_mark_a",ADM_param_stdstring ,"U", 0, 0}, { KEYBOARD_SHORTCUTS_ALT_RESET_MARK_B,"keyboard_shortcuts.alt_reset_mark_b",ADM_param_stdstring ,"P", 0, 0}, { KEYBOARD_SHORTCUTS_ALT_RESET_MARKERS,"keyboard_shortcuts.alt_reset_markers",ADM_param_stdstring ,"R", 0, 0}, @@ -85,5 +94,15 @@ static optionDesc myOptions[]={ { HDR_TONEMAPPING,"hdr.tonemapping" ,ADM_param_uint32_t ,"1", 0, 99}, { HDR_TARGET_LUMINANCE,"hdr.target_luminance" ,ADM_param_float ,"100.0", 0.0, 1000.0}, { HDR_OUT_OF_GAMUT_HANDLING,"hdr.out_of_gamut_handling" ,ADM_param_uint32_t ,"0", 0, 99}, +{ TOOLBARS_TOOLBAR_VISIBLE,"toolbars.toolbar_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_STATUSBAR_VISIBLE,"toolbars.statusbar_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_CODEC_VISIBLE,"toolbars.codec_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_NAVIGATION_VISIBLE,"toolbars.navigation_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_AUDIOMETER_VISIBLE,"toolbars.audiometer_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_VOLUME_VISIBLE,"toolbars.volume_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_CONTROLS_VISIBLE,"toolbars.controls_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_SELECTION_VISIBLE,"toolbars.selection_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_TIME_VISIBLE,"toolbars.time_visible" ,ADM_param_bool ,"1", 0, 1}, +{ TOOLBARS_SLIDER_VISIBLE,"toolbars.slider_visible" ,ADM_param_bool ,"1", 0, 1}, };