From d38cbae8d5b62d26c43dd28c06057f5c711bb151 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Wed, 1 Mar 2006 04:32:00 +0000 Subject: [PATCH] Made double click on grid row jump video to it Originally committed to SVN as r190. --- core/base_grid.cpp | 8 ++++-- core/changelog.txt | 1 + core/subtitles_rasterizer.h | 57 +++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 core/subtitles_rasterizer.h diff --git a/core/base_grid.cpp b/core/base_grid.cpp index 48165205b..3baf9e275 100644 --- a/core/base_grid.cpp +++ b/core/base_grid.cpp @@ -573,6 +573,7 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) { // Row that mouse is over bool click = event.ButtonDown(wxMOUSE_BTN_LEFT); + bool dclick = event.LeftDClick(); int row = event.GetY()/lineHeight + yPos - 1; if (holding && !click) { row = MID(0,row,GetRows()-1); @@ -611,7 +612,7 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) { } // Click - if ((click || holding) && validRow) { + if ((click || holding || dclick) && validRow) { // Disable extending extendRow = -1; @@ -623,8 +624,9 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) { } // Normal click - if (click && !shift && !ctrl && !alt) { - editBox->SetToLine(row); + if ((click || dclick) && !shift && !ctrl && !alt) { + if (editBox->linen != row) editBox->SetToLine(row); + if (dclick) video->JumpToFrame(VFR_Output.GetFrameAtTime(GetDialogue(row)->Start.GetMS(),true)); SelectRow(row,false); parentFrame->UpdateToolbar(); lastRow = row; diff --git a/core/changelog.txt b/core/changelog.txt index ba94f2042..4f5166e3a 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -29,6 +29,7 @@ Please visit http://aegisub.net to download latest version o Inserted lines will now be automatically selected. o Alt+Click on grid will activate the clicked line, without modifying selection. o Actor and effect columns are now only visible if they are being used. + o Double clicking a row will jump video to it, regardless of auto go to option. - Toolbar will now properly disable the Jump To buttons if more than one line is selected. (AMZ) - Fixed the toolbar "grey area" glitch (was actually a wxWidgets issue). (AMZ) - Default video zoom can now be set in config.dat and is defaulted to 100%. (AMZ) diff --git a/core/subtitles_rasterizer.h b/core/subtitles_rasterizer.h new file mode 100644 index 000000000..573fae7bb --- /dev/null +++ b/core/subtitles_rasterizer.h @@ -0,0 +1,57 @@ +// Copyright (c) 2006, Rodrigo Braz Monteiro, Fredrik Mellbin +// 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 +// +// Website: http://aegisub.cellosoft.com +// Contact: mailto:zeratul@cellosoft.com +// + + +#pragma once + + +////////////// +// Prototypes +class VideoFrame; +class AssFile; + + +//////////////////////////// +// Video Provider interface +class SubtitleRasterizer { +public: + virtual ~SubtitleRasterizer() {} + + wxString GetFromDisk(AssFile *subs); + + virtual void Load(AssFile *subs)=0; + virtual void Close() {} + virtual void RenderFrame(VideoFrame *frame,int ms)=0; +};