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/
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @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-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"
|
|
|
|
#include "../dialog_jumpto.h"
|
|
|
|
#include "../dialog_video_details.h"
|
2011-07-15 06:05:15 +02:00
|
|
|
#include "../selection_controller.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"
|
|
|
|
#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) {
|
|
|
|
return c->videoController->IsLoaded() && !c->detachedVideo;
|
|
|
|
}
|
|
|
|
};
|
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-07-15 06:05:22 +02:00
|
|
|
struct video_aspect_cinematic : 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/aspect/cinematic")
|
|
|
|
STR_MENU("&Cinematic (2.35)")
|
|
|
|
STR_DISP("Cinematic (235)")
|
|
|
|
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-07-15 06:05:22 +02:00
|
|
|
struct video_aspect_custom : 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/aspect/custom")
|
|
|
|
STR_MENU("Custom..")
|
|
|
|
STR_DISP("Custom")
|
|
|
|
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('/');
|
|
|
|
if (pos==wxNOT_FOUND&&value.Contains(_T('x'))) {
|
|
|
|
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-01-16 08:16:54 +01:00
|
|
|
if (scale) c->videoBox->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
|
|
|
|
if (numval < 0.5 || numval > 5.0) wxMessageBox(_("Invalid value! Aspect ratio must be between 0.5 and 5.0."),_("Invalid Aspect Ratio"),wxICON_ERROR|wxOK);
|
|
|
|
|
|
|
|
// 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-07-15 06:05:22 +02:00
|
|
|
struct video_aspect_default : 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/aspect/default")
|
|
|
|
STR_MENU("&Default")
|
|
|
|
STR_DISP("Default")
|
|
|
|
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-07-15 06:05:22 +02:00
|
|
|
struct video_aspect_full : 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/aspect/full")
|
|
|
|
STR_MENU("&Fullscreen (4:3)")
|
|
|
|
STR_DISP("Fullscreen (4:3)")
|
|
|
|
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-07-15 06:05:22 +02:00
|
|
|
struct video_aspect_wide : 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/aspect/wide")
|
|
|
|
STR_MENU("&Widescreen (16:9)")
|
|
|
|
STR_DISP("Widescreen (16:9)")
|
|
|
|
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")
|
|
|
|
STR_HELP("Closes the currently open video file.")
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_MENU("Detach Video")
|
|
|
|
STR_DISP("Detach Video")
|
|
|
|
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) {
|
|
|
|
return !!c->detachedVideo;
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
wxGetApp().frame->DetachVideo(!c->detachedVideo);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_MENU("Show Video Details..")
|
|
|
|
STR_DISP("Show Video Details")
|
|
|
|
STR_HELP("Shows video details.")
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
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")
|
|
|
|
STR_MENU("XXX: no idea")
|
|
|
|
STR_DISP("XXX: no idea")
|
|
|
|
STR_HELP("XXX: no idea")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
wxWindow *curFocus = wxWindow::FindFocus();
|
|
|
|
if (curFocus == c->videoBox->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;
|
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
|
|
|
c->videoBox->videoSlider->SetFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Seek to the next frame.")
|
|
|
|
|
|
|
|
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")
|
|
|
|
STR_HELP("Seek to the next subtitle boundary.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
AssDialogue *active_line = c->selectionController->GetActiveLine();
|
|
|
|
if (!active_line) return;
|
|
|
|
|
|
|
|
int target = c->videoController->FrameAtTime(active_line->Start.GetMS(), agi::vfr::START);
|
|
|
|
if (target > c->videoController->GetFrameN()) {
|
|
|
|
c->videoController->JumpToFrame(target);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
target = c->videoController->FrameAtTime(active_line->End.GetMS(), agi::vfr::END);
|
|
|
|
if (target > c->videoController->GetFrameN()) {
|
|
|
|
c->videoController->JumpToFrame(target);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
c->selectionController->NextLine();
|
|
|
|
AssDialogue *new_line = c->selectionController->GetActiveLine();
|
|
|
|
if (new_line != active_line)
|
|
|
|
c->videoController->JumpToTime(new_line->Start.GetMS());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Seek to the next keyframe.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
std::vector<int> const& kf = c->videoController->GetKeyFrames();
|
|
|
|
std::vector<int>::const_iterator pos = lower_bound(kf.begin(), kf.end(), c->videoController->GetFrameN());
|
|
|
|
if (pos != kf.end()) ++pos;
|
|
|
|
|
|
|
|
c->videoController->JumpToFrame(pos == kf.end() ? c->videoController->GetFrameN() - 1 : *pos);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Fast jump forward.")
|
|
|
|
|
|
|
|
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")
|
|
|
|
STR_HELP("Seek to the previous frame.")
|
|
|
|
|
|
|
|
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")
|
|
|
|
STR_HELP("Seek to the previous subtitle boundary.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
AssDialogue *active_line = c->selectionController->GetActiveLine();
|
|
|
|
if (!active_line) return;
|
|
|
|
|
|
|
|
int target = c->videoController->FrameAtTime(active_line->End.GetMS(), agi::vfr::END);
|
|
|
|
if (target < c->videoController->GetFrameN()) {
|
|
|
|
c->videoController->JumpToFrame(target);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
target = c->videoController->FrameAtTime(active_line->Start.GetMS(), agi::vfr::START);
|
|
|
|
if (target < c->videoController->GetFrameN()) {
|
|
|
|
c->videoController->JumpToFrame(target);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
c->selectionController->PrevLine();
|
|
|
|
AssDialogue *new_line = c->selectionController->GetActiveLine();
|
|
|
|
if (new_line != active_line)
|
|
|
|
c->videoController->JumpToTime(new_line->End.GetMS(), agi::vfr::END);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Seek to the previous keyframe.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
int frame = c->videoController->GetFrameN();
|
|
|
|
std::vector<int> const& kf = c->videoController->GetKeyFrames();
|
|
|
|
std::vector<int>::const_iterator pos = lower_bound(kf.begin(), kf.end(), frame);
|
|
|
|
|
|
|
|
if (frame != 0 && (pos == kf.end() || *pos == frame))
|
|
|
|
--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
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_MENU("&Jump to..")
|
|
|
|
STR_DISP("Jump to")
|
|
|
|
STR_HELP("Jump to frame or time.")
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
c->videoBox->videoSlider->SetFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_MENU("Jump Video to End")
|
|
|
|
STR_DISP("Jump Video to End")
|
|
|
|
STR_HELP("Jumps the video to the end frame of current subtitle.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-07-15 06:25:23 +02:00
|
|
|
if (AssDialogue *active_line = c->selectionController->GetActiveLine()) {
|
|
|
|
c->videoController->JumpToTime(active_line->End.GetMS(), agi::vfr::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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_MENU("Jump Video to Start")
|
|
|
|
STR_DISP("Jump Video to Start")
|
|
|
|
STR_HELP("Jumps the video to the start frame of current subtitle.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-07-15 06:25:23 +02:00
|
|
|
if (AssDialogue *active_line = c->selectionController->GetActiveLine()) {
|
|
|
|
c->videoController->JumpToTime(active_line->Start.GetMS());
|
|
|
|
}
|
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")
|
|
|
|
STR_MENU("&Open Video..")
|
|
|
|
STR_DISP("Open Video")
|
|
|
|
STR_HELP("Opens a video file.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
wxString path = lagi_wxString(OPT_GET("Path/Last/Video")->GetString());
|
|
|
|
wxString str = wxString(_("Video Formats")) + _T(" (*.avi,*.mkv,*.mp4,*.avs,*.d2v,*.ogm,*.mpeg,*.mpg,*.vob,*.mov)|*.avi;*.avs;*.d2v;*.mkv;*.ogm;*.mp4;*.mpeg;*.mpg;*.vob;*.mov|")
|
|
|
|
+ _("All Files") + _T(" (*.*)|*.*");
|
|
|
|
wxString filename = wxFileSelector(_("Open video file"),path,_T(""),_T(""),str,wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
|
|
|
if (!filename.empty()) {
|
2011-01-16 08:16:54 +01:00
|
|
|
c->videoController->SetVideo(filename);
|
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
|
|
|
OPT_SET("Path/Last/Video")->SetString(STD_STR(filename));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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-01-20 06:58:01 +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")
|
|
|
|
STR_HELP("Opens a video clip with solid colour.")
|
|
|
|
|
|
|
|
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-07-15 06:06:03 +02:00
|
|
|
bool IsActive(const agi::Context *c) {
|
|
|
|
return OPT_GET("Video/Subtitle Sync")->GetBool();
|
|
|
|
}
|
|
|
|
|
2011-01-20 06:58:01 +01:00
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
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")
|
|
|
|
STR_MENU("Show Overscan Mask")
|
|
|
|
STR_DISP("Show Overscan Mask")
|
|
|
|
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-07-15 06:06:03 +02:00
|
|
|
bool IsActive(const agi::Context *c) {
|
|
|
|
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());
|
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
|
|
|
c->videoBox->videoDisplay->Render();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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%")
|
|
|
|
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) {
|
|
|
|
return c->videoBox->videoDisplay->GetZoom() == 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();
|
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
|
|
|
c->videoBox->videoDisplay->SetZoom(1.);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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%")
|
|
|
|
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) {
|
|
|
|
return c->videoBox->videoDisplay->GetZoom() == 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();
|
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
|
|
|
c->videoBox->videoDisplay->SetZoom(2.);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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%")
|
|
|
|
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) {
|
|
|
|
return c->videoBox->videoDisplay->GetZoom() == .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
|
|
|
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
|
|
|
c->videoBox->videoDisplay->SetZoom(.5);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Zoom video in.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
c->videoBox->videoDisplay->SetZoom(c->videoBox->videoDisplay->GetZoom() + .125);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 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")
|
|
|
|
STR_HELP("Zoom video out.")
|
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
|
|
|
c->videoBox->videoDisplay->SetZoom(c->videoBox->videoDisplay->GetZoom() - .125);
|
|
|
|
}
|
|
|
|
};
|
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);
|
|
|
|
reg(new video_detach);
|
|
|
|
reg(new video_details);
|
|
|
|
reg(new video_focus_seek);
|
|
|
|
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);
|
|
|
|
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
|
|
|
}
|