Unconditionally enable building automation even if there are no enabled engines as there isn't really any reason not to and the defines uglify the code.

Originally committed to SVN as r5621.
This commit is contained in:
Thomas Goyne 2011-09-28 19:45:35 +00:00
parent 66e826edb3
commit 0a91be1c7c
11 changed files with 2 additions and 54 deletions

View File

@ -3,7 +3,6 @@
#########################
HAVE_ALSA = @with_alsa@
HAVE_AUTO4_LUA = @with_auto4_lua@
HAVE_AUTOMATION = @with_automation@
HAVE_HUNSPELL = @with_hunspell@
HAVE_OPENAL = @with_openal@
HAVE_OPENMP = @with_openmp@

View File

@ -134,7 +134,7 @@
<!-- Automation Lua support -->
<ItemDefinitionGroup Condition="'$(AegisubUseAutomationLua)'=='true'">
<ClCompile>
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_AUTOMATION;WITH_AUTO4_LUA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_AUTO4_LUA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(AegisubContribBase)lua51\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -294,4 +294,4 @@
<ProjectTools Include="SubWCRev;CreateDefaultConfigurationHeader" />
</ItemGroup>
</Project>
</Project>

View File

@ -760,11 +760,9 @@ fi
LIBS="$aegisub_save_LIBS"
if test "$agi_cv_with_lua" = "yes"; then
with_automation="yes"
with_auto4_lua="yes"
AC_DEFINE(WITH_AUTO4_LUA, 1, [Enable Automation (auto4), requires lua])
else
with_automation="no"
with_auto4_lua="no"
fi
@ -772,14 +770,6 @@ AC_SUBST(with_auto4_lua)
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LDFLAGS)
# Automation setup
if test "$with_automation" = "yes"; then
AC_DEFINE(WITH_AUTOMATION, 1, [Enable Automation support, requires any automation language.])
fi
AC_SUBST(with_automation)
################
# Widget support
################

View File

@ -36,8 +36,6 @@
#include "config.h"
#ifdef WITH_AUTOMATION
#ifndef AGI_PRE
#ifdef __WINDOWS__
#include <tchar.h>
@ -1059,7 +1057,3 @@ namespace Automation4 {
}
};
#endif // WITH_AUTOMATION

View File

@ -64,7 +64,6 @@ struct am_manager : public Command {
STR_HELP("Open automation manager.")
void operator()(agi::Context *c) {
#ifdef WITH_AUTOMATION
#ifdef __APPLE__
if (wxGetMouseState().CmdDown()) {
#else
@ -94,7 +93,6 @@ struct am_manager : public Command {
c->videoController->Stop();
DialogAutomation(c->parent, c->local_scripts).ShowModal();
}
#endif
}
};

View File

@ -51,11 +51,6 @@
////////////// HIGH PRIORITY /////////////
// Enable Automation
// Requires: Nothing
#define WITH_AUTOMATION
// Enable Automation 4 Lua
// Requires: Lua 5.1 (in repository)
#define WITH_AUTO4_LUA

View File

@ -37,8 +37,6 @@
#include "config.h"
#ifdef WITH_AUTOMATION
#ifndef AGI_PRE
#include <wx/filedlg.h>
#include <wx/filename.h>
@ -371,7 +369,3 @@ void DialogAutomation::OnSelectionChange(wxListEvent &evt)
{
UpdateDisplay();
}
#endif // WITH_AUTOMATION

View File

@ -58,9 +58,7 @@
#include "ass_file.h"
#include "audio_controller.h"
#include "audio_box.h"
#ifdef WITH_AUTOMATION
#include "auto4_base.h"
#endif
#include "compat.h"
#include "command/command.h"
#include "dialog_search_replace.h"
@ -124,9 +122,7 @@ FrameMain::FrameMain (wxArrayString args)
context->ass->AddFileOpenListener(&FrameMain::OnSubtitlesOpen, this);
context->ass->AddFileSaveListener(&FrameMain::UpdateTitle, this);
#ifdef WITH_AUTOMATION
context->local_scripts = new Automation4::ScriptManager();
#endif
StartupLog("Initializing context controls");
context->audioController = new AudioController;
@ -232,9 +228,7 @@ FrameMain::~FrameMain () {
delete context->ass;
HelpButton::ClearPages();
delete context->audioController;
#ifdef WITH_AUTOMATION
delete context->local_scripts;
#endif
SubsGrid->Destroy();
}
@ -684,9 +678,7 @@ void FrameMain::OnSubtitlesOpen() {
curSubsVFR != context->videoController->GetTimecodesName() ||
curSubsVideo != context->videoController->videoName ||
curSubsKeyframes != context->videoController->GetKeyFramesName()
#ifdef WITH_AUTOMATION
|| !AutoScriptString.IsEmpty() || context->local_scripts->GetScripts().size() > 0
#endif
)
{
if (autoLoadMode == 1) {
@ -734,7 +726,6 @@ void FrameMain::OnSubtitlesOpen() {
}
// Automation scripts
#ifdef WITH_AUTOMATION
context->local_scripts->RemoveAll();
wxStringTokenizer tok(AutoScriptString, "|", wxTOKEN_STRTOK);
wxFileName assfn(context->ass->filename);
@ -765,7 +756,6 @@ void FrameMain::OnSubtitlesOpen() {
sfnamel, sfnames, basepath, sfname.GetFullPath());
}
}
#endif
}
// Display
@ -781,7 +771,6 @@ void FrameMain::OnSubtitlesSave() {
// 2. Otherwise try making it relative to the ass filename
// 3. If step 2 failed, or absolute path is shorter than path relative to ass, use absolute path ("/")
// 4. Otherwise, use path relative to ass ("~")
#ifdef WITH_AUTOMATION
wxString scripts_string;
wxString autobasefn(lagi_wxString(OPT_GET("Path/Automation/Base")->GetString()));
@ -808,7 +797,6 @@ void FrameMain::OnSubtitlesSave() {
scripts_string += scriptfn;
}
context->ass->SetScriptInfo("Automation Scripts", scripts_string);
#endif
}
void FrameMain::OnKeyDown(wxKeyEvent &event) {

View File

@ -61,9 +61,7 @@
#include "ass_file.h"
#include "ass_time.h"
#include "audio_box.h"
#ifdef WITH_AUTOMATION
#include "auto4_base.h"
#endif
#include "charset_conv.h"
#include "compat.h"
#include "export_clean_info.h"
@ -276,10 +274,8 @@ bool AegisubApp::OnInit() {
plugins->RegisterBuiltInPlugins();
// Load Automation scripts
#ifdef WITH_AUTOMATION
StartupLog("Load global Automation scripts");
global_scripts = new Automation4::AutoloadScriptManager(lagi_wxString(OPT_GET("Path/Automation/Autoload")->GetString()));
#endif
// Load export filters
StartupLog("Register export filters");
@ -335,9 +331,7 @@ int AegisubApp::OnExit() {
delete config::path;
cmd::clear();
#ifdef WITH_AUTOMATION
delete global_scripts;
#endif
AssExportFilterChain::Clear();

View File

@ -116,10 +116,8 @@ public:
/// DOCME
FrameMain *frame;
#ifdef WITH_AUTOMATION
/// DOCME
Automation4::AutoloadScriptManager *global_scripts;
#endif
/// @brief DOCME

View File

@ -281,10 +281,8 @@ void process_menu_item(wxMenu *parent, agi::Context *c, json::Object const& ele,
}
if (special == "automation") {
#ifdef WITH_AUTOMATION
/// @todo Actually implement this
parent->Append(-1, _("No Automation macros loaded"))->Enable(false);
#endif
return;
}