2011-09-15 07:17:14 +02:00
|
|
|
// Copyright (c) 2011, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-09-15 07:17:14 +02:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-09-15 07:17:14 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
|
|
|
|
|
|
|
/// @file dialog_shift_times.h
|
|
|
|
/// @see dialog_shift_times.cpp
|
|
|
|
/// @ingroup secondary_ui
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <libaegisub/fs_fwd.h>
|
2011-09-15 07:17:14 +02:00
|
|
|
#include <libaegisub/signal.h>
|
|
|
|
#include <libaegisub/vfr.h>
|
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
#include <deque>
|
2013-06-10 15:58:13 +02:00
|
|
|
#include <memory>
|
2013-01-04 16:01:50 +01:00
|
|
|
|
|
|
|
#include <wx/dialog.h>
|
2011-09-15 07:17:14 +02:00
|
|
|
|
|
|
|
class AssDialogue;
|
2011-01-16 08:17:36 +01:00
|
|
|
class TimeEdit;
|
|
|
|
class wxListBox;
|
|
|
|
class wxRadioBox;
|
|
|
|
class wxRadioButton;
|
|
|
|
class wxTextCtrl;
|
2011-09-15 07:17:14 +02:00
|
|
|
namespace agi { struct Context; }
|
2012-01-26 00:09:45 +01:00
|
|
|
namespace json {
|
|
|
|
class UnknownElement;
|
|
|
|
typedef std::deque<UnknownElement> Array;
|
|
|
|
}
|
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
|
|
|
|
2014-03-13 02:39:07 +01:00
|
|
|
class DialogShiftTimes final : public wxDialog {
|
2013-06-10 15:58:13 +02:00
|
|
|
wxDECLARE_NO_COPY_CLASS(DialogShiftTimes); // clang + libc++ herps a derp without this
|
2011-01-16 08:17:36 +01:00
|
|
|
agi::Context *context;
|
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
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
agi::fs::path history_filename;
|
2013-06-10 15:58:13 +02:00
|
|
|
std::unique_ptr<json::Array> history;
|
2011-09-15 07:17:14 +02:00
|
|
|
agi::vfr::Framerate fps;
|
|
|
|
agi::signal::Connection timecodes_loaded_slot;
|
2012-10-05 05:22:54 +02:00
|
|
|
agi::signal::Connection selected_set_changed_slot;
|
2011-09-15 07:17:14 +02:00
|
|
|
|
|
|
|
TimeEdit *shift_time;
|
|
|
|
wxTextCtrl *shift_frames;
|
|
|
|
wxRadioButton *shift_by_time;
|
|
|
|
wxRadioButton *shift_by_frames;
|
|
|
|
wxRadioButton *shift_forward;
|
|
|
|
wxRadioButton *shift_backward;
|
|
|
|
wxRadioBox *selection_mode;
|
|
|
|
wxRadioBox *time_fields;
|
2012-01-26 00:09:45 +01:00
|
|
|
wxListBox *history_box;
|
2011-09-15 07:17:14 +02:00
|
|
|
|
2012-01-26 00:09:45 +01:00
|
|
|
void SaveHistory(json::Array const& shifted_blocks);
|
2011-09-15 07:17:14 +02:00
|
|
|
void LoadHistory();
|
|
|
|
void Process(wxCommandEvent&);
|
|
|
|
int Shift(int initial_time, int shift, bool by_time, agi::vfr::Time type);
|
|
|
|
|
|
|
|
void OnClear(wxCommandEvent&);
|
|
|
|
void OnByTime(wxCommandEvent&);
|
|
|
|
void OnByFrames(wxCommandEvent&);
|
2012-01-26 00:09:45 +01:00
|
|
|
void OnHistoryClick(wxCommandEvent&);
|
2011-09-15 07:17:14 +02:00
|
|
|
|
2012-10-05 05:22:54 +02:00
|
|
|
void OnSelectedSetChanged();
|
2011-09-15 07:17:14 +02:00
|
|
|
void OnTimecodesLoaded(agi::vfr::Framerate const& new_fps);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-01-16 08:17:36 +01:00
|
|
|
public:
|
2011-09-15 07:17:14 +02:00
|
|
|
DialogShiftTimes(agi::Context *context);
|
|
|
|
~DialogShiftTimes();
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|