Commit c05d2ce6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

qt4 - SPrefs: define a caching general value ( Custom, lowest, low, normal,...

qt4 - SPrefs: define a caching general value ( Custom, lowest, low, normal, high, highest) that control all the caching values in the preferences for dummies.
Preferences for dummies should now be finished. ref #603

parent 72a25f19
...@@ -285,7 +285,6 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -285,7 +285,6 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
/* Input and Codecs Panel Implementation */ /* Input and Codecs Panel Implementation */
START_SPREFS_CAT( InputAndCodecs, qtr("Input & Codecs settings") ); START_SPREFS_CAT( InputAndCodecs, qtr("Input & Codecs settings") );
/* Disk Devices */ /* Disk Devices */
{ {
ui.DVDDevice->setToolTip( ui.DVDDevice->setToolTip(
...@@ -307,17 +306,6 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -307,17 +306,6 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort ); CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort );
CONFIG_GENERIC( "http-proxy", String , NULL, proxy ); CONFIG_GENERIC( "http-proxy", String , NULL, proxy );
/* Caching */
#define addToCachingBox( str, cachingNumber ) \
ui.cachingCombo->addItem( str, QVariant( cachingNumber ) );
addToCachingBox( "Custom", CachingCustom );
addToCachingBox( "Lowest latency", CachingLowest );
addToCachingBox( "Low latency", CachingLow );
addToCachingBox( "Normal", CachingNormal );
addToCachingBox( "High latency", CachingHigh );
addToCachingBox( "Higher latency", CachingHigher );
CONFIG_GENERIC_NO_BOOL( "ffmpeg-pp-q", Integer, NULL, PostProcLevel ); CONFIG_GENERIC_NO_BOOL( "ffmpeg-pp-q", Integer, NULL, PostProcLevel );
CONFIG_GENERIC( "avi-index", IntegerList, NULL, AviRepair ); CONFIG_GENERIC( "avi-index", IntegerList, NULL, AviRepair );
CONFIG_GENERIC( "rtsp-tcp", Bool, NULL, RTSP_TCPBox ); CONFIG_GENERIC( "rtsp-tcp", Bool, NULL, RTSP_TCPBox );
...@@ -339,8 +327,44 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -339,8 +327,44 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
optionWidgets.append( ui.timeshiftBox ); optionWidgets.append( ui.timeshiftBox );
optionWidgets.append( ui.DVDDevice ); optionWidgets.append( ui.DVDDevice );
optionWidgets.append( ui.cachingCombo ); optionWidgets.append( ui.cachingCombo );
END_SPREFS_CAT;
/* Caching */
/* Add the things to the ComboBox */
#define addToCachingBox( str, cachingNumber ) \
ui.cachingCombo->addItem( str, QVariant( cachingNumber ) );
addToCachingBox( "Custom", CachingCustom );
addToCachingBox( "Lowest latency", CachingLowest );
addToCachingBox( "Low latency", CachingLow );
addToCachingBox( "Normal", CachingNormal );
addToCachingBox( "High latency", CachingHigh );
addToCachingBox( "Higher latency", CachingHigher );
#define TestCaC( name ) \
b_cache_equal = b_cache_equal && ( i_cache == 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 ComboBox */
bool b_cache_equal = true;
int i_cache = config_GetInt( p_intf, "file-caching");
TestCaC( "udp-caching" ) TestCaC( "dvdread-caching" )
TestCaC( "dvdnav-caching" ) TestCaC( "tcp-caching" )
TestCaC( "fake-caching" ) TestCaC( "cdda-caching" )
TestCaC( "screen-caching" ) TestCaC( "vcd-caching" )
#ifdef WIN32
TestCaC( "dshow-caching" )
#else
TestCaC( "v4l-caching" ) TestCaC( "jack-input-caching" )
TestCaC( "v4l2-caching" ) TestCaC( "pvr-caching" )
#endif
TestCaCi( "rtsp-caching", 4 ) TestCaCi( "ftp-caching", 2 )
TestCaCi( "http-caching", 4 ) TestCaCi( "realrtsp-caching", 10 )
TestCaCi( "mms-caching", 19 )
if( b_cache_equal )
ui.cachingCombo->setCurrentIndex( ui.cachingCombo->findData( QVariant( i_cache ) ) );
END_SPREFS_CAT;
/******************* /*******************
* Interface Panel * * Interface Panel *
*******************/ *******************/
...@@ -459,16 +483,36 @@ void SPrefsPanel::apply() ...@@ -459,16 +483,36 @@ void SPrefsPanel::apply()
} } } }
bool b_first = true; bool b_first = true;
qs_filter.clear();
saveBox( "record", qobject_cast<QCheckBox *>(optionWidgets[recordChB]) ); saveBox( "record", qobject_cast<QCheckBox *>(optionWidgets[recordChB]) );
saveBox( "dump", qobject_cast<QCheckBox *>(optionWidgets[dumpChB]) ); saveBox( "dump", qobject_cast<QCheckBox *>(optionWidgets[dumpChB]) );
saveBox( "timeshift", qobject_cast<QCheckBox *>(optionWidgets[timeshiftChB]) ); saveBox( "timeshift", qobject_cast<QCheckBox *>(optionWidgets[timeshiftChB]) );
saveBox( "bandwidth", qobject_cast<QCheckBox *>(optionWidgets[bandwidthChB] ) ); saveBox( "bandwidth", qobject_cast<QCheckBox *>(optionWidgets[bandwidthChB] ) );
config_PutPsz( p_intf, "access-filter", qtu( qs_filter ) ); config_PutPsz( p_intf, "access-filter", qtu( qs_filter ) );
QComboBox *cachingCombo = qobject_cast<QComboBox *>(optionWidgets[cachingCoB]); #define CaCi( name, int ) config_PutInt( p_intf, name, int * i_comboValue );
#define CaC( name ) CaCi( name, 1 );
/* Caching */ /* Caching */
msg_Dbg( p_intf, "%i", QComboBox *cachingCombo = qobject_cast<QComboBox *>(optionWidgets[cachingCoB]);
cachingCombo->itemData( cachingCombo->currentIndex() ).toInt() ); int i_comboValue = cachingCombo->itemData( cachingCombo->currentIndex() ).toInt();
if( i_comboValue )
{
msg_Dbg( p_intf, "Adjusting all the cache values at level: %i", i_comboValue );
CaC( "udp-caching" ); CaC( "dvdread-caching" );
CaC( "dvdnav-caching" ); CaC( "tcp-caching" ); CaC( "vcd-caching" );
CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
CaC( "screen-caching" );
CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
CaCi( "http-caching", 4 ); CaCi( "realrtsp-caching", 10 );
CaCi( "mms-caching", 19 );
#ifdef WIN32
CaC( "dshow-caching" );
#else
CaC( "v4l-caching" ); CaC( "jack-input-caching" ); CaC( "v4l2-caching" );
CaC( "pvr-caching" );
#endif
//CaCi( "dv-caching" ) too short...
}
} }
/* Interfaces */ /* Interfaces */
......
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