Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
// Copyright (c) 2005-2010, Niels Martin Hansen
// Copyright (c) 2005-2010, Rodrigo Braz Monteiro
// Copyright (c) 2010, Amar Takhar
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Aegisub Project http://www.aegisub.org/
/// @file video.cpp
/// @brief video/ commands.
/// @ingroup command
///
2011-01-05 19:40:37 +01:00
# include "../config.h"
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
# include "command.h"
2011-08-31 06:23:18 +02:00
# include <wx/clipbrd.h>
2012-12-02 00:57:02 +01:00
# include <wx/filedlg.h>
2011-11-25 23:12:15 +01:00
# include <wx/filename.h>
2012-12-02 00:57:02 +01:00
# include <wx/msgdlg.h>
# include <wx/textdlg.h>
2011-08-31 06:23:18 +02:00
2011-01-21 05:57:36 +01:00
# include "../ass_dialogue.h"
# include "../ass_time.h"
2011-01-05 19:40:37 +01:00
# include "../compat.h"
# include "../frame_main.h"
# include "../main.h"
# include "../include/aegisub/context.h"
# include "../dialog_detached_video.h"
# include "../dialog_dummy_video.h"
2012-03-09 01:23:41 +01:00
# include "../dialog_manager.h"
2011-01-05 19:40:37 +01:00
# include "../dialog_jumpto.h"
# include "../dialog_video_details.h"
2011-07-15 06:05:15 +02:00
# include "../selection_controller.h"
2011-12-06 01:17:45 +01:00
# include "../standard_paths.h"
2011-01-05 19:40:37 +01:00
# include "../subs_grid.h"
# include "../utils.h"
# include "../video_box.h"
# include "../video_context.h"
# include "../video_display.h"
2012-01-18 21:08:42 +01:00
# include "../video_frame.h"
2011-01-05 19:40:37 +01:00
# include "../video_slider.h"
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:05:01 +02:00
namespace {
using cmd : : Command ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// @defgroup cmd-video Video commands.
/// @{
2011-07-15 06:05:22 +02:00
struct validator_video_loaded : public Command {
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE )
2011-07-15 06:05:22 +02:00
bool Validate ( const agi : : Context * c ) {
return c - > videoController - > IsLoaded ( ) ;
}
} ;
struct validator_video_attached : public Command {
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE )
2011-07-15 06:05:22 +02:00
bool Validate ( const agi : : Context * c ) {
2012-03-09 01:23:41 +01:00
return c - > videoController - > IsLoaded ( ) & & ! c - > dialog - > Get < DialogDetachedVideo > ( ) ;
2011-07-15 06:05:22 +02:00
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Forces video to 2.35 aspect ratio.
2011-09-30 22:42:20 +02:00
struct video_aspect_cinematic : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/aspect/cinematic " )
STR_MENU ( " &Cinematic (2.35) " )
2012-09-22 03:13:10 +02:00
STR_DISP ( " Cinematic (2.35) " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Forces video to 2.35 aspect ratio " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
return c - > videoController - > GetAspectRatioType ( ) = = 3 ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-07-15 06:05:22 +02:00
c - > videoController - > Stop ( ) ;
c - > videoController - > SetAspectRatio ( 3 ) ;
wxGetApp ( ) . frame - > SetDisplayMode ( 1 , - 1 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Forces video to a custom aspect ratio.
2011-09-30 22:42:20 +02:00
struct video_aspect_custom : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/aspect/custom " )
2012-01-27 20:22:57 +01:00
STR_MENU ( " C&ustom... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Custom " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Forces video to a custom aspect ratio " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
return c - > videoController - > GetAspectRatioType ( ) = = 4 ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-01-16 08:16:54 +01:00
wxString value = wxGetTextFromUser ( _ ( " Enter aspect ratio in either: \n decimal (e.g. 2.35) \n fractional (e.g. 16:9) \n specific resolution (e.g. 853x480) " ) , _ ( " Enter aspect ratio " ) , AegiFloatToString ( c - > videoController - > GetAspectRatioValue ( ) ) ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
if ( value . IsEmpty ( ) ) return ;
value . MakeLower ( ) ;
// Process text
double numval ;
if ( value . ToDouble ( & numval ) ) {
//Nothing to see here, move along
}
else {
double a , b ;
int pos = 0 ;
bool scale = false ;
//Why bloat using Contains when we can just check the output of Find?
pos = value . Find ( ' : ' ) ;
if ( pos = = wxNOT_FOUND ) pos = value . Find ( ' / ' ) ;
2011-09-28 21:43:11 +02:00
if ( pos = = wxNOT_FOUND & & value . Contains ( ' x ' ) ) {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
pos = value . Find ( ' x ' ) ;
scale = true ;
}
if ( pos > 0 ) {
wxString num = value . Left ( pos ) ;
wxString denum = value . Mid ( pos + 1 ) ;
if ( num . ToDouble ( & a ) & & denum . ToDouble ( & b ) & & b ! = 0 ) {
numval = a / b ;
2011-11-12 02:23:18 +01:00
if ( scale ) c - > videoDisplay - > SetZoom ( b / c - > videoController - > GetHeight ( ) ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
else numval = 0.0 ;
}
// Sanity check
2012-03-29 01:59:19 +02:00
if ( numval < 0.5 | | numval > 5.0 ) wxMessageBox ( _ ( " Invalid value! Aspect ratio must be between 0.5 and 5.0. " ) , _ ( " Invalid Aspect Ratio " ) , wxOK | wxICON_ERROR | wxCENTER ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
// Set value
else {
2011-01-16 08:16:54 +01:00
c - > videoController - > SetAspectRatio ( 4 , numval ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
wxGetApp ( ) . frame - > SetDisplayMode ( 1 , - 1 ) ;
}
}
} ;
/// Leave video on original aspect ratio.
2011-09-30 22:42:20 +02:00
struct video_aspect_default : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/aspect/default " )
STR_MENU ( " &Default " )
STR_DISP ( " Default " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Leave video on original aspect ratio " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
return c - > videoController - > GetAspectRatioType ( ) = = 0 ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
c - > videoController - > SetAspectRatio ( 0 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
wxGetApp ( ) . frame - > SetDisplayMode ( 1 , - 1 ) ;
}
} ;
/// Forces video to 4:3 aspect ratio.
2011-09-30 22:42:20 +02:00
struct video_aspect_full : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/aspect/full " )
STR_MENU ( " &Fullscreen (4:3) " )
STR_DISP ( " Fullscreen (4:3) " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Forces video to 4:3 aspect ratio " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
return c - > videoController - > GetAspectRatioType ( ) = = 1 ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
c - > videoController - > SetAspectRatio ( 1 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
wxGetApp ( ) . frame - > SetDisplayMode ( 1 , - 1 ) ;
}
} ;
/// Forces video to 16:9 aspect ratio.
2011-09-30 22:42:20 +02:00
struct video_aspect_wide : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/aspect/wide " )
STR_MENU ( " &Widescreen (16:9) " )
STR_DISP ( " Widescreen (16:9) " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Forces video to 16:9 aspect ratio " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
return c - > videoController - > GetAspectRatioType ( ) = = 2 ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
c - > videoController - > SetAspectRatio ( 2 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
wxGetApp ( ) . frame - > SetDisplayMode ( 1 , - 1 ) ;
}
} ;
/// Closes the currently open video file.
2011-07-15 06:05:22 +02:00
struct video_close : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/close " )
STR_MENU ( " &Close Video " )
STR_DISP ( " Close Video " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Closes the currently open video file " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > SetVideo ( " " ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2011-08-27 08:30:29 +02:00
/// Copy the current coordinates of the mouse over the video to the clipboard.
struct video_copy_coordinates : public validator_video_loaded {
CMD_NAME ( " video/copy_coordinates " )
STR_MENU ( " Copy coordinates to Clipboard " )
STR_DISP ( " Copy coordinates to Clipboard " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Copy the current coordinates of the mouse over the video to the clipboard " )
2011-08-27 08:30:29 +02:00
void operator ( ) ( agi : : Context * c ) {
2012-10-25 17:13:13 +02:00
SetClipboard ( c - > videoDisplay - > GetMousePosition ( ) . Str ( ) ) ;
2011-08-27 08:30:29 +02:00
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Detach video, displaying it in a separate Window.
2011-07-15 06:05:22 +02:00
struct video_detach : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/detach " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " &Detach Video " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Detach Video " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Detach video, displaying it in a separate Window " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_TOGGLE )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
2012-03-09 01:23:41 +01:00
return ! ! c - > dialog - > Get < DialogDetachedVideo > ( ) ;
2011-07-15 06:06:03 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2012-03-09 01:23:41 +01:00
if ( DialogDetachedVideo * d = c - > dialog - > Get < DialogDetachedVideo > ( ) )
d - > Close ( ) ;
else
c - > dialog - > Show < DialogDetachedVideo > ( c ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Shows video details.
2011-07-15 06:05:22 +02:00
struct video_details : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/details " )
2012-02-07 02:22:50 +01:00
STR_MENU ( " Show &Video Details " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Show Video Details " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Shows video details " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
2011-01-21 05:57:44 +01:00
DialogVideoDetails ( c ) . ShowModal ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2012-01-08 02:05:39 +01:00
/// Toggle focus between the video slider and other things
2011-07-15 06:05:22 +02:00
struct video_focus_seek : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/focus_seek " )
2012-01-08 02:05:39 +01:00
STR_MENU ( " Toggle video slider focus " )
STR_DISP ( " Toggle video slider focus " )
STR_HELP ( " Toggle focus between the video slider and other things " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
wxWindow * curFocus = wxWindow : : FindFocus ( ) ;
2011-11-12 02:23:18 +01:00
if ( curFocus = = c - > videoSlider ) {
2011-01-16 08:16:54 +01:00
if ( c - > previousFocus ) c - > previousFocus - > SetFocus ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
else {
2011-01-16 08:16:54 +01:00
c - > previousFocus = curFocus ;
2011-11-12 02:23:18 +01:00
c - > videoSlider - > SetFocus ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
} ;
2011-08-27 08:30:29 +02:00
/// Copy the current video frame to the clipboard, with subtitles
struct video_frame_copy : public validator_video_loaded {
CMD_NAME ( " video/frame/copy " )
STR_MENU ( " Copy image to Clipboard " )
STR_DISP ( " Copy image to Clipboard " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Copy the currently displayed frame to the clipboard " )
2011-08-27 08:30:29 +02:00
void operator ( ) ( agi : : Context * c ) {
2012-10-25 17:13:13 +02:00
SetClipboard ( wxBitmap ( c - > videoController - > GetFrame ( c - > videoController - > GetFrameN ( ) ) - > GetImage ( ) , 24 ) ) ;
2011-08-27 08:30:29 +02:00
}
} ;
/// Copy the current video frame to the clipboard, without subtitles
struct video_frame_copy_raw : public validator_video_loaded {
CMD_NAME ( " video/frame/copy/raw " )
STR_MENU ( " Copy image to Clipboard (no subtitles) " )
STR_DISP ( " Copy image to Clipboard (no subtitles) " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Copy the currently displayed frame to the clipboard, without the subtitles " )
2011-08-27 08:30:29 +02:00
void operator ( ) ( agi : : Context * c ) {
2012-10-25 17:13:13 +02:00
SetClipboard ( wxBitmap ( c - > videoController - > GetFrame ( c - > videoController - > GetFrameN ( ) , true ) - > GetImage ( ) , 24 ) ) ;
2011-08-27 08:30:29 +02:00
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Seek to the next frame.
2011-07-15 06:05:22 +02:00
struct video_frame_next : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/frame/next " )
STR_MENU ( " Next Frame " )
STR_DISP ( " Next Frame " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the next frame " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > NextFrame ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2011-01-21 05:57:36 +01:00
/// Seek to the next subtitle boundary.
2011-07-15 06:05:22 +02:00
struct video_frame_next_boundary : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/next/boundary " )
STR_MENU ( " Next Boundary " )
STR_DISP ( " Next Boundary " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the next subtitle boundary " )
2011-01-21 05:57:36 +01:00
void operator ( ) ( agi : : Context * c ) {
AssDialogue * active_line = c - > selectionController - > GetActiveLine ( ) ;
if ( ! active_line ) return ;
2011-12-22 22:28:51 +01:00
int target = c - > videoController - > FrameAtTime ( active_line - > Start , agi : : vfr : : START ) ;
2011-01-21 05:57:36 +01:00
if ( target > c - > videoController - > GetFrameN ( ) ) {
c - > videoController - > JumpToFrame ( target ) ;
return ;
}
2011-12-22 22:28:51 +01:00
target = c - > videoController - > FrameAtTime ( active_line - > End , agi : : vfr : : END ) ;
2011-01-21 05:57:36 +01:00
if ( target > c - > videoController - > GetFrameN ( ) ) {
c - > videoController - > JumpToFrame ( target ) ;
return ;
}
c - > selectionController - > NextLine ( ) ;
AssDialogue * new_line = c - > selectionController - > GetActiveLine ( ) ;
if ( new_line ! = active_line )
2011-12-22 22:28:51 +01:00
c - > videoController - > JumpToTime ( new_line - > Start ) ;
2011-01-21 05:57:36 +01:00
}
} ;
/// Seek to the next keyframe.
2011-07-15 06:05:22 +02:00
struct video_frame_next_keyframe : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/next/keyframe " )
STR_MENU ( " Next Keyframe " )
STR_DISP ( " Next Keyframe " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the next keyframe " )
2011-01-21 05:57:36 +01:00
void operator ( ) ( agi : : Context * c ) {
std : : vector < int > const & kf = c - > videoController - > GetKeyFrames ( ) ;
2011-12-22 22:14:15 +01:00
std : : vector < int > : : const_iterator pos = lower_bound ( kf . begin ( ) , kf . end ( ) , c - > videoController - > GetFrameN ( ) + 1 ) ;
2011-01-21 05:57:36 +01:00
2011-12-22 22:14:24 +01:00
c - > videoController - > JumpToFrame ( pos = = kf . end ( ) ? c - > videoController - > GetLength ( ) - 1 : * pos ) ;
2011-01-21 05:57:36 +01:00
}
} ;
/// Fast jump forward
2011-07-15 06:05:22 +02:00
struct video_frame_next_large : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/next/large " )
STR_MENU ( " Fast jump forward " )
STR_DISP ( " Fast jump forward " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Fast jump forward " )
2011-01-21 05:57:36 +01:00
void operator ( ) ( agi : : Context * c ) {
c - > videoController - > JumpToFrame (
c - > videoController - > GetFrameN ( ) +
OPT_GET ( " Video/Slider/Fast Jump Step " ) - > GetInt ( ) ) ;
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Seek to the previous frame.
2011-07-15 06:05:22 +02:00
struct video_frame_prev : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/frame/prev " )
STR_MENU ( " Previous Frame " )
STR_DISP ( " Previous Frame " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the previous frame " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > PrevFrame ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2011-01-21 05:57:36 +01:00
/// Seek to the previous subtitle boundary.
2011-07-15 06:05:22 +02:00
struct video_frame_prev_boundary : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/prev/boundary " )
STR_MENU ( " Previous Boundary " )
STR_DISP ( " Previous Boundary " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the previous subtitle boundary " )
2011-01-21 05:57:36 +01:00
void operator ( ) ( agi : : Context * c ) {
AssDialogue * active_line = c - > selectionController - > GetActiveLine ( ) ;
if ( ! active_line ) return ;
2011-12-22 22:28:51 +01:00
int target = c - > videoController - > FrameAtTime ( active_line - > End , agi : : vfr : : END ) ;
2011-01-21 05:57:36 +01:00
if ( target < c - > videoController - > GetFrameN ( ) ) {
c - > videoController - > JumpToFrame ( target ) ;
return ;
}
2011-12-22 22:28:51 +01:00
target = c - > videoController - > FrameAtTime ( active_line - > Start , agi : : vfr : : START ) ;
2011-01-21 05:57:36 +01:00
if ( target < c - > videoController - > GetFrameN ( ) ) {
c - > videoController - > JumpToFrame ( target ) ;
return ;
}
c - > selectionController - > PrevLine ( ) ;
AssDialogue * new_line = c - > selectionController - > GetActiveLine ( ) ;
if ( new_line ! = active_line )
2011-12-22 22:28:51 +01:00
c - > videoController - > JumpToTime ( new_line - > End , agi : : vfr : : END ) ;
2011-01-21 05:57:36 +01:00
}
} ;
/// Seek to the previous keyframe.
2011-07-15 06:05:22 +02:00
struct video_frame_prev_keyframe : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/prev/keyframe " )
STR_MENU ( " Previous Keyframe " )
STR_DISP ( " Previous Keyframe " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Seek to the previous keyframe " )
2011-01-21 05:57:36 +01:00
void operator ( ) ( agi : : Context * c ) {
std : : vector < int > const & kf = c - > videoController - > GetKeyFrames ( ) ;
2012-01-18 21:08:16 +01:00
if ( kf . empty ( ) ) {
c - > videoController - > JumpToFrame ( 0 ) ;
return ;
}
std : : vector < int > : : const_iterator pos =
lower_bound ( kf . begin ( ) , kf . end ( ) , c - > videoController - > GetFrameN ( ) ) ;
2011-01-21 05:57:36 +01:00
2011-12-26 23:20:57 +01:00
if ( pos ! = kf . begin ( ) )
2011-01-21 05:57:36 +01:00
- - pos ;
c - > videoController - > JumpToFrame ( * pos ) ;
}
} ;
/// Fast jump backwards
2011-07-15 06:05:22 +02:00
struct video_frame_prev_large : public validator_video_loaded {
2011-01-21 05:57:36 +01:00
CMD_NAME ( " video/frame/prev/large " )
STR_MENU ( " Fast jump backwards " )
STR_DISP ( " Fast jump backwards " )
STR_HELP ( " Fast jump backwards " )
void operator ( ) ( agi : : Context * c ) {
c - > videoController - > JumpToFrame (
c - > videoController - > GetFrameN ( ) -
OPT_GET ( " Video/Slider/Fast Jump Step " ) - > GetInt ( ) ) ;
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-12-06 01:17:45 +01:00
static void save_snapshot ( agi : : Context * c , bool raw ) {
static const agi : : OptionValue * ssPath = OPT_GET ( " Path/Screenshot " ) ;
wxString option = lagi_wxString ( ssPath - > GetString ( ) ) ;
2011-12-06 01:17:54 +01:00
wxFileName videoFile ( c - > videoController - > GetVideoName ( ) ) ;
2011-12-06 01:17:45 +01:00
wxString basepath ;
// Is it a path specifier and not an actual fixed path?
if ( option [ 0 ] = = ' ? ' ) {
// If dummy video is loaded, we can't save to the video location
2011-12-06 01:17:54 +01:00
if ( option . StartsWith ( " ?video " ) & & ( c - > videoController - > GetVideoName ( ) . Find ( " ?dummy " ) ! = wxNOT_FOUND ) ) {
2011-12-06 01:17:45 +01:00
// So try the script location instead
option = " ?script " ;
}
// Find out where the ?specifier points to
basepath = StandardPaths : : DecodePath ( option ) ;
// If where ever that is isn't defined, we can't save there
if ( ( basepath = = " \\ " ) | | ( basepath = = " / " ) ) {
// So save to the current user's home dir instead
basepath = wxGetHomeDir ( ) ;
}
}
// Actual fixed (possibly relative) path, decode it
else basepath = DecodeRelativePath ( option , StandardPaths : : DecodePath ( " ?user/ " ) ) ;
basepath + = " / " + videoFile . GetName ( ) ;
// Get full path
int session_shot_count = 1 ;
wxString path ;
do {
path = wxString : : Format ( " %s_%03d_%d.png " , basepath , session_shot_count + + , c - > videoController - > GetFrameN ( ) ) ;
} while ( wxFileName : : FileExists ( path ) ) ;
c - > videoController - > GetFrame ( c - > videoController - > GetFrameN ( ) , raw ) - > GetImage ( ) . SaveFile ( path , wxBITMAP_TYPE_PNG ) ;
}
2011-08-27 08:30:29 +02:00
/// Save the current video frame, with subtitles (if any)
struct video_frame_save : public validator_video_loaded {
CMD_NAME ( " video/frame/save " )
STR_MENU ( " Save PNG snapshot " )
STR_DISP ( " Save PNG snapshot " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Save the currently displayed frame to a PNG file in the video's directory " )
2011-08-27 08:30:29 +02:00
void operator ( ) ( agi : : Context * c ) {
2011-12-06 01:17:45 +01:00
save_snapshot ( c , false ) ;
2011-08-27 08:30:29 +02:00
}
} ;
/// Save the current video frame, without subtitles
struct video_frame_save_raw : public validator_video_loaded {
CMD_NAME ( " video/frame/save/raw " )
STR_MENU ( " Save PNG snapshot (no subtitles) " )
STR_DISP ( " Save PNG snapshot (no subtitles) " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Save the currently displayed frame without the subtitles to a PNG file in the video's directory " )
2011-08-27 08:30:29 +02:00
void operator ( ) ( agi : : Context * c ) {
2011-12-06 01:17:45 +01:00
save_snapshot ( c , true ) ;
2011-08-27 08:30:29 +02:00
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Jump to frame or time.
2011-07-15 06:05:22 +02:00
struct video_jump : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/jump " )
2011-10-01 20:35:12 +02:00
STR_MENU ( " &Jump to... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Jump to " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Jump to frame or time " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
if ( c - > videoController - > IsLoaded ( ) ) {
2011-01-21 05:57:28 +01:00
DialogJumpTo ( c ) . ShowModal ( ) ;
2011-11-12 02:23:18 +01:00
c - > videoSlider - > SetFocus ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
} ;
/// Jumps the video to the end frame of current subtitle.
2011-07-15 06:05:22 +02:00
struct video_jump_end : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/jump/end " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " Jump Video to &End " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Jump Video to End " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Jumps the video to the end frame of current subtitle " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-07-15 06:25:23 +02:00
if ( AssDialogue * active_line = c - > selectionController - > GetActiveLine ( ) ) {
2011-12-22 22:28:51 +01:00
c - > videoController - > JumpToTime ( active_line - > End , agi : : vfr : : END ) ;
2011-07-15 06:25:23 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Jumps the video to the start frame of current subtitle.
2011-07-15 06:05:22 +02:00
struct video_jump_start : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/jump/start " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " Jump Video to &Start " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Jump Video to Start " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Jumps the video to the start frame of current subtitle " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-07-15 06:25:23 +02:00
if ( AssDialogue * active_line = c - > selectionController - > GetActiveLine ( ) ) {
2011-12-22 22:28:51 +01:00
c - > videoController - > JumpToTime ( active_line - > Start ) ;
2011-07-15 06:25:23 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Opens a video file.
2011-01-16 08:15:32 +01:00
struct video_open : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/open " )
2011-10-01 20:35:12 +02:00
STR_MENU ( " &Open Video... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Open Video " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Opens a video file " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
wxString path = lagi_wxString ( OPT_GET ( " Path/Last/Video " ) - > GetString ( ) ) ;
2012-05-01 04:49:33 +02:00
wxString str = _ ( " Video Formats " ) + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts,*.y4m,*.yuv)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts;*.y4m;*.yuv| "
2011-09-28 21:43:11 +02:00
+ _ ( " All Files " ) + " (*.*)|*.* " ;
wxString filename = wxFileSelector ( _ ( " Open video file " ) , path , " " , " " , str , wxFD_OPEN | wxFD_FILE_MUST_EXIST ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
if ( ! filename . empty ( ) ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > SetVideo ( filename ) ;
2011-11-25 20:29:46 +01:00
OPT_SET ( " Path/Last/Video " ) - > SetString ( STD_STR ( wxFileName ( filename ) . GetPath ( ) ) ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
} ;
/// Opens a video clip with solid colour.
2011-01-16 08:15:32 +01:00
struct video_open_dummy : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/open/dummy " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " &Use Dummy Video... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Use Dummy Video " )
2012-04-03 19:38:50 +02:00
STR_HELP ( " Opens a video clip with solid color " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
wxString fn ;
if ( DialogDummyVideo : : CreateDummyVideo ( c - > parent , fn ) ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > SetVideo ( fn ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
} ;
2011-01-20 06:58:01 +01:00
/// Toggle autoscrolling video when the active line changes
struct video_opt_autoscroll : public Command {
CMD_NAME ( " video/opt/autoscroll " )
STR_MENU ( " Toggle autoscroll of video " )
STR_DISP ( " Toggle autoscroll of video " )
STR_HELP ( " Toggle autoscroll of video " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_TOGGLE )
2011-01-20 06:58:01 +01:00
2011-12-22 22:09:31 +01:00
bool IsActive ( const agi : : Context * ) {
2011-07-15 06:06:03 +02:00
return OPT_GET ( " Video/Subtitle Sync " ) - > GetBool ( ) ;
}
2011-12-22 22:09:31 +01:00
void operator ( ) ( agi : : Context * ) {
2011-01-20 06:58:01 +01:00
OPT_SET ( " Video/Subtitle Sync " ) - > SetBool ( ! OPT_GET ( " Video/Subtitle Sync " ) - > GetBool ( ) ) ;
}
} ;
/// Play video.
2011-07-15 06:05:22 +02:00
struct video_play : public validator_video_loaded {
2011-01-20 06:58:01 +01:00
CMD_NAME ( " video/play " )
STR_MENU ( " Play " )
STR_DISP ( " Play " )
STR_HELP ( " Play video starting on this position " )
void operator ( ) ( agi : : Context * c ) {
c - > videoController - > Play ( ) ;
}
} ;
/// Play video for the active line.
2011-07-15 06:05:22 +02:00
struct video_play_line : public validator_video_loaded {
2011-01-20 06:58:01 +01:00
CMD_NAME ( " video/play/line " )
STR_MENU ( " Play line " )
STR_DISP ( " Play line " )
STR_HELP ( " Play current line " )
void operator ( ) ( agi : : Context * c ) {
c - > videoController - > PlayLine ( ) ;
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Show a mask over the video.
2011-07-15 06:05:22 +02:00
struct video_show_overscan : public validator_video_loaded {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/show_overscan " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " Show &Overscan Mask " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Show Overscan Mask " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Show a mask over the video, indicating areas that might get cropped off by overscan on televisions " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_TOGGLE )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-12-22 22:09:31 +01:00
bool IsActive ( const agi : : Context * ) {
2011-07-15 06:06:03 +02:00
return OPT_GET ( " Video/Overscan Mask " ) - > GetBool ( ) ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-25 05:24:19 +01:00
OPT_SET ( " Video/Overscan Mask " ) - > SetBool ( ! OPT_GET ( " Video/Overscan Mask " ) - > GetBool ( ) ) ;
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > Render ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Set zoom to 100%.
2011-07-15 06:05:22 +02:00
class video_zoom_100 : public validator_video_attached {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
public :
CMD_NAME ( " video/zoom/100 " )
STR_MENU ( " &100% " )
STR_DISP ( " 100% " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Set zoom to 100% " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
2011-11-12 02:23:18 +01:00
return c - > videoDisplay - > GetZoom ( ) = = 1. ;
2011-07-15 06:06:03 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > SetZoom ( 1. ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2011-01-20 06:58:01 +01:00
/// Stop video playback
2011-07-15 06:05:22 +02:00
class video_stop : public validator_video_loaded {
2011-01-20 06:58:01 +01:00
public :
CMD_NAME ( " video/stop " )
STR_MENU ( " Stop video " )
STR_DISP ( " Stop video " )
STR_HELP ( " Stop video playback " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-01-20 06:58:01 +01:00
void operator ( ) ( agi : : Context * c ) {
c - > videoController - > Stop ( ) ;
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// Set zoom to 200%.
2011-07-15 06:05:22 +02:00
class video_zoom_200 : public validator_video_attached {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
public :
CMD_NAME ( " video/zoom/200 " )
STR_MENU ( " &200% " )
STR_DISP ( " 200% " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Set zoom to 200% " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
2011-11-12 02:23:18 +01:00
return c - > videoDisplay - > GetZoom ( ) = = 2. ;
2011-07-15 06:06:03 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > SetZoom ( 2. ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Set zoom to 50%.
2011-07-15 06:05:22 +02:00
class video_zoom_50 : public validator_video_attached {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
public :
CMD_NAME ( " video/zoom/50 " )
STR_MENU ( " &50% " )
STR_DISP ( " 50% " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Set zoom to 50% " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:06:03 +02:00
bool IsActive ( const agi : : Context * c ) {
2011-11-12 02:23:18 +01:00
return c - > videoDisplay - > GetZoom ( ) = = .5 ;
2011-07-15 06:06:03 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-01-16 08:16:54 +01:00
c - > videoController - > Stop ( ) ;
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > SetZoom ( .5 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Zoom video in.
2011-07-15 06:05:22 +02:00
struct video_zoom_in : public validator_video_attached {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/zoom/in " )
STR_MENU ( " Zoom In " )
STR_DISP ( " Zoom In " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Zoom video in " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > SetZoom ( c - > videoDisplay - > GetZoom ( ) + .125 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
/// Zoom video out.
2011-07-15 06:05:22 +02:00
struct video_zoom_out : public validator_video_attached {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " video/zoom/out " )
STR_MENU ( " Zoom Out " )
STR_DISP ( " Zoom Out " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Zoom video out " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
void operator ( ) ( agi : : Context * c ) {
2011-11-12 02:23:18 +01:00
c - > videoDisplay - > SetZoom ( c - > videoDisplay - > GetZoom ( ) - .125 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2011-07-15 06:05:01 +02:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
/// @}
2011-07-15 06:05:01 +02:00
namespace cmd {
void init_video ( ) {
reg ( new video_aspect_cinematic ) ;
reg ( new video_aspect_custom ) ;
reg ( new video_aspect_default ) ;
reg ( new video_aspect_full ) ;
reg ( new video_aspect_wide ) ;
reg ( new video_close ) ;
2011-08-27 08:30:29 +02:00
reg ( new video_copy_coordinates ) ;
2011-07-15 06:05:01 +02:00
reg ( new video_detach ) ;
reg ( new video_details ) ;
reg ( new video_focus_seek ) ;
2011-08-27 08:30:29 +02:00
reg ( new video_frame_copy ) ;
reg ( new video_frame_copy_raw ) ;
2011-07-15 06:05:01 +02:00
reg ( new video_frame_next ) ;
reg ( new video_frame_next_boundary ) ;
reg ( new video_frame_next_keyframe ) ;
reg ( new video_frame_next_large ) ;
reg ( new video_frame_prev ) ;
reg ( new video_frame_prev_boundary ) ;
reg ( new video_frame_prev_keyframe ) ;
reg ( new video_frame_prev_large ) ;
2011-08-27 08:30:29 +02:00
reg ( new video_frame_save ) ;
reg ( new video_frame_save_raw ) ;
2011-07-15 06:05:01 +02:00
reg ( new video_jump ) ;
reg ( new video_jump_end ) ;
reg ( new video_jump_start ) ;
reg ( new video_open ) ;
reg ( new video_open_dummy ) ;
reg ( new video_opt_autoscroll ) ;
reg ( new video_play ) ;
reg ( new video_play_line ) ;
reg ( new video_show_overscan ) ;
reg ( new video_stop ) ;
reg ( new video_zoom_100 ) ;
reg ( new video_zoom_200 ) ;
reg ( new video_zoom_50 ) ;
reg ( new video_zoom_in ) ;
reg ( new video_zoom_out ) ;
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}