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

Qt4 - SPrefs, save the access-filter.

parent bddd76b0
...@@ -227,7 +227,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -227,7 +227,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
updateAudioOptions( int ) ); updateAudioOptions( int ) );
audioOutput = ui.outputModule; audioOutput = ui.outputModule;
//FIXME: use modules_Exists //TODO: use modules_Exists
#ifndef WIN32 #ifndef WIN32
CONFIG_GENERIC( "alsadev" , StringList , ui.alsaLabel, alsaDevice ); CONFIG_GENERIC( "alsadev" , StringList , ui.alsaLabel, alsaDevice );
CONFIG_GENERIC_FILE( "dspdev" , File , ui.OSSLabel, OSSDevice, CONFIG_GENERIC_FILE( "dspdev" , File , ui.OSSLabel, OSSDevice,
...@@ -319,9 +319,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -319,9 +319,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#else #else
ui.systemCodecBox->hide(); ui.systemCodecBox->hide();
#endif #endif
CONFIG_GENERIC( "timeshift-force", Bool, NULL, timeshiftBox ); /* Access Filters */
CONFIG_GENERIC( "dump-force", Bool, NULL, DumpBox ); qs_filter = qfu( config_GetPsz( p_intf, "access-filter" ) );
// CONFIG_GENERIC( "", Bool, NULL, RecordBox ); //FIXME activate record ui.timeshiftBox->setChecked( qs_filter.contains( "timeshift" ) );
ui.dumpBox->setChecked( qs_filter.contains( "dump" ) );
ui.recordBox->setChecked( qs_filter.contains( "record" ) );
ui.bandwidthBox->setChecked( qs_filter.contains( "bandwidth" ) );
timeshiftBox = ui.timeshiftBox;
recordBox = ui.recordBox;
dumpBox = ui.dumpBox;
bandwidthBox = ui.bandwidthBox;
END_SPREFS_CAT; END_SPREFS_CAT;
/* Interface Panel */ /* Interface Panel */
...@@ -348,6 +355,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -348,6 +355,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
} }
skinInterfaceButton = ui.skins; skinInterfaceButton = ui.skins;
qtInterfaceButton = ui.qt4; qtInterfaceButton = ui.qt4;
delete psz_intf;
CONFIG_GENERIC( "qt-always-video", Bool, NULL, qtAlwaysVideo ); CONFIG_GENERIC( "qt-always-video", Bool, NULL, qtAlwaysVideo );
CONFIG_GENERIC_FILE( "skins2-last", File, NULL, fileSkin, CONFIG_GENERIC_FILE( "skins2-last", File, NULL, fileSkin,
...@@ -435,6 +443,22 @@ void SPrefsPanel::apply() ...@@ -435,6 +443,22 @@ void SPrefsPanel::apply()
config_PutPsz( p_intf, "vcd", psz_devicepath ); config_PutPsz( p_intf, "vcd", psz_devicepath );
config_PutPsz( p_intf, "cd-audio", psz_devicepath ); config_PutPsz( p_intf, "cd-audio", psz_devicepath );
} }
bool b_first = true;
#define saveBox( name, box ) {\
if( box->isChecked() ) { \
if( b_first ) { \
qs_filter.append( name ); \
b_first = false; \
} \
else qs_filter.append( ":" ).append( name ); \
} }
saveBox( "record", recordBox );
saveBox( "dump", dumpBox );
saveBox( "timeshift", timeshiftBox );
saveBox( "bandwidth", bandwidthBox );
config_PutPsz( p_intf, "access-filter", qtu( qs_filter ) );
} }
/* Interfaces */ /* Interfaces */
...@@ -458,7 +482,8 @@ void SPrefsPanel::apply() ...@@ -458,7 +482,8 @@ void SPrefsPanel::apply()
{ {
if( qs_filter.contains( "volnorm" ) ) if( qs_filter.contains( "volnorm" ) )
{ {
/* The qs_filter not empty and contains "volnorm" that we have to remove */ /* The qs_filter not empty and contains "volnorm"
that we have to remove */
if( !b_normChecked ) if( !b_normChecked )
{ {
/* Ugly :D */ /* Ugly :D */
...@@ -467,7 +492,7 @@ void SPrefsPanel::apply() ...@@ -467,7 +492,7 @@ void SPrefsPanel::apply()
qs_filter.remove( "volnorm" ); qs_filter.remove( "volnorm" );
} }
} }
else /* qs_filter not empty, but doesn't have volnorm inside already */ else /* qs_filter not empty, but doesn't have volnorm inside */
if( b_normChecked ) qs_filter.append( ":volnorm" ); if( b_normChecked ) qs_filter.append( ":volnorm" );
} }
config_PutPsz( p_intf, "audio-filter", qtu( qs_filter ) ); config_PutPsz( p_intf, "audio-filter", qtu( qs_filter ) );
......
...@@ -85,6 +85,7 @@ private: ...@@ -85,6 +85,7 @@ private:
QRadioButton *qtInterfaceButton; QRadioButton *qtInterfaceButton;
QString qs_filter; QString qs_filter;
QCheckBox *normalizerBox; QCheckBox *normalizerBox;
QCheckBox *recordBox, *dumpBox, *bandwidthBox, *timeshiftBox;
/* Display only the options for the selected audio output */ /* Display only the options for the selected audio output */
private slots: private slots:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>422</width> <width>508</width>
<height>478</height> <height>478</height>
</rect> </rect>
</property> </property>
...@@ -14,12 +14,21 @@ ...@@ -14,12 +14,21 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>10</number> <number>10</number>
</property> </property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item> <item>
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="title" > <property name="title" >
...@@ -52,10 +61,22 @@ ...@@ -52,10 +61,22 @@
<string>_("Network")</string> <string>_("Network")</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="2" column="0" colspan="2" > <item row="2" column="0" colspan="2" >
...@@ -93,12 +114,12 @@ ...@@ -93,12 +114,12 @@
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight</set> <set>Qt::AlignRight</set>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" > <property name="value" >
<number>1234</number> <number>1234</number>
</property> </property>
...@@ -120,10 +141,22 @@ ...@@ -120,10 +141,22 @@
<string>_("Codecs / Muxers")</string> <string>_("Codecs / Muxers")</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
...@@ -138,12 +171,12 @@ ...@@ -138,12 +171,12 @@
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight</set> <set>Qt::AlignRight</set>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" > <property name="value" >
<number>6</number> <number>6</number>
</property> </property>
...@@ -182,12 +215,21 @@ ...@@ -182,12 +215,21 @@
<string>_("Access Filter")</string> <string>_("Access Filter")</string>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item> <item>
<widget class="QCheckBox" name="timeshiftBox" > <widget class="QCheckBox" name="timeshiftBox" >
<property name="text" > <property name="text" >
...@@ -196,19 +238,26 @@ ...@@ -196,19 +238,26 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="RecordBox" > <widget class="QCheckBox" name="recordBox" >
<property name="text" > <property name="text" >
<string>_("Record")</string> <string>_("Record")</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="DumpBox" > <widget class="QCheckBox" name="dumpBox" >
<property name="text" > <property name="text" >
<string>_("Dump")</string> <string>_("Dump")</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="bandwidthBox" >
<property name="text" >
<string>_("Bandwidth limiter")</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -225,8 +274,8 @@ ...@@ -225,8 +274,8 @@
<tabstop>RTSP_TCPBox</tabstop> <tabstop>RTSP_TCPBox</tabstop>
<tabstop>systemCodecBox</tabstop> <tabstop>systemCodecBox</tabstop>
<tabstop>timeshiftBox</tabstop> <tabstop>timeshiftBox</tabstop>
<tabstop>RecordBox</tabstop> <tabstop>recordBox</tabstop>
<tabstop>DumpBox</tabstop> <tabstop>dumpBox</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>
......
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