2010-05-21 03:13:36 +02:00
// Copyright (c) 2010, Amar Takhar <verm@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// $Id$
/// @file preferences.cpp
/// @brief Preferences dialogue
/// @ingroup configuration_ui
# ifndef AGI_PRE
2010-08-02 08:31:38 +02:00
# include <iterator>
2010-06-14 21:26:27 +02:00
# include <wx/checkbox.h>
# include <wx/combobox.h>
2010-05-21 03:13:36 +02:00
# include <wx/filefn.h>
2010-06-14 21:26:27 +02:00
# include <wx/sizer.h>
2010-05-21 03:13:36 +02:00
# include <wx/spinctrl.h>
2010-06-14 21:26:27 +02:00
# include <wx/stattext.h>
2010-05-21 03:13:36 +02:00
# include <wx/stdpaths.h>
# include <wx/treebook.h>
# endif
# include <libaegisub/exception.h>
# include "colour_button.h"
2010-06-03 22:32:25 +02:00
# include "compat.h"
2010-05-21 03:13:36 +02:00
# include "libresrc/libresrc.h"
# include "preferences.h"
# include "main.h"
2010-08-02 08:31:38 +02:00
# include "include/aegisub/audio_player.h"
# include "include/aegisub/audio_provider.h"
# include "include/aegisub/subtitles_provider.h"
2010-05-21 03:13:36 +02:00
# include "video_provider_manager.h"
2010-07-19 19:53:29 +02:00
# include "preferences_base.h"
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// General preferences page
2010-08-26 20:38:20 +02:00
General : : General ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " General " ) ) {
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * startup = PageSizer ( _ ( " Startup " ) ) ;
2010-08-26 20:37:46 +02:00
OptionAdd ( startup , _ ( " Check for updates " ) , " App/Auto/Check For Updates " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * recent = PageSizer ( _ ( " Recently Used Lists " ) ) ;
OptionAdd ( recent , _ ( " Files " ) , " Limits/MRU " ) ;
OptionAdd ( recent , _ ( " Find/Replace " ) , " Limits/Find Replace " ) ;
sizer - > AddSpacer ( 15 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * undo = PageSizer ( _ ( " Undo / Redo Settings " ) ) ;
OptionAdd ( undo , _ ( " Undo Levels " ) , " Limits/MRU " ) ;
2010-05-21 03:13:36 +02:00
2011-07-15 06:06:23 +02:00
wxFlexGridSizer * toolbar = PageSizer ( _ ( " Toolbar Settings " ) ) ;
OptionAdd ( toolbar , _ ( " Toolbar Icon Size " ) , " App/Toolbar Icon Size " ) ;
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Subtitles preferences page
2010-08-26 20:38:20 +02:00
Subtitles : : Subtitles ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Subtitles " ) ) {
2010-07-18 16:46:16 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " Options " ) ) ;
OptionAdd ( general , _ ( " Enable call tips " ) , " App/Call Tips " ) ;
OptionAdd ( general , _ ( " Enable syntax highlighting " ) , " Subtitle/Highlight/Syntax " ) ;
OptionAdd ( general , _ ( " Link commiting of times " ) , " Subtitle/Edit Box/Link Time Boxes Commit " ) ;
OptionAdd ( general , _ ( " Overwrite-Insertion in time boxes " ) , " Subtitle/Time Edit/Insert Mode " ) ;
2010-07-18 16:46:16 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * grid = PageSizer ( _ ( " Grid " ) ) ;
OptionAdd ( grid , _ ( " Allow grid to take focus " ) , " Subtitle/Grid/Focus Allow " ) ;
OptionAdd ( grid , _ ( " Highlight visible subtitles " ) , " Subtitle/Grid/Highlight Subtitles in Frame " ) ;
2010-07-18 16:46:16 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-07-18 16:46:16 +02:00
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Audio preferences page
2010-08-26 20:38:20 +02:00
Audio : : Audio ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Audio " ) ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " Options " ) ) ;
OptionAdd ( general , _ ( " Grab times from line upon selection " ) , " Audio/Grab Times on Select " ) ;
OptionAdd ( general , _ ( " Default mouse wheel to zoom " ) , " Audio/Wheel Default to Zoom " ) ;
OptionAdd ( general , _ ( " Lock scroll on cursor " ) , " Audio/Lock Scroll on Cursor " ) ;
OptionAdd ( general , _ ( " Snap to keyframes " ) , " Audio/Display/Snap/Keyframes " ) ;
OptionAdd ( general , _ ( " Snap to adjacent lines " ) , " Audio/Display/Snap/Other Lines " ) ;
OptionAdd ( general , _ ( " Auto-focus on mouse over " ) , " Audio/Auto/Focus " ) ;
OptionAdd ( general , _ ( " Play audio when stepping in video " ) , " Audio/Plays When Stepping Video " ) ;
CellSkip ( general ) ;
OptionAdd ( general , _ ( " Default timing length " ) , " Timing/Default Duration " , 0 , 36000 ) ;
OptionAdd ( general , _ ( " Default lead-in length " ) , " Audio/Lead/IN " , 0 , 36000 ) ;
OptionAdd ( general , _ ( " Default lead-out length " ) , " Audio/Lead/OUT " , 0 , 36000 ) ;
const wxString dtl_arr [ 3 ] = { _ ( " Don't show " ) , _ ( " Show previous " ) , _ ( " Show all " ) } ;
wxArrayString choice_dtl ( 3 , dtl_arr ) ;
OptionChoice ( general , _ ( " Show inactive lines " ) , choice_dtl , " Audio/Inactive Lines Display Mode " ) ;
OptionAdd ( general , _ ( " Start-marker drag sensitivity " ) , " Audio/Start Drag Sensitivity " , 1 , 15 ) ;
wxFlexGridSizer * display = PageSizer ( _ ( " Display Visual Options " ) ) ;
OptionAdd ( display , _ ( " Secondary lines " ) , " Audio/Display/Draw/Secondary Lines " ) ;
OptionAdd ( display , _ ( " Selection background " ) , " Audio/Display/Draw/Selection Background " ) ;
OptionAdd ( display , _ ( " Timeline " ) , " Audio/Display/Draw/Timeline " ) ;
OptionAdd ( display , _ ( " Cursor time " ) , " Audio/Display/Draw/Cursor Time " ) ;
OptionAdd ( display , _ ( " Keyframes " ) , " Audio/Display/Draw/Keyframes " ) ;
OptionAdd ( display , _ ( " Video position " ) , " Audio/Display/Draw/Video Position " ) ;
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Video preferences page
2010-08-26 20:38:20 +02:00
Video : : Video ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Video " ) ) {
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " Options " ) ) ;
OptionAdd ( general , _ ( " Show keyframes in slider " ) , " Video/Slider/Show Keyframes " ) ;
OptionAdd ( general , _ ( " Always show visual tools " ) , " Tool/Visual/Always Show " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString cres_arr [ 3 ] = { _ ( " Never " ) , _ ( " Ask " ) , _ ( " Always " ) } ;
wxArrayString choice_res ( 3 , cres_arr ) ;
OptionChoice ( general , _ ( " Match video resolution on open " ) , choice_res , " Video/Check Script Res " ) ;
2010-05-21 03:13:36 +02:00
2011-09-28 21:43:11 +02:00
const wxString czoom_arr [ 24 ] = { " 12.5% " , " 25% " , " 37.5% " , " 50% " , " 62.5% " , " 75% " , " 87.5% " , " 100% " , " 112.5% " , " 125% " , " 137.5% " , " 150% " , " 162.5% " , " 175% " , " 187.5% " , " 200% " , " 212.5% " , " 225% " , " 237.5% " , " 250% " , " 262.5% " , " 275% " , " 287.5% " , " 300% " } ;
2010-07-19 19:53:29 +02:00
wxArrayString choice_zoom ( 24 , czoom_arr ) ;
OptionChoice ( general , _ ( " Default Zoom " ) , choice_zoom , " Video/Default Zoom " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionAdd ( general , _ ( " Fast jump step in frames " ) , " Video/Slider/Fast Jump Step " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString cscr_arr [ 3 ] = { _ ( " ?video " ) , _ ( " ?script " ) , _ ( " . " ) } ;
wxArrayString scr_res ( 3 , cscr_arr ) ;
OptionChoice ( general , _ ( " Screenshot save path " ) , scr_res , " Path/Screenshot " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Interface preferences page
2010-08-26 20:38:20 +02:00
Interface : : Interface ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Interface " ) ) {
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * grid = PageSizer ( _ ( " Subtitle Grid " ) ) ;
OptionBrowse ( grid , _ ( " Font face " ) , BROWSE_FONT , " Subtitle/Grid/Font Face " ) ;
OptionAdd ( grid , _ ( " Font size " ) , " Subtitle/Grid/Font Size " , 3 , 42 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionAdd ( grid , _ ( " Hide overrides symbol " ) , " Subtitle/Grid/Hide Overrides Char " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Interface Colours preferences subpage
2010-08-26 20:38:20 +02:00
Interface_Colours : : Interface_Colours ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Colours " ) , PAGE_SCROLL | PAGE_SUB ) {
2010-08-26 20:38:14 +02:00
delete sizer ;
2010-08-26 20:38:26 +02:00
wxSizer * main_sizer = sizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * audio = PageSizer ( _ ( " Audio Display " ) ) ;
OptionAdd ( audio , _ ( " Play cursor " ) , " Colour/Audio Display/Play Cursor " ) ;
OptionAdd ( audio , _ ( " Background " ) , " Colour/Audio Display/Background/Background " ) ;
OptionAdd ( audio , _ ( " Selection background " ) , " Colour/Audio Display/Background/Selection " ) ;
OptionAdd ( audio , _ ( " Selection background modified " ) , " Colour/Audio Display/Background/Selection Modified " ) ;
OptionAdd ( audio , _ ( " Seconds boundaries " ) , " Colour/Audio Display/Seconds Boundaries " ) ;
OptionAdd ( audio , _ ( " Waveform " ) , " Colour/Audio Display/Waveform " ) ;
OptionAdd ( audio , _ ( " Waveform selected " ) , " Colour/Audio Display/Waveform Selected " ) ;
OptionAdd ( audio , _ ( " Waveform Modified " ) , " Colour/Audio Display/Waveform Modified " ) ;
OptionAdd ( audio , _ ( " Waveform Inactive " ) , " Colour/Audio Display/Waveform Inactive " ) ;
OptionAdd ( audio , _ ( " Line boundary start " ) , " Colour/Audio Display/Line boundary Start " ) ;
OptionAdd ( audio , _ ( " Line boundary end " ) , " Colour/Audio Display/Line boundary End " ) ;
OptionAdd ( audio , _ ( " Line boundary inactive line " ) , " Colour/Audio Display/Line Boundary Inactive Line " ) ;
OptionAdd ( audio , _ ( " Syllable text " ) , " Colour/Audio Display/Syllable Text " ) ;
OptionAdd ( audio , _ ( " Syllable boundaries " ) , " Colour/Audio Display/Syllable Boundaries " ) ;
2010-08-26 20:38:14 +02:00
sizer = new wxBoxSizer ( wxVERTICAL ) ;
main_sizer - > Add ( sizer ) ;
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * syntax = PageSizer ( _ ( " Syntax Highlighting " ) ) ;
OptionAdd ( syntax , _ ( " Normal " ) , " Colour/Subtitle/Syntax/Normal " ) ;
OptionAdd ( syntax , _ ( " Brackets " ) , " Colour/Subtitle/Syntax/Brackets " ) ;
OptionAdd ( syntax , _ ( " Slashes and Parentheses " ) , " Colour/Subtitle/Syntax/Slashes " ) ;
2011-09-29 22:27:40 +02:00
OptionAdd ( syntax , _ ( " Tags " ) , " Colour/Subtitle/Syntax/Tags " ) ;
2010-07-19 19:53:29 +02:00
OptionAdd ( syntax , _ ( " Parameters " ) , " Colour/Subtitle/Syntax/Parameters " ) ;
OptionAdd ( syntax , _ ( " Error " ) , " Colour/Subtitle/Syntax/Error " ) ;
OptionAdd ( syntax , _ ( " Error Background " ) , " Colour/Subtitle/Syntax/Background/Error " ) ;
OptionAdd ( syntax , _ ( " Line Break " ) , " Colour/Subtitle/Syntax/Line Break " ) ;
OptionAdd ( syntax , _ ( " Karaoke templates " ) , " Colour/Subtitle/Syntax/Karaoke Template " ) ;
wxFlexGridSizer * grid = PageSizer ( _ ( " Subtitle Grid " ) ) ;
OptionAdd ( grid , _ ( " Standard foreground " ) , " Colour/Subtitle Grid/Standard " ) ;
OptionAdd ( grid , _ ( " Standard background " ) , " Colour/Subtitle Grid/Background/Background " ) ;
OptionAdd ( grid , _ ( " Selection foreground " ) , " Colour/Subtitle Grid/Selection " ) ;
OptionAdd ( grid , _ ( " Selection background " ) , " Colour/Subtitle Grid/Background/Selection " ) ;
2011-09-30 22:40:58 +02:00
OptionAdd ( grid , _ ( " Collision foreground " ) , " Colour/Subtitle Grid/Collision " ) ;
OptionAdd ( grid , _ ( " In frame background " ) , " Colour/Subtitle Grid/Background/Inframe " ) ;
2010-07-19 19:53:29 +02:00
OptionAdd ( grid , _ ( " Comment background " ) , " Colour/Subtitle Grid/Background/Comment " ) ;
OptionAdd ( grid , _ ( " Selected comment background " ) , " Colour/Subtitle Grid/Background/Selected Comment " ) ;
OptionAdd ( grid , _ ( " Left Column " ) , " Colour/Subtitle Grid/Left Column " ) ;
OptionAdd ( grid , _ ( " Active Line Border " ) , " Colour/Subtitle Grid/Active Border " ) ;
OptionAdd ( grid , _ ( " Lines " ) , " Colour/Subtitle Grid/Lines " ) ;
2010-08-26 20:38:14 +02:00
sizer = main_sizer ;
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Interface Hotkeys preferences subpage
2010-08-26 20:38:20 +02:00
Interface_Hotkeys : : Interface_Hotkeys ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Hotkeys " ) , PAGE_SUB ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * hotkeys = PageSizer ( _ ( " Hotkeys " ) ) ;
hotkeys - > Add ( new wxStaticText ( this , wxID_ANY , _T ( " To be added after hotkey rewrite. " ) ) , 0 , wxALL , 5 ) ;
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
/// Paths preferences page class Paths: public OptionPage { public:
2010-08-26 20:38:20 +02:00
Paths : : Paths ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Paths " ) ) {
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " General " ) ) ;
2011-09-28 21:43:11 +02:00
general - > Add ( new wxStaticText ( this , wxID_ANY , " TBD.. " ) , 0 , wxALL , 5 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// File Associations preferences page
2010-08-26 20:38:20 +02:00
File_Associations : : File_Associations ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " File Associations " ) ) {
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * assoc = PageSizer ( _ ( " General " ) ) ;
2011-09-28 21:43:11 +02:00
assoc - > Add ( new wxStaticText ( this , wxID_ANY , " TBD.. " ) , 0 , wxALL , 5 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Backup preferences page
2010-08-26 20:38:20 +02:00
Backup : : Backup ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Backup " ) ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * save = PageSizer ( _ ( " Automatic Save " ) ) ;
OptionAdd ( save , _ ( " Enable " ) , " App/Auto/Backup " ) ;
CellSkip ( save ) ;
OptionAdd ( save , _ ( " Interval in seconds. " ) , " App/Auto/Save Every Seconds " ) ;
OptionBrowse ( save , _ ( " Path " ) , BROWSE_FOLDER , " Path/Auto/Save " ) ;
wxFlexGridSizer * backup = PageSizer ( _ ( " Automatic Backup " ) ) ;
CellSkip ( backup ) ;
OptionAdd ( backup , _ ( " Enable " ) , " App/Auto/Backup " ) ;
OptionBrowse ( backup , _ ( " Path " ) , BROWSE_FOLDER , " Path/Auto/Backup " ) ;
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Automation preferences page
2010-08-26 20:38:20 +02:00
Automation : : Automation ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Automation " ) ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " General " ) ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionAdd ( general , _ ( " Base path " ) , " Path/Automation/Base " ) ;
OptionAdd ( general , _ ( " Include path " ) , " Path/Automation/Include " ) ;
OptionAdd ( general , _ ( " Auto-load path " ) , " Path/Automation/Autoload " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString tl_arr [ 6 ] = { _ ( " Fatal " ) , _ ( " Error " ) , _ ( " Warning " ) , _ ( " Hint " ) , _ ( " Debug " ) , _ ( " Trace " ) } ;
wxArrayString tl_choice ( 6 , tl_arr ) ;
OptionChoice ( general , _ ( " Trace level " ) , tl_choice , " Automation/Trace Level " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString tp_arr [ 3 ] = { _ ( " Normal " ) , _ ( " Below Normal (recommended) " ) , _ ( " Lowest " ) } ;
wxArrayString tp_choice ( 3 , tp_arr ) ;
2011-09-28 21:47:40 +02:00
OptionChoice ( general , _ ( " Thread priority " ) , tp_choice , " Automation/Thread Priority " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString ar_arr [ 4 ] = { _ ( " No scripts " ) , _ ( " Subtitle-local scripts " ) , _ ( " Global autoload scripts " ) , _ ( " All scripts " ) } ;
wxArrayString ar_choice ( 4 , ar_arr ) ;
OptionChoice ( general , _ ( " Autoreload on Export " ) , ar_choice , " Automation/Autoreload Mode " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Advanced preferences page
2010-08-26 20:38:20 +02:00
Advanced : : Advanced ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Advanced " ) ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * general = PageSizer ( _ ( " General " ) ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxStaticText * warning = new wxStaticText ( this , wxID_ANY , _ ( " Changing these settings might result in bugs and/or crashes. Do not touch these unless you know what you're doing. " ) ) ;
warning - > SetFont ( wxFont ( 12 , wxFONTFAMILY_SWISS , wxFONTSTYLE_NORMAL , wxFONTWEIGHT_BOLD ) ) ;
sizer - > Fit ( this ) ;
warning - > Wrap ( 400 ) ;
general - > Add ( warning , 0 , wxALL , 5 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Advanced Interface preferences subpage
2010-08-26 20:38:20 +02:00
Advanced_Interface : : Advanced_Interface ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Backup " ) , PAGE_SUB ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * interface_ = PageSizer ( _ ( " Interface " ) ) ;
2010-05-21 03:13:36 +02:00
2011-09-28 21:43:11 +02:00
interface_ - > Add ( new wxStaticText ( this , wxID_ANY , " TBD.. " ) , 0 , wxALL , 5 ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-08-02 08:31:38 +02:00
static wxArrayString vec_to_arrstr ( std : : vector < std : : string > const & vec ) {
wxArrayString arrstr ;
std : : copy ( vec . begin ( ) , vec . end ( ) , std : : back_inserter ( arrstr ) ) ;
return arrstr ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Advanced Audio preferences subpage
2010-08-26 20:38:20 +02:00
Advanced_Audio : : Advanced_Audio ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Audio " ) , PAGE_SUB ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * expert = PageSizer ( _ ( " Expert " ) ) ;
2010-05-21 03:13:36 +02:00
2010-08-02 08:31:38 +02:00
wxArrayString ap_choice = vec_to_arrstr ( AudioProviderFactory : : GetClasses ( ) ) ;
2010-07-19 19:53:29 +02:00
OptionChoice ( expert , _ ( " Audio provider " ) , ap_choice , " Audio/Provider " ) ;
2010-05-21 03:13:36 +02:00
2010-08-02 08:31:38 +02:00
wxArrayString apl_choice = vec_to_arrstr ( AudioPlayerFactory : : GetClasses ( ) ) ;
2010-07-19 19:53:29 +02:00
OptionChoice ( expert , _ ( " Audio player " ) , apl_choice , " Audio/Player " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * cache = PageSizer ( _ ( " Cache " ) ) ;
const wxString ct_arr [ 3 ] = { _ ( " None (NOT RECOMMENDED) " ) , _ ( " RAM " ) , _ ( " Hard Disk " ) } ;
wxArrayString ct_choice ( 3 , ct_arr ) ;
OptionChoice ( cache , _ ( " Cache type " ) , ct_choice , " Audio/Cache/Type " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionBrowse ( cache , _ ( " Path " ) , BROWSE_FOLDER , " Audio/Cache/HD/Location " ) ;
OptionAdd ( cache , _ ( " File name " ) , " Audio/Cache/HD/Name " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * spectrum = PageSizer ( _ ( " Spectrum " ) ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionAdd ( spectrum , _ ( " Cutoff " ) , " Audio/Renderer/Spectrum/Cutoff " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
const wxString sq_arr [ 4 ] = { _ ( " Regular quality " ) , _ ( " Better quality " ) , _ ( " High quality " ) , _ ( " Insane quality " ) } ;
wxArrayString sq_choice ( 4 , sq_arr ) ;
OptionChoice ( spectrum , _ ( " Quality " ) , sq_choice , " Audio/Renderer/Spectrum/Quality " ) ;
2010-05-21 03:13:36 +02:00
2010-07-19 19:53:29 +02:00
OptionAdd ( spectrum , _ ( " Cache memory max (MB) " ) , " Audio/Renderer/Spectrum/Memory Max " , 2 , 1024 ) ;
2010-05-21 03:13:36 +02:00
2011-07-15 06:06:23 +02:00
# if defined(WIN32) || defined(_DEBUG)
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * windows = PageSizer ( _ ( " Windows Specific " ) ) ;
2011-09-28 21:43:11 +02:00
const wxString adm_arr [ 3 ] = { " ConvertToMono " , " GetLeftChannel " , " GetRightChannel " } ;
2010-07-19 19:53:29 +02:00
wxArrayString adm_choice ( 3 , adm_arr ) ;
OptionChoice ( windows , _ ( " Avisynth down-mixer " ) , adm_choice , " Audio/Downmixer " ) ;
2010-05-21 03:13:36 +02:00
# endif
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
}
2010-05-21 03:13:36 +02:00
2010-07-19 14:25:53 +02:00
/// Advanced Video preferences subpage
2010-08-26 20:38:20 +02:00
Advanced_Video : : Advanced_Video ( wxTreebook * book , Preferences * parent ) : OptionPage ( book , parent , _ ( " Video " ) , PAGE_SUB ) {
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * expert = PageSizer ( _ ( " Expert " ) ) ;
2010-05-21 03:13:36 +02:00
2010-08-02 08:31:38 +02:00
wxArrayString vp_choice = vec_to_arrstr ( VideoProviderFactory : : GetClasses ( ) ) ;
2010-07-19 19:53:29 +02:00
OptionChoice ( expert , _ ( " Video provider " ) , vp_choice , " Video/Provider " ) ;
2010-05-21 03:13:36 +02:00
2010-08-02 08:31:38 +02:00
wxArrayString sp_choice = vec_to_arrstr ( SubtitlesProviderFactory : : GetClasses ( ) ) ;
2010-07-19 19:53:29 +02:00
OptionChoice ( expert , _ ( " Subtitle provider " ) , sp_choice , " Subtitle/Provider " ) ;
2010-05-21 03:13:36 +02:00
2011-07-15 06:06:23 +02:00
# if defined(WIN32) || defined(_DEBUG)
2010-07-19 19:53:29 +02:00
wxFlexGridSizer * windows = PageSizer ( _ ( " Windows Specific " ) ) ;
OptionAdd ( windows , _ ( " Allow pre-2.56a Avisynth " ) , " Provider/Avisynth/Allow Ancient " ) ;
CellSkip ( windows ) ;
OptionAdd ( windows , _ ( " Avisynth memory limit " ) , " Provider/Avisynth/Memory Max " ) ;
2010-05-21 03:13:36 +02:00
# endif
2010-07-19 19:53:29 +02:00
SetSizerAndFit ( sizer ) ;
2010-07-18 18:33:32 +02:00
}