diff --git a/core/aspell_wrap.cpp b/core/aspell_wrap.cpp index ecb7be570..7ad21ca5b 100644 --- a/core/aspell_wrap.cpp +++ b/core/aspell_wrap.cpp @@ -33,12 +33,12 @@ // Contact: mailto:zeratul@cellosoft.com // -#ifndef NO_SPELLCHECKER - /////////// //Includes -#include ".\aspell_wrap.h" +#include "setup.h" +#if USE_ASPELL == 1 +#include "aspell_wrap.h" ////////////////////// diff --git a/core/ass_dialogue.cpp b/core/ass_dialogue.cpp index 38b6b5695..d71dd23b7 100644 --- a/core/ass_dialogue.cpp +++ b/core/ass_dialogue.cpp @@ -36,13 +36,14 @@ //////////// // Includes +#include "setup.h" #include "ass_dialogue.h" #include "ass_override.h" #include "vfr.h" #include "utils.h" #include #include -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 #include "../FexTrackerSource/FexTracker.h" #include "../FexTrackerSource/FexMovement.h" #endif @@ -51,7 +52,7 @@ ////////////////////// AssDialogue ////////////////////// // Constructs AssDialogue AssDialogue::AssDialogue() { -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 Tracker = 0; Movement = 0; #endif @@ -75,7 +76,7 @@ AssDialogue::AssDialogue() { AssDialogue::AssDialogue(wxString _data,bool IsSSA) { -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 Tracker = 0; Movement = 0; #endif @@ -100,7 +101,7 @@ AssDialogue::~AssDialogue () { // Clear void AssDialogue::Clear () { ClearBlocks(); -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 if( Tracker ) { delete Tracker; @@ -193,7 +194,7 @@ bool AssDialogue::Parse(wxString rawData, bool IsSSA) { Effect.Trim(true); Effect.Trim(false); -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 if( Effect.BeforeFirst(':')==_T("FexMovement") ) { if( Movement ) DeleteMovement( Movement ); diff --git a/core/ass_dialogue.h b/core/ass_dialogue.h index d4b65fa46..5d9eecf52 100644 --- a/core/ass_dialogue.h +++ b/core/ass_dialogue.h @@ -39,10 +39,11 @@ //////////// // Includes +#include "setup.h" #include #include "ass_entry.h" #include "ass_time.h" -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 class FexTracker; class FexMovement; #endif @@ -174,7 +175,7 @@ public: wxString Actor; // Actor name wxString Effect; // Effect name wxString Text; // Raw text data -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 FexTracker *Tracker; // Point tracker FexMovement *Movement; // Point tracker generated movement #endif diff --git a/core/audio_player.cpp b/core/audio_player.cpp index 42da228e7..6bb168315 100644 --- a/core/audio_player.cpp +++ b/core/audio_player.cpp @@ -37,8 +37,9 @@ /////////// // Headers #include +#include "setup.h" #include "audio_player_portaudio.h" -#ifdef USE_DSOUND +#if USE_DIRECTSOUND == 1 #include "audio_player_dsound.h" #endif #include "audio_provider.h" @@ -122,7 +123,7 @@ AudioPlayer* AudioPlayer::GetAudioPlayer() { try { // Get DirectSound player - #ifdef USE_DSOUND + #if USE_DIRECTSOUND == 1 player = new DirectSoundPlayer; #endif diff --git a/core/audio_player_dsound.cpp b/core/audio_player_dsound.cpp index 5bb7b1247..2509f0872 100644 --- a/core/audio_player_dsound.cpp +++ b/core/audio_player_dsound.cpp @@ -39,6 +39,8 @@ /////////// // Headers +#include "setup.h" +#if USE_DIRECTSOUND == 1 #include #include "audio_provider.h" #include "audio_player_dsound.h" @@ -372,3 +374,5 @@ wxThread::ExitCode DirectSoundPlayerThread::Entry() { Delete(); return 0; } + +#endif diff --git a/core/audio_player_dsound.h b/core/audio_player_dsound.h index 00d9c425e..53df99251 100644 --- a/core/audio_player_dsound.h +++ b/core/audio_player_dsound.h @@ -39,6 +39,8 @@ /////////// // Headers +#include "setup.h" +#if USE_DIRECTSOUND == 1 #include "audio_player.h" #include @@ -109,3 +111,5 @@ public: wxMutex *GetMutex() { return &DSMutex; } }; + +#endif diff --git a/core/dialog_spellcheck.cpp b/core/dialog_spellcheck.cpp index b0eb41d39..897833baa 100644 --- a/core/dialog_spellcheck.cpp +++ b/core/dialog_spellcheck.cpp @@ -34,8 +34,8 @@ // -#ifndef NO_SPELLCHECKER - +#include "setup.h" +#if USE_ASPELL == 1 #include "aspell_wrap.h" #include "main.h" #include "dialog_spellcheck.h" diff --git a/core/fextracker_main_events.cpp b/core/fextracker_main_events.cpp index aa817c557..79f0fdccc 100644 --- a/core/fextracker_main_events.cpp +++ b/core/fextracker_main_events.cpp @@ -7,6 +7,8 @@ /////////////////// // Include headers +#include "setup.h" +#if USE_FEXTRACKER == 1 #include #include #include @@ -287,4 +289,4 @@ void FrameMain::OnVideoTrackMovementMoveAfter(wxCommandEvent &event) { videoBox->videoDisplay->bTrackerEditing = 0; } - +#endif diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index 0d85478e0..3d3e8e5d0 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -36,6 +36,7 @@ /////////////////// // Include headers +#include "setup.h" #include #include #include @@ -73,7 +74,7 @@ #include "toggle_bitmap.h" #include "dialog_hotkeys.h" #include "dialog_timing_processor.h" -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 #include "../FexTrackerSource/FexTracker.h" #include "../FexTrackerSource/FexTrackingFeature.h" #include "../FexTrackerSource/FexMovement.h" @@ -95,7 +96,7 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame) EVT_BUTTON(Video_Stop, FrameMain::OnVideoStop) EVT_TOGGLEBUTTON(Video_Auto_Scroll, FrameMain::OnVideoToggleScroll) -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 EVT_BUTTON(Video_Tracker_Menu, FrameMain::OnVideoTrackerMenu) EVT_MENU(Video_Track_Points, FrameMain::OnVideoTrackPoints) EVT_MENU(Video_Track_Point_Add, FrameMain::OnVideoTrackPointAdd) diff --git a/core/setup0.h b/core/setup0.h new file mode 100644 index 000000000..b2b54b4e6 --- /dev/null +++ b/core/setup0.h @@ -0,0 +1,101 @@ +// Copyright (c) 2006, 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. +// +// ----------------------------------------------------------------------------- +// +// AEGISUB +// +// Website: http://aegisub.cellosoft.com +// Contact: mailto:zeratul@cellosoft.com +// + + +// +// This is a configuration file for the Aegisub project +// +// In order to use it, copy it as setup.h and edit anything you might want there +// DO NOT commit your personal setup.h to the repository +// + + + +//////////////////////////////////// +// Enable DirectShow Video Provider +// Requires: Win32, DirectX SDK +#define USE_DIRECTSHOW 0 + + +/////////////////////////////////// +// Enable DirectSound Audio Player +// Requires: Win32, DirectX SDK +#define USE_DIRECTSOUND 1 + + +///////////////////////////////// +// Enable PortAudio Audio Player +// Requires: PortAudio library +#define USE_PORTAUDIO 0 + + +////////////////////////////// +// Enable ASpell spellchecker +// Requires: aspell ibrary +#define USE_ASPELL 0 + + +////////////////////////////// +// Enable LAVC video provider +// Requires: FFMPEG library +#define USE_LAVC 0 + + +//////////////////////// +// Enable PRS Exporting +// Requires: wxPNG library +#define USE_PRS 1 + + +///////////////////// +// Enable FexTracker +// Requires: Win32, FexTracker library +#define USE_FEXTRACKER 1 + + +// The following two are Linux-specific, so it would involve changing the makefiles +// Therefore, I haven't changed the code to make them work, yet + + +///////////////// +// Enable LibASS +// Requires: libass library, GNU? +#define USE_LIBASS 0 + + +////////////// +// Enable ASA +// Requires: asa library +#define USE_ASA 0 diff --git a/core/subtitle_format.cpp b/core/subtitle_format.cpp index 3cc0b020a..a4f026338 100644 --- a/core/subtitle_format.cpp +++ b/core/subtitle_format.cpp @@ -36,11 +36,14 @@ /////////// // Headers +#include "setup.h" #include "subtitle_format.h" #include "subtitle_format_ass.h" #include "subtitle_format_srt.h" #include "subtitle_format_txt.h" +#if USE_PRS == 1 #include "subtitle_format_prs.h" +#endif #include "subtitle_format_mkv.h" #include "ass_file.h" @@ -125,7 +128,7 @@ void SubtitleFormat::LoadFormats () { new SRTSubtitleFormat(); new TXTSubtitleFormat(); new MKVSubtitleFormat(); -#ifndef NO_PRS +#if USE_PRS == 1 new PRSSubtitleFormat(); #endif } diff --git a/core/subtitle_format_prs.cpp b/core/subtitle_format_prs.cpp index 86f32380b..c0f0bdfe6 100644 --- a/core/subtitle_format_prs.cpp +++ b/core/subtitle_format_prs.cpp @@ -34,10 +34,10 @@ // -#ifndef NO_PRS - /////////// // Headers +#include "setup.h" +#if USE_PRS == 1 #include #include #include @@ -779,4 +779,4 @@ wxImage PRSSubtitleFormat::SubImageWithAlpha (wxImage &source,const wxRect &rect return image; } -#endif /* NO_PRS */ +#endif diff --git a/core/subtitle_format_prs.h b/core/subtitle_format_prs.h index a8d00c7a1..6dbd7ebb7 100644 --- a/core/subtitle_format_prs.h +++ b/core/subtitle_format_prs.h @@ -39,6 +39,8 @@ /////////// // Headers +#include "setup.h" +#if USE_PRS == 1 #include "subtitle_format.h" #include @@ -69,3 +71,5 @@ public: bool CanWriteFile(wxString filename); void WriteFile(wxString filename,wxString encoding); }; + +#endif diff --git a/core/subtitle_provider_libass.cpp b/core/subtitle_provider_libass.cpp index b8aa6a9fa..0f87886fb 100644 --- a/core/subtitle_provider_libass.cpp +++ b/core/subtitle_provider_libass.cpp @@ -1,5 +1,5 @@ // -*- c-basic-offset: 8; indent-tabs-mode: t -*- -// Copyright (c) 2006, David Lamparter +// Copyright (c) 2006, Evgeniy Stepanov // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/core/video_display.cpp b/core/video_display.cpp index 0971004ab..11839351d 100644 --- a/core/video_display.cpp +++ b/core/video_display.cpp @@ -36,6 +36,7 @@ //////////// // Includes +#include "setup.h" #include "video_display.h" #include "video_provider.h" #include "vfr.h" @@ -55,7 +56,7 @@ #include #include #include -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 #include "../FexTrackerSource/FexTracker.h" #include "../FexTrackerSource/FexTrackingFeature.h" #include "../FexTrackerSource/FexMovement.h" @@ -300,7 +301,7 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { int x = event.GetX(); int y = event.GetY(); -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 if( event.ButtonDown(wxMOUSE_BTN_LEFT) ) { MouseDownX = x; @@ -672,7 +673,7 @@ void VideoDisplay::OnCopyCoords(wxCommandEvent &event) { // Draw Tracking Overlay void VideoDisplay::DrawTrackingOverlay( wxDC &dc ) { -#ifndef NO_FEX +#if USE_FEXTRACKER == 1 if( IsPlaying ) return; // Get line diff --git a/core/video_provider.cpp b/core/video_provider.cpp index 3ed825912..6eb9fd8e0 100644 --- a/core/video_provider.cpp +++ b/core/video_provider.cpp @@ -40,6 +40,7 @@ #include "video_provider_lavc.h" #include "video_provider_dshow.h" #include "options.h" +#include "setup.h" //////////////// @@ -65,7 +66,7 @@ VideoProvider *VideoProvider::GetProvider(wxString video,wxString subtitles) { wxString preffered = Options.AsText(_T("Video provider")).Lower(); // See if it's OK to use LAVC - #ifdef USE_LAVC + #if USE_LAVC == 1 if (preffered == _T("ffmpeg") || (!avisynthAvailable && !dshowAvailable)) { // Load bool success = false; @@ -101,7 +102,7 @@ VideoProvider *VideoProvider::GetProvider(wxString video,wxString subtitles) { #endif #ifdef __WINDOWS__ - #ifdef USE_DIRECTSHOW + #if USE_DIRECTSHOW == 1 // Use DirectShow provider if (!provider && (preffered == _T("dshow") || !avisynthAvailable)) { try { diff --git a/core/video_provider_dshow.cpp b/core/video_provider_dshow.cpp index 0f6e2b083..01d6a7280 100644 --- a/core/video_provider_dshow.cpp +++ b/core/video_provider_dshow.cpp @@ -37,8 +37,9 @@ /////////// // Headers #include +#include "setup.h" #ifdef __WINDOWS__ -#ifdef USE_DIRECTSHOW +#if USE_DIRECTSHOW == 1 #pragma warning(disable: 4995) #include #include diff --git a/core/video_provider_dshow.h b/core/video_provider_dshow.h index ac1d330ca..6b9b58e05 100644 --- a/core/video_provider_dshow.h +++ b/core/video_provider_dshow.h @@ -40,9 +40,9 @@ /////////// // Headers #include - #ifdef __WINDOWS__ -#ifdef USE_DIRECTSHOW +#include "setup.h" +#if USE_DIRECTSHOW == 1 #include "video_provider.h" #pragma warning(disable: 4995) #include