Eliminate double inclusion of frame_main.h and remove #pragma once

Originally committed to SVN as r4526.
This commit is contained in:
Thomas Goyne 2010-06-16 06:20:27 +00:00
parent 392ce99083
commit 43f3502043
8 changed files with 111 additions and 874 deletions

View file

@ -185,7 +185,7 @@ void AlsaPlayer::SetUpHardware()
if (snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &period_len, &dir) < 0) {
throw _T("ALSA player: Couldn't set period length");
}
LOG_D_IF(period_len != wanted_period, "player/audio/alsa") << Couldn't get wanted period size of " << wanted_period" << ", got " << period_len << " instead";
LOG_D_IF(period_len != wanted_period, "player/audio/alsa") << "Couldn't get wanted period size of " << wanted_period << ", got " << period_len << " instead";
if (snd_pcm_hw_params_get_period_size(hwparams, &period, &dir) < 0) {
LOG_E("player/audio/alsa") << "Couldn't get period size";

View file

@ -42,7 +42,6 @@
// Headers
#include <alsa/asoundlib.h>
#include "frame_main.h"
#include "include/aegisub/audio_player.h"
#include "include/aegisub/audio_provider.h"
#include "options.h"

View file

@ -45,7 +45,6 @@
#include <dsound.h>
#include "frame_main.h"
#include "include/aegisub/audio_player.h"
#include "include/aegisub/audio_provider.h"
#include "utils.h"

View file

@ -41,7 +41,6 @@
///////////
// Headers
#include "audio_player_manager.h"
#include "frame_main.h"
#include "include/aegisub/audio_player.h"
#include "include/aegisub/audio_provider.h"
#include "options.h"

View file

@ -54,8 +54,6 @@
# endif
#endif
#include "frame_main.h"
#include "include/aegisub/audio_player.h"
#include "include/aegisub/audio_provider.h"
#include "options.h"

View file

@ -32,11 +32,7 @@
/// @file frame_main.cpp
/// @brief Main window creation and control management
/// @ingroup main_ui
///
///////////////////
// Include headers
#include "config.h"
#ifndef AGI_PRE
@ -102,13 +98,6 @@
#define StartupLog(a)
#endif
/////////////////////////
// FrameMain constructor
/// @brief DOCME
/// @param args
///
FrameMain::FrameMain (wxArrayString args)
: wxFrame ((wxFrame*)NULL,-1,_T(""),wxDefaultPosition,wxSize(920,700),wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN)
{
@ -228,10 +217,7 @@ FrameMain::FrameMain (wxArrayString args)
StartupLog(_T("Leaving FrameMain constructor"));
}
/// @brief FrameMain destructor
///
FrameMain::~FrameMain () {
DeInitContents();
#ifdef WITH_AUTOMATION
@ -239,10 +225,7 @@ FrameMain::~FrameMain () {
#endif
}
/// @brief Initialize toolbar
///
void FrameMain::InitToolbar () {
// Create toolbar
wxSystemOptions::SetOption(_T("msw.remap"), 0);
@ -319,14 +302,12 @@ void FrameMain::InitToolbar () {
/// @param item_text
/// @param hotkey_name
/// @return
///
wxString MakeHotkeyText(const wxString &item_text, const wxString &hotkey_name) {
return item_text + wxString(_T("\t")) + Hotkeys.GetText(hotkey_name);
}
/// @brief Initialize menu bar
///
void FrameMain::InitMenu() {
// Deinit menu if needed
if (menuCreated) {
@ -580,10 +561,7 @@ void FrameMain::InitMenu() {
menuCreated = true;
}
/// @brief Initialize contents
///
void FrameMain::InitContents() {
// Set a background panel
StartupLog(_T("Create background panel"));
@ -646,10 +624,7 @@ void FrameMain::InitContents() {
StartupLog(_T("Leaving InitContents"));
}
/// @brief Deinitialize controls
///
void FrameMain::DeInitContents() {
if (detachedVideo) detachedVideo->Destroy();
if (stylingAssistant) stylingAssistant->Destroy();
@ -660,10 +635,7 @@ void FrameMain::DeInitContents() {
HelpButton::ClearPages();
}
/// @brief Update toolbar
///
void FrameMain::UpdateToolbar() {
// Collect flags
bool isVideo = VideoContext::Get()->IsLoaded();
@ -686,13 +658,9 @@ void FrameMain::UpdateToolbar() {
toolbar->Realize();
}
/// @brief Open subtitles
/// @param filename
/// @param charset
/// @return
///
void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
// First check if there is some loaded
if (AssFile::top && AssFile::top->loaded) {
@ -781,13 +749,10 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
UpdateTitle();
}
/// @brief Save subtitles
/// @param saveas
/// @param withCharset
/// @return
///
bool FrameMain::SaveSubtitles(bool saveas,bool withCharset) {
// Try to get filename from file
wxString filename;
@ -838,12 +803,9 @@ bool FrameMain::SaveSubtitles(bool saveas,bool withCharset) {
return false;
}
/// @brief Try to close subtitles
/// @param enableCancel
/// @return
///
int FrameMain::TryToCloseSubs(bool enableCancel) {
AssFile *ass = AssFile::top;
if (ass->IsModified()) {
@ -860,8 +822,6 @@ int FrameMain::TryToCloseSubs(bool enableCancel) {
else return wxYES;
}
/// @brief Set the video and audio display visibilty
/// @param video -1: leave unchanged; 0: hide; 1: show
/// @param audio -1: leave unchanged; 0: hide; 1: show
@ -902,10 +862,7 @@ void FrameMain::SetDisplayMode(int video, int audio) {
Thaw();
}
/// @brief Update title bar
///
void FrameMain::UpdateTitle() {
// Determine if current subs are modified
bool subsMod = AssFile::top->IsModified();
@ -942,11 +899,8 @@ void FrameMain::UpdateTitle() {
if (curTitle != newTitle) SetTitle(newTitle);
}
/// @brief Updates subs with video/whatever data
/// @param fromSubs
///
void FrameMain::SynchronizeProject(bool fromSubs) {
// Gather current data
AssFile *subs = AssFile::top;
@ -1130,13 +1084,9 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
}
}
/// @brief Loads video
/// @param file
/// @param autoload
/// @return
///
void FrameMain::LoadVideo(wxString file,bool autoload) {
if (blockVideoLoad) return;
Freeze();
@ -1210,13 +1160,9 @@ void FrameMain::LoadVideo(wxString file,bool autoload) {
Thaw();
}
/// @brief Loads audio
/// @param filename
/// @param FromVideo
/// @return
///
void FrameMain::LoadAudio(wxString filename,bool FromVideo) {
if (blockAudioLoad) return;
VideoContext::Get()->Stop();
@ -1239,11 +1185,8 @@ void FrameMain::LoadAudio(wxString filename,bool FromVideo) {
}
}
/// @brief Loads VFR
/// @param filename
///
void FrameMain::LoadVFR(wxString filename) {
VideoContext::Get()->Stop();
if (filename != _T("")) {
@ -1273,26 +1216,17 @@ void FrameMain::LoadVFR(wxString filename) {
EditBox->UpdateFrameTiming();
}
/// @brief Saves VFR
/// @param filename
///
void FrameMain::SaveVFR(wxString filename) {
VFR_Output.Save(filename);
}
/// @brief Open help
/// @param page
///
void FrameMain::OpenHelp(wxString page) {
void FrameMain::OpenHelp(wxString) {
HelpButton::OpenPage(_T("Main"));
}
/// @brief Detach video window
/// @param detach
void FrameMain::DetachVideo(bool detach) {
@ -1311,22 +1245,16 @@ void FrameMain::DetachVideo(bool detach) {
UpdateToolbar();
}
/// @brief Sets status and clear after n miliseconds
/// @brief Sets status and clear after n milliseconds
/// @param text
/// @param ms
///
void FrameMain::StatusTimeout(wxString text,int ms) {
SetStatusText(text,1);
StatusClear.SetOwner(this,StatusClear_Timer);
StatusClear.Start(ms,true);
}
/// @brief Setup accelerator table
///
void FrameMain::SetAccelerators() {
std::vector<wxAcceleratorEntry> entry;
entry.reserve(32);
@ -1364,12 +1292,9 @@ void FrameMain::SetAccelerators() {
SetAcceleratorTable(table);
}
/// @brief Load list of files
/// @param list
/// @return
///
bool FrameMain::LoadList(wxArrayString list) {
// Build list
wxArrayString List;
@ -1455,19 +1380,13 @@ bool FrameMain::LoadList(wxArrayString list) {
}
/// @brief Sets the descriptions for undo/redo
///
void FrameMain::SetUndoRedoDesc() {
editMenu->SetHelpString(0,_T("Undo ")+AssFile::GetUndoDescription());
editMenu->SetHelpString(1,_T("Redo ")+AssFile::GetRedoDescription());
}
/// @brief Check if ASSDraw is available
///
bool FrameMain::HasASSDraw() {
#ifdef __WINDOWS__
wxFileName fn(StandardPaths::DecodePath(_T("?data/ASSDraw3.exe")));
@ -1476,5 +1395,3 @@ bool FrameMain::HasASSDraw() {
return false;
#endif
}

View file

@ -34,12 +34,6 @@
/// @ingroup main_ui
///
#pragma once
///////////////////
// Include headers
#ifndef AGI_PRE
#include <vector>
@ -53,8 +47,6 @@
#endif
////////////////////
// Class prototypes
class VideoDisplay;
class VideoSlider;
class VideoZoomSlider;
@ -66,8 +58,7 @@ class DialogDetachedVideo;
class DialogStyling;
class AegisubFileDropTarget;
/// DOCME
namespace Automation4 { class FeatureMacro; class ScriptManager; };
namespace Automation4 { class FeatureMacro; class ScriptManager; }
@ -386,410 +377,157 @@ public:
};
////////////////
// Menu Entries
/// Menu entry event ids
enum {
/// DOCME
Menu_File_New = 200,
/// DOCME
Menu_File_Open,
/// DOCME
Menu_File_Save,
/// DOCME
Menu_File_SaveAs,
/// DOCME
Menu_File_Close,
/// DOCME
Menu_File_Open_Video,
/// DOCME
Menu_File_Close_Video,
/// DOCME
Menu_File_Open_Subtitles,
/// DOCME
Menu_File_Open_Subtitles_Charset,
Menu_File_Open_Subtitles_From_Video,
/// DOCME
Menu_File_New_Subtitles,
/// DOCME
Menu_File_Save_Subtitles,
/// DOCME
Menu_File_Save_Subtitles_As,
/// DOCME
Menu_File_Save_Subtitles_With_Charset,
/// DOCME
Menu_File_Export_Subtitles,
/// DOCME
Menu_File_Open_VFR,
/// DOCME
Menu_File_Save_VFR,
/// DOCME
Menu_File_Close_VFR,
/// DOCME
Menu_File_New_Window,
/// DOCME
Menu_File_Exit,
/// DOCME
Menu_File_Recent_Subs_Parent,
/// DOCME
Menu_File_Recent_Vids_Parent,
/// DOCME
Menu_File_Recent_Auds_Parent,
/// DOCME
Menu_File_Recent_Timecodes_Parent,
/// DOCME
Menu_File_Recent_Keyframes_Parent,
/// DOCME
Menu_Video_JumpTo,
/// DOCME
Menu_View_Zoom,
/// DOCME
Menu_View_Zoom_50,
/// DOCME
Menu_View_Zoom_100,
/// DOCME
Menu_View_Zoom_200,
/// DOCME
Menu_Video_Zoom_In,
/// DOCME
Menu_Video_Zoom_Out,
/// DOCME
Menu_Video_Load_Keyframes,
/// DOCME
Menu_Video_Save_Keyframes,
/// DOCME
Menu_Video_Close_Keyframes,
/// DOCME
Toolbar_Zoom_Dropdown,
/// DOCME
Menu_Video_AR,
/// DOCME
Menu_Video_AR_Default,
/// DOCME
Menu_Video_AR_Full,
/// DOCME
Menu_Video_AR_Wide,
/// DOCME
Menu_Video_AR_235,
/// DOCME
Menu_Video_AR_Custom,
/// DOCME
Menu_Video_Select_Visible,
/// DOCME
Menu_Video_Play,
/// DOCME
Menu_Video_Detach,
/// DOCME
Menu_Video_Dummy,
/// DOCME
Menu_Video_Overscan,
/// DOCME
Menu_Video_Details,
/// DOCME
Menu_Audio_Open_File,
/// DOCME
Menu_Audio_Open_From_Video,
/// DOCME
Menu_Audio_Close,
#ifdef _DEBUG
/// DOCME
Menu_Audio_Open_Dummy,
/// DOCME
Menu_Audio_Open_Dummy_Noise,
#endif
/// DOCME
Menu_Edit_Select,
/// DOCME
Menu_Edit_Undo,
/// DOCME
Menu_Edit_Redo,
/// DOCME
Menu_Edit_Find,
/// DOCME
Menu_Edit_Find_Next,
/// DOCME
Menu_Edit_Replace,
/// DOCME
Menu_Edit_Shift,
/// DOCME
Menu_Edit_Cut,
/// DOCME
Menu_Edit_Copy,
/// DOCME
Menu_Edit_Paste,
/// DOCME
Menu_Edit_Paste_Over,
/// DOCME
Menu_Edit_Delete,
/// DOCME
Menu_View_Language,
/// DOCME
Menu_View_Standard,
/// DOCME
Menu_View_Audio,
/// DOCME
Menu_View_Video,
/// DOCME
Menu_View_Subs,
Menu_View_FullTags,
Menu_View_ShortTags,
Menu_View_NoTags,
/// DOCME
Menu_Subtitles_Join,
/// DOCME
Menu_Subtitles_Recombine,
/// DOCME
Menu_Subtitles_Insert,
Menu_Subtitles_Sort_Start,
Menu_Subtitles_Sort_End,
Menu_Subtitles_Sort_Style,
/// DOCME
Menu_Tools_Properties,
/// DOCME
Menu_Tools_Styles_Manager,
/// DOCME
Menu_Tools_Attachments,
/// DOCME
Menu_Tools_Translation,
/// DOCME
Menu_Tools_SpellCheck,
/// DOCME
Menu_Tools_Fonts_Collector,
/// DOCME
Menu_Tools_Automation,
/// DOCME
Menu_Tools_Styling,
/// DOCME
Menu_Tools_Resample,
/// DOCME
Menu_Tools_Timing_Processor,
/// DOCME
Menu_Tools_Kanji_Timer,
/// DOCME
Menu_Tools_Options,
/// DOCME
Menu_Tools_ASSDraw,
/// DOCME
Menu_Help_Contents,
/// DOCME
Menu_Help_Files,
/// DOCME
Menu_Help_IRCChannel,
/// DOCME
Menu_Help_Website,
/// DOCME
Menu_Help_Forums,
/// DOCME
Menu_Help_BugTracker,
/// DOCME
Menu_Help_Check_Updates,
/// DOCME
Menu_Help_About,
Menu_Help_Log,
/// DOCME
Menu_Subs_Snap_Start_To_Video,
/// DOCME
Menu_Subs_Snap_End_To_Video,
/// DOCME
Menu_Subs_Snap_Video_To_Start,
/// DOCME
Menu_Subs_Snap_Video_To_End,
/// DOCME
Menu_Video_Snap_To_Scene,
/// DOCME
Menu_Video_Shift_To_Frame,
/// DOCME
AutoSave_Timer,
/// DOCME
StatusClear_Timer,
/// DOCME
Video_Next_Frame,
/// DOCME
Video_Prev_Frame,
/// DOCME
Video_Focus_Seek,
/// DOCME
Grid_Next_Line,
/// DOCME
Grid_Prev_Line,
/// DOCME
Grid_Toggle_Tags,
/// DOCME
Edit_Box_Commit,
/// DOCME
Video_Frame_Play,
/// DOCME
Medusa_Play,
/// DOCME
Medusa_Stop,
/// DOCME
Medusa_Shift_Start_Forward,
/// DOCME
Medusa_Shift_Start_Back,
/// DOCME
Medusa_Shift_End_Forward,
/// DOCME
Medusa_Shift_End_Back,
/// DOCME
Medusa_Play_Before,
/// DOCME
Medusa_Play_After,
/// DOCME
Medusa_Next,
/// DOCME
Medusa_Prev,
/// DOCME
Medusa_Enter,
/// DOCME
Menu_File_Recent = 2000,
/// DOCME
Menu_Video_Recent = 2200,
/// DOCME
Menu_Audio_Recent = 2400,
/// DOCME
Menu_Timecodes_Recent = 2500,
/// DOCME
Menu_Keyframes_Recent = 2600,
/// DOCME
Menu_Automation_Macro = 2700
};

File diff suppressed because it is too large Load diff