Index: mythtv/filters/linearblend/filter_linearblend.c
===================================================================
--- mythtv/filters/linearblend/filter_linearblend.c (revision 22465)
+++ mythtv/filters/linearblend/filter_linearblend.c (working copy)
@@ -372,7 +372,7 @@
{
symbol: "new_filter",
name: "linearblend",
- descript: "fast blending deinterlace filter",
+ descript: "Fast blending deinterlace filter.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/quickdnr/filter_quickdnr.c
===================================================================
--- mythtv/filters/quickdnr/filter_quickdnr.c (revision 22465)
+++ mythtv/filters/quickdnr/filter_quickdnr.c (working copy)
@@ -590,7 +590,7 @@
{
symbol: "new_filter",
name: "quickdnr",
- descript: "removes noise with a fast single/double thresholded average filter",
+ descript: "Removes noise with a fast single/double thresholded average filter.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/postprocess/filter_postprocess.c
===================================================================
--- mythtv/filters/postprocess/filter_postprocess.c (revision 22465)
+++ mythtv/filters/postprocess/filter_postprocess.c (working copy)
@@ -134,7 +134,7 @@
{
symbol: "new_filter",
name: "postprocess",
- descript: "FFMPEG's postprocessing filters",
+ descript: "FFMPEG's postprocessing filters.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/onefield/filter_onefield.c
===================================================================
--- mythtv/filters/onefield/filter_onefield.c (revision 22465)
+++ mythtv/filters/onefield/filter_onefield.c (working copy)
@@ -97,9 +97,9 @@
{
symbol: "new_filter",
name: "onefield",
- descript: "one-field-only deinterlace filter; parameter \"bottom\" for bottom field, otherwise top",
+ descript: "One-field-only deinterlace filter.",
formats: FmtList,
- libname: NULL,
+ libname: NULL
},
FILT_NULL
};
Index: mythtv/filters/bobdeint/filter_bobdeint.c
===================================================================
--- mythtv/filters/bobdeint/filter_bobdeint.c (revision 22465)
+++ mythtv/filters/bobdeint/filter_bobdeint.c (working copy)
@@ -143,9 +143,9 @@
{
symbol: "new_filter",
name: "bobdeint",
- descript: "bob deinterlace filter; splits fields to top and bottom of buffer",
+ descript: "Bob deinterlace filter; splits fields to top and bottom of buffer.",
formats: FmtList,
- libname: NULL,
+ libname: NULL
},
FILT_NULL
};
Index: mythtv/filters/adjust/filter_adjust.c
===================================================================
--- mythtv/filters/adjust/filter_adjust.c (revision 22465)
+++ mythtv/filters/adjust/filter_adjust.c (working copy)
@@ -314,7 +314,7 @@
{
symbol: "newAdjustFilter",
name: "adjust",
- descript: "adjust range and gamma of video",
+ descript: "Adjust range and gamma of video.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/yadif/filter_yadif.c
===================================================================
--- mythtv/filters/yadif/filter_yadif.c (revision 22465)
+++ mythtv/filters/yadif/filter_yadif.c (working copy)
@@ -725,14 +725,14 @@
{
symbol: "YadifDeintFilter",
name: "yadifdeint",
- descript: "combines data from several fields to deinterlace with less motion blur",
+ descript: "Combines data from several fields to deinterlace with less motion blur.",
formats: FmtList,
libname: NULL
},
{
symbol: "YadifDeintFilter",
name: "yadifdoubleprocessdeint",
- descript: "combines data from several fields to deinterlace with less motion blur",
+ descript: "Combines data from several fields to deinterlace with less motion blur.",
formats: FmtList,
libname: NULL
},FILT_NULL
Index: mythtv/filters/force/filter_force.c
===================================================================
--- mythtv/filters/force/filter_force.c (revision 22465)
+++ mythtv/filters/force/filter_force.c (working copy)
@@ -100,28 +100,28 @@
{
symbol: "new_force_yv12",
name: "forceyv12",
- descript: "forces use of YV12 video format",
+ descript: "Forces use of YV12 video format.",
formats: Fmt_List_YV12,
libname: NULL
},
{
symbol: "new_force_yuv422p",
name: "forceyuv422p",
- descript: "forces use of YUV422P video format",
+ descript: "forces use of YUV422P video format.",
formats: Fmt_List_YUV422P,
libname: NULL
},
{
symbol: "new_force_rgb24",
name: "forcergb24",
- descript: "forces use of RGB24 video format",
+ descript: "Forces use of RGB24 video format.",
formats: Fmt_List_RGB24,
libname: NULL
},
{
symbol: "new_force_argb32",
name: "forceargb32",
- descript: "forces use of ARGB32 video format",
+ descript: "Forces use of ARGB32 video format.",
formats: Fmt_List_ARGB32,
libname: NULL
},
Index: mythtv/filters/crop/filter_crop.c
===================================================================
--- mythtv/filters/crop/filter_crop.c (revision 22465)
+++ mythtv/filters/crop/filter_crop.c (working copy)
@@ -303,7 +303,7 @@
{
symbol: "new_filter",
name: "crop",
- descript: "crops picture by macroblock intervals",
+ descript: "Crops picture by macroblock intervals.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/kerneldeint/filter_kerneldeint.c
===================================================================
--- mythtv/filters/kerneldeint/filter_kerneldeint.c (revision 22465)
+++ mythtv/filters/kerneldeint/filter_kerneldeint.c (working copy)
@@ -665,8 +665,8 @@
{
symbol: "NewKernelDeintFilter",
name: "kerneldeint",
- descript: "combines data from several fields to deinterlace "
- "with less motion blur",
+ descript: "Combines data from several fields to deinterlace "
+ "with less motion blur.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/ivtc/filter_ivtc.c
===================================================================
--- mythtv/filters/ivtc/filter_ivtc.c (revision 22465)
+++ mythtv/filters/ivtc/filter_ivtc.c (working copy)
@@ -253,7 +253,7 @@
{
symbol: "NewIvtcFilter",
name: "ivtc",
- descript: "inverse telecine filter",
+ descript: "Inverse telecine filter.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/invert/filter_invert.c
===================================================================
--- mythtv/filters/invert/filter_invert.c (revision 22465)
+++ mythtv/filters/invert/filter_invert.c (working copy)
@@ -79,7 +79,7 @@
{
symbol: "new_filter",
name: "invert",
- descript: "inverts the colors of the input video",
+ descript: "Inverts the colors of the input video.",
formats: FmtList,
libname: NULL
},
Index: mythtv/filters/greedyhdeint/filter_greedyhdeint.c
===================================================================
--- mythtv/filters/greedyhdeint/filter_greedyhdeint.c (revision 22465)
+++ mythtv/filters/greedyhdeint/filter_greedyhdeint.c (working copy)
@@ -275,14 +275,14 @@
{
symbol: "GreedyHDeintFilter",
name: "greedyhdeint",
- descript: "combines data from several fields to deinterlace with less motion blur",
+ descript: "Combines data from several fields to deinterlace with less motion blur.",
formats: FmtList,
libname: NULL
},
{
symbol: "GreedyHDeintFilter",
name: "greedyhdoubleprocessdeint",
- descript: "combines data from several fields to deinterlace with less motion blur",
+ descript: "Combines data from several fields to deinterlace with less motion blur.",
formats: FmtList,
libname: NULL
},FILT_NULL
Index: mythtv/filters/denoise3d/filter_denoise3d.c
===================================================================
--- mythtv/filters/denoise3d/filter_denoise3d.c (revision 22465)
+++ mythtv/filters/denoise3d/filter_denoise3d.c (working copy)
@@ -473,7 +473,7 @@
{
symbol: "NewDenoise3DFilter",
name: "denoise3d",
- descript: "removes noise with a spatial and temporal low-pass filter",
+ descript: "Removes noise with a spatial and temporal low-pass filter.",
formats: FmtList,
libname: NULL
},
Index: mythtv/themes/default/filters-ui.xml
===================================================================
--- mythtv/themes/default/filters-ui.xml (revision 0)
+++ mythtv/themes/default/filters-ui.xml (revision 0)
@@ -0,0 +1,305 @@
+
+
+
+
+
+ 10,50,780,280
+ roundbox
+
+
+ 12
+
+
+
+ 10,63
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 240, 60
+ Amount to crop on top as number of 16 pixel blocks.
+
+
+
+ 240, 140
+ Amount to crop on left as number of 16 pixel blocks.
+
+
+
+ 240, 220
+ Amount to crop on bottom as number of 16 pixel blocks.
+
+
+
+ 240, 300
+ Amount to crop on right as number of 16 pixel blocks.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 240, 60
+ Keep the bottom field instead of the top one.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 240, 65
+ Use the default parameters.
+
+
+
+
+
+
+
+
+
+ 390, 140
+ Luma spatial filter strength.
+
+
+
+ 390, 220
+ Chroma spatial filter strength.
+
+
+
+ 390, 300
+ Luma temporal filter strength.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 240, 65
+ Use the default parameters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 250, 140
+ Minimum luma input value.
+
+
+
+ 250, 220
+ Maximum luma input value.
+
+
+
+ 250, 300
+ Luma gamma correction.
+
+
+
+ 610, 140
+ Minimum chroma input value.
+
+
+
+ 610, 220
+ Maximum chroma input value.
+
+
+
+ 610, 300
+ Chroma gamma correction.
+
+
+
+
+ -1,-1,580,165
+
+
+ mythprogressdialog-background.png
+
+
+
+
+
+
+ 102,50
+
+
+
+
Index: mythtv/themes/default-wide/filters-ui.xml
===================================================================
--- mythtv/themes/default-wide/filters-ui.xml (revision 0)
+++ mythtv/themes/default-wide/filters-ui.xml (revision 0)
@@ -0,0 +1,318 @@
+
+
+
+
+
+ 20,49,1240,360
+ roundbox
+
+
+ 12
+
+
+
+ 25,56
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 780, 160
+ Amount to crop on top as number of 16 pixel blocks.
+
+
+
+ 780, 240
+ Amount to crop on left as number of 16 pixel blocks.
+
+
+
+ 780, 320
+ Amount to crop on bottom as number of 16 pixel blocks.
+
+
+
+ 780, 400
+ Amount to crop on right as number of 16 pixel blocks.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 780, 260
+ Keep the bottom field instead of the top one.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 610, 165
+ Use the default parameters.
+
+
+
+
+
+
+
+
+
+ 760, 240
+ Luma spatial filter strength.
+
+
+
+ 760, 320
+ Chroma spatial filter strength.
+
+
+
+ 760, 400
+ Luma temporal filter strength.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 440, 165
+ Use the default parameters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 450, 240
+ Minimum luma input value.
+
+
+
+ 450, 320
+ Maximum luma input value.
+
+
+
+ 450, 400
+ Luma gamma correction.
+
+
+
+ 980, 240
+ Minimum chroma input value.
+
+
+
+ 980, 320
+ Maximum chroma input value.
+
+
+
+ 980, 400
+ Chroma gamma correction.
+
+
+
+
+ -1,-1,580,165
+
+
+ mythprogressdialog-background.png
+
+
+
+
+
+
+ 102,50
+
+
+
Index: mythtv/libs/libmythtv/filterscreen.cpp
===================================================================
--- mythtv/libs/libmythtv/filterscreen.cpp (revision 0)
+++ mythtv/libs/libmythtv/filterscreen.cpp (revision 0)
@@ -0,0 +1,460 @@
+
+#include "filterscreen.h"
+#include "filtermanager.h"
+#include "mythverbose.h"
+
+#include
+
+/** \class FilterScreen
+ * \brief Provides an interface for configuring individual video filters.
+ *
+ * FilterScreen displays a configuration screen for modifying the parameters
+ * of a video filter.
+ */
+FilterScreen::FilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ MythScreenType(parent, "FilterScreen"),
+ m_filterName(filterName),
+ m_filterParams(filterParams),
+ m_edit(edit)
+{
+ m_heading = NULL;
+ m_helpText = NULL;
+ m_cancelButton = NULL;
+ m_acceptButton = NULL;
+}
+
+bool FilterScreen::CreateCommon()
+{
+ m_heading = dynamic_cast(GetChild("heading"));
+ m_helpText = dynamic_cast(GetChild("helptext"));
+ m_cancelButton = dynamic_cast(GetChild("cancelbutton"));
+ m_acceptButton = dynamic_cast(GetChild("acceptbutton"));
+
+ if (!m_helpText || !m_heading || !m_cancelButton || !m_acceptButton)
+ {
+ VERBOSE(VB_IMPORTANT, "FilterScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ QString name(m_filterName);
+ name[0] = name[0].toUpper();
+ m_heading->SetText(tr("Configure") + ' ' + name + ' ' + tr("Filter"));
+
+ connect(m_acceptButton, SIGNAL(Clicked()), SLOT(accept()));
+ connect(m_cancelButton, SIGNAL(Clicked()), SLOT(Close()));
+
+ return true;
+}
+
+void FilterScreen::setHelpText()
+{
+ m_helpText->SetText(GetFocusWidget()->GetHelpText());
+}
+
+bool CropScreen::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "cropscreen", this))
+ return false;
+
+ m_topValue = dynamic_cast(GetChild("topvalue"));
+ m_leftValue = dynamic_cast(GetChild("leftvalue"));
+ m_bottomValue = dynamic_cast(GetChild("bottomvalue"));
+ m_rightValue = dynamic_cast(GetChild("rightvalue"));
+
+ if (!CreateCommon() || !m_topValue || !m_leftValue || !m_bottomValue || !m_rightValue)
+ {
+ VERBOSE(VB_IMPORTANT, "CropScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ connect(m_topValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_leftValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_bottomValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_rightValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+
+ if (!Load())
+ return false;
+
+ BuildFocusList();
+
+ return true;
+}
+
+bool CropScreen::Load()
+{
+ QStringList arguments = m_filterParams.split(':');
+
+ QString top = "1";
+ QString left = "1";
+ QString bottom = "1";
+ QString right = "1";
+
+ if (arguments.size() > 0 && !arguments[0].isEmpty())
+ top = arguments[0];
+ if (arguments.size() > 1)
+ left = arguments[1];
+ if (arguments.size() > 2)
+ bottom = arguments[2];
+ if (arguments.size() > 3)
+ right = arguments[3];
+
+ m_topValue->SetRange(0, 255, 1);
+ m_topValue->SetValue(top);
+
+ m_leftValue->SetRange(0, 255, 1);
+ m_leftValue->SetValue(left);
+
+ m_bottomValue->SetRange(0, 255, 1);
+ m_bottomValue->SetValue(bottom);
+
+ m_rightValue->SetRange(0, 255, 1);
+ m_rightValue->SetValue(right);
+
+ return true;
+}
+
+void CropScreen::accept()
+{
+ QString filter(m_filterName);
+ filter.append('=');
+ filter.append(m_topValue->GetValue());
+ filter.append(':');
+ filter.append(m_leftValue->GetValue());
+ filter.append(':');
+ filter.append(m_bottomValue->GetValue());
+ filter.append(':');
+ filter.append(m_rightValue->GetValue());
+
+ emit accepting(filter);
+ Close();
+}
+
+bool Denoise3dScreen::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "denoise3dscreen", this))
+ return false;
+
+ m_defaultValue = dynamic_cast(GetChild("defaultvalue"));
+ m_lumaSpatialLabel = dynamic_cast(GetChild("lumaspatiallabel"));
+ m_chromaSpatialLabel = dynamic_cast(GetChild("chromaspatiallabel"));
+ m_lumaTemporalLabel = dynamic_cast(GetChild("lumatemporallabel"));
+ m_lumaSpatialValue = dynamic_cast(GetChild("lumaspatialvalue"));
+ m_chromaSpatialValue = dynamic_cast(GetChild("chromaspatialvalue"));
+ m_lumaTemporalValue = dynamic_cast(GetChild("lumatemporalvalue"));
+
+ if (!CreateCommon() || !m_defaultValue || !m_lumaSpatialLabel || !m_chromaSpatialLabel ||
+ !m_lumaTemporalLabel || !m_lumaSpatialValue || !m_chromaSpatialValue || !m_lumaTemporalValue)
+ {
+ VERBOSE(VB_IMPORTANT, "Denoise3dScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ connect(m_defaultValue, SIGNAL(valueChanged()), SLOT(useDefaults()));
+ connect(m_defaultValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_lumaSpatialValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_chromaSpatialValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_lumaTemporalValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+
+ if (!Load())
+ return false;
+
+ BuildFocusList();
+
+ return true;
+}
+
+bool Denoise3dScreen::Load()
+{
+ if (m_edit && m_filterParams.trimmed().isEmpty())
+ {
+ m_defaultValue->SetCheckState(MythUIStateType::Full);
+ }
+
+ float lumaSpatialStrength = 0;
+ float chromaSpatialStrength = 0;
+ float lumaTemporalStrengh = 0;
+
+ QStringList arguments = m_filterParams.split(':');
+
+ if (arguments.size() > 0 && !arguments[0].isEmpty())
+ lumaSpatialStrength = arguments[0].toFloat() * 100;
+ if (arguments.size() > 1)
+ chromaSpatialStrength = arguments[1].toFloat() * 100;
+ if (arguments.size() > 2)
+ lumaTemporalStrengh = arguments[2].toFloat() * 100;
+
+ m_lumaSpatialValue->SetRange(0, 100, 1);
+ m_lumaSpatialValue->SetValue(lumaSpatialStrength);
+
+ m_chromaSpatialValue->SetRange(0, 100, 1);
+ m_chromaSpatialValue->SetValue(chromaSpatialStrength);
+
+ m_lumaTemporalValue->SetRange(0, 100, 1);
+ m_lumaTemporalValue->SetValue(lumaTemporalStrengh);
+
+ return true;
+}
+
+void Denoise3dScreen::useDefaults()
+{
+ bool visible = m_defaultValue->GetCheckState() != MythUIStateType::Full;
+ m_lumaSpatialLabel->SetVisible(visible);
+ m_chromaSpatialLabel->SetVisible(visible);
+ m_lumaTemporalLabel->SetVisible(visible);
+ m_lumaSpatialValue->SetVisible(visible);
+ m_chromaSpatialValue->SetVisible(visible);
+ m_lumaTemporalValue->SetVisible(visible);
+}
+
+void Denoise3dScreen::accept()
+{
+ QString filter(m_filterName);
+
+ if(m_defaultValue->GetCheckState() != MythUIStateType::Full)
+ {
+ filter.append('=');
+ filter.append(QString::number(m_lumaSpatialValue->GetIntValue() / 100.0, 'g', 2));
+ filter.append(':');
+ filter.append(QString::number(m_chromaSpatialValue->GetIntValue() / 100.0, 'g', 2));
+ filter.append(':');
+ filter.append(QString::number(m_lumaTemporalValue->GetIntValue() / 100.0, 'g', 2));
+ }
+
+ emit accepting(filter);
+ Close();
+}
+
+bool AdjustScreen::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "adjustscreen", this))
+ return false;
+
+ m_defaultValue = dynamic_cast(GetChild("defaultvalue"));
+ m_minLumaLabel = dynamic_cast(GetChild("minlumalabel"));
+ m_maxLumaLabel = dynamic_cast(GetChild("maxlumalabel"));
+ m_lumaGammaLabel = dynamic_cast(GetChild("lumagammalabel"));
+ m_minChromaLabel = dynamic_cast(GetChild("minchromalabel"));
+ m_maxChromaLabel = dynamic_cast(GetChild("maxchromalabel"));
+ m_chromaGammaLabel = dynamic_cast(GetChild("chromagammalabel"));
+ m_minLumaValue = dynamic_cast(GetChild("minlumavalue"));
+ m_maxLumaValue = dynamic_cast(GetChild("maxlumavalue"));
+ m_lumaGammaValue = dynamic_cast(GetChild("lumagammavalue"));
+ m_minChromaValue = dynamic_cast(GetChild("minchromavalue"));
+ m_maxChromaValue = dynamic_cast(GetChild("maxchromavalue"));
+ m_chromaGammaValue = dynamic_cast(GetChild("chromagammavalue"));
+
+ if (!CreateCommon() || !m_defaultValue || !m_minLumaLabel || !m_maxLumaLabel ||
+ !m_lumaGammaLabel || !m_minChromaLabel || !m_maxChromaLabel || !m_chromaGammaLabel ||
+ !m_minLumaValue || !m_maxLumaValue || !m_lumaGammaValue || !m_minChromaValue ||
+ !m_maxChromaValue || !m_chromaGammaValue)
+ {
+ VERBOSE(VB_IMPORTANT, "AdjustScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ connect(m_defaultValue, SIGNAL(valueChanged()), SLOT(useDefaults()));
+ connect(m_defaultValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_minLumaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_maxLumaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_lumaGammaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_minChromaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_maxChromaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+ connect(m_chromaGammaValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+
+ if (!Load())
+ return false;
+
+ BuildFocusList();
+
+ return true;
+}
+
+bool AdjustScreen::Load()
+{
+ if (m_edit && m_filterParams.trimmed().isEmpty())
+ {
+ m_defaultValue->SetCheckState(MythUIStateType::Full);
+ }
+
+ QString minLuma = "16";
+ QString maxLuma = "253";
+ float lumaGamma = 100;
+ QString minChroma = "16";
+ QString maxChroma = "240";
+ float chromaGamma = 100;
+
+ QStringList arguments = m_filterParams.split(':');
+
+ if (arguments.size() > 0 && !arguments[0].isEmpty())
+ minLuma = arguments[0];
+ if (arguments.size() > 1)
+ maxLuma = arguments[1];
+ if (arguments.size() > 2)
+ lumaGamma = arguments[2].toFloat() * 100;
+ if (arguments.size() > 3)
+ minChroma = arguments[3];
+ if (arguments.size() > 4)
+ maxChroma = arguments[4];
+ if (arguments.size() > 5)
+ chromaGamma = arguments[5].toFloat() * 100;
+
+ m_minLumaValue->SetRange(0, 255, 1);
+ m_minLumaValue->SetValue(minLuma);
+
+ m_maxLumaValue->SetRange(0, 255, 1);
+ m_maxLumaValue->SetValue(maxLuma);
+
+ m_lumaGammaValue->SetRange(0, 100, 1);
+ m_lumaGammaValue->SetValue(lumaGamma);
+
+ m_minChromaValue->SetRange(0, 255, 1);
+ m_minChromaValue->SetValue(minChroma);
+
+ m_maxChromaValue->SetRange(0, 255, 1);
+ m_maxChromaValue->SetValue(maxChroma);
+
+ m_chromaGammaValue->SetRange(0, 100, 1);
+ m_chromaGammaValue->SetValue(chromaGamma);
+
+ return true;
+}
+
+void AdjustScreen::useDefaults()
+{
+ bool visible = m_defaultValue->GetCheckState() != MythUIStateType::Full;
+
+ m_minLumaLabel->SetVisible(visible);
+ m_maxLumaLabel->SetVisible(visible);
+ m_lumaGammaLabel->SetVisible(visible);
+ m_minChromaLabel->SetVisible(visible);
+ m_maxChromaLabel->SetVisible(visible);
+ m_chromaGammaLabel->SetVisible(visible);
+ m_minLumaValue->SetVisible(visible);
+ m_maxLumaValue->SetVisible(visible);
+ m_lumaGammaValue->SetVisible(visible);
+ m_minChromaValue->SetVisible(visible);
+ m_maxChromaValue->SetVisible(visible);
+ m_chromaGammaValue->SetVisible(visible);
+}
+
+void AdjustScreen::accept()
+{
+ QString filter(m_filterName);
+
+ if(m_defaultValue->GetCheckState() != MythUIStateType::Full)
+ {
+ filter.append('=');
+ filter.append(m_minLumaValue->GetValue());
+ filter.append(':');
+ filter.append(m_maxLumaValue->GetValue());
+ filter.append(':');
+ filter.append(QString::number(m_lumaGammaValue->GetIntValue() / 100.0, 'g', 2));
+ filter.append(':');
+ filter.append(m_minChromaValue->GetValue());
+ filter.append(':');
+ filter.append(m_maxChromaValue->GetValue());
+ filter.append(':');
+ filter.append(QString::number(m_chromaGammaValue->GetIntValue() / 100.0, 'g', 2));
+ }
+
+ emit accepting(filter);
+ Close();
+}
+
+bool OneFieldScreen::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "onefieldscreen", this))
+ return false;
+
+ m_fieldValue = dynamic_cast(GetChild("fieldvalue"));
+
+ if (!CreateCommon() || !m_fieldValue)
+ {
+ VERBOSE(VB_IMPORTANT, "OneFieldScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ connect(m_fieldValue, SIGNAL(TakingFocus()), SLOT(setHelpText()));
+
+ if (!Load())
+ return false;
+
+ BuildFocusList();
+
+ return true;
+}
+
+bool OneFieldScreen::Load()
+{
+ if (m_filterParams == "bottom")
+ m_fieldValue->SetCheckState(MythUIStateType::Full);
+
+ return true;
+}
+
+void OneFieldScreen::accept()
+{
+ QString filter(m_filterName);
+
+ if(m_fieldValue->GetCheckState() == MythUIStateType::Full)
+ {
+ filter.append("=bottom");
+ }
+
+ emit accepting(filter);
+ Close();
+}
+
+bool CustomFilterScreen::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "customfilterscreen", this))
+ return false;
+
+ m_optionsInput = dynamic_cast(GetChild("optionsinput"));
+ m_heading = dynamic_cast(GetChild("heading"));
+ m_acceptButton = dynamic_cast(GetChild("acceptbutton"));
+
+ if (!m_optionsInput || !m_heading || !m_acceptButton)
+ {
+ VERBOSE(VB_IMPORTANT, "CustomFilterScreen, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ QString name(m_filterName);
+ name[0] = name[0].toUpper();
+ m_heading->SetText(tr("Configure") + ' ' + name + ' ' + tr("Filter"));
+ connect(m_acceptButton, SIGNAL(Clicked()), SLOT(accept()));
+
+ if (!Load())
+ return false;
+
+ BuildFocusList();
+
+ return true;
+}
+
+bool CustomFilterScreen::Load()
+{
+ m_optionsInput->SetText(m_filterParams);
+ return true;
+}
+
+void CustomFilterScreen::accept()
+{
+ QString filter(m_filterName);
+ if (!m_optionsInput->GetText().trimmed().isEmpty())
+ {
+ filter.append('=');
+ filter.append(m_optionsInput->GetText());
+ }
+
+ emit accepting(filter);
+ Close();
+}
+
Index: mythtv/libs/libmythtv/libmythtv.pro
===================================================================
--- mythtv/libs/libmythtv/libmythtv.pro (revision 22465)
+++ mythtv/libs/libmythtv/libmythtv.pro (working copy)
@@ -238,6 +238,12 @@
HEADERS += profilegroup.h
SOURCES += profilegroup.cpp
+ # Filter configuration stuff
+ HEADERS += filterlist.h
+ HEADERS += filterscreen.h
+ SOURCES += filterlist.cpp
+ SOURCES += filterscreen.cpp
+
# XBox LED control
HEADERS += xbox.h
SOURCES += xbox.cpp
Index: mythtv/libs/libmythtv/recordingprofile.h
===================================================================
--- mythtv/libs/libmythtv/recordingprofile.h (revision 22465)
+++ mythtv/libs/libmythtv/recordingprofile.h (working copy)
@@ -117,6 +117,8 @@
void ResizeTranscode(bool resize);
void SetLosslessTranscode(bool lossless);
void FiltersChanged(const QString &val);
+ void EditFilters();
+ void SetFilter(QString);
private:
ID *id;
Index: mythtv/libs/libmythtv/filterlist.cpp
===================================================================
--- mythtv/libs/libmythtv/filterlist.cpp (revision 0)
+++ mythtv/libs/libmythtv/filterlist.cpp (revision 0)
@@ -0,0 +1,476 @@
+
+#include "filterlist.h"
+#include "filterscreen.h"
+#include "mythverbose.h"
+#include "mythmainwindow.h"
+#include "mythdialogbox.h"
+
+Q_DECLARE_METATYPE(FilterConfiguration)
+
+/** \class FilterList
+ * \brief Provides an interface for viewing and editing video filters.
+ *
+ * FilterList displays the chain of video processing filters that the user
+ * has configured and provides an interface for editing this chain.
+ */
+FilterList::FilterList(MythScreenStack *parent, QString filterString) :
+ MythScreenType(parent, "FilterList"), m_filterString(filterString)
+{
+ m_filterList = NULL;
+ m_helpText = NULL;
+ m_helpLabel = NULL;
+ m_addButton = NULL;
+}
+
+bool FilterList::Create()
+{
+ if (!LoadWindowFromXML("filters-ui.xml", "filterlist", this))
+ return false;
+
+ m_filterList = dynamic_cast(GetChild("filters"));
+ m_helpText = dynamic_cast(GetChild("helptext"));
+ m_helpLabel = dynamic_cast(GetChild("helplabel"));
+ m_addButton = dynamic_cast(GetChild("addfilter"));
+
+ if (!m_filterList || !m_helpText || !m_addButton)
+ {
+ VERBOSE(VB_IMPORTANT, "FilterList, theme is missing "
+ "required elements");
+ return false;
+ }
+
+ connect(m_filterList, SIGNAL(itemSelected(MythUIButtonListItem *)),
+ SLOT(setHelpText(MythUIButtonListItem *)));
+ connect(m_filterList, SIGNAL(itemClicked(MythUIButtonListItem *)),
+ SLOT(popupMenu(MythUIButtonListItem *)));
+ connect(m_addButton, SIGNAL(TakingFocus()), SLOT(selectButton()));
+ connect(m_addButton, SIGNAL(Clicked()), SLOT(addFilter()));
+
+ m_addButton->SetLockable(false);
+
+ BuildFocusList();
+ Load();
+
+ return true;
+}
+
+void FilterList::Load()
+{
+ QStringList filters = m_filterString.split(',');
+
+ MythUIButtonListItem *item;
+ for (QStringList::Iterator filter = filters.begin(); filter != filters.end(); ++filter)
+ {
+ if (!filter->trimmed().isEmpty())
+ {
+ FilterConfiguration configuration = parseFilter(*filter);
+ item = new MythUIButtonListItem(m_filterList, *filter, qVariantFromValue(configuration));
+ }
+ }
+}
+
+void FilterList::selectButton()
+{
+ m_helpLabel->SetText(tr("Add Filter"));
+ m_helpText->SetText(tr("Add a new filter to the end of the list."));
+}
+
+void FilterList::addFilter()
+{
+ MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
+ MythDialogBox *addFilterPopup = new MythDialogBox(tr("Add Filter"), popupStack, "addfilterpopup");
+ if (addFilterPopup->Create())
+ {
+ popupStack->AddScreen(addFilterPopup);
+ addFilterPopup->SetReturnEvent(this, "add");
+
+ // get the list of the available filters on the system
+ filter_map_t info = m_manager.GetAllFilterInfo();
+ filter_map_t::iterator iter;
+ for (iter = info.begin(); iter != info.end(); ++iter)
+ {
+ QString name(iter->second->name);
+ addFilterPopup->AddButton(name, qVariantFromValue(name));
+ }
+ }
+}
+
+void FilterList::addFilter(QString name)
+{
+ FilterManager manager;
+
+ if (!configurable(name))
+ {
+ FilterConfiguration configuration = parseFilter(name);
+ MythUIButtonListItem *item = new MythUIButtonListItem(m_filterList, name,
+ qVariantFromValue(configuration));
+ }
+ else
+ {
+ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+ FilterScreen *filterScreen;
+
+ if (name == "crop")
+ {
+ filterScreen = new CropScreen(mainStack, name, "", false);
+ }
+ else if (name == "denoise3d")
+ {
+ filterScreen = new Denoise3dScreen(mainStack, name, "", false);
+ }
+ else if (name == "adjust")
+ {
+ filterScreen = new AdjustScreen(mainStack, name, "", false);
+ }
+ else if (name == "onefield")
+ {
+ filterScreen = new OneFieldScreen(mainStack, name, "", false);
+ }
+ else
+ {
+ filterScreen = new CustomFilterScreen(mainStack, name, "", false);
+ }
+
+ connect(filterScreen, SIGNAL(accepting(QString)), this, SLOT(getAddedFilter(QString)));
+
+ if (filterScreen->Create())
+ {
+ mainStack->AddScreen(filterScreen);
+ }
+ else
+ {
+ delete filterScreen;
+ }
+ }
+}
+
+bool FilterList::configurable(QString name) const
+{
+ return name != "bobdeint" &&
+ name != "fieldorderdoubleprocessdeint" &&
+ name != "forceyv12" &&
+ name != "forceyuv422p" &&
+ name != "forcergb24" &&
+ name != "forceargb32" &&
+ name != "kerneldeint" &&
+ name != "kerneldoubleprocessdeint" &&
+ name != "greedyhdeint" &&
+ name != "greedyhdoubleprocessdeint" &&
+ name != "invert" &&
+ name != "ivtc" &&
+ name != "linearblend" &&
+ name != "yadifdeint" &&
+ name != "yadifdoubleprocessdeint";
+}
+
+void FilterList::getAddedFilter(QString filter)
+{
+ FilterConfiguration configuration = parseFilter(filter);
+ MythUIButtonListItem *item = new MythUIButtonListItem(m_filterList, filter,
+ qVariantFromValue(configuration));
+}
+
+void FilterList::getEditedFilter(QString filter)
+{
+ FilterConfiguration configuration = parseFilter(filter);
+ MythUIButtonListItem* current = m_filterList->GetItemCurrent();
+ current->SetData(qVariantFromValue(configuration));
+ current->SetText(filter);
+ m_helpText->SetText(configuration.description);
+}
+
+void FilterList::disableFilter(MythUIButtonListItem *item)
+{
+ FilterConfiguration filter = qVariantValue(item->GetData());
+ filter.options = "-1";
+ item->SetData(qVariantFromValue(filter));
+ item->SetText(filter.name + '=' + filter.options);
+}
+
+void FilterList::enableFilter(MythUIButtonListItem *item)
+{
+ FilterConfiguration filter = qVariantValue(item->GetData());
+ filter.options = filter.prevOptions;
+ item->SetData(qVariantFromValue(filter));
+
+ if (!filter.options.trimmed().isEmpty())
+ {
+ item->SetText(filter.name + '=' + filter.options);
+ }
+}
+
+FilterConfiguration FilterList::parseFilter(const QString &filter) const
+{
+ FilterConfiguration configuration;
+ configuration.name = filter.section('=', 0, 0);
+ configuration.options = filter.section('=', 1, 1);
+ configuration.configurable = configurable(configuration.name);
+ configuration.canDisable = false;
+
+ if (configuration.name == "adjust")
+ configuration.canDisable = true;
+
+ if (configuration.options != "-1")
+ configuration.prevOptions = configuration.options;
+ else
+ configuration.prevOptions = "";
+
+ const FilterInfo* info = m_manager.GetFilterInfo(configuration.name);
+ if (info)
+ {
+ configuration.description.append(info->descript);
+ }
+ return configuration;
+}
+
+void FilterList::setHelpText(MythUIButtonListItem *item)
+{
+ if (!item || GetFocusWidget() != m_filterList)
+ return;
+
+ FilterConfiguration configuration = qVariantValue(item->GetData());
+ m_helpText->SetText(configuration.description);
+
+ QString name(configuration.name);
+ name[0] = name[0].toUpper();
+ m_helpLabel->SetText(name);
+}
+
+bool FilterList::keyPressEvent(QKeyEvent *event)
+{
+ if (GetFocusWidget()->keyPressEvent(event))
+ {
+ return true;
+ }
+
+ QStringList actions;
+ bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
+
+ for (int i = 0; i < actions.size() && !handled; i++)
+ {
+ handled = true;
+ QString action = actions[i];
+
+ MythUIButtonListItem* current = m_filterList->GetItemCurrent();
+
+ if (action == "MENU" && current != NULL)
+ {
+ popupMenu(current);
+ }
+ else if (action == "EDIT" && current != NULL)
+ {
+ editFilter(current);
+ }
+ else if (action == "DELETE" && current != NULL)
+ {
+ deleteFilter(current);
+ }
+ else if (action == "ESCAPE")
+ {
+ emit finished(buildFilterString());
+ GetScreenStack()->PopScreen();
+ }
+ else
+ {
+ handled = false;
+ }
+ }
+
+ if (!handled && MythScreenType::keyPressEvent(event))
+ {
+ handled = true;
+ }
+
+ return handled;
+}
+
+QString FilterList::buildFilterString()
+{
+ QString filterString = "";
+ int count = m_filterList->GetCount();
+ for (int i = 0; i < count; i++)
+ {
+ FilterConfiguration filter =
+ qVariantValue(m_filterList->GetItemAt(i)->GetData());
+ filterString.append(filter.name);
+
+ if (!filter.options.trimmed().isEmpty())
+ {
+ filterString.append('=');
+ filterString.append(filter.options);
+ }
+
+ if (i != count - 1)
+ filterString.append(',');
+ }
+
+ return filterString;
+}
+
+void FilterList::popupMenu(MythUIButtonListItem* current)
+{
+ int position = m_filterList->GetItemPos(current);
+ FilterConfiguration filter = qVariantValue(current->GetData());
+
+ MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
+ MythDialogBox *menuPopup = new MythDialogBox(tr("Manage Filter"), popupStack, "filterpopup");
+
+ if (menuPopup->Create())
+ {
+ popupStack->AddScreen(menuPopup);
+ menuPopup->SetReturnEvent(this, "manage");
+
+ if (position > 0)
+ {
+ menuPopup->AddButton(tr("Move Up"));
+ }
+
+ if (position < m_filterList->GetCount() - 1)
+ {
+ menuPopup->AddButton(tr("Move Down"));
+ }
+
+ bool disabled = filter.canDisable && filter.options == "-1";
+
+ if (filter.configurable && !disabled)
+ {
+ menuPopup->AddButton(tr("Edit"));
+ }
+
+ if (disabled)
+ {
+ menuPopup->AddButton(tr("Enable"));
+ }
+ else if (filter.canDisable)
+ {
+ menuPopup->AddButton(tr("Disable"));
+ }
+
+ menuPopup->AddButton(tr("Delete"));
+ menuPopup->AddButton(tr("Cancel"));
+ }
+}
+
+void FilterList::editFilter(MythUIButtonListItem *item)
+{
+ if (!item)
+ return;
+
+ FilterConfiguration filter = qVariantValue(item->GetData());
+
+ if (!filter.configurable)
+ {
+ return;
+ }
+
+ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+
+ FilterScreen *filterScreen;
+ if (filter.name == "crop")
+ {
+ filterScreen = new CropScreen(mainStack, filter.name, filter.options, true);
+ }
+ else if (filter.name == "denoise3d")
+ {
+ filterScreen = new Denoise3dScreen(mainStack, filter.name, filter.options, true);
+ }
+ else if (filter.name == "adjust")
+ {
+ filterScreen = new AdjustScreen(mainStack, filter.name, filter.options, true);
+ }
+ else if (filter.name == "onefield")
+ {
+ filterScreen = new OneFieldScreen(mainStack, filter.name, filter.options, true);
+ }
+ else
+ {
+ filterScreen = new CustomFilterScreen(mainStack, filter.name, filter.options, true);
+ }
+
+ connect(filterScreen, SIGNAL(accepting(QString)), this, SLOT(getEditedFilter(QString)));
+
+ if (filterScreen->Create())
+ {
+ mainStack->AddScreen(filterScreen);
+ }
+ else
+ {
+ delete filterScreen;
+ }
+}
+
+void FilterList::deleteFilter(MythUIButtonListItem *item)
+{
+ if (!item)
+ return;
+
+ m_filterList->RemoveItem(item);
+
+ if (m_filterList->GetCount() == 0)
+ {
+ m_helpLabel->Reset();
+ m_helpText->Reset();
+ }
+}
+
+void FilterList::moveFilterUp(MythUIButtonListItem *item)
+{
+ if (!item)
+ return;
+
+ item->MoveUpDown(true);
+}
+
+void FilterList::moveFilterDown(MythUIButtonListItem *item)
+{
+ if (!item)
+ return;
+
+ item->MoveUpDown(false);
+}
+
+void FilterList::customEvent(QEvent *event)
+{
+ if (event->type() == kMythDialogBoxCompletionEventType)
+ {
+ DialogCompletionEvent *dce =
+ dynamic_cast(event);
+
+ QString resultid= dce->GetId();
+ QString resultText = dce->GetResultText();
+
+ MythUIButtonListItem* current = m_filterList->GetItemCurrent();
+
+ if (resultid == "manage")
+ {
+ if (resultText == tr("Delete"))
+ {
+ deleteFilter(current);
+ }
+ else if (resultText == tr("Move Up"))
+ {
+ moveFilterUp(current);
+ }
+ else if (resultText == tr("Move Down"))
+ {
+ moveFilterDown(current);
+ }
+ else if (resultText == tr("Edit"))
+ {
+ editFilter(current);
+ }
+ else if (resultText == tr("Disable"))
+ {
+ disableFilter(current);
+ }
+ else if (resultText == tr("Enable"))
+ {
+ enableFilter(current);
+ }
+ }
+ else if (resultid == "add" && dce->GetResult() != -1)
+ {
+ addFilter(qVariantValue(dce->GetData()));
+ }
+ }
+}
Index: mythtv/libs/libmythtv/channelsettings.cpp
===================================================================
--- mythtv/libs/libmythtv/channelsettings.cpp (revision 22465)
+++ mythtv/libs/libmythtv/channelsettings.cpp (working copy)
@@ -1,7 +1,11 @@
+#include
+
#include "channelsettings.h"
#include "cardutil.h"
#include "channelutil.h"
+#include "filterlist.h"
#include "programinfo.h" // for COMM_DETECT*, GetPreferredSkipTypeCombinations()
+#include "mythcontext.h"
QString ChannelDBStorage::GetWhereClause(MSqlBindings &bindings) const
{
@@ -197,13 +201,13 @@
}
};
-class VideoFilters : public LineEditSetting, public ChannelDBStorage
+class VideoFilterButton : public ButtonSetting, public ChannelDBStorage
{
public:
- VideoFilters(const ChannelID &id) :
- LineEditSetting(this), ChannelDBStorage(this, id, "videofilters")
+ VideoFilterButton(const ChannelID &id) :
+ ButtonSetting(this), ChannelDBStorage(this, id, "videofilters")
{
- setLabel(QObject::tr("Video filters"));
+ setLabel(QObject::tr("Set Video filters"));
setHelpText(QObject::tr("Filters to be used when recording "
"from this channel. Not used with "
"hardware encoding cards."));
@@ -212,17 +216,15 @@
};
-class OutputFilters : public LineEditSetting, public ChannelDBStorage
+class OutputFilterButton : public ButtonSetting, public ChannelDBStorage
{
public:
- OutputFilters(const ChannelID &id) :
- LineEditSetting(this), ChannelDBStorage(this, id, "outputfilters")
+ OutputFilterButton(const ChannelID &id) :
+ ButtonSetting(this), ChannelDBStorage(this, id, "outputfilters")
{
- setLabel(QObject::tr("Playback filters"));
+ setLabel(QObject::tr("Set Playback filters"));
setHelpText(QObject::tr("Filters to be used when recordings "
- "from this channel are viewed. "
- "Start with a plus to append to the "
- "global playback filters."));
+ "from this channel are viewed."));
}
};
@@ -469,10 +471,120 @@
setLabel(QObject::tr("Channel Options - Filters"));
setUseLabel(false);
- addChild(new VideoFilters(id));
- addChild(new OutputFilters(id));
+ videoButton = new VideoFilterButton(id);
+ outputButton = new OutputFilterButton(id);
+
+ addChild(videoButton);
+ addChild(outputButton);
+
+ connect(videoButton, SIGNAL( pressed()),
+ this, SLOT(videoPressed()));
+ connect(outputButton, SIGNAL( pressed()),
+ this, SLOT(outputPressed()));
}
+void ChannelOptionsFilters::videoPressed()
+{
+ MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
+ FilterList *filterList = new FilterList(mainStack, videoButton->getValue());
+ if (!filterList->Create())
+ {
+ delete filterList;
+ return;
+ }
+
+ connect(filterList, SIGNAL(finished(QString)), this, SLOT(setInputFilters(QString)));
+
+ mainStack->AddScreen(filterList);
+
+ // HACK begin - remove when everything is using mythui
+ if (GetMythMainWindow()->currentWidget())
+ {
+ QWidget *widget = GetMythMainWindow()->currentWidget();
+ vector widgetList;
+
+ while (widget)
+ {
+ widgetList.push_back(widget);
+ GetMythMainWindow()->detach(widget);
+ widget = GetMythMainWindow()->currentWidget();
+ }
+
+ GetMythMainWindow()->GetPaintWindow()->raise();
+ GetMythMainWindow()->GetPaintWindow()->setFocus();
+
+ int screenCount = mainStack->TotalScreens();
+ do
+ {
+ qApp->processEvents();
+ usleep(5000);
+ } while (mainStack->TotalScreens() >= screenCount);
+
+ vector::reverse_iterator it;
+ for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
+ {
+ GetMythMainWindow()->attach(*it);
+ }
+ }
+ // HACK end
+}
+
+void ChannelOptionsFilters::outputPressed()
+{
+ MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
+ FilterList *filterList = new FilterList(mainStack, outputButton->getValue());
+ if (!filterList->Create())
+ {
+ delete filterList;
+ return;
+ }
+
+ connect(filterList, SIGNAL(finished(QString)), this, SLOT(setInputFilters(QString)));
+
+ mainStack->AddScreen(filterList);
+
+ // HACK begin - remove when everything is using mythui
+ if (GetMythMainWindow()->currentWidget())
+ {
+ QWidget *widget = GetMythMainWindow()->currentWidget();
+ vector widgetList;
+
+ while (widget)
+ {
+ widgetList.push_back(widget);
+ GetMythMainWindow()->detach(widget);
+ widget = GetMythMainWindow()->currentWidget();
+ }
+
+ GetMythMainWindow()->GetPaintWindow()->raise();
+ GetMythMainWindow()->GetPaintWindow()->setFocus();
+
+ int screenCount = mainStack->TotalScreens();
+ do
+ {
+ qApp->processEvents();
+ usleep(5000);
+ } while (mainStack->TotalScreens() >= screenCount);
+
+ vector::reverse_iterator it;
+ for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
+ {
+ GetMythMainWindow()->attach(*it);
+ }
+ }
+ // HACK end
+}
+
+void ChannelOptionsFilters::setOutputFilters(QString filters)
+{
+ outputButton->setValue(filters);
+}
+
+void ChannelOptionsFilters::setInputFilters(QString filters)
+{
+ videoButton->setValue(filters);
+}
+
ChannelOptionsV4L::ChannelOptionsV4L(const ChannelID& id) :
VerticalConfigurationGroup(false, true, false, false)
{
Index: mythtv/libs/libmythtv/filterlist.h
===================================================================
--- mythtv/libs/libmythtv/filterlist.h (revision 0)
+++ mythtv/libs/libmythtv/filterlist.h (revision 0)
@@ -0,0 +1,69 @@
+#ifndef FILTERLIST_H
+#define FILTERLIST_H
+
+// MythTV headers
+#include
+#include
+#include
+#include
+#include "filtermanager.h"
+
+struct FilterConfiguration
+{
+ QString name;
+ QString options;
+ QString description;
+ QString prevOptions;
+ bool configurable;
+ bool canDisable;
+};
+
+class FilterList : public MythScreenType
+{
+ Q_OBJECT
+
+ public:
+ FilterList(MythScreenStack *parent, QString filterString);
+ ~FilterList(void) {}
+
+ bool Create(void);
+
+ signals:
+ void finished(QString string);
+
+ private slots:
+ void setHelpText(MythUIButtonListItem *item);
+ void popupMenu(MythUIButtonListItem *item);
+ void addFilter();
+ void selectButton();
+ void getAddedFilter(QString filter);
+ void getEditedFilter(QString filter);
+
+ private:
+ void Load();
+
+ bool configurable(QString name) const;
+ void addFilter(QString name);
+ void deleteFilter(MythUIButtonListItem *item);
+ void moveFilterUp(MythUIButtonListItem *item);
+ void moveFilterDown(MythUIButtonListItem *item);
+ void editFilter(MythUIButtonListItem *item);
+ void enableFilter(MythUIButtonListItem *item);
+ void disableFilter(MythUIButtonListItem *item);
+ QString buildFilterString();
+
+ bool keyPressEvent(QKeyEvent *);
+ void customEvent(QEvent *);
+
+ FilterConfiguration parseFilter(const QString &filter) const;
+
+ FilterManager m_manager;
+ MythUIText *m_helpText;
+ MythUIText *m_helpLabel;
+ MythUIButtonList *m_filterList;
+ MythUIButton *m_addButton;
+ QString m_filterString;
+};
+
+#endif /* FILTERLIST_H */
+
Index: mythtv/libs/libmythtv/filtermanager.h
===================================================================
--- mythtv/libs/libmythtv/filtermanager.h (revision 22465)
+++ mythtv/libs/libmythtv/filtermanager.h (working copy)
@@ -49,10 +49,16 @@
int &height, int &bufsize,
int max_threads = 1);
+ const FilterInfo *GetFilterInfo(const QString &name) const;
+
+ filter_map_t GetAllFilterInfo()
+ {
+ return filter_map_t(filters);
+ }
+
private:
bool LoadFilterLib(const QString &path);
- const FilterInfo *GetFilterInfo(const QString &name) const;
-
+
library_map_t dlhandles;
filter_map_t filters;
};
Index: mythtv/libs/libmythtv/filterscreen.h
===================================================================
--- mythtv/libs/libmythtv/filterscreen.h (revision 0)
+++ mythtv/libs/libmythtv/filterscreen.h (revision 0)
@@ -0,0 +1,164 @@
+#ifndef FILTERSCREEN_H
+#define FILTERSCREEN_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class FilterScreen : public MythScreenType
+{
+ Q_OBJECT
+
+ public:
+ FilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit);
+ ~FilterScreen(void) {}
+
+ signals:
+ void accepting(QString string);
+
+ protected slots:
+ void setHelpText();
+ virtual void accept() = 0;
+
+ protected:
+ virtual bool Load() = 0;
+ bool CreateCommon();
+
+ MythUIText *m_heading;
+ MythUIText *m_helpText;
+ MythUIButton *m_cancelButton;
+ MythUIButton *m_acceptButton;
+ QString m_filterName;
+ QString m_filterParams;
+ bool m_edit;
+};
+
+class CropScreen : public FilterScreen
+{
+ Q_OBJECT
+
+ public:
+ CropScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ FilterScreen(parent, filterName, filterParams, edit) {}
+ ~CropScreen(void) {}
+
+ bool Create(void);
+
+ protected slots:
+ void accept();
+
+ protected:
+ bool Load();
+
+ MythUISpinBox *m_topValue;
+ MythUISpinBox *m_leftValue;
+ MythUISpinBox *m_bottomValue;
+ MythUISpinBox *m_rightValue;
+};
+
+class Denoise3dScreen : public FilterScreen
+{
+ Q_OBJECT
+
+ public:
+ Denoise3dScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ FilterScreen(parent, filterName, filterParams, edit) {}
+ ~Denoise3dScreen(void) {}
+
+ bool Create(void);
+
+ protected slots:
+ void accept();
+ void useDefaults();
+
+ protected:
+ bool Load();
+
+ MythUICheckBox *m_defaultValue;
+ MythUIText *m_lumaSpatialLabel;
+ MythUIText *m_chromaSpatialLabel;
+ MythUIText *m_lumaTemporalLabel;
+ MythUISpinBox *m_lumaSpatialValue;
+ MythUISpinBox *m_chromaSpatialValue;
+ MythUISpinBox *m_lumaTemporalValue;
+};
+
+class AdjustScreen : public FilterScreen
+{
+ Q_OBJECT
+
+ public:
+ AdjustScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ FilterScreen(parent, filterName, filterParams, edit) {}
+ ~AdjustScreen(void) {}
+
+ bool Create(void);
+
+ protected slots:
+ void accept();
+ void useDefaults();
+
+ protected:
+ bool Load();
+
+ MythUICheckBox *m_defaultValue;
+ MythUIText *m_minLumaLabel;
+ MythUIText *m_maxLumaLabel;
+ MythUIText *m_lumaGammaLabel;
+ MythUIText *m_minChromaLabel;
+ MythUIText *m_maxChromaLabel;
+ MythUIText *m_chromaGammaLabel;
+ MythUISpinBox *m_minLumaValue;
+ MythUISpinBox *m_maxLumaValue;
+ MythUISpinBox *m_lumaGammaValue;
+ MythUISpinBox *m_minChromaValue;
+ MythUISpinBox *m_maxChromaValue;
+ MythUISpinBox *m_chromaGammaValue;
+};
+
+class OneFieldScreen : public FilterScreen
+{
+ Q_OBJECT
+
+ public:
+ OneFieldScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ FilterScreen(parent, filterName, filterParams, edit) {}
+ ~OneFieldScreen(void) {}
+
+ bool Create(void);
+
+ protected slots:
+ void accept();
+
+ protected:
+ bool Load();
+
+ MythUICheckBox *m_fieldValue;
+};
+
+class CustomFilterScreen : public FilterScreen
+{
+ Q_OBJECT
+
+ public:
+ CustomFilterScreen(MythScreenStack *parent, QString filterName, QString filterParams, bool edit) :
+ FilterScreen(parent, filterName, filterParams, edit) {}
+ ~CustomFilterScreen(void) {}
+
+ bool Create(void);
+
+ protected slots:
+ void accept();
+
+ protected:
+ bool Load();
+
+ MythUITextEdit *m_optionsInput;
+};
+
+#endif /* FILTERSCREEN_H */
+
Index: mythtv/libs/libmythtv/recordingprofile.cpp
===================================================================
--- mythtv/libs/libmythtv/recordingprofile.cpp (revision 22465)
+++ mythtv/libs/libmythtv/recordingprofile.cpp (working copy)
@@ -2,8 +2,10 @@
#include
#include
+#include
#include "recordingprofile.h"
+#include "filterlist.h"
#include "cardutil.h"
#include "mythcontext.h"
#include "mythdb.h"
@@ -1008,18 +1010,17 @@
};
};
-class TranscodeFilters : public LineEditSetting, public CodecParamStorage
+class TranscodeFilters : public ButtonSetting, public CodecParamStorage
{
public:
TranscodeFilters(const RecordingProfile &parent) :
- LineEditSetting(this),
+ ButtonSetting(this),
CodecParamStorage(this, parent, "transcodefilters")
{
- setLabel(QObject::tr("Custom Filters"));
+ setLabel(QObject::tr("Set Custom Filters"));
setHelpText(QObject::tr("Filters used when transcoding with this "
"profile. This value must be blank to perform "
- "lossless transcoding. Format: "
- "[[=,]...]"
+ "lossless transcoding."
));
};
};
@@ -1285,6 +1286,8 @@
this, SLOT( SetLosslessTranscode(bool)));
connect(tr_filters, SIGNAL(valueChanged(const QString&)),
this, SLOT(FiltersChanged(const QString&)));
+ connect(tr_filters, SIGNAL(pressed ()),
+ this, SLOT(EditFilters()));
}
}
else if (type.toUpper() == "DVB")
@@ -1296,6 +1299,57 @@
Load();
}
+void RecordingProfile::EditFilters()
+{
+ MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
+ FilterList *filterList = new FilterList(mainStack, tr_filters->getValue());
+ if (!filterList->Create())
+ {
+ delete filterList;
+ return;
+ }
+
+ connect(filterList, SIGNAL(finished(QString)), this, SLOT(SetFilter(QString)));
+
+ mainStack->AddScreen(filterList);
+
+ // HACK begin - remove when everything is using mythui
+ if (GetMythMainWindow()->currentWidget())
+ {
+ QWidget *widget = GetMythMainWindow()->currentWidget();
+ vector widgetList;
+
+ while (widget)
+ {
+ widgetList.push_back(widget);
+ GetMythMainWindow()->detach(widget);
+ widget = GetMythMainWindow()->currentWidget();
+ }
+
+ GetMythMainWindow()->GetPaintWindow()->raise();
+ GetMythMainWindow()->GetPaintWindow()->setFocus();
+
+ int screenCount = mainStack->TotalScreens();
+ do
+ {
+ qApp->processEvents();
+ usleep(5000);
+ } while (mainStack->TotalScreens() >= screenCount);
+
+ vector::reverse_iterator it;
+ for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
+ {
+ GetMythMainWindow()->attach(*it);
+ }
+ }
+ // HACK end
+}
+
+void RecordingProfile::SetFilter(QString filter)
+{
+ tr_filters->setValue(filter);
+}
+
void RecordingProfile::FiltersChanged(const QString &val)
{
if (!tr_filters || !tr_lossless)
Index: mythtv/libs/libmythtv/channelsettings.h
===================================================================
--- mythtv/libs/libmythtv/channelsettings.h (revision 22465)
+++ mythtv/libs/libmythtv/channelsettings.h (working copy)
@@ -109,6 +109,8 @@
class OnAirGuide;
class XmltvID;
+class VideoFilterButton;
+class OutputFilterButton;
class MPUBLIC ChannelOptionsCommon: public VerticalConfigurationGroup
{
@@ -128,8 +130,18 @@
};
class MPUBLIC ChannelOptionsFilters: public VerticalConfigurationGroup {
+Q_OBJECT
public:
ChannelOptionsFilters(const ChannelID& id);
+public slots:
+ void outputPressed();
+ void videoPressed();
+ void setOutputFilters(QString);
+ void setInputFilters(QString);
+
+protected:
+ VideoFilterButton *videoButton;
+ OutputFilterButton *outputButton;
};
class MPUBLIC ChannelOptionsV4L: public VerticalConfigurationGroup {
Index: mythtv/programs/mythfrontend/globalsettings.cpp
===================================================================
--- mythtv/programs/mythfrontend/globalsettings.cpp (revision 22465)
+++ mythtv/programs/mythfrontend/globalsettings.cpp (working copy)
@@ -834,7 +834,7 @@
osdfade = new TransCheckBoxSetting();
deint0 = new TransComboBoxSetting();
deint1 = new TransComboBoxSetting();
- filters = new TransLineEditSetting(true);
+ filters = new TransButtonSetting();
for (uint i = 0; i < 2; ++i)
{
@@ -865,7 +865,7 @@
osdfade->setLabel(tr("OSD Fade"));
deint0->setLabel(tr("Primary Deinterlacer"));
deint1->setLabel(tr("Fallback Deinterlacer"));
- filters->setLabel(tr("Custom Filters"));
+ filters->setLabel(tr("Set Custom Filters"));
max_cpus->setHelpText(
tr("Maximum number of CPU cores used for video decoding and filtering.") +
@@ -906,15 +906,17 @@
addChild(page2);
connect(decoder, SIGNAL(valueChanged(const QString&)),
- this, SLOT(decoderChanged(const QString&)));\
+ this, SLOT(decoderChanged(const QString&)));
connect(vidrend, SIGNAL(valueChanged(const QString&)),
this, SLOT(vrenderChanged(const QString&)));
connect(osdrend, SIGNAL(valueChanged(const QString&)),
this, SLOT(orenderChanged(const QString&)));
- connect(deint0, SIGNAL(valueChanged(const QString&)),
+ connect(deint0, SIGNAL(valueChanged(const QString&)),
this, SLOT(deint0Changed(const QString&)));
- connect(deint1, SIGNAL(valueChanged(const QString&)),
+ connect(deint1, SIGNAL(valueChanged(const QString&)),
this, SLOT(deint1Changed(const QString&)));
+ connect(filters, SIGNAL(pressed()),
+ this, SLOT(filtersPressed()));
}
void PlaybackProfileItemConfig::Load(void)
@@ -978,6 +980,8 @@
deint1->setValue(pdeint1);
if (!pfilter.isEmpty())
filters->setValue(pfilter);
+
+ filters->setHelpText(tr("Filters: ") + pfilter);
}
void PlaybackProfileItemConfig::Save(void)
@@ -1084,6 +1088,58 @@
VideoDisplayProfile::GetDeinterlacerHelp(deint));
}
+void PlaybackProfileItemConfig::filtersPressed()
+{
+ MythScreenStack *mainStack = gContext->GetMainWindow()->GetMainStack();
+ FilterList *filterList = new FilterList(mainStack, filters->getValue());
+ if (!filterList->Create())
+ {
+ delete filterList;
+ return;
+ }
+
+ connect(filterList, SIGNAL(finished(QString)), this, SLOT(setFilters(QString)));
+
+ mainStack->AddScreen(filterList);
+
+ // HACK begin - remove when everything is using mythui
+ if (GetMythMainWindow()->currentWidget())
+ {
+ QWidget *widget = GetMythMainWindow()->currentWidget();
+ vector widgetList;
+
+ while (widget)
+ {
+ widgetList.push_back(widget);
+ GetMythMainWindow()->detach(widget);
+ widget = GetMythMainWindow()->currentWidget();
+ }
+
+ GetMythMainWindow()->GetPaintWindow()->raise();
+ GetMythMainWindow()->GetPaintWindow()->setFocus();
+
+ int screenCount = mainStack->TotalScreens();
+ do
+ {
+ qApp->processEvents();
+ usleep(5000);
+ } while (mainStack->TotalScreens() >= screenCount);
+
+ vector::reverse_iterator it;
+ for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
+ {
+ GetMythMainWindow()->attach(*it);
+ }
+ }
+ // HACK end
+}
+
+void PlaybackProfileItemConfig::setFilters(QString filter)
+{
+ filters->setValue(filter);
+ filters->setHelpText(tr("Filters: ") + filter);
+}
+
PlaybackProfileConfig::PlaybackProfileConfig(const QString &profilename) :
VerticalConfigurationGroup(false, false, true, true),
profile_name(profilename), needs_save(false),
Index: mythtv/programs/mythfrontend/globalsettings.h
===================================================================
--- mythtv/programs/mythfrontend/globalsettings.h (revision 22465)
+++ mythtv/programs/mythfrontend/globalsettings.h (working copy)
@@ -4,6 +4,7 @@
#include "libmyth/settings.h"
#include "libmyth/mythcontext.h"
#include "libmythtv/videodisplayprofile.h"
+#include "libmythtv/filterlist.h"
#include "themeinfo.h"
class ThemeSelector : public HostImageSelect
@@ -79,6 +80,8 @@
void orenderChanged(const QString &renderer);
void deint0Changed(const QString &deint);
void deint1Changed(const QString &deint);
+ void filtersPressed();
+ void setFilters(QString filter);
private:
ProfileItem &item;
@@ -92,7 +95,7 @@
TransCheckBoxSetting *osdfade;
TransComboBoxSetting *deint0;
TransComboBoxSetting *deint1;
- TransLineEditSetting *filters;
+ TransButtonSetting *filters;
};
class PlaybackProfileConfig : public VerticalConfigurationGroup