Ticket #3152: filter_gui.2.patch

File filter_gui.2.patch, 77.0 KB (added by Marc Alban <marcalban@…>, 15 years ago)

Updates the filter configuration screen patch with a wide theme file and several fixes pointed out by gbee. Also, the screenshots at http://www.mythtv.org/wiki/Filter_Wizard have been updated.

  • mythtv/filters/linearblend/filter_linearblend.c

     
    372372    {
    373373        symbol:     "new_filter",
    374374        name:       "linearblend",
    375         descript:   "fast blending deinterlace filter",
     375        descript:   "Fast blending deinterlace filter.",
    376376        formats:    FmtList,
    377377        libname:    NULL
    378378    },
  • mythtv/filters/quickdnr/filter_quickdnr.c

     
    590590    {
    591591        symbol:     "new_filter",
    592592        name:       "quickdnr",
    593         descript:   "removes noise with a fast single/double thresholded average filter",
     593        descript:   "Removes noise with a fast single/double thresholded average filter.",
    594594        formats:    FmtList,
    595595        libname:    NULL
    596596    },
  • mythtv/filters/postprocess/filter_postprocess.c

     
    134134    {
    135135        symbol:     "new_filter",
    136136        name:       "postprocess",
    137         descript:   "FFMPEG's postprocessing filters",
     137        descript:   "FFMPEG's postprocessing filters.",
    138138        formats:    FmtList,
    139139        libname:    NULL
    140140    },
  • mythtv/filters/onefield/filter_onefield.c

     
    9797    {
    9898        symbol:     "new_filter",
    9999        name:       "onefield",
    100         descript:   "one-field-only deinterlace filter; parameter \"bottom\" for bottom field, otherwise top",
     100        descript:   "One-field-only deinterlace filter.",
    101101        formats:    FmtList,
    102         libname:    NULL,
     102        libname:    NULL
    103103    },
    104104    FILT_NULL
    105105};
  • mythtv/filters/bobdeint/filter_bobdeint.c

     
    143143    {
    144144        symbol:     "new_filter",
    145145        name:       "bobdeint",
    146         descript:   "bob deinterlace filter; splits fields to top and bottom of buffer",
     146        descript:   "Bob deinterlace filter; splits fields to top and bottom of buffer.",
    147147        formats:    FmtList,
    148         libname:    NULL,
     148        libname:    NULL
    149149    },
    150150    FILT_NULL
    151151};
  • mythtv/filters/adjust/filter_adjust.c

     
    314314    {
    315315        symbol:     "newAdjustFilter",
    316316        name:       "adjust",
    317         descript:   "adjust range and gamma of video",
     317        descript:   "Adjust range and gamma of video.",
    318318        formats:    FmtList,
    319319        libname:    NULL
    320320    },
  • mythtv/filters/yadif/filter_yadif.c

     
    725725    {
    726726            symbol:     "YadifDeintFilter",
    727727            name:       "yadifdeint",
    728             descript:   "combines data from several fields to deinterlace with less motion blur",
     728            descript:   "Combines data from several fields to deinterlace with less motion blur.",
    729729            formats:    FmtList,
    730730            libname:    NULL
    731731    },
    732732    {
    733733            symbol:     "YadifDeintFilter",
    734734            name:       "yadifdoubleprocessdeint",
    735             descript:   "combines data from several fields to deinterlace with less motion blur",
     735            descript:   "Combines data from several fields to deinterlace with less motion blur.",
    736736            formats:    FmtList,
    737737            libname:    NULL
    738738    },FILT_NULL
  • mythtv/filters/force/filter_force.c

     
    100100    {
    101101        symbol:     "new_force_yv12",
    102102        name:       "forceyv12",
    103         descript:   "forces use of YV12 video format",
     103        descript:   "Forces use of YV12 video format.",
    104104        formats:    Fmt_List_YV12,
    105105        libname:    NULL
    106106    },
    107107    {
    108108        symbol:     "new_force_yuv422p",
    109109        name:       "forceyuv422p",
    110         descript:   "forces use of YUV422P video format",
     110        descript:   "forces use of YUV422P video format.",
    111111        formats:    Fmt_List_YUV422P,
    112112        libname:    NULL
    113113    },
    114114    {
    115115        symbol:     "new_force_rgb24",
    116116        name:       "forcergb24",
    117         descript:   "forces use of RGB24 video format",
     117        descript:   "Forces use of RGB24 video format.",
    118118        formats:    Fmt_List_RGB24,
    119119        libname:    NULL
    120120    },
    121121    {
    122122        symbol:     "new_force_argb32",
    123123        name:       "forceargb32",
    124         descript:   "forces use of ARGB32 video format",
     124        descript:   "Forces use of ARGB32 video format.",
    125125        formats:    Fmt_List_ARGB32,
    126126        libname:    NULL
    127127    },
  • mythtv/filters/crop/filter_crop.c

     
    303303    {
    304304        symbol:     "new_filter",
    305305        name:       "crop",
    306         descript:   "crops picture by macroblock intervals",
     306        descript:   "Crops picture by macroblock intervals.",
    307307        formats:    FmtList,
    308308        libname:    NULL
    309309    },
  • mythtv/filters/kerneldeint/filter_kerneldeint.c

     
    665665    {
    666666        symbol:     "NewKernelDeintFilter",
    667667        name:       "kerneldeint",
    668         descript:   "combines data from several fields to deinterlace "
    669                     "with less motion blur",
     668        descript:   "Combines data from several fields to deinterlace "
     669                    "with less motion blur.",
    670670        formats:    FmtList,
    671671        libname:    NULL
    672672    },
  • mythtv/filters/ivtc/filter_ivtc.c

     
    253253    {
    254254        symbol:     "NewIvtcFilter",
    255255        name:       "ivtc",
    256         descript:   "inverse telecine filter",
     256        descript:   "Inverse telecine filter.",
    257257        formats:    FmtList,
    258258        libname:    NULL   
    259259    },
  • mythtv/filters/invert/filter_invert.c

     
    7979    {
    8080        symbol:     "new_filter",
    8181        name:       "invert",
    82         descript:   "inverts the colors of the input video",
     82        descript:   "Inverts the colors of the input video.",
    8383        formats:    FmtList,
    8484        libname:    NULL
    8585    },
  • mythtv/filters/greedyhdeint/filter_greedyhdeint.c

     
    275275    {
    276276            symbol:     "GreedyHDeintFilter",
    277277            name:       "greedyhdeint",
    278             descript:   "combines data from several fields to deinterlace with less motion blur",
     278            descript:   "Combines data from several fields to deinterlace with less motion blur.",
    279279            formats:    FmtList,
    280280            libname:    NULL
    281281    },
    282282    {
    283283            symbol:     "GreedyHDeintFilter",
    284284            name:       "greedyhdoubleprocessdeint",
    285             descript:   "combines data from several fields to deinterlace with less motion blur",
     285            descript:   "Combines data from several fields to deinterlace with less motion blur.",
    286286            formats:    FmtList,
    287287            libname:    NULL
    288288    },FILT_NULL
  • mythtv/filters/denoise3d/filter_denoise3d.c

     
    473473    {
    474474        symbol:     "NewDenoise3DFilter",
    475475        name:       "denoise3d",
    476         descript:   "removes noise with a spatial and temporal low-pass filter",
     476        descript:   "Removes noise with a spatial and temporal low-pass filter.",
    477477        formats:    FmtList,
    478478        libname:    NULL
    479479    },
  • mythtv/themes/default/filters-ui.xml

     
     1<mythuitheme>
     2    <window name="filterlist">
     3        <textarea name="heading">
     4            <area>30,10,740,40</area>
     5            <font>baselarge</font>
     6            <value>Filter Configuration</value>
     7        </textarea>
     8       
     9        <shape name="background">
     10            <area>10,50,780,280</area>
     11            <type>roundbox</type>
     12            <fill color="#000000" alpha="90" />
     13            <line color="#FFFFFF" alpha="255" width="2" />
     14            <cornerradius>12</cornerradius>
     15        </shape>
     16       
     17        <buttonlist name="filters" from="basebuttonlist2">
     18            <position>10,63</position>
     19        </buttonlist>
     20       
     21        <button name="addfilter" from="basebutton">
     22            <position>20,345</position>
     23            <value>Add Filter</value>
     24        </button>
     25       
     26        <textarea name="helplabel">
     27            <area>30,400,740,30</area>
     28            <font>basemedium</font>
     29        </textarea>
     30        <textarea name="helptext">
     31            <area>40,440,730,140</area>
     32            <multiline>yes</multiline>
     33        </textarea>
     34    </window>
     35   
     36    <window name ="cropscreen" >
     37        <textarea name="heading">
     38            <area>30,10,740,40</area>
     39            <font>baselarge</font>
     40        </textarea>
     41       
     42        <textarea name="helptext">
     43            <area>40,440,730,140</area>
     44            <multiline>yes</multiline>
     45        </textarea>
     46       
     47        <button name="cancelbutton" from="basebutton">
     48            <position>30,520</position>
     49            <value>Cancel</value>
     50        </button>
     51       
     52        <button name="acceptbutton" from="basebutton">
     53            <position>600,520</position>
     54            <value>Accept</value>
     55        </button>
     56   
     57        <textarea name="toplabel" from="basetextarea">
     58            <area>30,70,200,25</area>
     59            <value>Top:</value>
     60        </textarea>
     61       
     62        <textarea name= "leftlabel" from="toplabel">
     63            <position>30, 150</position>
     64            <value>Left:</value>
     65        </textarea>
     66       
     67        <textarea name= "bottomlabel" from="toplabel">
     68            <position>30, 230</position>
     69            <value>Bottom:</value>
     70        </textarea>
     71       
     72        <textarea name= "rightlabel" from="toplabel">
     73            <position>30, 310</position>
     74            <value>Right:</value>
     75        </textarea>
     76       
     77        <spinbox name="topvalue" from="basespinbox">
     78            <position>240, 60</position>
     79            <helptext>Amount to crop on top as number of 16 pixel blocks.</helptext>
     80        </spinbox>
     81       
     82        <spinbox name="leftvalue" from="topvalue">
     83            <position>240, 140</position>
     84            <helptext>Amount to crop on left as number of 16 pixel blocks.</helptext>
     85        </spinbox>
     86       
     87        <spinbox name="bottomvalue" from="topvalue">
     88            <position>240, 220</position>
     89            <helptext>Amount to crop on bottom as number of 16 pixel blocks.</helptext>
     90        </spinbox>
     91       
     92        <spinbox name="rightvalue" from="topvalue">
     93            <position>240, 300</position>
     94            <helptext>Amount to crop on right as number of 16 pixel blocks.</helptext>
     95        </spinbox>
     96    </window>
     97   
     98    <window name ="onefieldscreen" >
     99        <textarea name="heading">
     100            <area>30,10,740,40</area>
     101            <font>baselarge</font>
     102        </textarea>
     103       
     104        <textarea name="helptext">
     105            <area>40,440,730,140</area>
     106            <multiline>yes</multiline>
     107        </textarea>
     108       
     109        <button name="cancelbutton" from="basebutton">
     110            <position>30,520</position>
     111            <value>Cancel</value>
     112        </button>
     113       
     114        <button name="acceptbutton" from="basebutton">
     115            <position>600,520</position>
     116            <value>Accept</value>
     117        </button>
     118   
     119        <textarea name="fieldlabel" from="basetextarea">
     120            <area>30,70,200,25</area>
     121            <value>Keep Bottom Field:</value>
     122        </textarea>
     123       
     124        <checkbox name="fieldvalue" from="basecheckbox">
     125            <position>240, 60</position>
     126            <helptext>Keep the bottom field instead of the top one.</helptext>
     127        </checkbox>
     128    </window>
     129   
     130    <window name ="denoise3dscreen" >
     131        <textarea name="heading">
     132            <area>30,10,740,40</area>
     133            <font>baselarge</font>
     134        </textarea>
     135       
     136        <textarea name="helptext">
     137            <area>40,440,730,140</area>
     138            <multiline>yes</multiline>
     139        </textarea>
     140       
     141        <button name="cancelbutton" from="basebutton">
     142            <position>30,520</position>
     143            <value>Cancel</value>
     144        </button>
     145       
     146        <button name="acceptbutton" from="basebutton">
     147            <position>600,520</position>
     148            <value>Accept</value>
     149        </button>
     150       
     151        <textarea name="defaultlabel" from="basetextarea">
     152            <area>30,70,200,25</area>
     153            <value>Use Defaults:</value>
     154        </textarea>
     155       
     156        <checkbox name="defaultvalue" from="basecheckbox">
     157            <position>240, 65</position>
     158            <helptext>Use the default parameters.</helptext>
     159        </checkbox>
     160   
     161        <textarea name="lumaspatiallabel" from="basetextarea">
     162            <area>30,150,350,25</area>
     163            <value>Luma Spatial Filter Strength:</value>
     164        </textarea>
     165       
     166        <textarea name= "chromaspatiallabel" from="lumaspatiallabel">
     167            <position>30, 230</position>
     168            <value>Chroma Spatial Filter Strength:</value>
     169        </textarea>
     170       
     171        <textarea name= "lumatemporallabel" from="lumaspatiallabel">
     172            <position>30, 310</position>
     173            <value>Luma Temporal Filter Strength:</value>
     174        </textarea>
     175       
     176        <spinbox name="lumaspatialvalue" from="basespinbox">
     177            <position>390, 140</position>
     178            <helptext>Luma spatial filter strength.</helptext>
     179        </spinbox>
     180       
     181        <spinbox name="chromaspatialvalue" from="lumaspatialvalue">
     182            <position>390, 220</position>
     183            <helptext>Chroma spatial filter strength.</helptext>
     184        </spinbox>
     185       
     186        <spinbox name="lumatemporalvalue" from="lumaspatialvalue">
     187            <position>390, 300</position>
     188            <helptext>Luma temporal filter strength.</helptext>
     189        </spinbox>
     190    </window>
     191   
     192    <window name ="adjustscreen" >
     193        <textarea name="heading">
     194            <area>30,10,740,40</area>
     195            <font>baselarge</font>
     196        </textarea>
     197       
     198        <textarea name="helptext">
     199            <area>40,440,730,140</area>
     200            <multiline>yes</multiline>
     201        </textarea>
     202       
     203        <button name="cancelbutton" from="basebutton">
     204            <position>30,520</position>
     205            <value>Cancel</value>
     206        </button>
     207       
     208        <button name="acceptbutton" from="basebutton">
     209            <position>600,520</position>
     210            <value>Accept</value>
     211        </button>
     212       
     213        <textarea name="defaultlabel" from="basetextarea">
     214            <area>30,70,200,25</area>
     215            <value>Use Defaults:</value>
     216        </textarea>
     217       
     218        <checkbox name="defaultvalue" from="basecheckbox">
     219            <position>240, 65</position>
     220            <helptext>Use the default parameters.</helptext>
     221        </checkbox>
     222   
     223        <textarea name="minlumalabel" from="basetextarea">
     224            <area>30,150,350,25</area>
     225            <value>Min Luma:</value>
     226        </textarea>
     227       
     228        <textarea name= "maxlumalabel" from="minlumalabel">
     229            <position>30, 230</position>
     230            <value>Max Luma:</value>
     231        </textarea>
     232       
     233        <textarea name= "lumagammalabel" from="minlumalabel">
     234            <position>30, 310</position>
     235            <value>Luma Gamma:</value>
     236        </textarea>
     237       
     238        <textarea name="minchromalabel" from="minlumalabel">
     239            <position>390, 150</position>
     240            <value>Min Chroma:</value>
     241        </textarea>
     242       
     243        <textarea name= "maxchromalabel" from="minlumalabel">
     244            <position>390, 230</position>
     245            <value>Max Chroma:</value>
     246        </textarea>
     247       
     248        <textarea name= "chromagammalabel" from="minlumalabel">
     249            <position>390, 310</position>
     250            <value>Chroma Gamma:</value>
     251        </textarea>
     252       
     253        <spinbox name="minlumavalue" from="basespinbox">
     254            <position>250, 140</position>
     255            <helptext>Minimum luma input value.</helptext>
     256        </spinbox>
     257       
     258        <spinbox name="maxlumavalue" from="minlumavalue">
     259            <position>250, 220</position>
     260            <helptext>Maximum luma input value.</helptext>
     261        </spinbox>
     262       
     263        <spinbox name="lumagammavalue" from="minlumavalue">
     264            <position>250, 300</position>
     265            <helptext>Luma gamma correction.</helptext>
     266        </spinbox>
     267       
     268        <spinbox name="minchromavalue" from="minlumavalue">
     269            <position>610, 140</position>
     270            <helptext>Minimum chroma input value.</helptext>
     271        </spinbox>
     272       
     273        <spinbox name="maxchromavalue" from="minlumavalue">
     274            <position>610, 220</position>
     275            <helptext>Maximum chroma input value.</helptext>
     276        </spinbox>
     277       
     278        <spinbox name="chromagammavalue" from="minlumavalue">
     279            <position>610, 300</position>
     280            <helptext>Chroma gamma correction.</helptext>
     281        </spinbox>
     282    </window>
     283   
     284    <window name ="customfilterscreen" >
     285        <textarea name="heading">
     286            <area>30,10,740,40</area>
     287            <font>baselarge</font>
     288        </textarea>
     289       
     290        <textarea name="helptext">
     291            <area>40,440,730,140</area>
     292            <multiline>yes</multiline>
     293        </textarea>
     294       
     295        <button name="cancelbutton" from="basebutton">
     296            <position>30,520</position>
     297            <value>Cancel</value>
     298        </button>
     299       
     300        <button name="acceptbutton" from="basebutton">
     301            <position>600,520</position>
     302            <value>Accept</value>
     303        </button>
     304   
     305        <textarea name="optionslabel" from="basetextarea">
     306            <area>30,70,200,25</area>
     307            <value>Filter Parameters:</value>
     308        </textarea>
     309       
     310        <textedit name="optionsinput" from="basetextedit">
     311            <position>240, 60</position>
     312        </textedit>
     313    </window>
     314</mythuitheme>
  • mythtv/themes/default-wide/filters-ui.xml

     
     1<mythuitheme>
     2    <window name="filterlist">
     3        <textarea name="heading">
     4            <area>20,5,570,40</area>
     5            <font>baselarge</font>
     6            <value>Filter Configuration</value>
     7        </textarea>
     8       
     9        <shape name="background">
     10            <area>20,49,1240,360</area>
     11            <type>roundbox</type>
     12            <fill color="#000000" alpha="90" />
     13            <line color="#FFFFFF" alpha="255" width="2" />
     14            <cornerradius>12</cornerradius>
     15        </shape>
     16       
     17        <buttonlist name="filters" from="basebuttonlist2">
     18            <position>25,56</position>
     19        </buttonlist>
     20       
     21        <button name="addfilter" from="basebutton">
     22            <position>20,430</position>
     23            <value>Add Filter</value>
     24        </button>
     25       
     26        <textarea name="helplabel">
     27            <area>30,480,740,40</area>
     28            <font>baselarge</font>
     29        </textarea>
     30        <textarea name="helptext">
     31            <area>40,520,1200,170</area>
     32            <multiline>yes</multiline>
     33        </textarea>
     34    </window>
     35   
     36    <window name ="cropscreen" >
     37        <textarea name="heading">
     38            <area>10,10,1260,40</area>
     39            <font>baselarge</font>
     40            <align>center</align>
     41        </textarea>
     42       
     43        <textarea name="helptext">
     44            <area>40,490,1200,140</area>
     45            <multiline>yes</multiline>
     46            <font>basemedium</font>
     47            <align>center</align>
     48        </textarea>
     49       
     50        <button name="cancelbutton" from="basebutton">
     51            <position>350,625</position>
     52            <value>Cancel</value>
     53        </button>
     54       
     55        <button name="acceptbutton" from="basebutton">
     56            <position>780,625</position>
     57            <value>Accept</value>
     58        </button>
     59   
     60        <textarea name="toplabel" from="basetextarea">
     61            <area>300,170,200,25</area>
     62            <align>right</align>
     63            <value>Top:</value>
     64        </textarea>
     65       
     66        <textarea name= "leftlabel" from="toplabel">
     67            <position>300, 250</position>
     68            <value>Left:</value>
     69        </textarea>
     70       
     71        <textarea name= "bottomlabel" from="toplabel">
     72            <position>300, 330</position>
     73            <value>Bottom:</value>
     74        </textarea>
     75       
     76        <textarea name= "rightlabel" from="toplabel">
     77            <position>300, 410</position>
     78            <value>Right:</value>
     79        </textarea>
     80       
     81        <spinbox name="topvalue" from="basespinbox">
     82            <position>780, 160</position>
     83            <helptext>Amount to crop on top as number of 16 pixel blocks.</helptext>
     84        </spinbox>
     85       
     86        <spinbox name="leftvalue" from="topvalue">
     87            <position>780, 240</position>
     88            <helptext>Amount to crop on left as number of 16 pixel blocks.</helptext>
     89        </spinbox>
     90       
     91        <spinbox name="bottomvalue" from="topvalue">
     92            <position>780, 320</position>
     93            <helptext>Amount to crop on bottom as number of 16 pixel blocks.</helptext>
     94        </spinbox>
     95       
     96        <spinbox name="rightvalue" from="topvalue">
     97            <position>780, 400</position>
     98            <helptext>Amount to crop on right as number of 16 pixel blocks.</helptext>
     99        </spinbox>
     100    </window>
     101   
     102    <window name ="onefieldscreen" >
     103        <textarea name="heading">
     104            <area>10,10,1260,40</area>
     105            <font>baselarge</font>
     106            <align>center</align>
     107        </textarea>
     108       
     109        <textarea name="helptext">
     110            <area>40,490,1200,140</area>
     111            <multiline>yes</multiline>
     112            <font>basemedium</font>
     113            <align>center</align>
     114        </textarea>
     115       
     116        <button name="cancelbutton" from="basebutton">
     117            <position>350,625</position>
     118            <value>Cancel</value>
     119        </button>
     120       
     121        <button name="acceptbutton" from="basebutton">
     122            <position>780,625</position>
     123            <value>Accept</value>
     124        </button>
     125   
     126        <textarea name="fieldlabel" from="basetextarea">
     127            <area>400,270,200,25</area>
     128            <value>Keep Bottom Field:</value>
     129            <align>right</align>
     130        </textarea>
     131       
     132        <checkbox name="fieldvalue" from="basecheckbox">
     133            <position>780, 260</position>
     134            <helptext>Keep the bottom field instead of the top one.</helptext>
     135        </checkbox>
     136    </window>
     137   
     138    <window name ="denoise3dscreen" >
     139        <textarea name="heading">
     140            <area>10,10,1260,40</area>
     141            <font>baselarge</font>
     142            <align>center</align>
     143        </textarea>
     144       
     145        <textarea name="helptext">
     146            <area>40,490,1200,140</area>
     147            <multiline>yes</multiline>
     148            <font>basemedium</font>
     149            <align>center</align>
     150        </textarea>
     151       
     152        <button name="cancelbutton" from="basebutton">
     153            <position>350,625</position>
     154            <value>Cancel</value>
     155        </button>
     156       
     157        <button name="acceptbutton" from="basebutton">
     158            <position>780,625</position>
     159            <value>Accept</value>
     160        </button>
     161       
     162        <textarea name="defaultlabel" from="basetextarea">
     163            <area>400,170,200,25</area>
     164            <value>Use Defaults:</value>
     165        </textarea>
     166       
     167        <checkbox name="defaultvalue" from="basecheckbox">
     168            <position>610, 165</position>
     169            <helptext>Use the default parameters.</helptext>
     170        </checkbox>
     171   
     172        <textarea name="lumaspatiallabel" from="basetextarea">
     173            <area>400,250,350,25</area>
     174            <value>Luma Spatial Filter Strength:</value>
     175        </textarea>
     176       
     177        <textarea name= "chromaspatiallabel" from="lumaspatiallabel">
     178            <position>400, 330</position>
     179            <value>Chroma Spatial Filter Strength:</value>
     180        </textarea>
     181       
     182        <textarea name= "lumatemporallabel" from="lumaspatiallabel">
     183            <position>400, 410</position>
     184            <value>Luma Temporal Filter Strength:</value>
     185        </textarea>
     186       
     187        <spinbox name="lumaspatialvalue" from="basespinbox">
     188            <position>760, 240</position>
     189            <helptext>Luma spatial filter strength.</helptext>
     190        </spinbox>
     191       
     192        <spinbox name="chromaspatialvalue" from="lumaspatialvalue">
     193            <position>760, 320</position>
     194            <helptext>Chroma spatial filter strength.</helptext>
     195        </spinbox>
     196       
     197        <spinbox name="lumatemporalvalue" from="lumaspatialvalue">
     198            <position>760, 400</position>
     199            <helptext>Luma temporal filter strength.</helptext>
     200        </spinbox>
     201    </window>
     202   
     203    <window name ="adjustscreen" >
     204        <textarea name="heading">
     205            <area>10,10,1260,40</area>
     206            <font>baselarge</font>
     207            <align>center</align>
     208        </textarea>
     209       
     210        <textarea name="helptext">
     211            <area>40,490,1200,140</area>
     212            <multiline>yes</multiline>
     213            <font>basemedium</font>
     214            <align>center</align>
     215        </textarea>
     216       
     217        <button name="cancelbutton" from="basebutton">
     218            <position>350,625</position>
     219            <value>Cancel</value>
     220        </button>
     221       
     222        <button name="acceptbutton" from="basebutton">
     223            <position>780,625</position>
     224            <value>Accept</value>
     225        </button>
     226       
     227        <textarea name="defaultlabel" from="basetextarea">
     228            <area>230,170,200,25</area>
     229            <value>Use Defaults:</value>
     230        </textarea>
     231       
     232        <checkbox name="defaultvalue" from="basecheckbox">
     233            <position>440, 165</position>
     234            <helptext>Use the default parameters.</helptext>
     235        </checkbox>
     236   
     237        <textarea name="minlumalabel" from="basetextarea">
     238            <area>230,250,350,25</area>
     239            <value>Min Luma:</value>
     240        </textarea>
     241       
     242        <textarea name= "maxlumalabel" from="minlumalabel">
     243            <position>230, 330</position>
     244            <value>Max Luma:</value>
     245        </textarea>
     246       
     247        <textarea name= "lumagammalabel" from="minlumalabel">
     248            <position>230, 410</position>
     249            <value>Luma Gamma:</value>
     250        </textarea>
     251       
     252        <textarea name="minchromalabel" from="minlumalabel">
     253            <position>760, 250</position>
     254            <value>Min Chroma:</value>
     255        </textarea>
     256       
     257        <textarea name= "maxchromalabel" from="minlumalabel">
     258            <position>760, 330</position>
     259            <value>Max Chroma:</value>
     260        </textarea>
     261       
     262        <textarea name= "chromagammalabel" from="minlumalabel">
     263            <position>760, 410</position>
     264            <value>Chroma Gamma:</value>
     265        </textarea>
     266       
     267        <spinbox name="minlumavalue" from="basespinbox">
     268            <position>450, 240</position>
     269            <helptext>Minimum luma input value.</helptext>
     270        </spinbox>
     271       
     272        <spinbox name="maxlumavalue" from="minlumavalue">
     273            <position>450, 320</position>
     274            <helptext>Maximum luma input value.</helptext>
     275        </spinbox>
     276       
     277        <spinbox name="lumagammavalue" from="minlumavalue">
     278            <position>450, 400</position>
     279            <helptext>Luma gamma correction.</helptext>
     280        </spinbox>
     281       
     282        <spinbox name="minchromavalue" from="minlumavalue">
     283            <position>980, 240</position>
     284            <helptext>Minimum chroma input value.</helptext>
     285        </spinbox>
     286       
     287        <spinbox name="maxchromavalue" from="minlumavalue">
     288            <position>980, 320</position>
     289            <helptext>Maximum chroma input value.</helptext>
     290        </spinbox>
     291       
     292        <spinbox name="chromagammavalue" from="minlumavalue">
     293            <position>980, 400</position>
     294            <helptext>Chroma gamma correction.</helptext>
     295        </spinbox>
     296    </window>
     297   
     298    <window name ="customfilterscreen" >
     299        <textarea name="heading">
     300            <area>10,10,1260,40</area>
     301            <font>baselarge</font>
     302            <align>center</align>
     303        </textarea>
     304       
     305        <textarea name="helptext">
     306            <area>40,490,1200,140</area>
     307            <multiline>yes</multiline>
     308            <font>basemedium</font>
     309            <align>center</align>
     310        </textarea>
     311       
     312        <button name="cancelbutton" from="basebutton">
     313            <position>350,625</position>
     314            <value>Cancel</value>
     315        </button>
     316       
     317        <button name="acceptbutton" from="basebutton">
     318            <position>780,625</position>
     319            <value>Accept</value>
     320        </button>
     321   
     322        <textarea name="optionslabel" from="basetextarea">
     323            <area>350,270,200,25</area>
     324            <value>Filter Parameters:</value>
     325            <align>right</align>
     326        </textarea>
     327       
     328        <textedit name="optionsinput" from="basetextedit">
     329            <position>570, 260</position>
     330        </textedit>
     331    </window>
     332</mythuitheme>
  • mythtv/libs/libmythtv/filterscreen.cpp

     
     1
     2#include "filterscreen.h"
     3#include "filtermanager.h"
     4#include "mythverbose.h"
     5
     6#include <mythscreenstack.h>
     7
     8/** \class FilterScreen
     9 *  \brief Provides an interface for configuring individual video filters.
     10 *
     11 *  FilterScreen displays a configuration screen for modifying the parameters
     12 *  of a video filter.
     13 */
     14FilterScreen::FilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     15  MythScreenType(parent, "FilterScreen"),
     16  m_filterName(filterName),
     17  m_filterParams(filterParams),
     18  m_edit(edit)
     19{
     20    m_heading = NULL;
     21    m_helpText = NULL;
     22    m_cancelButton = NULL;
     23    m_acceptButton = NULL;
     24}
     25
     26bool FilterScreen::CreateCommon()
     27{
     28    m_heading = dynamic_cast<MythUIText *>(GetChild("heading"));
     29    m_helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
     30    m_cancelButton = dynamic_cast<MythUIButton *>(GetChild("cancelbutton"));
     31    m_acceptButton = dynamic_cast<MythUIButton *>(GetChild("acceptbutton"));
     32   
     33    if (!m_helpText || !m_heading || !m_cancelButton || !m_acceptButton)
     34    {
     35        VERBOSE(VB_IMPORTANT, "FilterScreen, theme is missing "
     36                              "required elements");
     37        return false;
     38    }
     39       
     40    QString name(m_filterName);
     41    name[0] = name[0].toUpper();
     42    m_heading->SetText(tr("Configure") + ' ' + name + ' ' + tr("Filter"));
     43       
     44    connect(m_acceptButton, SIGNAL(Clicked()), SLOT(accept()));
     45    connect(m_cancelButton, SIGNAL(Clicked()), SLOT(Close()));
     46   
     47    return true;
     48}
     49
     50void FilterScreen::setHelpText()
     51{
     52    m_helpText->SetText(GetFocusWidget()->GetHelpText());
     53}
     54
     55bool CropScreen::Create()
     56{
     57    if (!LoadWindowFromXML("filters-ui.xml", "cropscreen", this))
     58        return false;
     59
     60    m_topValue = dynamic_cast<MythUISpinBox *>(GetChild("topvalue"));
     61    m_leftValue = dynamic_cast<MythUISpinBox *>(GetChild("leftvalue"));
     62    m_bottomValue = dynamic_cast<MythUISpinBox *>(GetChild("bottomvalue"));
     63    m_rightValue = dynamic_cast<MythUISpinBox *>(GetChild("rightvalue"));
     64
     65    if (!CreateCommon() || !m_topValue || !m_leftValue || !m_bottomValue || !m_rightValue)
     66    {   
     67        VERBOSE(VB_IMPORTANT, "CropScreen, theme is missing "
     68                              "required elements");
     69        return false;
     70    }
     71   
     72    connect(m_topValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     73    connect(m_leftValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     74    connect(m_bottomValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     75    connect(m_rightValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     76
     77    if (!Load())
     78        return false;
     79
     80    BuildFocusList();
     81
     82    return true;
     83}
     84
     85bool CropScreen::Load()
     86{
     87    QStringList arguments = m_filterParams.split(':');
     88   
     89    QString top = "1";
     90    QString left = "1";
     91    QString bottom = "1";
     92    QString right = "1";
     93   
     94    if (arguments.size() > 0 && !arguments[0].isEmpty())
     95          top = arguments[0];
     96    if (arguments.size() > 1)
     97        left = arguments[1];
     98    if (arguments.size() > 2)
     99        bottom = arguments[2];
     100    if (arguments.size() > 3)
     101        right = arguments[3];
     102       
     103    m_topValue->SetRange(0, 255, 1);
     104    m_topValue->SetValue(top);
     105   
     106    m_leftValue->SetRange(0, 255, 1);
     107    m_leftValue->SetValue(left);
     108   
     109    m_bottomValue->SetRange(0, 255, 1);
     110    m_bottomValue->SetValue(bottom);
     111   
     112    m_rightValue->SetRange(0, 255, 1);
     113    m_rightValue->SetValue(right);
     114   
     115    return true;
     116}
     117
     118void CropScreen::accept()
     119{
     120    QString filter(m_filterName);
     121    filter.append('=');
     122    filter.append(m_topValue->GetValue());
     123    filter.append(':');
     124    filter.append(m_leftValue->GetValue());
     125    filter.append(':');
     126    filter.append(m_bottomValue->GetValue());
     127    filter.append(':');
     128    filter.append(m_rightValue->GetValue());
     129   
     130    emit accepting(filter);
     131    Close();
     132}
     133
     134bool Denoise3dScreen::Create()
     135{
     136    if (!LoadWindowFromXML("filters-ui.xml", "denoise3dscreen", this))
     137        return false;
     138
     139    m_defaultValue = dynamic_cast<MythUICheckBox *>(GetChild("defaultvalue"));
     140    m_lumaSpatialLabel = dynamic_cast<MythUIText *>(GetChild("lumaspatiallabel"));
     141    m_chromaSpatialLabel = dynamic_cast<MythUIText *>(GetChild("chromaspatiallabel"));
     142    m_lumaTemporalLabel = dynamic_cast<MythUIText *>(GetChild("lumatemporallabel"));
     143    m_lumaSpatialValue = dynamic_cast<MythUISpinBox *>(GetChild("lumaspatialvalue"));
     144    m_chromaSpatialValue = dynamic_cast<MythUISpinBox *>(GetChild("chromaspatialvalue"));
     145    m_lumaTemporalValue = dynamic_cast<MythUISpinBox *>(GetChild("lumatemporalvalue"));
     146
     147    if (!CreateCommon() || !m_defaultValue || !m_lumaSpatialLabel || !m_chromaSpatialLabel ||
     148        !m_lumaTemporalLabel || !m_lumaSpatialValue || !m_chromaSpatialValue || !m_lumaTemporalValue)
     149    {   
     150        VERBOSE(VB_IMPORTANT, "Denoise3dScreen, theme is missing "
     151                              "required elements");
     152        return false;
     153    }
     154   
     155    connect(m_defaultValue, SIGNAL(valueChanged()), SLOT(useDefaults()));
     156    connect(m_defaultValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     157    connect(m_lumaSpatialValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     158    connect(m_chromaSpatialValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     159    connect(m_lumaTemporalValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     160
     161    if (!Load())
     162        return false;
     163
     164    BuildFocusList();
     165
     166    return true;
     167}
     168
     169bool Denoise3dScreen::Load()
     170{
     171    if (m_edit && m_filterParams.trimmed().isEmpty())
     172    {
     173        m_defaultValue->SetCheckState(MythUIStateType::Full);
     174    }
     175
     176    float lumaSpatialStrength = 0;
     177    float chromaSpatialStrength = 0;
     178    float lumaTemporalStrengh = 0;
     179
     180    QStringList arguments = m_filterParams.split(':');
     181       
     182    if (arguments.size() > 0  && !arguments[0].isEmpty())
     183          lumaSpatialStrength = arguments[0].toFloat() * 100;
     184    if (arguments.size() > 1)
     185        chromaSpatialStrength = arguments[1].toFloat() * 100;
     186    if (arguments.size() > 2)
     187        lumaTemporalStrengh = arguments[2].toFloat() * 100;
     188       
     189    m_lumaSpatialValue->SetRange(0, 100, 1);
     190    m_lumaSpatialValue->SetValue(lumaSpatialStrength);
     191   
     192    m_chromaSpatialValue->SetRange(0, 100, 1);
     193    m_chromaSpatialValue->SetValue(chromaSpatialStrength);
     194   
     195    m_lumaTemporalValue->SetRange(0, 100, 1);
     196    m_lumaTemporalValue->SetValue(lumaTemporalStrengh);
     197   
     198    return true;
     199}
     200
     201void Denoise3dScreen::useDefaults()
     202{
     203    bool visible = m_defaultValue->GetCheckState() != MythUIStateType::Full;
     204    m_lumaSpatialLabel->SetVisible(visible);
     205    m_chromaSpatialLabel->SetVisible(visible);
     206    m_lumaTemporalLabel->SetVisible(visible);
     207    m_lumaSpatialValue->SetVisible(visible);
     208    m_chromaSpatialValue->SetVisible(visible);
     209    m_lumaTemporalValue->SetVisible(visible);
     210}
     211
     212void Denoise3dScreen::accept()
     213{
     214    QString filter(m_filterName);
     215   
     216    if(m_defaultValue->GetCheckState() != MythUIStateType::Full)
     217    {
     218        filter.append('=');
     219        filter.append(QString::number(m_lumaSpatialValue->GetIntValue() / 100.0, 'g', 2));
     220        filter.append(':');
     221        filter.append(QString::number(m_chromaSpatialValue->GetIntValue() / 100.0, 'g', 2));
     222        filter.append(':');
     223        filter.append(QString::number(m_lumaTemporalValue->GetIntValue() / 100.0, 'g', 2));
     224    }
     225   
     226    emit accepting(filter);
     227    Close();
     228}
     229
     230bool AdjustScreen::Create()
     231{
     232    if (!LoadWindowFromXML("filters-ui.xml", "adjustscreen", this))
     233        return false;
     234
     235    m_defaultValue = dynamic_cast<MythUICheckBox *>(GetChild("defaultvalue"));
     236    m_minLumaLabel = dynamic_cast<MythUIText *>(GetChild("minlumalabel"));
     237    m_maxLumaLabel = dynamic_cast<MythUIText *>(GetChild("maxlumalabel"));
     238    m_lumaGammaLabel = dynamic_cast<MythUIText *>(GetChild("lumagammalabel"));
     239    m_minChromaLabel = dynamic_cast<MythUIText *>(GetChild("minchromalabel"));
     240    m_maxChromaLabel = dynamic_cast<MythUIText *>(GetChild("maxchromalabel"));
     241    m_chromaGammaLabel = dynamic_cast<MythUIText *>(GetChild("chromagammalabel"));
     242    m_minLumaValue = dynamic_cast<MythUISpinBox *>(GetChild("minlumavalue"));
     243    m_maxLumaValue = dynamic_cast<MythUISpinBox *>(GetChild("maxlumavalue"));
     244    m_lumaGammaValue = dynamic_cast<MythUISpinBox *>(GetChild("lumagammavalue"));
     245    m_minChromaValue = dynamic_cast<MythUISpinBox *>(GetChild("minchromavalue"));
     246    m_maxChromaValue = dynamic_cast<MythUISpinBox *>(GetChild("maxchromavalue"));
     247    m_chromaGammaValue = dynamic_cast<MythUISpinBox *>(GetChild("chromagammavalue"));
     248
     249    if (!CreateCommon() || !m_defaultValue || !m_minLumaLabel || !m_maxLumaLabel ||
     250        !m_lumaGammaLabel || !m_minChromaLabel || !m_maxChromaLabel || !m_chromaGammaLabel ||
     251        !m_minLumaValue || !m_maxLumaValue || !m_lumaGammaValue || !m_minChromaValue ||
     252        !m_maxChromaValue || !m_chromaGammaValue)
     253    {   
     254        VERBOSE(VB_IMPORTANT, "AdjustScreen, theme is missing "
     255                              "required elements");
     256        return false;
     257    }
     258   
     259    connect(m_defaultValue, SIGNAL(valueChanged()), SLOT(useDefaults()));
     260    connect(m_defaultValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     261    connect(m_minLumaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     262    connect(m_maxLumaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     263    connect(m_lumaGammaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     264    connect(m_minChromaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     265    connect(m_maxChromaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     266    connect(m_chromaGammaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     267
     268    if (!Load())
     269        return false;
     270
     271    BuildFocusList();
     272
     273    return true;
     274}
     275
     276bool AdjustScreen::Load()
     277{
     278    if (m_edit && m_filterParams.trimmed().isEmpty())
     279    {
     280        m_defaultValue->SetCheckState(MythUIStateType::Full);
     281    }
     282
     283    QString minLuma = "16";
     284    QString maxLuma = "253";
     285    float lumaGamma = 100;
     286    QString minChroma = "16";
     287    QString maxChroma = "240";
     288    float chromaGamma = 100;
     289
     290    QStringList arguments = m_filterParams.split(':');
     291       
     292    if (arguments.size() > 0  && !arguments[0].isEmpty())
     293          minLuma = arguments[0];
     294    if (arguments.size() > 1)
     295        maxLuma = arguments[1];
     296    if (arguments.size() > 2)
     297        lumaGamma = arguments[2].toFloat() * 100;
     298    if (arguments.size() > 3)
     299          minChroma = arguments[3];
     300    if (arguments.size() > 4)
     301        maxChroma = arguments[4];
     302    if (arguments.size() > 5)
     303        chromaGamma = arguments[5].toFloat() * 100;
     304       
     305    m_minLumaValue->SetRange(0, 255, 1);
     306    m_minLumaValue->SetValue(minLuma);
     307   
     308    m_maxLumaValue->SetRange(0, 255, 1);
     309    m_maxLumaValue->SetValue(maxLuma);
     310   
     311    m_lumaGammaValue->SetRange(0, 100, 1);
     312    m_lumaGammaValue->SetValue(lumaGamma);
     313   
     314    m_minChromaValue->SetRange(0, 255, 1);
     315    m_minChromaValue->SetValue(minChroma);
     316   
     317    m_maxChromaValue->SetRange(0, 255, 1);
     318    m_maxChromaValue->SetValue(maxChroma);
     319   
     320    m_chromaGammaValue->SetRange(0, 100, 1);
     321    m_chromaGammaValue->SetValue(chromaGamma);
     322   
     323    return true;
     324}
     325
     326void AdjustScreen::useDefaults()
     327{
     328    bool visible = m_defaultValue->GetCheckState() != MythUIStateType::Full;
     329
     330    m_minLumaLabel->SetVisible(visible);
     331    m_maxLumaLabel->SetVisible(visible);
     332    m_lumaGammaLabel->SetVisible(visible);
     333    m_minChromaLabel->SetVisible(visible);
     334    m_maxChromaLabel->SetVisible(visible);
     335    m_chromaGammaLabel->SetVisible(visible);
     336    m_minLumaValue->SetVisible(visible);
     337    m_maxLumaValue->SetVisible(visible);
     338    m_lumaGammaValue->SetVisible(visible);
     339    m_minChromaValue->SetVisible(visible);
     340    m_maxChromaValue->SetVisible(visible);
     341    m_chromaGammaValue->SetVisible(visible);
     342}
     343
     344void AdjustScreen::accept()
     345{
     346    QString filter(m_filterName);
     347   
     348    if(m_defaultValue->GetCheckState() != MythUIStateType::Full)
     349    {
     350        filter.append('=');
     351        filter.append(m_minLumaValue->GetValue());
     352        filter.append(':');
     353        filter.append(m_maxLumaValue->GetValue());
     354        filter.append(':');
     355        filter.append(QString::number(m_lumaGammaValue->GetIntValue() / 100.0, 'g', 2));
     356        filter.append(':');
     357        filter.append(m_minChromaValue->GetValue());
     358        filter.append(':');
     359        filter.append(m_maxChromaValue->GetValue());
     360        filter.append(':');
     361        filter.append(QString::number(m_chromaGammaValue->GetIntValue() / 100.0, 'g', 2));
     362    }
     363   
     364    emit accepting(filter);
     365    Close();
     366}
     367
     368bool OneFieldScreen::Create()
     369{
     370    if (!LoadWindowFromXML("filters-ui.xml", "onefieldscreen", this))
     371        return false;
     372
     373    m_fieldValue = dynamic_cast<MythUICheckBox *>(GetChild("fieldvalue"));
     374
     375    if (!CreateCommon() || !m_fieldValue)
     376    {   
     377        VERBOSE(VB_IMPORTANT, "OneFieldScreen, theme is missing "
     378                              "required elements");
     379        return false;
     380    }
     381   
     382    connect(m_fieldValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     383
     384    if (!Load())
     385        return false;
     386
     387    BuildFocusList();
     388
     389    return true;
     390}
     391
     392bool OneFieldScreen::Load()
     393{
     394    if (m_filterParams == "bottom")
     395        m_fieldValue->SetCheckState(MythUIStateType::Full);
     396   
     397    return true;
     398}
     399
     400void OneFieldScreen::accept()
     401{
     402    QString filter(m_filterName);
     403   
     404    if(m_fieldValue->GetCheckState() == MythUIStateType::Full)
     405    {
     406        filter.append("=bottom");
     407    }
     408   
     409    emit accepting(filter);
     410    Close();
     411}
     412
     413bool CustomFilterScreen::Create()
     414{
     415    if (!LoadWindowFromXML("filters-ui.xml", "customfilterscreen", this))
     416        return false;
     417
     418    m_optionsInput = dynamic_cast<MythUITextEdit *>(GetChild("optionsinput"));
     419
     420    if (!CreateCommon() || !m_optionsInput)
     421    {   
     422        VERBOSE(VB_IMPORTANT, "CustomFilterScreen, theme is missing "
     423                              "required elements");
     424        return false;
     425    }
     426   
     427    connect(m_optionsInput, SIGNAL(TakingFocus()), SLOT(setHelpText()));
     428
     429    if (!Load())
     430        return false;
     431
     432    BuildFocusList();
     433
     434    return true;
     435}
     436
     437bool CustomFilterScreen::Load()
     438{
     439    m_optionsInput->SetText(m_filterParams);
     440    return true;
     441}
     442
     443void CustomFilterScreen::accept()
     444{
     445    QString filter(m_filterName);
     446    if (!m_optionsInput->GetText().trimmed().isEmpty())
     447    {
     448        filter.append('=');
     449        filter.append(m_optionsInput->GetText());
     450    }
     451
     452    emit accepting(filter);
     453    Close();
     454}
     455
  • mythtv/libs/libmythtv/libmythtv.pro

     
    246246    HEADERS += profilegroup.h
    247247    SOURCES += profilegroup.cpp
    248248
     249    # Filter configuration stuff
     250    HEADERS += filterlist.h
     251    HEADERS += filterscreen.h
     252    SOURCES += filterlist.cpp
     253    SOURCES += filterscreen.cpp
     254
    249255    # XBox LED control
    250256    HEADERS += xbox.h
    251257    SOURCES += xbox.cpp
  • mythtv/libs/libmythtv/recordingprofile.h

     
    116116    void ResizeTranscode(bool resize);
    117117    void SetLosslessTranscode(bool lossless);
    118118    void FiltersChanged(const QString &val);
     119    void EditFilters();
     120    void SetFilter(QString);
    119121
    120122  private:
    121123    ID                       *id;
  • mythtv/libs/libmythtv/filterlist.cpp

     
     1
     2#include "filterlist.h"
     3#include "filterscreen.h"
     4#include "mythverbose.h"
     5#include "mythmainwindow.h"
     6#include "mythdialogbox.h"
     7
     8Q_DECLARE_METATYPE(FilterConfiguration)
     9
     10/** \class FilterList
     11 *  \brief Provides an interface for viewing and editing video filters.
     12 *
     13 *  FilterList displays the chain of video processing filters that the user
     14 *  has configured and provides an interface for editing this chain.
     15 */
     16FilterList::FilterList(MythScreenStack *parent, QString filterString) :
     17    MythScreenType(parent, "FilterList"), m_filterString(filterString)
     18{
     19    m_filterList = NULL;
     20    m_helpText = NULL;
     21    m_helpLabel = NULL;
     22    m_addButton = NULL;
     23}
     24
     25bool FilterList::Create()
     26{
     27    if (!LoadWindowFromXML("filters-ui.xml", "filterlist", this))
     28        return false;
     29
     30    m_filterList = dynamic_cast<MythUIButtonList *>(GetChild("filters"));
     31    m_helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
     32    m_helpLabel = dynamic_cast<MythUIText *>(GetChild("helplabel"));
     33    m_addButton = dynamic_cast<MythUIButton *>(GetChild("addfilter"));
     34
     35    if (!m_filterList || !m_helpText || !m_addButton)
     36    {
     37        VERBOSE(VB_IMPORTANT, "FilterList, theme is missing "
     38                              "required elements");
     39        return false;
     40    }
     41   
     42    connect(m_filterList, SIGNAL(itemSelected(MythUIButtonListItem *)),
     43            SLOT(setHelpText(MythUIButtonListItem *)));
     44    connect(m_filterList, SIGNAL(itemClicked(MythUIButtonListItem *)),
     45            SLOT(popupMenu(MythUIButtonListItem *)));
     46    connect(m_addButton, SIGNAL(TakingFocus()), SLOT(selectButton()));
     47    connect(m_addButton, SIGNAL(Clicked()), SLOT(addFilter()));
     48
     49    m_addButton->SetLockable(false);
     50
     51    BuildFocusList();
     52    Load();
     53
     54    return true;
     55}
     56
     57void FilterList::Load()
     58{
     59    QStringList filters = m_filterString.split(',');
     60
     61    MythUIButtonListItem *item;
     62    for (QStringList::Iterator filter = filters.begin(); filter != filters.end(); ++filter)
     63    {
     64        if (!filter->trimmed().isEmpty())
     65        {
     66            FilterConfiguration configuration = parseFilter(*filter);
     67            item = new MythUIButtonListItem(m_filterList, *filter, qVariantFromValue(configuration));
     68        }
     69    } 
     70}
     71
     72void FilterList::selectButton()
     73{
     74    m_helpLabel->SetText(tr("Add Filter"));
     75    m_helpText->SetText(tr("Add a new filter to the end of the list."));
     76}
     77
     78void FilterList::addFilter()
     79{
     80    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     81    MythDialogBox *addFilterPopup = new MythDialogBox(tr("Add Filter"), popupStack, "addfilterpopup");
     82    if (addFilterPopup->Create())
     83    {
     84        popupStack->AddScreen(addFilterPopup);
     85        addFilterPopup->SetReturnEvent(this, "add");
     86       
     87        // get the list of the available filters on the system
     88        filter_map_t info = m_manager.GetAllFilterInfo();
     89        filter_map_t::iterator iter;
     90        for (iter = info.begin(); iter != info.end(); ++iter)
     91        {
     92            QString name(iter->second->name);
     93            addFilterPopup->AddButton(name, qVariantFromValue(name));
     94        }
     95    }
     96}
     97
     98void FilterList::addFilter(QString name)
     99{
     100    FilterManager manager;
     101       
     102    if (!configurable(name))
     103    {
     104        FilterConfiguration configuration = parseFilter(name);
     105        MythUIButtonListItem *item = new MythUIButtonListItem(m_filterList, name,
     106            qVariantFromValue(configuration));
     107    }
     108    else
     109    {   
     110        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     111        FilterScreen *filterScreen;
     112       
     113        if (name == "crop")
     114        {
     115            filterScreen = new CropScreen(mainStack, name, "", false);
     116        }
     117        else if (name == "denoise3d")
     118        {
     119            filterScreen = new Denoise3dScreen(mainStack, name, "", false);
     120        }
     121        else if (name == "adjust")
     122        {
     123            filterScreen = new AdjustScreen(mainStack, name, "", false);
     124        }
     125        else if (name == "onefield")
     126        {
     127            filterScreen = new OneFieldScreen(mainStack, name, "", false);
     128        }
     129        else
     130        {
     131            filterScreen = new CustomFilterScreen(mainStack, name, "", false);
     132        }
     133       
     134        connect(filterScreen, SIGNAL(accepting(QString)), this, SLOT(getAddedFilter(QString)));
     135       
     136        if (filterScreen->Create())
     137        {
     138            mainStack->AddScreen(filterScreen);
     139        }
     140        else
     141        {
     142            delete filterScreen;
     143        }
     144    }
     145}
     146
     147bool FilterList::configurable(QString name) const
     148{
     149    return name != "bobdeint" &&
     150        name != "fieldorderdoubleprocessdeint" &&
     151        name != "forceyv12" &&
     152        name != "forceyuv422p" &&
     153        name != "forcergb24" &&
     154        name != "forceargb32" &&
     155        name != "kerneldeint" &&
     156        name != "kerneldoubleprocessdeint" &&
     157        name != "greedyhdeint" &&
     158        name != "greedyhdoubleprocessdeint" &&
     159        name != "invert" &&
     160        name != "ivtc" &&
     161        name != "linearblend" &&
     162        name != "yadifdeint" &&
     163        name != "yadifdoubleprocessdeint";
     164}
     165
     166void FilterList::getAddedFilter(QString filter)
     167{
     168    FilterConfiguration configuration = parseFilter(filter);
     169    MythUIButtonListItem *item = new MythUIButtonListItem(m_filterList, filter,
     170        qVariantFromValue(configuration));
     171}
     172
     173void FilterList::getEditedFilter(QString filter)
     174{
     175    FilterConfiguration configuration = parseFilter(filter);
     176    MythUIButtonListItem* current = m_filterList->GetItemCurrent();
     177    current->SetData(qVariantFromValue(configuration));
     178    current->SetText(filter);
     179    m_helpText->SetText(configuration.description);
     180}
     181
     182void FilterList::disableFilter(MythUIButtonListItem *item)
     183{
     184    FilterConfiguration filter = qVariantValue<FilterConfiguration>(item->GetData());
     185    filter.options = "-1";
     186    item->SetData(qVariantFromValue(filter));
     187    item->SetText(filter.name + '=' + filter.options);
     188}
     189
     190void FilterList::enableFilter(MythUIButtonListItem *item)
     191{
     192    FilterConfiguration filter = qVariantValue<FilterConfiguration>(item->GetData());
     193    filter.options = filter.prevOptions;
     194    item->SetData(qVariantFromValue(filter));
     195               
     196    if (!filter.options.trimmed().isEmpty())
     197    {
     198        item->SetText(filter.name + '=' + filter.options);
     199    }
     200}
     201
     202FilterConfiguration FilterList::parseFilter(const QString &filter) const
     203{
     204    FilterConfiguration configuration;
     205    configuration.name = filter.section('=', 0, 0);
     206    configuration.options = filter.section('=', 1, 1);
     207    configuration.configurable = configurable(configuration.name);
     208    configuration.canDisable = false;
     209   
     210    if (configuration.name == "adjust")
     211        configuration.canDisable = true;   
     212       
     213    if (configuration.options != "-1")
     214        configuration.prevOptions = configuration.options;
     215    else
     216        configuration.prevOptions = "";
     217   
     218    const FilterInfo* info = m_manager.GetFilterInfo(configuration.name);
     219    if (info)
     220    {
     221        configuration.description.append(info->descript);
     222    }
     223    return configuration;
     224}
     225
     226void FilterList::setHelpText(MythUIButtonListItem *item)
     227{
     228    if (!item || GetFocusWidget() != m_filterList)
     229        return;
     230
     231    FilterConfiguration configuration = qVariantValue<FilterConfiguration>(item->GetData());
     232    m_helpText->SetText(configuration.description);
     233   
     234    QString name(configuration.name);
     235    name[0] = name[0].toUpper();
     236    m_helpLabel->SetText(name);
     237}
     238
     239bool FilterList::keyPressEvent(QKeyEvent *event)
     240{
     241    if (GetFocusWidget()->keyPressEvent(event))
     242    {
     243        return true;
     244    }
     245
     246    QStringList actions;
     247    bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
     248
     249    for (int i = 0; i < actions.size() && !handled; i++)
     250    {
     251        handled = true;
     252        QString action = actions[i];
     253       
     254        MythUIButtonListItem* current = m_filterList->GetItemCurrent();
     255       
     256        if (action == "MENU" && current != NULL)
     257        {
     258            popupMenu(current);
     259        }
     260        else if (action == "EDIT" && current != NULL)
     261        {
     262            editFilter(current);
     263        }
     264        else if (action == "DELETE" && current != NULL)
     265        {
     266            deleteFilter(current);
     267        }
     268        else if (action == "ESCAPE")
     269        {
     270            emit finished(buildFilterString());
     271            GetScreenStack()->PopScreen();
     272        }
     273        else
     274        {
     275            handled = false;
     276        }
     277    }
     278   
     279    if (!handled && MythScreenType::keyPressEvent(event))
     280    {
     281        handled = true;
     282    }
     283
     284    return handled;
     285}
     286
     287QString FilterList::buildFilterString()
     288{
     289    QString filterString = "";
     290    int count = m_filterList->GetCount();
     291    for (int i = 0; i < count; i++)
     292    {
     293        FilterConfiguration filter =
     294            qVariantValue<FilterConfiguration>(m_filterList->GetItemAt(i)->GetData());
     295        filterString.append(filter.name);
     296                               
     297        if (!filter.options.trimmed().isEmpty())
     298        {
     299            filterString.append('=');
     300            filterString.append(filter.options);
     301        }
     302                               
     303        if (i != count - 1)
     304            filterString.append(',');
     305    }
     306               
     307    return filterString;
     308}
     309
     310void FilterList::popupMenu(MythUIButtonListItem* current)
     311{
     312    int position = m_filterList->GetItemPos(current);
     313    FilterConfiguration filter = qVariantValue<FilterConfiguration>(current->GetData());
     314       
     315    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     316    MythDialogBox *menuPopup = new MythDialogBox(tr("Manage Filter"), popupStack, "filterpopup");
     317     
     318    if (menuPopup->Create())
     319    {
     320        popupStack->AddScreen(menuPopup);
     321        menuPopup->SetReturnEvent(this, "manage");
     322               
     323        if (position > 0)
     324        {
     325            menuPopup->AddButton(tr("Move Up"));
     326        }
     327               
     328        if (position < m_filterList->GetCount() - 1)
     329        {
     330            menuPopup->AddButton(tr("Move Down"));
     331        }
     332         
     333        bool disabled = filter.canDisable && filter.options == "-1";
     334               
     335        if (filter.configurable && !disabled)
     336        {
     337            menuPopup->AddButton(tr("Edit"));
     338        }
     339       
     340        if (disabled)
     341        {
     342            menuPopup->AddButton(tr("Enable"));
     343        }
     344        else if (filter.canDisable)
     345        {
     346            menuPopup->AddButton(tr("Disable"));
     347        }
     348               
     349        menuPopup->AddButton(tr("Delete"));
     350        menuPopup->AddButton(tr("Cancel"));
     351    }
     352}
     353
     354void FilterList::editFilter(MythUIButtonListItem *item)
     355{
     356    if (!item)
     357        return;
     358       
     359    FilterConfiguration filter = qVariantValue<FilterConfiguration>(item->GetData());
     360       
     361    if (!filter.configurable)
     362    {
     363        return;
     364    }
     365       
     366    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     367       
     368    FilterScreen *filterScreen;
     369    if (filter.name == "crop")
     370    {
     371        filterScreen = new CropScreen(mainStack, filter.name, filter.options, true);
     372    }
     373    else if (filter.name == "denoise3d")
     374    {
     375        filterScreen = new Denoise3dScreen(mainStack, filter.name, filter.options, true);
     376    }
     377    else if (filter.name == "adjust")
     378    {
     379        filterScreen = new AdjustScreen(mainStack, filter.name, filter.options, true);
     380    }
     381    else if (filter.name == "onefield")
     382    {
     383        filterScreen = new OneFieldScreen(mainStack, filter.name, filter.options, true);
     384    }
     385    else
     386    {
     387        filterScreen = new CustomFilterScreen(mainStack, filter.name, filter.options, true);
     388    }
     389       
     390    connect(filterScreen, SIGNAL(accepting(QString)), this, SLOT(getEditedFilter(QString)));
     391       
     392    if (filterScreen->Create())
     393    {
     394        mainStack->AddScreen(filterScreen);
     395    }
     396    else
     397    {
     398        delete filterScreen;
     399    }
     400}
     401
     402void FilterList::deleteFilter(MythUIButtonListItem *item)
     403{
     404    if (!item)
     405        return;
     406       
     407    m_filterList->RemoveItem(item);
     408   
     409    if (m_filterList->GetCount() == 0)
     410    {
     411        m_helpLabel->Reset();
     412        m_helpText->Reset();
     413    }
     414}
     415
     416void FilterList::moveFilterUp(MythUIButtonListItem *item)
     417{
     418    if (!item)
     419        return;
     420       
     421    item->MoveUpDown(true);
     422}
     423
     424void FilterList::moveFilterDown(MythUIButtonListItem *item)
     425{
     426    if (!item)
     427        return;
     428       
     429    item->MoveUpDown(false);
     430}
     431
     432void FilterList::customEvent(QEvent *event)
     433{
     434    if (event->type() == kMythDialogBoxCompletionEventType)
     435    {
     436        DialogCompletionEvent *dce =
     437        dynamic_cast<DialogCompletionEvent*>(event);
     438 
     439        QString resultid= dce->GetId();
     440        QString resultText = dce->GetResultText();
     441
     442        MythUIButtonListItem* current = m_filterList->GetItemCurrent();
     443
     444        if (resultid == "manage")
     445        {
     446            if (resultText == tr("Delete"))
     447            {
     448                deleteFilter(current);
     449            }
     450            else if (resultText == tr("Move Up"))
     451            {
     452                moveFilterUp(current);
     453            }
     454            else if (resultText == tr("Move Down"))
     455            {
     456                moveFilterDown(current);
     457            }
     458            else if (resultText == tr("Edit"))
     459            {
     460                editFilter(current);
     461            }
     462            else if (resultText == tr("Disable"))
     463            {
     464                disableFilter(current);
     465            }
     466            else if (resultText == tr("Enable"))
     467            {
     468                enableFilter(current);
     469            }
     470         }
     471         else if (resultid == "add" && dce->GetResult() != -1)
     472         {
     473             addFilter(qVariantValue<QString>(dce->GetData()));
     474         }
     475    }
     476}
  • mythtv/libs/libmythtv/channelsettings.cpp

     
     1#include <QApplication>
     2
    13#include "channelsettings.h"
    24#include "cardutil.h"
    35#include "channelutil.h"
     6#include "filterlist.h"
    47#include "programinfo.h" // for COMM_DETECT*, GetPreferredSkipTypeCombinations()
     8#include "mythcontext.h"
    59
    610QString ChannelDBStorage::GetWhereClause(MSqlBindings &bindings) const
    711{
     
    197201    }
    198202};
    199203
    200 class VideoFilters : public LineEditSetting, public ChannelDBStorage
     204class VideoFilterButton : public ButtonSetting, public ChannelDBStorage
    201205{
    202206  public:
    203     VideoFilters(const ChannelID &id) :
    204         LineEditSetting(this), ChannelDBStorage(this, id, "videofilters")
     207    VideoFilterButton(const ChannelID &id) :
     208        ButtonSetting(this), ChannelDBStorage(this, id, "videofilters")
    205209    {
    206210        setLabel(QObject::tr("Video filters"));
    207211        setHelpText(QObject::tr("Filters to be used when recording "
     
    212216};
    213217
    214218
    215 class OutputFilters : public LineEditSetting, public ChannelDBStorage
     219class OutputFilterButton : public ButtonSetting, public ChannelDBStorage
    216220{
    217221  public:
    218     OutputFilters(const ChannelID &id) :
    219         LineEditSetting(this), ChannelDBStorage(this, id, "outputfilters")
     222    OutputFilterButton(const ChannelID &id) :
     223        ButtonSetting(this), ChannelDBStorage(this, id, "outputfilters")
    220224    {
    221225        setLabel(QObject::tr("Playback filters"));
    222226        setHelpText(QObject::tr("Filters to be used when recordings "
     
    469473    setLabel(QObject::tr("Channel Options - Filters"));
    470474    setUseLabel(false);
    471475
    472     addChild(new VideoFilters(id));
    473     addChild(new OutputFilters(id));
     476    videoButton = new VideoFilterButton(id);
     477    outputButton = new OutputFilterButton(id);
     478
     479    addChild(videoButton);
     480    addChild(outputButton);
     481
     482    connect(videoButton,  SIGNAL(   pressed()),
     483            this,         SLOT(videoPressed()));
     484    connect(outputButton, SIGNAL(    pressed()),
     485            this,         SLOT(outputPressed()));
    474486}
    475487
     488void ChannelOptionsFilters::videoPressed()
     489{
     490    MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
     491    FilterList *filterList = new FilterList(mainStack, videoButton->getValue());
     492    if (!filterList->Create())
     493    {
     494        delete filterList;
     495        return;
     496    }
     497
     498    connect(filterList, SIGNAL(finished(QString)), this, SLOT(setInputFilters(QString)));
     499
     500    mainStack->AddScreen(filterList);
     501       
     502    // HACK begin - remove when everything is using mythui
     503    if (GetMythMainWindow()->currentWidget())
     504    {
     505        QWidget *widget = GetMythMainWindow()->currentWidget();
     506        vector<QWidget *> widgetList;
     507
     508        while (widget)
     509        {
     510            widgetList.push_back(widget);
     511            GetMythMainWindow()->detach(widget);
     512            widget = GetMythMainWindow()->currentWidget();
     513        }
     514
     515        GetMythMainWindow()->GetPaintWindow()->raise();
     516        GetMythMainWindow()->GetPaintWindow()->setFocus();
     517
     518        int screenCount = mainStack->TotalScreens();
     519        do
     520        {
     521            qApp->processEvents();
     522            usleep(5000);
     523        } while (mainStack->TotalScreens() >= screenCount);
     524
     525        vector<QWidget*>::reverse_iterator it;
     526        for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
     527        {
     528            GetMythMainWindow()->attach(*it);
     529        }
     530    }
     531    // HACK end
     532}
     533
     534void ChannelOptionsFilters::outputPressed()
     535{
     536    MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
     537    FilterList *filterList = new FilterList(mainStack, outputButton->getValue());
     538    if (!filterList->Create())
     539    {
     540        delete filterList;
     541        return;
     542    }
     543
     544    connect(filterList, SIGNAL(finished(QString)), this, SLOT(setInputFilters(QString)));
     545
     546    mainStack->AddScreen(filterList);
     547       
     548    // HACK begin - remove when everything is using mythui
     549    if (GetMythMainWindow()->currentWidget())
     550    {
     551        QWidget *widget = GetMythMainWindow()->currentWidget();
     552        vector<QWidget *> widgetList;
     553
     554        while (widget)
     555        {
     556            widgetList.push_back(widget);
     557            GetMythMainWindow()->detach(widget);
     558            widget = GetMythMainWindow()->currentWidget();
     559        }
     560
     561        GetMythMainWindow()->GetPaintWindow()->raise();
     562        GetMythMainWindow()->GetPaintWindow()->setFocus();
     563
     564        int screenCount = mainStack->TotalScreens();
     565        do
     566        {
     567            qApp->processEvents();
     568            usleep(5000);
     569        } while (mainStack->TotalScreens() >= screenCount);
     570
     571        vector<QWidget*>::reverse_iterator it;
     572        for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
     573        {
     574            GetMythMainWindow()->attach(*it);
     575        }
     576    }
     577    // HACK end
     578}
     579
     580void ChannelOptionsFilters::setOutputFilters(QString filters)
     581{
     582    outputButton->setValue(filters);
     583}
     584
     585void ChannelOptionsFilters::setInputFilters(QString filters)
     586{
     587    videoButton->setValue(filters);
     588}
     589
    476590ChannelOptionsV4L::ChannelOptionsV4L(const ChannelID& id) :
    477591    VerticalConfigurationGroup(false, true, false, false)
    478592{
  • mythtv/libs/libmythtv/filterlist.h

     
     1#ifndef FILTERLIST_H
     2#define FILTERLIST_H
     3
     4// MythTV headers
     5#include <mythscreentype.h>
     6#include <mythuitext.h>
     7#include <mythuibuttonlist.h>
     8#include <mythuibutton.h>
     9#include "filtermanager.h"
     10
     11struct FilterConfiguration
     12{
     13    QString name;
     14    QString options;
     15    QString description;
     16    QString prevOptions;
     17    bool    configurable;
     18    bool    canDisable;
     19};
     20
     21class FilterList : public MythScreenType
     22{
     23  Q_OBJECT
     24
     25  public:
     26    FilterList(MythScreenStack *parent, QString filterString);
     27   ~FilterList(void) {}
     28
     29    bool Create(void);
     30
     31  signals:
     32    void finished(QString string);
     33
     34  private slots:
     35    void setHelpText(MythUIButtonListItem *item);
     36    void popupMenu(MythUIButtonListItem *item);
     37    void addFilter();
     38    void selectButton();
     39    void getAddedFilter(QString filter);
     40    void getEditedFilter(QString filter);
     41   
     42  private:
     43    void Load();
     44   
     45    bool configurable(QString name) const;
     46    void addFilter(QString name);
     47    void deleteFilter(MythUIButtonListItem *item);
     48    void moveFilterUp(MythUIButtonListItem *item);
     49    void moveFilterDown(MythUIButtonListItem *item);
     50    void editFilter(MythUIButtonListItem *item);
     51    void enableFilter(MythUIButtonListItem *item);
     52    void disableFilter(MythUIButtonListItem *item);
     53    QString buildFilterString();
     54   
     55    bool keyPressEvent(QKeyEvent *);
     56    void customEvent(QEvent *);
     57   
     58    FilterConfiguration parseFilter(const QString &filter) const;
     59   
     60    FilterManager     m_manager;
     61    MythUIText       *m_helpText;
     62    MythUIText       *m_helpLabel;
     63    MythUIButtonList *m_filterList;
     64    MythUIButton     *m_addButton;
     65    QString           m_filterString;
     66};
     67
     68#endif /* FILTERLIST_H */
     69
  • mythtv/libs/libmythtv/filtermanager.h

     
    4949                             int &height, int &bufsize,
    5050                             int max_threads = 1);
    5151
     52    const FilterInfo *GetFilterInfo(const QString &name) const;
     53   
     54    filter_map_t GetAllFilterInfo()
     55    {
     56      return filter_map_t(filters);
     57    }
     58
    5259  private:
    5360    bool LoadFilterLib(const QString &path);
    54     const FilterInfo *GetFilterInfo(const QString &name) const;
    55 
     61   
    5662    library_map_t dlhandles;
    5763    filter_map_t  filters;
    5864};
  • mythtv/libs/libmythtv/filterscreen.h

     
     1#ifndef FILTERSCREEN_H
     2#define FILTERSCREEN_H
     3
     4#include <mythscreentype.h>
     5#include <mythuitext.h>
     6#include <mythuibutton.h>
     7#include <mythuigroup.h>
     8#include <mythuicheckbox.h>
     9#include <mythuispinbox.h>
     10#include <mythuitextedit.h>
     11
     12class FilterScreen : public MythScreenType
     13{
     14  Q_OBJECT
     15 
     16  public:
     17    FilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit);
     18   ~FilterScreen(void) {}
     19   
     20  signals:
     21    void accepting(QString string);
     22
     23  protected slots:
     24    void setHelpText();
     25    virtual void accept() = 0;
     26   
     27  protected:
     28    virtual bool Load() = 0;
     29    bool CreateCommon();
     30
     31    MythUIText         *m_heading;
     32    MythUIText         *m_helpText;
     33    MythUIButton       *m_cancelButton;
     34    MythUIButton       *m_acceptButton;
     35    QString             m_filterName;
     36    QString             m_filterParams;
     37    bool                m_edit;
     38};
     39
     40class CropScreen : public FilterScreen
     41{
     42  Q_OBJECT
     43 
     44  public:
     45    CropScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     46        FilterScreen(parent, filterName, filterParams, edit) {}
     47    ~CropScreen(void) {}
     48   
     49    bool Create(void);
     50 
     51  protected slots:
     52    void accept();
     53 
     54  protected:
     55    bool Load();
     56   
     57    MythUISpinBox  *m_topValue;
     58    MythUISpinBox  *m_leftValue;
     59    MythUISpinBox  *m_bottomValue;
     60    MythUISpinBox  *m_rightValue;
     61};
     62
     63class Denoise3dScreen : public FilterScreen
     64{
     65  Q_OBJECT
     66 
     67  public:
     68    Denoise3dScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     69        FilterScreen(parent, filterName, filterParams, edit) {}
     70    ~Denoise3dScreen(void) {}
     71   
     72    bool Create(void);
     73 
     74  protected slots:
     75    void accept();
     76    void useDefaults();
     77 
     78  protected:
     79    bool Load();
     80   
     81    MythUICheckBox *m_defaultValue;
     82    MythUIText     *m_lumaSpatialLabel;
     83    MythUIText     *m_chromaSpatialLabel;
     84    MythUIText     *m_lumaTemporalLabel;
     85    MythUISpinBox  *m_lumaSpatialValue;
     86    MythUISpinBox  *m_chromaSpatialValue;
     87    MythUISpinBox  *m_lumaTemporalValue;
     88};
     89
     90class AdjustScreen : public FilterScreen
     91{
     92  Q_OBJECT
     93 
     94  public:
     95    AdjustScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     96        FilterScreen(parent, filterName, filterParams, edit) {}
     97    ~AdjustScreen(void) {}
     98   
     99    bool Create(void);
     100 
     101  protected slots:
     102    void accept();
     103    void useDefaults();
     104 
     105  protected:
     106    bool Load();
     107   
     108    MythUICheckBox *m_defaultValue;
     109    MythUIText     *m_minLumaLabel;
     110    MythUIText     *m_maxLumaLabel;
     111    MythUIText     *m_lumaGammaLabel;
     112    MythUIText     *m_minChromaLabel;
     113    MythUIText     *m_maxChromaLabel;
     114    MythUIText     *m_chromaGammaLabel;
     115    MythUISpinBox  *m_minLumaValue;
     116    MythUISpinBox  *m_maxLumaValue;
     117    MythUISpinBox  *m_lumaGammaValue;
     118    MythUISpinBox  *m_minChromaValue;
     119    MythUISpinBox  *m_maxChromaValue;
     120    MythUISpinBox  *m_chromaGammaValue;
     121};
     122
     123class OneFieldScreen : public FilterScreen
     124{
     125  Q_OBJECT
     126 
     127  public:
     128    OneFieldScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     129        FilterScreen(parent, filterName, filterParams, edit) {}
     130    ~OneFieldScreen(void) {}
     131   
     132    bool Create(void);
     133 
     134  protected slots:
     135    void accept();
     136 
     137  protected:
     138    bool Load();
     139   
     140    MythUICheckBox  *m_fieldValue;
     141};
     142
     143class CustomFilterScreen : public FilterScreen
     144{
     145  Q_OBJECT
     146 
     147  public:
     148    CustomFilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
     149        FilterScreen(parent, filterName, filterParams, edit) {}
     150    ~CustomFilterScreen(void) {}
     151   
     152    bool Create(void);
     153 
     154  protected slots:
     155        void accept();
     156 
     157  protected:
     158    bool Load();
     159   
     160    MythUITextEdit  *m_optionsInput;
     161};
     162
     163#endif /* FILTERSCREEN_H */
     164
  • mythtv/libs/libmythtv/recordingprofile.cpp

     
    22
    33#include <QCursor>
    44#include <QLayout>
     5#include <QApplication>
    56
    67#include "recordingprofile.h"
     8#include "filterlist.h"
    79#include "cardutil.h"
    810#include "mythcontext.h"
    911#include "mythdb.h"
     
    10081010    };
    10091011};
    10101012
    1011 class TranscodeFilters : public LineEditSetting, public CodecParamStorage
     1013class TranscodeFilters : public ButtonSetting, public CodecParamStorage
    10121014{
    10131015  public:
    10141016    TranscodeFilters(const RecordingProfile &parent) :
    1015         LineEditSetting(this),
     1017        ButtonSetting(this),
    10161018        CodecParamStorage(this, parent, "transcodefilters")
    10171019    {
    10181020        setLabel(QObject::tr("Custom Filters"));
    10191021        setHelpText(QObject::tr("Filters used when transcoding with this "
    10201022                                "profile. This value must be blank to perform "
    1021                                 "lossless transcoding.  Format: "
    1022                                 "[[<filter>=<options>,]...]"
     1023                                "lossless transcoding."
    10231024                                ));
    10241025    };
    10251026};
     
    12851286                    this,        SLOT(  SetLosslessTranscode(bool)));
    12861287            connect(tr_filters,  SIGNAL(valueChanged(const QString&)),
    12871288                    this,        SLOT(FiltersChanged(const QString&)));
     1289            connect(tr_filters,  SIGNAL(pressed  ()),
     1290                    this,        SLOT(EditFilters()));
    12881291        }
    12891292    }
    12901293    else if (type.toUpper() == "DVB")
     
    12961299    Load();
    12971300}
    12981301
     1302void RecordingProfile::EditFilters()
     1303{
     1304    MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
     1305    FilterList *filterList = new FilterList(mainStack, tr_filters->getValue());
     1306    if (!filterList->Create())
     1307    {
     1308        delete filterList;
     1309        return;
     1310    }
     1311
     1312    connect(filterList, SIGNAL(finished(QString)), this, SLOT(SetFilter(QString)));
     1313
     1314    mainStack->AddScreen(filterList);
     1315       
     1316    // HACK begin - remove when everything is using mythui
     1317    if (GetMythMainWindow()->currentWidget())
     1318    {
     1319        QWidget *widget = GetMythMainWindow()->currentWidget();
     1320        vector<QWidget *> widgetList;
     1321
     1322        while (widget)
     1323        {
     1324            widgetList.push_back(widget);
     1325            GetMythMainWindow()->detach(widget);
     1326            widget = GetMythMainWindow()->currentWidget();
     1327        }
     1328
     1329        GetMythMainWindow()->GetPaintWindow()->raise();
     1330        GetMythMainWindow()->GetPaintWindow()->setFocus();
     1331
     1332        int screenCount = mainStack->TotalScreens();
     1333        do
     1334        {
     1335            qApp->processEvents();
     1336            usleep(5000);
     1337        } while (mainStack->TotalScreens() >= screenCount);
     1338
     1339        vector<QWidget*>::reverse_iterator it;
     1340        for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
     1341        {
     1342            GetMythMainWindow()->attach(*it);
     1343        }
     1344    }
     1345    // HACK end
     1346}
     1347
     1348void RecordingProfile::SetFilter(QString filter)
     1349{
     1350    tr_filters->setValue(filter);
     1351}
     1352
    12991353void RecordingProfile::FiltersChanged(const QString &val)
    13001354{
    13011355    if (!tr_filters || !tr_lossless)
  • mythtv/libs/libmythtv/channelsettings.h

     
    109109
    110110class OnAirGuide;
    111111class XmltvID;
     112class VideoFilterButton;
     113class OutputFilterButton;
    112114
    113115class MPUBLIC ChannelOptionsCommon: public VerticalConfigurationGroup
    114116{
     
    128130};
    129131
    130132class MPUBLIC ChannelOptionsFilters: public VerticalConfigurationGroup {
     133Q_OBJECT
    131134  public:
    132135    ChannelOptionsFilters(const ChannelID& id);
     136public slots:
     137    void outputPressed();
     138    void videoPressed();
     139    void setOutputFilters(QString);
     140    void setInputFilters(QString);
     141   
     142protected:
     143    VideoFilterButton  *videoButton;
     144    OutputFilterButton *outputButton;
    133145};
    134146
    135147class MPUBLIC ChannelOptionsV4L: public VerticalConfigurationGroup {