From 4f4f4cc91f94dce583829207665018eae8682dc2 Mon Sep 17 00:00:00 2001
From: Rodrigo Braz Monteiro <zeratul@cellosoft.com>
Date: Fri, 7 Mar 2008 21:00:20 +0000
Subject: [PATCH] Moved files relevant to providers to aegisub/include. A few
 things might be broken.

Originally committed to SVN as r1956.
---
 aegisub/audio_display.h                       |  4 +-
 aegisub/audio_player.cpp                      |  2 +-
 aegisub/audio_player_alsa.h                   |  5 +-
 aegisub/audio_player_dsound.cpp               |  2 -
 aegisub/audio_player_dsound.h                 |  5 +-
 aegisub/audio_player_manager.h                | 70 +++++++++++++++++
 aegisub/audio_player_openal.h                 |  4 +-
 aegisub/audio_player_portaudio.h              |  4 +-
 aegisub/audio_player_pulse.h                  |  4 +-
 aegisub/audio_provider_avs.h                  |  2 +-
 aegisub/audio_provider_convert.h              |  2 +-
 aegisub/audio_provider_dummy.h                |  2 +-
 aegisub/audio_provider_hd.h                   |  2 +-
 aegisub/audio_provider_lavc.h                 |  2 +-
 aegisub/audio_provider_manager.h              | 54 +++++++++++++
 aegisub/audio_provider_pcm.h                  |  2 +-
 aegisub/audio_provider_ram.h                  |  2 +-
 aegisub/audio_provider_stream.h               |  2 +-
 aegisub/audio_spectrum.h                      |  2 +-
 aegisub/dialog_options.cpp                    |  4 +-
 aegisub/dialog_properties.cpp                 |  2 +-
 aegisub/dialog_spellchecker.cpp               |  2 +-
 aegisub/dialog_style_editor.cpp               |  2 +-
 aegisub/dialog_video_details.cpp              |  4 +-
 aegisub/frame_main.cpp                        |  2 +-
 aegisub/include/aegisub/aegisub.h             | 60 +++++++++++++++
 aegisub/{ => include/aegisub}/audio_player.h  | 20 +----
 .../{ => include/aegisub}/audio_provider.h    | 14 +---
 aegisub/{ => include/aegisub}/spellchecker.h  | 12 +--
 .../aegisub}/subtitles_provider.h             | 14 +---
 .../{ => include/aegisub}/video_provider.h    | 12 +--
 aegisub/plugin_manager.cpp                    | 10 +--
 aegisub/spellchecker.cpp                      |  2 +-
 aegisub/spellchecker_hunspell.h               |  2 +-
 aegisub/spellchecker_manager.h                | 53 +++++++++++++
 aegisub/subs_edit_ctrl.h                      |  2 +-
 aegisub/subs_grid.h                           |  2 +-
 aegisub/subs_preview.cpp                      |  2 +-
 aegisub/subtitle_format_dvd.cpp               |  2 +-
 aegisub/subtitles_provider.cpp                |  2 +-
 aegisub/subtitles_provider_csri.h             |  2 +-
 aegisub/subtitles_provider_manager.h          | 56 ++++++++++++++
 aegisub/video_box.cpp                         |  2 +-
 aegisub/video_context.cpp                     |  4 +-
 aegisub/video_display.cpp                     |  2 +-
 aegisub/video_provider_avs.h                  |  4 +-
 aegisub/video_provider_cache.h                |  2 +-
 aegisub/video_provider_dshow.h                |  2 +-
 aegisub/video_provider_dummy.h                |  2 +-
 aegisub/video_provider_lavc.h                 |  2 +-
 ...rovider.cpp => video_provider_manager.cpp} |  2 +-
 aegisub/video_provider_manager.h              | 54 +++++++++++++
 aegisub/visual_tool.cpp                       |  2 +-
 build/aegisub_vs2008/aegisub_vs2008.vcproj    | 76 +++++++++++++------
 vsfilter/vsfilter_2008.sln                    | 73 ++++++++++++++++++
 vsfilter/vsfilter_2008.vcproj                 |  2 +-
 56 files changed, 533 insertions(+), 151 deletions(-)
 create mode 100644 aegisub/audio_player_manager.h
 create mode 100644 aegisub/audio_provider_manager.h
 create mode 100644 aegisub/include/aegisub/aegisub.h
 rename aegisub/{ => include/aegisub}/audio_player.h (90%)
 rename aegisub/{ => include/aegisub}/audio_provider.h (88%)
 rename aegisub/{ => include/aegisub}/spellchecker.h (90%)
 rename aegisub/{ => include/aegisub}/subtitles_provider.h (88%)
 rename aegisub/{ => include/aegisub}/video_provider.h (92%)
 create mode 100644 aegisub/spellchecker_manager.h
 create mode 100644 aegisub/subtitles_provider_manager.h
 rename aegisub/{video_provider.cpp => video_provider_manager.cpp} (99%)
 create mode 100644 aegisub/video_provider_manager.h

diff --git a/aegisub/audio_display.h b/aegisub/audio_display.h
index 65cf8eb83..4e9234732 100644
--- a/aegisub/audio_display.h
+++ b/aegisub/audio_display.h
@@ -44,8 +44,8 @@
 #include <wx/window.h>
 #include <wx/bitmap.h>
 #include <stdint.h>
-#include "audio_provider.h"
-#include "audio_player.h"
+#include "audio_provider_manager.h"
+#include "audio_player_manager.h"
 #include "audio_spectrum.h"
 
 
diff --git a/aegisub/audio_player.cpp b/aegisub/audio_player.cpp
index 37a0114ab..32b4ba587 100644
--- a/aegisub/audio_player.cpp
+++ b/aegisub/audio_player.cpp
@@ -37,7 +37,7 @@
 ///////////
 // Headers
 #include <wx/wxprec.h>
-#include "audio_player.h"
+#include "audio_player_manager.h"
 #include "options.h"
 #ifdef WITH_ALSA
 #include "audio_player_alsa.h"
diff --git a/aegisub/audio_player_alsa.h b/aegisub/audio_player_alsa.h
index 5efc1e353..b63c71a5f 100644
--- a/aegisub/audio_player_alsa.h
+++ b/aegisub/audio_player_alsa.h
@@ -40,12 +40,11 @@
 ///////////
 // Headers
 #include <wx/wxprec.h>
-#include "audio_player.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_player.h"
+#include "include/aegisub/audio_provider.h"
 #include "utils.h"
 #include "main.h"
 #include "frame_main.h"
-#include "audio_player.h"
 #include <alsa/asoundlib.h>
 #include "options.h"
 
diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp
index 845486c8d..12332ac16 100644
--- a/aegisub/audio_player_dsound.cpp
+++ b/aegisub/audio_player_dsound.cpp
@@ -39,8 +39,6 @@
 #ifdef WITH_DIRECTSOUND
 
 #include <wx/wxprec.h>
-#include "audio_player.h"
-#include "audio_provider.h"
 #include "utils.h"
 #include "main.h"
 #include "frame_main.h"
diff --git a/aegisub/audio_player_dsound.h b/aegisub/audio_player_dsound.h
index 6643413fc..9b96bcb88 100644
--- a/aegisub/audio_player_dsound.h
+++ b/aegisub/audio_player_dsound.h
@@ -39,12 +39,11 @@
 #ifdef WITH_DIRECTSOUND
 
 #include <wx/wxprec.h>
-#include "audio_player.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_player.h"
+#include "include/aegisub/audio_provider.h"
 #include "utils.h"
 #include "main.h"
 #include "frame_main.h"
-#include "audio_player.h"
 #include <mmsystem.h>
 #include <dsound.h>
 
diff --git a/aegisub/audio_player_manager.h b/aegisub/audio_player_manager.h
new file mode 100644
index 000000000..1781a33d9
--- /dev/null
+++ b/aegisub/audio_player_manager.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2005-2007, 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
+//
+
+
+#pragma once
+
+
+///////////
+// Headers
+#include <wx/wxprec.h>
+#include <wx/event.h>
+#include <wx/timer.h>
+#include <wx/thread.h>
+#include <stdint.h>
+#include "factory_manager.h"
+#include "include/aegisub/audio_player.h"
+
+
+//////////////
+// Prototypes
+class AudioProvider;
+
+
+///////////////////
+// Factory Manager
+class AudioPlayerFactoryManager : public FactoryManager<AudioPlayerFactory> {
+public:
+	static AudioPlayer *GetAudioPlayer();
+	static void RegisterProviders();
+};
+
+
+
+/////////
+// Event
+DECLARE_EVENT_TYPE(wxEVT_STOP_AUDIO, -1)
+
+
diff --git a/aegisub/audio_player_openal.h b/aegisub/audio_player_openal.h
index 67ec21f59..ace8c2f74 100644
--- a/aegisub/audio_player_openal.h
+++ b/aegisub/audio_player_openal.h
@@ -40,8 +40,8 @@
 ///////////
 // Headers
 #include <wx/wxprec.h>
-#include "audio_player.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_player.h"
+#include "include/aegisub/audio_provider.h"
 #include "utils.h"
 #include "main.h"
 #include "frame_main.h"
diff --git a/aegisub/audio_player_portaudio.h b/aegisub/audio_player_portaudio.h
index 7f723390c..85c3a571b 100644
--- a/aegisub/audio_player_portaudio.h
+++ b/aegisub/audio_player_portaudio.h
@@ -39,8 +39,8 @@
 
 ///////////
 // Headers
-#include "audio_player.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_player.h"
+#include "include/aegisub/audio_provider.h"
 #include "utils.h"
 extern "C" {
 #include <portaudio.h>
diff --git a/aegisub/audio_player_pulse.h b/aegisub/audio_player_pulse.h
index 22031f08f..e532a6ff5 100644
--- a/aegisub/audio_player_pulse.h
+++ b/aegisub/audio_player_pulse.h
@@ -41,8 +41,8 @@
 // Headers
 #include <wx/wxprec.h>
 #include <stdio.h>
-#include "audio_player.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_player.h"
+#include "include/aegisub/audio_provider.h"
 #include "utils.h"
 #include "options.h"
 #include <pulse/pulseaudio.h>
diff --git a/aegisub/audio_provider_avs.h b/aegisub/audio_provider_avs.h
index 3c29c9471..dcc59096d 100644
--- a/aegisub/audio_provider_avs.h
+++ b/aegisub/audio_provider_avs.h
@@ -39,7 +39,7 @@
 #include <wx/wxprec.h>
 #ifdef WITH_AVISYNTH
 #include <Mmreg.h>
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 #include "avisynth_wrap.h"
 
 
diff --git a/aegisub/audio_provider_convert.h b/aegisub/audio_provider_convert.h
index d88448650..e8f376f9f 100644
--- a/aegisub/audio_provider_convert.h
+++ b/aegisub/audio_provider_convert.h
@@ -39,7 +39,7 @@
 
 ///////////
 // Headers
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 
 
 ////////////////////////
diff --git a/aegisub/audio_provider_dummy.h b/aegisub/audio_provider_dummy.h
index 21d4bfd56..b9c1866fb 100644
--- a/aegisub/audio_provider_dummy.h
+++ b/aegisub/audio_provider_dummy.h
@@ -39,7 +39,7 @@
 
 ///////////
 // Headers
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 
 
 ////////////////////////
diff --git a/aegisub/audio_provider_hd.h b/aegisub/audio_provider_hd.h
index 3a875dabd..ab75af3a7 100644
--- a/aegisub/audio_provider_hd.h
+++ b/aegisub/audio_provider_hd.h
@@ -39,7 +39,7 @@
 
 ///////////
 // Headers
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 #include <wx/file.h>
 
 
diff --git a/aegisub/audio_provider_lavc.h b/aegisub/audio_provider_lavc.h
index 45efd2357..ac9b68870 100644
--- a/aegisub/audio_provider_lavc.h
+++ b/aegisub/audio_provider_lavc.h
@@ -57,7 +57,7 @@ extern "C" {
 }
 #include "mkv_wrap.h"
 #include "lavc_file.h"
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 #include "lavc_file.h"
 
 
diff --git a/aegisub/audio_provider_manager.h b/aegisub/audio_provider_manager.h
new file mode 100644
index 000000000..a5f93f7b3
--- /dev/null
+++ b/aegisub/audio_provider_manager.h
@@ -0,0 +1,54 @@
+// 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
+//
+
+
+#pragma once
+
+
+///////////
+// Headers
+#include <wx/wxprec.h>
+#include <stdint.h>
+#include "factory_manager.h"
+#include "include/aegisub/audio_provider.h"
+
+
+///////////////////
+// Factory Manager
+class AudioProviderFactoryManager : public FactoryManager<AudioProviderFactory> {
+public:
+	static void RegisterProviders();
+	static AudioProvider *GetAudioProvider(wxString filename, int cache=-1);
+};
diff --git a/aegisub/audio_provider_pcm.h b/aegisub/audio_provider_pcm.h
index b62e1ec5b..ea009e8ff 100644
--- a/aegisub/audio_provider_pcm.h
+++ b/aegisub/audio_provider_pcm.h
@@ -39,7 +39,7 @@
 
 ///////////
 // Headers
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 #include <wx/file.h>
 #include <wx/thread.h>
 #include <vector>
diff --git a/aegisub/audio_provider_ram.h b/aegisub/audio_provider_ram.h
index bf5b0cf91..f2ac0c781 100644
--- a/aegisub/audio_provider_ram.h
+++ b/aegisub/audio_provider_ram.h
@@ -39,7 +39,7 @@
 
 ///////////
 // Headers
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 
 
 ////////////////////////
diff --git a/aegisub/audio_provider_stream.h b/aegisub/audio_provider_stream.h
index 0614fa620..2ab52d49d 100644
--- a/aegisub/audio_provider_stream.h
+++ b/aegisub/audio_provider_stream.h
@@ -41,7 +41,7 @@
 // Headers
 #include <list>
 #include <vector>
-#include "audio_provider.h"
+#include "include/aegisub/audio_provider.h"
 
 
 ////////////////////////
diff --git a/aegisub/audio_spectrum.h b/aegisub/audio_spectrum.h
index 7834e1fe0..bf8011947 100644
--- a/aegisub/audio_spectrum.h
+++ b/aegisub/audio_spectrum.h
@@ -39,7 +39,7 @@
 
 #include <wx/wxprec.h>
 #include <stdint.h>
-#include "audio_provider.h"
+#include "audio_provider_manager.h"
 
 
 // Specified and implemented in cpp file, interface is private to spectrum code
diff --git a/aegisub/dialog_options.cpp b/aegisub/dialog_options.cpp
index c949f575e..536e0c9e0 100644
--- a/aegisub/dialog_options.cpp
+++ b/aegisub/dialog_options.cpp
@@ -55,8 +55,8 @@
 #include "subs_grid.h"
 #include "video_box.h"
 #include "video_slider.h"
-#include "video_provider.h"
-#include "subtitles_provider.h"
+#include "video_provider_manager.h"
+#include "subtitles_provider_manager.h"
 #include "audio_box.h"
 #include "audio_display.h"
 #include "video_context.h"
diff --git a/aegisub/dialog_properties.cpp b/aegisub/dialog_properties.cpp
index 11bb1022f..79ee6c71d 100644
--- a/aegisub/dialog_properties.cpp
+++ b/aegisub/dialog_properties.cpp
@@ -45,7 +45,7 @@
 #include "ass_file.h"
 #include "video_display.h"
 #include "validators.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "utils.h"
 #include "help_button.h"
 
diff --git a/aegisub/dialog_spellchecker.cpp b/aegisub/dialog_spellchecker.cpp
index 1cc41b474..62aa03925 100644
--- a/aegisub/dialog_spellchecker.cpp
+++ b/aegisub/dialog_spellchecker.cpp
@@ -37,7 +37,7 @@
 // Headers
 #include <wx/intl.h>
 #include "dialog_spellchecker.h"
-#include "spellchecker.h"
+#include "spellchecker_manager.h"
 #include "subs_grid.h"
 #include "frame_main.h"
 #include "ass_file.h"
diff --git a/aegisub/dialog_style_editor.cpp b/aegisub/dialog_style_editor.cpp
index d162f774a..9dc395cf3 100644
--- a/aegisub/dialog_style_editor.cpp
+++ b/aegisub/dialog_style_editor.cpp
@@ -51,7 +51,7 @@
 #include "colour_button.h"
 #include "subs_preview.h"
 #include "options.h"
-#include "subtitles_provider.h"
+#include "subtitles_provider_manager.h"
 #include "ass_style_storage.h"
 #include "help_button.h"
 
diff --git a/aegisub/dialog_video_details.cpp b/aegisub/dialog_video_details.cpp
index 8ff5de3c9..a8075e49e 100644
--- a/aegisub/dialog_video_details.cpp
+++ b/aegisub/dialog_video_details.cpp
@@ -38,8 +38,8 @@
 // Headers
 #include "dialog_video_details.h"
 #include "video_context.h"
-#include "video_provider.h"
-#include "audio_provider.h"
+#include "video_provider_manager.h"
+#include "audio_provider_manager.h"
 #include "audio_box.h"
 #include "utils.h"
 
diff --git a/aegisub/frame_main.cpp b/aegisub/frame_main.cpp
index d99517bea..ff45b9beb 100644
--- a/aegisub/frame_main.cpp
+++ b/aegisub/frame_main.cpp
@@ -50,7 +50,7 @@
 #include "avisynth_wrap.h"
 #endif
 #include "video_display.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "video_slider.h"
 #include "ass_file.h"
 #include "dialog_search_replace.h"
diff --git a/aegisub/include/aegisub/aegisub.h b/aegisub/include/aegisub/aegisub.h
new file mode 100644
index 000000000..721314d41
--- /dev/null
+++ b/aegisub/include/aegisub/aegisub.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2008, 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
+//
+
+
+#pragma once
+
+
+///////////////
+// STL Headers
+#include <vector>
+#include <string>
+#include <stdint.h>
+
+
+////////////////////////////////
+// Define types used by Aegisub
+namespace Aegisub {
+	// String type
+	typedef std::basic_string<wchar_t> String;
+
+	// String array
+	typedef std::vector<String> StringArray;
+};
+
+
+///////////////////
+// Aegisub headers
+//#include "video_frame.h"
diff --git a/aegisub/audio_player.h b/aegisub/include/aegisub/audio_player.h
similarity index 90%
rename from aegisub/audio_player.h
rename to aegisub/include/aegisub/audio_player.h
index ae4c6ae68..f58d49347 100644
--- a/aegisub/audio_player.h
+++ b/aegisub/include/aegisub/audio_player.h
@@ -43,8 +43,7 @@
 #include <wx/event.h>
 #include <wx/timer.h>
 #include <wx/thread.h>
-#include <stdint.h>
-#include "factory_manager.h"
+#include "aegisub.h"
 
 
 //////////////
@@ -100,20 +99,3 @@ class AudioPlayerFactory {
 public:
 	virtual AudioPlayer *CreatePlayer()=0;
 };
-
-
-///////////////////
-// Factory Manager
-class AudioPlayerFactoryManager : public FactoryManager<AudioPlayerFactory> {
-public:
-	static AudioPlayer *GetAudioPlayer();
-	static void RegisterProviders();
-};
-
-
-
-/////////
-// Event
-DECLARE_EVENT_TYPE(wxEVT_STOP_AUDIO, -1)
-
-
diff --git a/aegisub/audio_provider.h b/aegisub/include/aegisub/audio_provider.h
similarity index 88%
rename from aegisub/audio_provider.h
rename to aegisub/include/aegisub/audio_provider.h
index 0f6e3eee1..50d960362 100644
--- a/aegisub/audio_provider.h
+++ b/aegisub/include/aegisub/audio_provider.h
@@ -39,14 +39,11 @@
 
 ///////////
 // Headers
-#include <wx/wxprec.h>
-#include <stdint.h>
-#include "factory_manager.h"
+#include "aegisub.h"
 
 
 //////////////
 // Prototypes
-class AudioDisplay;
 class VideoProvider;
 
 
@@ -88,12 +85,3 @@ class AudioProviderFactory {
 public:
 	virtual AudioProvider *CreateProvider(wxString filename)=0;
 };
-
-
-///////////////////
-// Factory Manager
-class AudioProviderFactoryManager : public FactoryManager<AudioProviderFactory> {
-public:
-	static void RegisterProviders();
-	static AudioProvider *GetAudioProvider(wxString filename, int cache=-1);
-};
diff --git a/aegisub/spellchecker.h b/aegisub/include/aegisub/spellchecker.h
similarity index 90%
rename from aegisub/spellchecker.h
rename to aegisub/include/aegisub/spellchecker.h
index 692fc1148..845218641 100644
--- a/aegisub/spellchecker.h
+++ b/aegisub/include/aegisub/spellchecker.h
@@ -39,8 +39,7 @@
 
 ///////////
 // Headers
-#include <wx/wxprec.h>
-#include "factory_manager.h"
+#include "aegisub.h"
 
 
 ///////////////////////////
@@ -67,12 +66,3 @@ class SpellCheckerFactory {
 public:
 	virtual SpellChecker *CreateSpellChecker()=0;
 };
-
-
-///////////////////
-// Factory Manager
-class SpellCheckerFactoryManager : public FactoryManager<SpellCheckerFactory> {
-public:
-	static SpellChecker *GetSpellChecker();
-	static void RegisterProviders();
-};
diff --git a/aegisub/subtitles_provider.h b/aegisub/include/aegisub/subtitles_provider.h
similarity index 88%
rename from aegisub/subtitles_provider.h
rename to aegisub/include/aegisub/subtitles_provider.h
index 7781d7703..8defef305 100644
--- a/aegisub/subtitles_provider.h
+++ b/aegisub/include/aegisub/subtitles_provider.h
@@ -39,9 +39,8 @@
 
 ///////////
 // Headers
-#include <wx/wxprec.h>
+#include "aegisub.h"
 #include "video_frame.h"
-#include "factory_manager.h"
 
 
 //////////////
@@ -70,14 +69,3 @@ public:
 	virtual ~SubtitlesProviderFactory() {}
 	virtual SubtitlesProvider *CreateProvider(wxString subType=_T(""))=0;
 };
-
-
-///////////////////
-// Factory Manager
-class SubtitlesProviderFactoryManager : public FactoryManager<SubtitlesProviderFactory> {
-public:
-	static SubtitlesProvider *GetProvider();
-	static void RegisterProviders();
-	static bool ProviderAvailable();
-};
-
diff --git a/aegisub/video_provider.h b/aegisub/include/aegisub/video_provider.h
similarity index 92%
rename from aegisub/video_provider.h
rename to aegisub/include/aegisub/video_provider.h
index c8ce3af59..bfd9c43fc 100644
--- a/aegisub/video_provider.h
+++ b/aegisub/include/aegisub/video_provider.h
@@ -39,9 +39,8 @@
 
 //////////
 // Headers
-#include <wx/intl.h>
 #include "video_frame.h"
-#include "factory_manager.h"
+#include "aegisub.h"
 
 
 //////////////
@@ -90,12 +89,3 @@ class VideoProviderFactory {
 public:
 	virtual VideoProvider *CreateProvider(wxString video,double fps=0.0)=0;
 };
-
-
-///////////////////
-// Factory Manager
-class VideoProviderFactoryManager : public FactoryManager<VideoProviderFactory> {
-public:
-	static void RegisterProviders();
-	static VideoProvider *GetProvider(wxString video,double fps=0.0);
-};
diff --git a/aegisub/plugin_manager.cpp b/aegisub/plugin_manager.cpp
index 60a229fdf..2f10ac068 100644
--- a/aegisub/plugin_manager.cpp
+++ b/aegisub/plugin_manager.cpp
@@ -37,11 +37,11 @@
 ///////////
 // Headers
 #include "plugin_manager.h"
-#include "video_provider.h"
-#include "audio_provider.h"
-#include "audio_player.h"
-#include "subtitles_provider.h"
-#include "spellchecker.h"
+#include "video_provider_manager.h"
+#include "audio_provider_manager.h"
+#include "audio_player_manager.h"
+#include "subtitles_provider_manager.h"
+#include "spellchecker_manager.h"
 
 
 ///////////////
diff --git a/aegisub/spellchecker.cpp b/aegisub/spellchecker.cpp
index e30a2ad3f..bcbcd1c0f 100644
--- a/aegisub/spellchecker.cpp
+++ b/aegisub/spellchecker.cpp
@@ -36,7 +36,7 @@
 
 ///////////
 // Headers
-#include "spellchecker.h"
+#include "spellchecker_manager.h"
 #ifdef WITH_HUNSPELL
 #include "spellchecker_hunspell.h"
 #endif
diff --git a/aegisub/spellchecker_hunspell.h b/aegisub/spellchecker_hunspell.h
index bd98c902d..c56e38198 100644
--- a/aegisub/spellchecker_hunspell.h
+++ b/aegisub/spellchecker_hunspell.h
@@ -39,7 +39,7 @@
 
 #ifdef WITH_HUNSPELL
 
-#include "spellchecker.h"
+#include "include/aegisub/spellchecker.h"
 #include <hunspell/hunspell.hxx>
 #include <wx/wxprec.h>
 
diff --git a/aegisub/spellchecker_manager.h b/aegisub/spellchecker_manager.h
new file mode 100644
index 000000000..b81d3e6de
--- /dev/null
+++ b/aegisub/spellchecker_manager.h
@@ -0,0 +1,53 @@
+// 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
+//
+
+
+#pragma once
+
+
+///////////
+// Headers
+#include <wx/wxprec.h>
+#include "factory_manager.h"
+#include "include/aegisub/spellchecker.h"
+
+
+///////////////////
+// Factory Manager
+class SpellCheckerFactoryManager : public FactoryManager<SpellCheckerFactory> {
+public:
+	static SpellChecker *GetSpellChecker();
+	static void RegisterProviders();
+};
diff --git a/aegisub/subs_edit_ctrl.h b/aegisub/subs_edit_ctrl.h
index 2f5acc96f..4efb4d35b 100644
--- a/aegisub/subs_edit_ctrl.h
+++ b/aegisub/subs_edit_ctrl.h
@@ -40,7 +40,7 @@
 ////////////
 // Includes
 #include <wx/wxprec.h>
-#include "spellchecker.h"
+#include "spellchecker_manager.h"
 #include "thesaurus.h"
 #include "scintilla_text_ctrl.h"
 
diff --git a/aegisub/subs_grid.h b/aegisub/subs_grid.h
index be25942a1..930f76ab5 100644
--- a/aegisub/subs_grid.h
+++ b/aegisub/subs_grid.h
@@ -45,7 +45,7 @@
 #include <list>
 #include "base_grid.h"
 #include "audio_display.h"
-#include "audio_provider.h"
+#include "audio_provider_manager.h"
 #include "audio_box.h"
 #include <iostream>
 #include <fstream>
diff --git a/aegisub/subs_preview.cpp b/aegisub/subs_preview.cpp
index 4dbb73611..4f20e8f3b 100644
--- a/aegisub/subs_preview.cpp
+++ b/aegisub/subs_preview.cpp
@@ -42,7 +42,7 @@
 #include "ass_style.h"
 #include "subs_preview.h"
 #include "video_provider_dummy.h"
-#include "subtitles_provider.h"
+#include "subtitles_provider_manager.h"
 #include "ass_file.h"
 
 
diff --git a/aegisub/subtitle_format_dvd.cpp b/aegisub/subtitle_format_dvd.cpp
index b6a2a5216..f4fc67643 100644
--- a/aegisub/subtitle_format_dvd.cpp
+++ b/aegisub/subtitle_format_dvd.cpp
@@ -41,7 +41,7 @@
 // Headers
 #include "subtitle_format_dvd.h"
 #include "video_provider_dummy.h"
-#include "subtitles_provider.h"
+#include "subtitles_provider_manager.h"
 #include "ass_dialogue.h"
 #include "ass_file.h"
 #ifdef _OPENMP
diff --git a/aegisub/subtitles_provider.cpp b/aegisub/subtitles_provider.cpp
index 1960988d5..753fc3cd4 100644
--- a/aegisub/subtitles_provider.cpp
+++ b/aegisub/subtitles_provider.cpp
@@ -36,7 +36,7 @@
 
 ///////////
 // Headers
-#include "subtitles_provider.h"
+#include "subtitles_provider_manager.h"
 #ifdef WITH_CSRI
 #include "subtitles_provider_csri.h"
 #endif
diff --git a/aegisub/subtitles_provider_csri.h b/aegisub/subtitles_provider_csri.h
index 8a03f045f..a0b899f20 100644
--- a/aegisub/subtitles_provider_csri.h
+++ b/aegisub/subtitles_provider_csri.h
@@ -40,7 +40,7 @@
 #ifdef WITH_CSRI
 
 #include <wx/wxprec.h>
-#include "subtitles_provider.h"
+#include "include/aegisub/subtitles_provider.h"
 #ifdef WIN32
 #define CSRIAPI
 #endif
diff --git a/aegisub/subtitles_provider_manager.h b/aegisub/subtitles_provider_manager.h
new file mode 100644
index 000000000..d5ae146e8
--- /dev/null
+++ b/aegisub/subtitles_provider_manager.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2007, 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
+//
+
+
+#pragma once
+
+
+///////////
+// Headers
+#include <wx/wxprec.h>
+#include "include/aegisub/subtitles_provider.h"
+#include "video_frame.h"
+#include "factory_manager.h"
+
+
+///////////////////
+// Factory Manager
+class SubtitlesProviderFactoryManager : public FactoryManager<SubtitlesProviderFactory> {
+public:
+	static SubtitlesProvider *GetProvider();
+	static void RegisterProviders();
+	static bool ProviderAvailable();
+};
+
diff --git a/aegisub/video_box.cpp b/aegisub/video_box.cpp
index 8260391fa..faae2688a 100644
--- a/aegisub/video_box.cpp
+++ b/aegisub/video_box.cpp
@@ -49,7 +49,7 @@
 #include "toggle_bitmap.h"
 #include "options.h"
 #include "subs_grid.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "ass_file.h"
 #include "ass_dialogue.h"
 #include "vfr.h"
diff --git a/aegisub/video_context.cpp b/aegisub/video_context.cpp
index 2d066e793..07b711d24 100644
--- a/aegisub/video_context.cpp
+++ b/aegisub/video_context.cpp
@@ -51,9 +51,9 @@
 #include "utils.h"
 #include "video_display.h"
 #include "video_context.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "visual_tool.h"
-#include "subtitles_provider.h"
+#include "subtitles_provider_manager.h"
 #include "vfr.h"
 #include "ass_file.h"
 #include "ass_exporter.h"
diff --git a/aegisub/video_display.cpp b/aegisub/video_display.cpp
index 3b12ce08d..90e274e66 100644
--- a/aegisub/video_display.cpp
+++ b/aegisub/video_display.cpp
@@ -51,7 +51,7 @@
 #include <wx/config.h>
 #include "utils.h"
 #include "video_display.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "vfr.h"
 #include "ass_file.h"
 #include "ass_time.h"
diff --git a/aegisub/video_provider_avs.h b/aegisub/video_provider_avs.h
index efdd17600..931e1a301 100644
--- a/aegisub/video_provider_avs.h
+++ b/aegisub/video_provider_avs.h
@@ -39,8 +39,8 @@
 #include <wx/wxprec.h>
 #ifdef WITH_AVISYNTH
 #include "avisynth_wrap.h"
-#include "video_provider.h"
-#include "subtitles_provider.h"
+#include "include/aegisub/video_provider.h"
+#include "include/aegisub/subtitles_provider.h"
 
 
 ////////////
diff --git a/aegisub/video_provider_cache.h b/aegisub/video_provider_cache.h
index f15613582..630a6ba7c 100644
--- a/aegisub/video_provider_cache.h
+++ b/aegisub/video_provider_cache.h
@@ -40,7 +40,7 @@
 //////////
 // Headers
 #include <list>
-#include "video_provider.h"
+#include "include/aegisub/video_provider.h"
 
 
 ////////////////
diff --git a/aegisub/video_provider_dshow.h b/aegisub/video_provider_dshow.h
index a774bd0df..55a0d25bb 100644
--- a/aegisub/video_provider_dshow.h
+++ b/aegisub/video_provider_dshow.h
@@ -50,7 +50,7 @@
 #include <windows.h>
 #include <tchar.h>
 #include <initguid.h>
-#include "video_provider.h"
+#include "include/aegisub/video_provider.h"
 #include "videosink.h"
 
 
diff --git a/aegisub/video_provider_dummy.h b/aegisub/video_provider_dummy.h
index 90dd11102..256aa00be 100644
--- a/aegisub/video_provider_dummy.h
+++ b/aegisub/video_provider_dummy.h
@@ -41,7 +41,7 @@
 
 ///////////
 // Headers
-#include "video_provider.h"
+#include "include/aegisub/video_provider.h"
 #include <wx/colour.h>
 
 
diff --git a/aegisub/video_provider_lavc.h b/aegisub/video_provider_lavc.h
index 45951b26b..85cf867be 100644
--- a/aegisub/video_provider_lavc.h
+++ b/aegisub/video_provider_lavc.h
@@ -47,7 +47,7 @@ extern "C" {
 #include <ffmpeg/avformat.h>
 #include <ffmpeg/swscale.h>
 }
-#include "video_provider.h"
+#include "include/aegisub/video_provider.h"
 #include "mkv_wrap.h"
 #include "lavc_file.h"
 
diff --git a/aegisub/video_provider.cpp b/aegisub/video_provider_manager.cpp
similarity index 99%
rename from aegisub/video_provider.cpp
rename to aegisub/video_provider_manager.cpp
index b70cb339f..6dcb32021 100644
--- a/aegisub/video_provider.cpp
+++ b/aegisub/video_provider_manager.cpp
@@ -36,7 +36,7 @@
 
 ///////////
 // Headers
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "video_provider_dummy.h"
 #include "options.h"
 #include "vfr.h"
diff --git a/aegisub/video_provider_manager.h b/aegisub/video_provider_manager.h
new file mode 100644
index 000000000..fc54e5a26
--- /dev/null
+++ b/aegisub/video_provider_manager.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2008, Rodrigo Braz Monteiro, Fredrik Mellbin
+// 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
+//
+
+
+#pragma once
+
+
+//////////
+// Headers
+#include <wx/intl.h>
+#include "include/aegisub/video_provider.h"
+#include "video_frame.h"
+#include "factory_manager.h"
+
+
+///////////////////
+// Factory Manager
+class VideoProviderFactoryManager : public FactoryManager<VideoProviderFactory> {
+public:
+	static void RegisterProviders();
+	static VideoProvider *GetProvider(wxString video,double fps=0.0);
+};
diff --git a/aegisub/visual_tool.cpp b/aegisub/visual_tool.cpp
index 3abdf6f41..8399beebc 100644
--- a/aegisub/visual_tool.cpp
+++ b/aegisub/visual_tool.cpp
@@ -45,7 +45,7 @@
 #include <wx/wxprec.h>
 #include "visual_tool.h"
 #include "video_display.h"
-#include "video_provider.h"
+#include "video_provider_manager.h"
 #include "vfr.h"
 #include "ass_file.h"
 #include "ass_time.h"
diff --git a/build/aegisub_vs2008/aegisub_vs2008.vcproj b/build/aegisub_vs2008/aegisub_vs2008.vcproj
index 7ae93b0ee..5661123d0 100644
--- a/build/aegisub_vs2008/aegisub_vs2008.vcproj
+++ b/build/aegisub_vs2008/aegisub_vs2008.vcproj
@@ -56,7 +56,7 @@
 				WarningLevel="3"
 				WarnAsError="true"
 				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 				DisableSpecificWarnings="4267"
 				ForcedIncludeFiles="stdwx.h;config.h"
 			/>
@@ -489,10 +489,6 @@
 				RelativePath="..\..\aegisub\audio_player.cpp"
 				>
 			</File>
-			<File
-				RelativePath="..\..\aegisub\audio_player.h"
-				>
-			</File>
 			<File
 				RelativePath="..\..\aegisub\audio_player_alsa.cpp"
 				>
@@ -509,6 +505,10 @@
 				RelativePath="..\..\aegisub\audio_player_dsound.h"
 				>
 			</File>
+			<File
+				RelativePath="..\..\aegisub\audio_player_manager.h"
+				>
+			</File>
 			<File
 				RelativePath="..\..\aegisub\audio_player_openal.cpp"
 				>
@@ -537,10 +537,6 @@
 				RelativePath="..\..\aegisub\audio_provider.cpp"
 				>
 			</File>
-			<File
-				RelativePath="..\..\aegisub\audio_provider.h"
-				>
-			</File>
 			<File
 				RelativePath="..\..\aegisub\audio_provider_avs.cpp"
 				>
@@ -581,6 +577,10 @@
 				RelativePath="..\..\aegisub\audio_provider_lavc.h"
 				>
 			</File>
+			<File
+				RelativePath="..\..\aegisub\audio_provider_manager.h"
+				>
+			</File>
 			<File
 				RelativePath="..\..\aegisub\audio_provider_pcm.cpp"
 				>
@@ -1593,14 +1593,6 @@
 				RelativePath="..\..\aegisub\video_frame.h"
 				>
 			</File>
-			<File
-				RelativePath="..\..\aegisub\video_provider.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\aegisub\video_provider.h"
-				>
-			</File>
 			<File
 				RelativePath="..\..\aegisub\video_provider_avs.cpp"
 				>
@@ -1641,6 +1633,14 @@
 				RelativePath="..\..\aegisub\video_provider_lavc.h"
 				>
 			</File>
+			<File
+				RelativePath="..\..\aegisub\video_provider_manager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\video_provider_manager.h"
+				>
+			</File>
 			<File
 				RelativePath="..\..\aegisub\video_slider.cpp"
 				>
@@ -1658,15 +1658,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\aegisub\spellchecker.h"
+				RelativePath="..\..\aegisub\spellchecker_hunspell.cpp"
 				>
 			</File>
 			<File
-				RelativePath="..\..\aegisub\spellchecker_hunspell.cpp"
+				RelativePath="..\..\aegisub\spellchecker_hunspell.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\aegisub\spellchecker_hunspell.h"
+				RelativePath="..\..\aegisub\spellchecker_manager.h"
 				>
 			</File>
 			<File
@@ -1777,10 +1777,6 @@
 				RelativePath="..\..\aegisub\subtitles_provider.cpp"
 				>
 			</File>
-			<File
-				RelativePath="..\..\aegisub\subtitles_provider.h"
-				>
-			</File>
 			<File
 				RelativePath="..\..\aegisub\subtitles_provider_csri.cpp"
 				>
@@ -1797,6 +1793,10 @@
 				RelativePath="..\..\aegisub\subtitles_provider_libass.h"
 				>
 			</File>
+			<File
+				RelativePath="..\..\aegisub\subtitles_provider_manager.h"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Visual Tools"
@@ -1902,6 +1902,34 @@
 				</File>
 			</Filter>
 		</Filter>
+		<Filter
+			Name="Include"
+			>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\aegisub.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\audio_player.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\audio_provider.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\spellchecker.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\subtitles_provider.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\aegisub\include\aegisub\video_provider.h"
+				>
+			</File>
+		</Filter>
 		<File
 			RelativePath="..\..\aegisub\changelog.txt"
 			>
diff --git a/vsfilter/vsfilter_2008.sln b/vsfilter/vsfilter_2008.sln
index 790064f0e..94e30770e 100644
--- a/vsfilter/vsfilter_2008.sln
+++ b/vsfilter/vsfilter_2008.sln
@@ -7,6 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsfilter_2008", "vsfilter_2
 		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6} = {5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}
 		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270} = {6BB08A9D-BBD3-433A-A6D9-079C84EBE270}
 		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6} = {B0CD35D2-65C8-48D0-BEC8-D235137F62F6}
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} = {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basevideofilter_2008", "basevideofilter\basevideofilter_2008.vcproj", "{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}"
@@ -23,36 +24,108 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles_2008", "subtitles
 		{971851AB-A612-4F2F-866F-F0FA152EFFB2} = {971851AB-A612-4F2F-866F-F0FA152EFFB2}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "baseclasses", "C:\Program Files (x86)\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\baseclasses.vcproj", "{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug_MBCS|Win32 = Debug_MBCS|Win32
+		Debug_MBCS|x64 = Debug_MBCS|x64
 		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release_MBCS|Win32 = Release_MBCS|Win32
+		Release_MBCS|x64 = Release_MBCS|x64
 		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug|Win32.ActiveCfg = Debug|Win32
 		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug|Win32.Build.0 = Debug|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug|x64.ActiveCfg = Debug|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release|Win32.ActiveCfg = Release|Win32
 		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release|Win32.Build.0 = Release|Win32
+		{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release|x64.ActiveCfg = Release|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug|Win32.Build.0 = Debug|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Debug|x64.ActiveCfg = Debug|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release|Win32.ActiveCfg = Release|Win32
 		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release|Win32.Build.0 = Release|Win32
+		{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}.Release|x64.ActiveCfg = Release|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.Build.0 = Debug|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|x64.ActiveCfg = Debug|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release|Win32.ActiveCfg = Release|Win32
 		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release|Win32.Build.0 = Release|Win32
+		{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release|x64.ActiveCfg = Release|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug|Win32.ActiveCfg = Debug|Win32
 		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug|Win32.Build.0 = Debug|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug|x64.ActiveCfg = Debug|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release|Win32.ActiveCfg = Release|Win32
 		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release|Win32.Build.0 = Release|Win32
+		{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release|x64.ActiveCfg = Release|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug|Win32.ActiveCfg = Debug|Win32
 		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug|Win32.Build.0 = Debug|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Debug|x64.ActiveCfg = Debug|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{11B20554-2747-469C-9093-3345B1D99E0C}.Release|Win32.ActiveCfg = Release|Win32
 		{11B20554-2747-469C-9093-3345B1D99E0C}.Release|Win32.Build.0 = Release|Win32
+		{11B20554-2747-469C-9093-3345B1D99E0C}.Release|x64.ActiveCfg = Release|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug_MBCS|Win32.ActiveCfg = Debug|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug_MBCS|Win32.Build.0 = Debug|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug_MBCS|x64.ActiveCfg = Debug|Win32
 		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug|Win32.ActiveCfg = Debug|Win32
 		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug|Win32.Build.0 = Debug|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug|x64.ActiveCfg = Debug|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release_MBCS|Win32.ActiveCfg = Release|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release_MBCS|Win32.Build.0 = Release|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release_MBCS|x64.ActiveCfg = Release|Win32
 		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release|Win32.ActiveCfg = Release|Win32
 		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release|Win32.Build.0 = Release|Win32
+		{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release|x64.ActiveCfg = Release|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug_MBCS|Win32.ActiveCfg = Debug_MBCS|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug_MBCS|Win32.Build.0 = Debug_MBCS|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug_MBCS|x64.ActiveCfg = Debug_MBCS|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug_MBCS|x64.Build.0 = Debug_MBCS|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Win32.Build.0 = Debug|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|x64.ActiveCfg = Debug|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|x64.Build.0 = Debug|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release_MBCS|Win32.ActiveCfg = Release_MBCS|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release_MBCS|Win32.Build.0 = Release_MBCS|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release_MBCS|x64.ActiveCfg = Release_MBCS|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release_MBCS|x64.Build.0 = Release_MBCS|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|Win32.ActiveCfg = Release|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|Win32.Build.0 = Release|Win32
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|x64.ActiveCfg = Release|x64
+		{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/vsfilter/vsfilter_2008.vcproj b/vsfilter/vsfilter_2008.vcproj
index e21705f7a..653ea09db 100644
--- a/vsfilter/vsfilter_2008.vcproj
+++ b/vsfilter/vsfilter_2008.vcproj
@@ -147,7 +147,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="delayimp.lib strmbaseu.lib winmm.lib"
+				AdditionalDependencies="delayimp.lib winmm.lib"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\lib"
 				ModuleDefinitionFile=".\vsfilter.def"
-- 
GitLab