Commit 9892a1ce authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed caching preferences (refs #5994)

also includes a minor fix to make room for the wordy German l10n
parent 20b891eb
...@@ -604,24 +604,20 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na ...@@ -604,24 +604,20 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100]; [[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100];
[[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200]; [[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200];
[[o_input_cachelevel_pop itemAtIndex: 3] setTag: 300]; [[o_input_cachelevel_pop itemAtIndex: 3] setTag: 300];
[[o_input_cachelevel_pop itemAtIndex: 4] setTag: 400]; [[o_input_cachelevel_pop itemAtIndex: 4] setTag: 500];
[[o_input_cachelevel_pop itemAtIndex: 5] setTag: 500]; [[o_input_cachelevel_pop itemAtIndex: 5] setTag: 1000];
#define TestCaC( name ) \ #define TestCaC( name, factor ) \
b_cache_equal = b_cache_equal && \ b_cache_equal = b_cache_equal && \
( i_cache == config_GetInt( p_intf, name ) ) ( i_cache * factor == config_GetInt( p_intf, name ) );
#define TestCaCi( name, int ) \
b_cache_equal = b_cache_equal && \
( ( i_cache * int ) == config_GetInt( p_intf, name ) )
/* Select the accurate value of the PopupButton */ /* Select the accurate value of the PopupButton */
bool b_cache_equal = true; bool b_cache_equal = true;
int i_cache = config_GetInt( p_intf, "file-caching"); int i_cache = config_GetInt( p_intf, "file-caching");
TestCaC( "network-caching" ); TestCaC( "network-caching", 10/3 );
TestCaC( "disc-caching" ); TestCaC( "disc-caching", 1 );
TestCaC( "live-caching" ); TestCaC( "live-caching", 1 );
if( b_cache_equal ) if( b_cache_equal )
{ {
[o_input_cachelevel_pop selectItemWithTag: i_cache]; [o_input_cachelevel_pop selectItemWithTag: i_cache];
...@@ -632,6 +628,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na ...@@ -632,6 +628,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[o_input_cachelevel_pop selectItemWithTitle: _NS("Custom")]; [o_input_cachelevel_pop selectItemWithTitle: _NS("Custom")];
[o_input_cachelevel_custom_txt setHidden: NO]; [o_input_cachelevel_custom_txt setHidden: NO];
} }
#undef TestCaC
/********************* /*********************
* subtitle settings * * subtitle settings *
...@@ -928,8 +925,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -928,8 +925,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
config_PutInt( p_intf, "mkv-preload-local-dir", [o_input_mkv_preload_dir_ckb state] ); config_PutInt( p_intf, "mkv-preload-local-dir", [o_input_mkv_preload_dir_ckb state] );
#define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] ) #define CaC( name, factor ) config_PutInt( p_intf, name, [[o_input_cachelevel_pop selectedItem] tag] * factor )
#define CaC( name ) CaCi( name, 1 )
if ( [[o_input_cachelevel_pop selectedItem] tag] == 0 ) if ( [[o_input_cachelevel_pop selectedItem] tag] == 0 )
{ {
msg_Dbg( p_intf, "Custom chosen, not adjusting cache values" ); msg_Dbg( p_intf, "Custom chosen, not adjusting cache values" );
...@@ -937,11 +933,12 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -937,11 +933,12 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
else else
{ {
msg_Dbg( p_intf, "Adjusting all cache values to: %i", (int)[[o_input_cachelevel_pop selectedItem] tag] ); msg_Dbg( p_intf, "Adjusting all cache values to: %i", (int)[[o_input_cachelevel_pop selectedItem] tag] );
CaC( "file-caching" ); CaC( "file-caching", 1 );
CaC( "network-caching" ); CaC( "network-caching", 10/3 );
CaC( "disc-caching" ); CaC( "disc-caching", 1 );
CaC( "live-caching" ); CaC( "live-caching", 1 );
} }
#undef CaC
b_inputSettingChanged = NO; b_inputSettingChanged = NO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment