2012-03-25 06:04:59 +02:00
|
|
|
// Copyright (c) 2012, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2012-03-25 06:04:59 +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
|
|
|
//
|
2012-03-25 06:04:59 +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.
|
2014-05-22 21:07:15 +02:00
|
|
|
//
|
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "ass_file.h"
|
2014-05-22 01:23:28 +02:00
|
|
|
#include "async_video_provider.h"
|
2014-05-20 01:47:54 +02:00
|
|
|
#include "compat.h"
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "help_button.h"
|
2014-05-20 01:47:54 +02:00
|
|
|
#include "include/aegisub/context.h"
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "libresrc/libresrc.h"
|
2014-05-22 01:23:28 +02:00
|
|
|
#include "project.h"
|
2013-07-05 01:28:43 +02:00
|
|
|
#include "resolution_resampler.h"
|
2014-05-16 18:20:30 +02:00
|
|
|
#include "validators.h"
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2014-05-16 18:20:30 +02:00
|
|
|
#include <boost/range/size.hpp>
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <wx/checkbox.h>
|
2014-05-20 01:47:54 +02:00
|
|
|
#include <wx/combobox.h>
|
2014-05-22 21:07:15 +02:00
|
|
|
#include <wx/dialog.h>
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/spinctrl.h>
|
|
|
|
#include <wx/statbox.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/valgen.h>
|
|
|
|
|
2014-05-22 21:07:15 +02:00
|
|
|
namespace {
|
|
|
|
/// @class DialogResample
|
|
|
|
/// @brief Configuration dialog for resolution resampling
|
|
|
|
///
|
|
|
|
/// Populate a ResampleSettings structure with data from the user
|
2014-05-31 02:05:25 +02:00
|
|
|
struct DialogResample {
|
|
|
|
wxDialog d;
|
2014-05-22 21:07:15 +02:00
|
|
|
agi::Context *c; ///< Project context
|
|
|
|
|
|
|
|
int script_w;
|
|
|
|
int script_h;
|
|
|
|
YCbCrMatrix script_mat;
|
|
|
|
int video_w = 0;
|
|
|
|
int video_h = 0;
|
|
|
|
YCbCrMatrix video_mat;
|
|
|
|
|
|
|
|
wxSpinCtrl *source_x;
|
|
|
|
wxSpinCtrl *source_y;
|
|
|
|
wxSpinCtrl *dest_x;
|
|
|
|
wxSpinCtrl *dest_y;
|
|
|
|
wxComboBox *source_matrix;
|
|
|
|
wxComboBox *dest_matrix;
|
|
|
|
wxCheckBox *symmetrical;
|
|
|
|
wxRadioBox *ar_mode;
|
|
|
|
wxSpinCtrl *margin_ctrl[4];
|
|
|
|
|
|
|
|
wxButton *from_script;
|
|
|
|
wxButton *from_video;
|
|
|
|
|
|
|
|
void SetSourceFromScript(wxCommandEvent &);
|
|
|
|
/// Set the destination resolution to the video's resolution
|
|
|
|
void SetDestFromVideo(wxCommandEvent &);
|
|
|
|
/// Symmetrical checkbox toggle handler
|
|
|
|
void OnSymmetrical(wxCommandEvent &);
|
|
|
|
/// Copy margin values over if symmetrical is enabled
|
|
|
|
void OnMarginChange(wxSpinCtrl *src, wxSpinCtrl *dst);
|
|
|
|
void UpdateButtons();
|
|
|
|
|
|
|
|
public:
|
|
|
|
/// Constructor
|
|
|
|
/// @param context Project context
|
|
|
|
/// @param[out] settings Settings struct to populate
|
|
|
|
DialogResample(agi::Context *context, ResampleSettings &settings);
|
|
|
|
};
|
|
|
|
|
2011-01-16 08:17:36 +01:00
|
|
|
enum {
|
2012-03-25 06:04:59 +02:00
|
|
|
LEFT = 0,
|
|
|
|
RIGHT = 1,
|
|
|
|
TOP = 2,
|
|
|
|
BOTTOM = 3
|
2011-01-16 08:17:36 +01:00
|
|
|
};
|
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings)
|
2014-05-31 02:05:25 +02:00
|
|
|
: d(c->parent, -1, _("Resample Resolution"))
|
2011-01-21 07:09:13 +01:00
|
|
|
, c(c)
|
2006-01-16 22:02:54 +01:00
|
|
|
{
|
2014-05-31 02:05:25 +02:00
|
|
|
d.SetIcon(GETICON(resample_toolbutton_16));
|
2007-07-05 01:09:40 +02:00
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
memset(&settings, 0, sizeof(settings));
|
2013-09-08 17:03:55 +02:00
|
|
|
c->ass->GetResolution(script_w, script_h);
|
|
|
|
settings.source_x = script_w;
|
|
|
|
settings.source_y = script_h;
|
2014-05-20 01:47:54 +02:00
|
|
|
settings.source_matrix = script_mat = MatrixFromString(c->ass->GetScriptInfo("YCbCr Matrix"));
|
2013-09-08 17:03:55 +02:00
|
|
|
|
2014-05-22 01:23:28 +02:00
|
|
|
if (auto provider = c->project->VideoProvider()) {
|
|
|
|
settings.dest_x = video_w = provider->GetWidth();
|
|
|
|
settings.dest_y = video_h = provider->GetHeight();
|
|
|
|
settings.dest_matrix = video_mat = MatrixFromString(provider->GetRealColorSpace());
|
2013-09-08 17:03:55 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
settings.dest_x = script_w;
|
|
|
|
settings.dest_y = script_h;
|
2014-05-20 01:47:54 +02:00
|
|
|
settings.dest_matrix = script_mat;
|
|
|
|
video_mat = YCbCrMatrix::rgb;
|
2013-09-08 17:03:55 +02:00
|
|
|
}
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
// Create all controls and set validators
|
|
|
|
for (size_t i = 0; i < 4; ++i) {
|
2014-05-31 02:05:25 +02:00
|
|
|
margin_ctrl[i] = new wxSpinCtrl(&d, -1, "0", wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, -9999, 9999, 0);
|
2012-03-25 06:04:59 +02:00
|
|
|
margin_ctrl[i]->SetValidator(wxGenericValidator(&settings.margin[i]));
|
|
|
|
}
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
symmetrical = new wxCheckBox(&d, -1, _("&Symmetrical"));
|
2012-03-25 06:04:59 +02:00
|
|
|
symmetrical->SetValue(true);
|
|
|
|
|
|
|
|
margin_ctrl[RIGHT]->Enable(false);
|
|
|
|
margin_ctrl[BOTTOM]->Enable(false);
|
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
source_x = new wxSpinCtrl(&d, -1, "", wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 1, INT_MAX);
|
|
|
|
source_y = new wxSpinCtrl(&d, -1, "", wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 1, INT_MAX);
|
|
|
|
source_matrix = new wxComboBox(&d, -1, "", wxDefaultPosition,
|
2014-05-20 01:47:54 +02:00
|
|
|
wxDefaultSize, to_wx(MatrixNames()), wxCB_READONLY);
|
2014-05-31 02:05:25 +02:00
|
|
|
dest_x = new wxSpinCtrl(&d, -1, "", wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 1, INT_MAX);
|
|
|
|
dest_y = new wxSpinCtrl(&d, -1, "", wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 1, INT_MAX);
|
|
|
|
dest_matrix = new wxComboBox(&d, -1, "", wxDefaultPosition, wxDefaultSize,
|
2014-05-20 01:47:54 +02:00
|
|
|
to_wx(MatrixNames()), wxCB_READONLY);
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2013-09-08 17:03:55 +02:00
|
|
|
source_x->SetValidator(wxGenericValidator(&settings.source_x));
|
|
|
|
source_y->SetValidator(wxGenericValidator(&settings.source_y));
|
2014-05-20 01:47:54 +02:00
|
|
|
source_matrix->SetValidator(MakeEnumBinder(&settings.source_matrix));
|
2013-09-08 17:03:55 +02:00
|
|
|
dest_x->SetValidator(wxGenericValidator(&settings.dest_x));
|
|
|
|
dest_y->SetValidator(wxGenericValidator(&settings.dest_y));
|
2014-05-20 01:47:54 +02:00
|
|
|
dest_matrix->SetValidator(MakeEnumBinder(&settings.dest_matrix));
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
from_video = new wxButton(&d, -1, _("From &video"));
|
2013-09-08 17:03:55 +02:00
|
|
|
from_video->Enable(false);
|
2014-05-31 02:05:25 +02:00
|
|
|
from_script = new wxButton(&d, -1, _("From s&cript"));
|
2013-09-08 17:03:55 +02:00
|
|
|
from_script->Enable(false);
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2014-05-16 18:20:30 +02:00
|
|
|
wxString ar_modes[] = {_("Stretch"), _("Add borders"), _("Remove borders"), _("Manual")};
|
2014-05-31 02:05:25 +02:00
|
|
|
ar_mode = new wxRadioBox(&d, -1, _("Aspect Ratio Handling"), wxDefaultPosition,
|
2014-05-16 18:20:30 +02:00
|
|
|
wxDefaultSize, boost::size(ar_modes), ar_modes, 1, 4, MakeEnumBinder(&settings.ar_mode));
|
2012-03-25 06:04:59 +02:00
|
|
|
|
|
|
|
// Position the controls
|
2013-09-08 17:03:55 +02:00
|
|
|
auto margin_sizer = new wxGridSizer(3, 3, 5, 5);
|
2012-03-25 06:04:59 +02:00
|
|
|
margin_sizer->AddSpacer(1);
|
|
|
|
margin_sizer->Add(margin_ctrl[TOP], wxSizerFlags(1).Expand());
|
|
|
|
margin_sizer->AddSpacer(1);
|
|
|
|
margin_sizer->Add(margin_ctrl[LEFT], wxSizerFlags(1).Expand());
|
|
|
|
margin_sizer->Add(symmetrical, wxSizerFlags(1).Expand());
|
|
|
|
margin_sizer->Add(margin_ctrl[RIGHT], wxSizerFlags(1).Expand());
|
|
|
|
margin_sizer->AddSpacer(1);
|
|
|
|
margin_sizer->Add(margin_ctrl[BOTTOM], wxSizerFlags(1).Expand());
|
|
|
|
margin_sizer->AddSpacer(1);
|
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
auto margin_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Margin offset"));
|
2012-03-25 06:04:59 +02:00
|
|
|
margin_box->Add(margin_sizer, wxSizerFlags(1).Expand().Border(wxBOTTOM));
|
|
|
|
|
2014-05-20 01:47:54 +02:00
|
|
|
auto source_res_sizer = new wxBoxSizer(wxHORIZONTAL);
|
2013-09-08 17:03:55 +02:00
|
|
|
source_res_sizer->Add(source_x, wxSizerFlags(1).Border(wxRIGHT).Align(wxALIGN_CENTER_VERTICAL));
|
2014-05-31 02:05:25 +02:00
|
|
|
source_res_sizer->Add(new wxStaticText(&d, -1, _("x")), wxSizerFlags().Center().Border(wxRIGHT));
|
2013-09-08 17:03:55 +02:00
|
|
|
source_res_sizer->Add(source_y, wxSizerFlags(1).Border(wxRIGHT).Align(wxALIGN_CENTER_VERTICAL));
|
|
|
|
source_res_sizer->Add(from_script, wxSizerFlags(1));
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2014-05-20 01:47:54 +02:00
|
|
|
auto source_matrix_sizer = new wxBoxSizer(wxHORIZONTAL);
|
2014-05-31 02:05:25 +02:00
|
|
|
source_matrix_sizer->Add(new wxStaticText(&d, -1, _("YCbCr Matrix:")), wxSizerFlags().Border(wxRIGHT).Center());
|
2014-05-20 01:47:54 +02:00
|
|
|
source_matrix_sizer->Add(source_matrix, wxSizerFlags(1).Center().Right());
|
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
auto source_res_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Source Resolution"));
|
2014-05-20 01:47:54 +02:00
|
|
|
source_res_box->Add(source_res_sizer, wxSizerFlags(1).Expand().Border(wxBOTTOM));
|
|
|
|
source_res_box->Add(source_matrix_sizer, wxSizerFlags(1).Expand());
|
|
|
|
|
2013-09-08 17:03:55 +02:00
|
|
|
auto dest_res_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
dest_res_sizer->Add(dest_x, wxSizerFlags(1).Border(wxRIGHT).Align(wxALIGN_CENTER_VERTICAL));
|
2014-05-31 02:05:25 +02:00
|
|
|
dest_res_sizer->Add(new wxStaticText(&d, -1, _("x")), wxSizerFlags().Center().Border(wxRIGHT));
|
2013-09-08 17:03:55 +02:00
|
|
|
dest_res_sizer->Add(dest_y, wxSizerFlags(1).Border(wxRIGHT).Align(wxALIGN_CENTER_VERTICAL));
|
|
|
|
dest_res_sizer->Add(from_video, wxSizerFlags(1));
|
2012-03-25 06:04:59 +02:00
|
|
|
|
2014-05-20 01:47:54 +02:00
|
|
|
auto dest_matrix_sizer = new wxBoxSizer(wxHORIZONTAL);
|
2014-05-31 02:05:25 +02:00
|
|
|
dest_matrix_sizer->Add(new wxStaticText(&d, -1, _("YCbCr Matrix:")), wxSizerFlags().Border(wxRIGHT).Center());
|
2014-05-20 01:47:54 +02:00
|
|
|
dest_matrix_sizer->Add(dest_matrix, wxSizerFlags(1).Center().Right());
|
|
|
|
|
2014-05-31 02:05:25 +02:00
|
|
|
auto dest_res_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Destination Resolution"));
|
2013-09-08 17:03:55 +02:00
|
|
|
dest_res_box->Add(dest_res_sizer, wxSizerFlags(1).Expand().Border(wxBOTTOM));
|
2014-05-20 01:47:54 +02:00
|
|
|
dest_res_box->Add(dest_matrix_sizer, wxSizerFlags(1).Expand());
|
2013-09-08 17:03:55 +02:00
|
|
|
|
|
|
|
auto main_sizer = new wxBoxSizer(wxVERTICAL);
|
2014-05-20 01:47:54 +02:00
|
|
|
main_sizer->Add(source_res_box, wxSizerFlags().Expand().Border());
|
|
|
|
main_sizer->Add(dest_res_box, wxSizerFlags().Expand().Border());
|
|
|
|
main_sizer->Add(ar_mode, wxSizerFlags().Expand().Border());
|
2014-05-16 18:20:30 +02:00
|
|
|
main_sizer->Add(margin_box, wxSizerFlags(1).Expand().Border());
|
2014-05-31 02:05:25 +02:00
|
|
|
main_sizer->Add(d.CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP), wxSizerFlags().Expand().Border(wxALL & ~wxTOP));
|
|
|
|
d.SetSizerAndFit(main_sizer);
|
|
|
|
d.CenterOnParent();
|
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-05-31 02:05:25 +02:00
|
|
|
d.TransferDataToWindow();
|
2014-05-16 18:20:30 +02:00
|
|
|
UpdateButtons();
|
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
// Bind events
|
2012-09-25 01:35:27 +02:00
|
|
|
using std::bind;
|
2014-05-31 02:05:25 +02:00
|
|
|
d.Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Resample resolution"), wxID_HELP);
|
|
|
|
d.Bind(wxEVT_SPINCTRL, [=](wxCommandEvent&) { UpdateButtons(); });
|
|
|
|
d.Bind(wxEVT_RADIOBOX, [=](wxCommandEvent&) { UpdateButtons(); });
|
2013-12-12 03:25:13 +01:00
|
|
|
from_video->Bind(wxEVT_BUTTON, &DialogResample::SetDestFromVideo, this);
|
2013-09-08 17:03:55 +02:00
|
|
|
from_script->Bind(wxEVT_BUTTON, &DialogResample::SetSourceFromScript, this);
|
2013-12-12 03:25:13 +01:00
|
|
|
symmetrical->Bind(wxEVT_CHECKBOX, &DialogResample::OnSymmetrical, this);
|
|
|
|
margin_ctrl[LEFT]->Bind(wxEVT_SPINCTRL, bind(&DialogResample::OnMarginChange, this, margin_ctrl[LEFT], margin_ctrl[RIGHT]));
|
|
|
|
margin_ctrl[TOP]->Bind(wxEVT_SPINCTRL, bind(&DialogResample::OnMarginChange, this, margin_ctrl[TOP], margin_ctrl[BOTTOM]));
|
2007-10-18 04:47:13 +02: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
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
void DialogResample::SetDestFromVideo(wxCommandEvent &) {
|
2013-09-08 17:03:55 +02:00
|
|
|
dest_x->SetValue(video_w);
|
|
|
|
dest_y->SetValue(video_h);
|
2014-05-20 01:47:54 +02:00
|
|
|
dest_matrix->SetSelection((int)video_mat);
|
2013-09-08 17:03:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialogResample::SetSourceFromScript(wxCommandEvent&) {
|
|
|
|
source_x->SetValue(script_w);
|
|
|
|
source_y->SetValue(script_h);
|
2014-05-20 01:47:54 +02:00
|
|
|
source_matrix->SetSelection((int)script_mat);
|
2013-09-08 17:03:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialogResample::UpdateButtons() {
|
2014-05-22 01:23:28 +02:00
|
|
|
from_video->Enable(c->project->VideoProvider() &&
|
2013-09-08 17:03:55 +02:00
|
|
|
(dest_x->GetValue() != video_w || dest_y->GetValue() != video_h));
|
|
|
|
from_script->Enable(source_x->GetValue() != script_w || source_y->GetValue() != script_h);
|
|
|
|
|
2014-05-16 18:20:30 +02:00
|
|
|
auto source_ar = double(source_x->GetValue()) / source_y->GetValue();
|
|
|
|
auto dest_ar = double(dest_x->GetValue()) / dest_y->GetValue();
|
2014-12-29 04:29:02 +01:00
|
|
|
bool ar_changed = std::abs(source_ar - dest_ar) / dest_ar > .01;
|
2014-05-16 18:20:30 +02:00
|
|
|
|
|
|
|
ar_mode->Enable(ar_changed);
|
|
|
|
|
|
|
|
bool margins = ar_changed && ar_mode->GetSelection() == (int)ResampleARMode::Manual;
|
|
|
|
symmetrical->Enable(margins);
|
|
|
|
margin_ctrl[LEFT]->Enable(margins);
|
|
|
|
margin_ctrl[TOP]->Enable(margins);
|
|
|
|
margin_ctrl[RIGHT]->Enable(margins && !symmetrical->GetValue());
|
|
|
|
margin_ctrl[BOTTOM]->Enable(margins && !symmetrical->GetValue());
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
void DialogResample::OnSymmetrical(wxCommandEvent &) {
|
|
|
|
bool state = !symmetrical->IsChecked();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
margin_ctrl[RIGHT]->Enable(state);
|
|
|
|
margin_ctrl[BOTTOM]->Enable(state);
|
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
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
if (!state) {
|
|
|
|
margin_ctrl[RIGHT]->SetValue(margin_ctrl[LEFT]->GetValue());
|
|
|
|
margin_ctrl[BOTTOM]->SetValue(margin_ctrl[TOP]->GetValue());
|
2008-01-11 04:33:23 +01:00
|
|
|
}
|
2012-03-25 06:04:59 +02:00
|
|
|
}
|
2008-01-11 04:33:23 +01:00
|
|
|
|
2012-03-25 06:04:59 +02:00
|
|
|
void DialogResample::OnMarginChange(wxSpinCtrl *src, wxSpinCtrl *dst) {
|
|
|
|
if (symmetrical->IsChecked())
|
|
|
|
dst->SetValue(src->GetValue());
|
|
|
|
}
|
2014-05-22 21:07:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PromptForResampleSettings(agi::Context *c, ResampleSettings &settings) {
|
2014-05-31 02:05:25 +02:00
|
|
|
return DialogResample(c, settings).d.ShowModal() == wxID_OK;
|
2014-05-22 21:07:15 +02:00
|
|
|
}
|