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/
|
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <libaegisub/fs_fwd.h>
|
|
|
|
|
|
|
|
#include <memory>
|
2009-09-11 04:36:34 +02:00
|
|
|
#include <vector>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/frame.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/timer.h>
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2013-01-26 02:57:46 +01:00
|
|
|
class AegisubApp;
|
2014-05-22 01:23:28 +02:00
|
|
|
class AsyncVideoProvider;
|
2006-01-16 22:02:54 +01:00
|
|
|
class AudioBox;
|
2010-12-08 09:09:16 +01:00
|
|
|
class AudioProvider;
|
2011-07-15 06:05:49 +02:00
|
|
|
class VideoBox;
|
2011-07-30 01:16:36 +02:00
|
|
|
namespace agi { struct Context; class OptionValue; }
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2014-03-25 17:51:38 +01:00
|
|
|
class FrameMain : public wxFrame {
|
2013-01-26 02:57:46 +01:00
|
|
|
friend class AegisubApp;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
std::unique_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
|
|
|
|
2013-12-12 01:29:48 +01:00
|
|
|
bool showVideo = true; ///< Is the video display shown?
|
|
|
|
bool showAudio = true; ///< Is the audio display shown?
|
|
|
|
wxTimer StatusClear; ///< Status bar timeout timer
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
void InitContents();
|
|
|
|
|
2011-01-16 08:17:17 +01:00
|
|
|
void UpdateTitle();
|
|
|
|
|
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
|
|
|
|
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 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 09:09:16 +01:00
|
|
|
void OnAudioOpen(AudioProvider *provider);
|
2014-05-22 01:23:28 +02:00
|
|
|
void OnVideoOpen(AsyncVideoProvider *provider);
|
2011-07-30 01:16:36 +02:00
|
|
|
void OnVideoDetach(agi::OptionValue const& opt);
|
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
|
|
|
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:
|
2013-02-05 16:52:24 +01:00
|
|
|
FrameMain();
|
2011-01-16 08:17:17 +01:00
|
|
|
~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; }
|
|
|
|
|
2006-01-19 11:33:56 +01:00
|
|
|
DECLARE_EVENT_TABLE()
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|