Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI] add [Mark as cut point] functionality,shortcut,button and menu entry #351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions avidemux/common/ADM_commonUI/myOwnMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static const MenuEntry _myMenuEdit[] = {
{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","Reset Markers"), NULL,ACT_ResetMarkers, NULL,"Ctrl+Home",0},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Mark as cut point"), NULL,ACT_MarkCut, NULL,"Shift+M",0},
{MENU_SEPARATOR,"-",NULL,ACT_DUMMY,NULL,NULL,1},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Pr&eferences"), NULL,ACT_PREFERENCES, NULL,NULL,0},
{MENU_SEPARATOR,"-",NULL,ACT_DUMMY,NULL,NULL,1},
Expand Down
1 change: 1 addition & 0 deletions avidemux/common/gui_action.names
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ ACT(MarkB)
ACT(ResetMarkerA)
ACT(ResetMarkerB)
ACT(ResetMarkers)
ACT(MarkCut)
ACT(Copy)
ACT(Cut)
ACT(Paste)
Expand Down
23 changes: 23 additions & 0 deletions avidemux/common/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,29 @@ void HandleAction (Action action)
A_ResetMarkers();
break;
}
case ACT_MarkCut:
{
{
if(!UI_getCurrentVCodec())
{
GUI_Error_HIG(QT_TRANSLATE_NOOP("adm","Mark as cut point failed."),QT_TRANSLATE_NOOP("adm","This function is currently not available in Copy mode."));
video_body->undo();
break;
}
uint64_t current=video_body->getCurrentFramePts();
video_body->addToUndoQueue();
bool result = video_body->remove(current,current);
if(!result)
{
GUI_Error_HIG(QT_TRANSLATE_NOOP("adm","Mark as cut point failed."),NULL);
break;
}
if (video_body->goToTimeVideo(current))
admPreview::samePicture();
GUI_setAllFrameAndTime();
}
break;
}
case ACT_Copy:
{
uint64_t markA,markB;
Expand Down
2 changes: 1 addition & 1 deletion avidemux/common/gui_navigate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ void A_jog(void)
*/
void GUI_setAllFrameAndTime(void)
{
UI_setTotalTime(video_body->getVideoDuration());
uint32_t numOfSegs = video_body->getNbSegment();
uint64_t * segPts = new uint64_t[numOfSegs];
for(int i=0; i<numOfSegs; i++)
Expand All @@ -457,6 +456,7 @@ void GUI_setAllFrameAndTime(void)
segPts[i] = ADM_NO_PTS;
}
UI_setSegments(numOfSegs, segPts);
UI_setTotalTime(video_body->getVideoDuration());
delete [] segPts;
// progress bar
GUI_setCurrentFrameAndTime(0);
Expand Down
12 changes: 9 additions & 3 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ void MainWindow::buildButtonLists(void)
ADD_BUTTON_LOADED(toolButtonNextIntraFrame)
ADD_BUTTON_LOADED(toolButtonSetMarkerA)
ADD_BUTTON_LOADED(toolButtonSetMarkerB)
ADD_BUTTON_LOADED(toolButtonMarkAsCutPoint)
ADD_BUTTON_LOADED(toolButtonPreviousCutPoint)
ADD_BUTTON_LOADED(toolButtonNextCutPoint)
ADD_BUTTON_LOADED(toolButtonPreviousBlackFrame)
Expand All @@ -1082,6 +1083,7 @@ void MainWindow::buildButtonLists(void)
ADD_BUTTON_PLAYBACK(toolButtonNextIntraFrame)
ADD_BUTTON_PLAYBACK(toolButtonSetMarkerA)
ADD_BUTTON_PLAYBACK(toolButtonSetMarkerB)
ADD_BUTTON_PLAYBACK(toolButtonMarkAsCutPoint)
ADD_BUTTON_PLAYBACK(toolButtonPreviousCutPoint)
ADD_BUTTON_PLAYBACK(toolButtonNextCutPoint)
ADD_BUTTON_PLAYBACK(toolButtonPreviousBlackFrame)
Expand Down Expand Up @@ -1468,9 +1470,13 @@ void MainWindow::widgetsUpdateTooltips(void)
tt += SHORTCUT(ACT_MarkB,Edit)
ui.toolButtonSetMarkerB->setToolTip(tt);

tt = QString(QT_TRANSLATE_NOOP("qgui2","Go to previous cut point"));
tt += SHORTCUT(ACT_PrevCutPoint,Go)
ui.toolButtonPreviousCutPoint->setToolTip(tt);
tt = QString(QT_TRANSLATE_NOOP("qgui2","Set end marker"));
tt += SHORTCUT(ACT_MarkB,Edit)
ui.toolButtonSetMarkerB->setToolTip(tt);

tt = QString(QT_TRANSLATE_NOOP("qgui2","Mark as cut point"));
tt += SHORTCUT(ACT_MarkCut,Edit)
ui.toolButtonMarkAsCutPoint->setToolTip(tt);

tt = QString(QT_TRANSLATE_NOOP("qgui2","Go to next cut point"));
tt += SHORTCUT(ACT_NextCutPoint,Go)
Expand Down
1 change: 1 addition & 0 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<file>pics/info.png</file>
<file>pics/markA.png</file>
<file>pics/markB.png</file>
<file>pics/markCut.png</file>
<file>pics/next.png</file>
<file>pics/next_black.png</file>
<file>pics/next_cut.png</file>
Expand Down
1 change: 1 addition & 0 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_osx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<file>pics/info.png</file>
<file>pics/markA.png</file>
<file>pics/markB.png</file>
<file>pics/markCut.png</file>
<file>pics/next.png</file>
<file>pics/next_black.png</file>
<file>pics/next_cut.png</file>
Expand Down
1 change: 1 addition & 0 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/avidemux_win32.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<file>pics/info.png</file>
<file>pics/markA.png</file>
<file>pics/markB.png</file>
<file>pics/markCut.png</file>
<file>pics/next.png</file>
<file>pics/next_black.png</file>
<file>pics/next_cut.png</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<file>pics/info.png</file>
<file>pics/markA.png</file>
<file>pics/markB.png</file>
<file>pics/markCut.png</file>
<file>pics/next.png</file>
<file>pics/next_black.png</file>
<file>pics/next_cut.png</file>
Expand Down
24 changes: 24 additions & 0 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/gui2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,29 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonMarkAsCutPoint">
<property name="toolTip">
<string>Mark as cut point [SHIFT+M]</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="avidemux.qrc">
<normaloff>:/new/prefix1/pics/markCut.png</normaloff>:/new/prefix1/pics/markCut.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonPreviousCutPoint">
<property name="enabled">
Expand Down Expand Up @@ -2056,6 +2079,7 @@
<tabstop>toolButtonNextIntraFrame</tabstop>
<tabstop>toolButtonSetMarkerA</tabstop>
<tabstop>toolButtonSetMarkerB</tabstop>
<tabstop>toolButtonMarkAsCutPoint</tabstop>
<tabstop>toolButtonPreviousCutPoint</tabstop>
<tabstop>toolButtonNextCutPoint</tabstop>
<tabstop>toolButtonPreviousBlackFrame</tabstop>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ PROCESS(toolButtonPreviousIntraFrame, ACT_PreviousKFrame) \
PROCESS(toolButtonNextIntraFrame, ACT_NextKFrame) \
PROCESS(toolButtonSetMarkerA, ACT_MarkA) \
PROCESS(toolButtonSetMarkerB, ACT_MarkB) \
PROCESS(toolButtonMarkAsCutPoint, ACT_MarkCut) \
PROCESS(toolButtonPreviousCutPoint, ACT_PrevCutPoint) \
PROCESS(toolButtonNextCutPoint, ACT_NextCutPoint) \
PROCESS(toolButtonPreviousBlackFrame, ACT_PrevBlackFrame) \
Expand Down