Hopefully made Aegisub compile on Linux without WITH_FFMPEG.

Originally committed to SVN as r1723.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-15 00:54:54 +00:00
parent bfea6fd11e
commit 3ce6d62f4e
4 changed files with 25 additions and 13 deletions

View file

@ -147,7 +147,7 @@ bool FontFileLister::IsFilenameCached(wxString filename) {
void FontFileLister::SaveCache() { void FontFileLister::SaveCache() {
try { try {
// Open file // Open file
TextFileWriter file(StandardPaths::DecodePath(_T("?user/fontcache.dat"))); TextFileWriter file(StandardPaths::DecodePath(_T("?user/fontscache.dat")));
// For each face... // For each face...
for (FontMap::iterator iter = fontTable.begin();iter!=fontTable.end();iter++) { for (FontMap::iterator iter = fontTable.begin();iter!=fontTable.end();iter++) {
@ -175,7 +175,7 @@ void FontFileLister::SaveCache() {
void FontFileLister::LoadCache() { void FontFileLister::LoadCache() {
try { try {
// Load cache // Load cache
TextFileReader file(StandardPaths::DecodePath(_T("?user/fontcache.dat"))); TextFileReader file(StandardPaths::DecodePath(_T("?user/fontscache.dat")));
// Read each line // Read each line
while (file.HasMoreLines()) { while (file.HasMoreLines()) {

View file

@ -236,9 +236,10 @@ void FrameMain::InitToolbar () {
Toolbar->AddSeparator(); Toolbar->AddSeparator();
// Property stuff // Property stuff
Toolbar->AddTool(Menu_Tools_Properties,_("Properties"),wxBITMAP(properties_toolbutton),_("Open Properties"));
Toolbar->AddTool(Menu_Tools_Styles_Manager,_("Styles Manager"),wxBITMAP(style_toolbutton),_("Open Styles Manager")); Toolbar->AddTool(Menu_Tools_Styles_Manager,_("Styles Manager"),wxBITMAP(style_toolbutton),_("Open Styles Manager"));
Toolbar->AddTool(Menu_Tools_Properties,_("Properties"),wxBITMAP(properties_toolbutton),_("Open Properties"));
Toolbar->AddTool(Menu_Tools_Attachments,_("Attachments"),wxBITMAP(attach_button),_("Open Attachment List")); Toolbar->AddTool(Menu_Tools_Attachments,_("Attachments"),wxBITMAP(attach_button),_("Open Attachment List"));
Toolbar->AddTool(Menu_Tools_Fonts_Collector,_("Fonts Collector"),wxBITMAP(font_collector_button),_("Open Fonts Collector"));
Toolbar->AddSeparator(); Toolbar->AddSeparator();
// Automation // Automation
@ -251,7 +252,6 @@ void FrameMain::InitToolbar () {
Toolbar->AddTool(Menu_Edit_Shift,_("Shift Times"),wxBITMAP(shift_times_toolbutton),_("Open Shift Times Dialogue")); Toolbar->AddTool(Menu_Edit_Shift,_("Shift Times"),wxBITMAP(shift_times_toolbutton),_("Open Shift Times Dialogue"));
Toolbar->AddTool(Menu_Tools_Styling,_("Styling Assistant"),wxBITMAP(styling_toolbutton),_("Open Styling Assistant")); Toolbar->AddTool(Menu_Tools_Styling,_("Styling Assistant"),wxBITMAP(styling_toolbutton),_("Open Styling Assistant"));
Toolbar->AddTool(Menu_Tools_Translation,_("Translation Assistant"),wxBITMAP(translation_toolbutton),_("Open Translation Assistant")); Toolbar->AddTool(Menu_Tools_Translation,_("Translation Assistant"),wxBITMAP(translation_toolbutton),_("Open Translation Assistant"));
Toolbar->AddTool(Menu_Tools_Fonts_Collector,_("Fonts Collector"),wxBITMAP(font_collector_button),_("Open Fonts Collector"));
Toolbar->AddTool(Menu_Tools_Resample,_("Resample"),wxBITMAP(resample_toolbutton),_("Resample Script Resolution")); Toolbar->AddTool(Menu_Tools_Resample,_("Resample"),wxBITMAP(resample_toolbutton),_("Resample Script Resolution"));
Toolbar->AddTool(Menu_Tools_Timing_Processor,_("Timing Post-Processor"),wxBITMAP(timing_processor_toolbutton),_("Open Timing Post-processor dialog")); Toolbar->AddTool(Menu_Tools_Timing_Processor,_("Timing Post-Processor"),wxBITMAP(timing_processor_toolbutton),_("Open Timing Post-processor dialog"));
Toolbar->AddTool(Menu_Tools_Kanji_Timer,_("Kanji Timer"),wxBITMAP(kanji_timer_button),_("Open Kanji Timer dialog")); Toolbar->AddTool(Menu_Tools_Kanji_Timer,_("Kanji Timer"),wxBITMAP(kanji_timer_button),_("Open Kanji Timer dialog"));
@ -313,6 +313,7 @@ void FrameMain::InitMenu() {
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
AppendBitmapMenuItem (fileMenu,Menu_Tools_Properties, _("&Properties..."), _("Open script properties window"),wxBITMAP(properties_toolbutton)); AppendBitmapMenuItem (fileMenu,Menu_Tools_Properties, _("&Properties..."), _("Open script properties window"),wxBITMAP(properties_toolbutton));
AppendBitmapMenuItem (fileMenu,Menu_Tools_Attachments, _("&Attachments..."), _("Open the attachment list"), wxBITMAP(attach_button)); AppendBitmapMenuItem (fileMenu,Menu_Tools_Attachments, _("&Attachments..."), _("Open the attachment list"), wxBITMAP(attach_button));
AppendBitmapMenuItem (fileMenu,Menu_Tools_Fonts_Collector, _("&Fonts Collector..."),_("Open fonts collector"), wxBITMAP(font_collector_button));
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
#ifndef __APPLE__ #ifndef __APPLE__
// Doesn't work on Mac, only one instance is ever allowed there from OS side // Doesn't work on Mac, only one instance is ever allowed there from OS side
@ -344,6 +345,12 @@ void FrameMain::InitMenu() {
#ifndef __APPLE__ #ifndef __APPLE__
InsertParent->SetBitmap(wxBITMAP(blank_button)); InsertParent->SetBitmap(wxBITMAP(blank_button));
#endif #endif
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Styles_Manager, _("&Styles Manager..."), _("Open styles manager"), wxBITMAP(style_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Styling, _("St&yling Assistant..."), _("Open styling assistant"), wxBITMAP(styling_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Translation, _("&Translation Assistant..."),_("Open translation assistant"), wxBITMAP(translation_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Resample,_("Resample Resolution..."), _("Changes resolution and modifies subtitles to conform to change"), wxBITMAP(resample_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_SpellCheck, _("Spe&ll Checker..."),_("Open spell checker"), wxBITMAP(spellcheck_toolbutton));
subtitlesMenu->AppendSeparator();
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE,_("&Before Current"),_("Inserts a line before current"),wxBITMAP(blank_button)); AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE,_("&Before Current"),_("Inserts a line before current"),wxBITMAP(blank_button));
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_AFTER,_("&After Current"),_("Inserts a line after current"),wxBITMAP(blank_button)); AppendBitmapMenuItem(InsertMenu,MENU_INSERT_AFTER,_("&After Current"),_("Inserts a line after current"),wxBITMAP(blank_button));
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE_VIDEO,_("Before Current, at Video Time"),_("Inserts a line before current, starting at video time"),wxBITMAP(blank_button)); AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE_VIDEO,_("Before Current, at Video Time"),_("Inserts a line before current, starting at video time"),wxBITMAP(blank_button));
@ -367,13 +374,6 @@ void FrameMain::InitMenu() {
subtitlesMenu->AppendSeparator(); subtitlesMenu->AppendSeparator();
AppendBitmapMenuItem(subtitlesMenu,MENU_SWAP,_("Swap Lines"),_("Swaps the two selected lines"),wxBITMAP(arrow_sort)); AppendBitmapMenuItem(subtitlesMenu,MENU_SWAP,_("Swap Lines"),_("Swaps the two selected lines"),wxBITMAP(arrow_sort));
AppendBitmapMenuItem (subtitlesMenu,Menu_Edit_Select, MakeHotkeyText(_("Select Lines..."), _T("Select lines")), _("Selects lines based on defined criterea"),wxBITMAP(select_lines_button)); AppendBitmapMenuItem (subtitlesMenu,Menu_Edit_Select, MakeHotkeyText(_("Select Lines..."), _T("Select lines")), _("Selects lines based on defined criterea"),wxBITMAP(select_lines_button));
subtitlesMenu->AppendSeparator();
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Styles_Manager, _("&Styles Manager..."), _("Open styles manager"), wxBITMAP(style_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Styling, _("St&yling Assistant..."), _("Open styling assistant"), wxBITMAP(styling_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Translation, _("&Translation Assistant..."),_("Open translation assistant"), wxBITMAP(translation_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Resample,_("Resample Resolution..."), _("Changes resolution and modifies subtitles to conform to change"), wxBITMAP(resample_toolbutton));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Fonts_Collector, _("&Fonts Collector..."),_("Open fonts collector"), wxBITMAP(font_collector_button));
AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_SpellCheck, _("Spe&ll Checker..."),_("Open spell checker"), wxBITMAP(spellcheck_toolbutton));
MenuBar->Append(subtitlesMenu, _("&Subtitles")); MenuBar->Append(subtitlesMenu, _("&Subtitles"));
// Create timing menu // Create timing menu

View file

@ -36,6 +36,8 @@
/////////// ///////////
// Headers // Headers
#include "config.h"
#ifdef WITH_FFMPEG
#include "dialog_progress.h" #include "dialog_progress.h"
#include "lavc_keyframes.h" #include "lavc_keyframes.h"
@ -130,3 +132,5 @@ wxArrayInt LAVCKeyFrames::GetKeyFrames() {
return keyframes; return keyframes;
} }
#endif // WITH_FFMPEG

View file

@ -62,9 +62,12 @@
#include "ass_style.h" #include "ass_style.h"
#include "subs_grid.h" #include "subs_grid.h"
#include "vfw_wrap.h" #include "vfw_wrap.h"
#include "config.h"
#if !defined(__WINDOWS__) && !defined(__APPLE__) #if !defined(__WINDOWS__) && !defined(__APPLE__)
#ifdef WITH_FFMPEG
#include "lavc_keyframes.h" #include "lavc_keyframes.h"
#endif #endif
#endif
#include "mkv_wrap.h" #include "mkv_wrap.h"
#include "options.h" #include "options.h"
#include "subs_edit_box.h" #include "subs_edit_box.h"
@ -287,15 +290,20 @@ void VideoContext::SetVideo(const wxString &filename) {
} }
else if (ext == _T(".avi")) { else if (ext == _T(".avi")) {
keyFramesLoaded = false;
KeyFrames.Clear();
#ifdef __WINDOWS__ #ifdef __WINDOWS__
KeyFrames = VFWWrapper::GetKeyFrames(filename); KeyFrames = VFWWrapper::GetKeyFrames(filename);
keyFramesLoaded = true;
#else #else
#ifndef __APPLE__ #ifndef __APPLE__
#ifdef WITH_FFMPEG
LAVCKeyFrames k(filename); LAVCKeyFrames k(filename);
KeyFrames = k.GetKeyFrames(); KeyFrames = k.GetKeyFrames();
#endif
#endif
keyFramesLoaded = true; keyFramesLoaded = true;
#endif
#endif
#endif
} }
// Check if the file is all keyframes // Check if the file is all keyframes