2006-01-16 22:02:54 +01:00
|
|
|
// Copyright (c) 2005, Rodrigo Braz Monteiro
|
|
|
|
// 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.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file frame_main.h
|
|
|
|
/// @see frame_main.cpp
|
|
|
|
/// @ingroup main_ui
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <wx/combobox.h>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/frame.h>
|
|
|
|
#include <wx/log.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#include <wx/menu.h>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/panel.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/timer.h>
|
|
|
|
#endif
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-01-16 08:16:00 +01:00
|
|
|
#include <libaegisub/scoped_ptr.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:49 +02:00
|
|
|
class AegisubFileDropTarget;
|
2010-07-09 09:31:48 +02:00
|
|
|
class AssFile;
|
2006-01-16 22:02:54 +01:00
|
|
|
class AudioBox;
|
2010-12-08 04:36:10 +01:00
|
|
|
class AudioController;
|
2010-12-08 09:09:16 +01:00
|
|
|
class AudioProvider;
|
2011-07-15 06:05:49 +02:00
|
|
|
class DialogDetachedVideo;
|
|
|
|
class DialogStyling;
|
|
|
|
class SubsEditBox;
|
|
|
|
class SubtitlesGrid;
|
|
|
|
class VideoBox;
|
|
|
|
class VideoDisplay;
|
|
|
|
class VideoSlider;
|
|
|
|
class VideoZoomSlider;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-07-30 01:16:36 +02:00
|
|
|
namespace agi { struct Context; class OptionValue; }
|
2006-01-16 22:02:54 +01:00
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
|
|
|
/// @class FrameMain
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2010-12-08 09:09:16 +01:00
|
|
|
class FrameMain: public wxFrame {
|
2006-01-16 22:02:54 +01:00
|
|
|
friend class AegisubFileDropTarget;
|
|
|
|
|
2011-01-16 08:16:54 +01:00
|
|
|
agi::scoped_ptr<agi::Context> context;
|
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-02-23 14:14:48 +01:00
|
|
|
// XXX: Make Freeze()/Thaw() noops on GTK, this seems to be buggy
|
|
|
|
#ifdef __WXGTK__
|
|
|
|
void Freeze(void) {}
|
|
|
|
void Thaw(void) {}
|
|
|
|
#endif
|
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:49 +02:00
|
|
|
bool showVideo; ///< Is the video display shown?
|
|
|
|
bool showAudio; ///< Is the audio display shown?
|
|
|
|
wxTimer AutoSave; ///< Autosave timer
|
|
|
|
wxTimer StatusClear; ///< Status bar timeout timer
|
|
|
|
/// Block video loading; used when both video and subtitles are opened at
|
|
|
|
/// the same time, so that the video associated with the subtitles (if any)
|
|
|
|
/// isn't loaded
|
2006-01-16 22:02:54 +01:00
|
|
|
bool blockVideoLoad;
|
2012-03-27 06:23:45 +02:00
|
|
|
bool blockAudioLoad;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
void InitToolbar();
|
|
|
|
void InitContents();
|
|
|
|
|
2011-01-16 08:17:17 +01:00
|
|
|
bool LoadList(wxArrayString list);
|
|
|
|
void UpdateTitle();
|
2011-11-16 22:58:58 +01:00
|
|
|
wxString GetScriptFileName() const;
|
2011-01-16 08:17:17 +01: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 OnKeyDown(wxKeyEvent &event);
|
2011-10-25 21:40:57 +02:00
|
|
|
void OnMouseWheel(wxMouseEvent &evt);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-07-15 06:05:49 +02:00
|
|
|
/// @brief Autosave the currently open file, if any
|
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 OnAutoSave(wxTimerEvent &event);
|
|
|
|
void OnStatusClear(wxTimerEvent &event);
|
2006-01-16 22:02:54 +01:00
|
|
|
void OnCloseWindow (wxCloseEvent &event);
|
2006-12-28 23:31:33 +01:00
|
|
|
|
2010-12-08 04:36:10 +01:00
|
|
|
// AudioControllerAudioEventListener implementation
|
2010-12-08 09:09:16 +01:00
|
|
|
void OnAudioOpen(AudioProvider *provider);
|
|
|
|
void OnAudioClose();
|
2010-12-08 04:36:10 +01:00
|
|
|
|
2011-01-16 08:16:27 +01:00
|
|
|
void OnVideoOpen();
|
2011-07-30 01:16:36 +02:00
|
|
|
void OnVideoDetach(agi::OptionValue const& opt);
|
2010-12-08 04:36:10 +01:00
|
|
|
|
2011-01-16 08:16:33 +01:00
|
|
|
void OnSubtitlesOpen();
|
2010-12-07 20:09:28 +01:00
|
|
|
|
2012-01-23 00:44:24 +01:00
|
|
|
void EnableToolBar(agi::OptionValue const& opt);
|
|
|
|
|
2011-07-15 06:05:49 +02:00
|
|
|
SubtitlesGrid *SubsGrid; ///< The subtitle editing area
|
|
|
|
AudioBox *audioBox; ///< The audio area
|
|
|
|
VideoBox *videoBox; ///< The video area
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-07-15 06:05:49 +02:00
|
|
|
wxBoxSizer *MainSizer; ///< Arranges things from top to bottom in the window
|
|
|
|
wxBoxSizer *TopSizer; ///< Arranges video box and tool box from left to right
|
|
|
|
wxBoxSizer *ToolsSizer; ///< Arranges audio and editing areas top to bottom
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-01-16 08:17:17 +01:00
|
|
|
public:
|
|
|
|
FrameMain(wxArrayString args);
|
|
|
|
~FrameMain();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-07-30 01:16:55 +02:00
|
|
|
/// Set the status bar text
|
|
|
|
/// @param text New status bar text
|
|
|
|
/// @param ms Time in milliseconds that the message should be visible
|
|
|
|
void StatusTimeout(wxString text,int ms=10000);
|
2011-12-22 22:30:49 +01:00
|
|
|
|
2011-07-30 01:16:55 +02:00
|
|
|
/// @brief Set the video and audio display visibility
|
|
|
|
/// @param video -1: leave unchanged; 0: hide; 1: show
|
|
|
|
/// @param audio -1: leave unchanged; 0: hide; 1: show
|
|
|
|
void SetDisplayMode(int showVid,int showAudio);
|
2011-12-22 22:30:49 +01:00
|
|
|
|
|
|
|
bool IsVideoShown() const { return showVideo; }
|
|
|
|
bool IsAudioShown() const { return showAudio; }
|
|
|
|
|
2012-01-08 02:05:57 +01:00
|
|
|
/// Close the currently open subs, asking the user if they want to save if there are unsaved changes
|
|
|
|
/// @param enableCancel Should the user be able to cancel the close?
|
|
|
|
int TryToCloseSubs(bool enableCancel=true);
|
|
|
|
|
2011-07-30 01:16:55 +02:00
|
|
|
void LoadSubtitles(wxString filename,wxString charset="");
|
|
|
|
|
2006-01-19 11:33:56 +01:00
|
|
|
DECLARE_EVENT_TABLE()
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|