Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
d77ec471
Commit
d77ec471
authored
Jun 17, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a huge bunch of things in the video effects panel. Implement combo box options.
parent
d6ce9ba9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
13 deletions
+112
-13
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+53
-12
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+1
-0
modules/gui/qt4/ui/video_effects.ui
modules/gui/qt4/ui/video_effects.ui
+58
-1
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
d77ec471
...
...
@@ -114,6 +114,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QWidget *_parent ) :
} \
CONNECT( ui.widget##Enable, clicked(), this, updateFilters() );
#define SETUP_VFILTER_OPTION( widget, signal ) \
initComboBoxItems( ui.widget ); \
setWidgetValue( ui.widget ); \
CONNECT( ui.widget, signal, this, updateFilterOptions() );
...
...
@@ -140,7 +141,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QWidget *_parent ) :
SETUP_VFILTER_OPTION
(
gradientTypeCheck
,
stateChanged
(
int
)
)
SETUP_VFILTER_OPTION
(
gradientCartoonCheck
,
stateChanged
(
int
)
)
SETUP_VFILTER
(
blur
)
SETUP_VFILTER
(
motion
blur
)
SETUP_VFILTER_OPTION
(
blurFactorSlider
,
valueChanged
(
int
)
)
SETUP_VFILTER
(
motiondetect
)
...
...
@@ -211,7 +212,7 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
vlc_object_find_name
(
p_intf
->
p_libvlc_global
,
psz_name
,
FIND_CHILD
);
if
(
!
p_obj
)
{
msg_Err
(
p_intf
,
"Unable to find filter module
."
);
msg_Err
(
p_intf
,
"Unable to find filter module
\"
%s
\n
."
,
psz_name
);
return
;
}
...
...
@@ -319,6 +320,32 @@ void ExtVideo::updateFilters()
:
groupbox
->
isChecked
()
);
}
void
ExtVideo
::
initComboBoxItems
(
QObject
*
widget
)
{
QComboBox
*
combobox
=
qobject_cast
<
QComboBox
*>
(
widget
);
if
(
!
combobox
)
return
;
QString
option
=
OptionFromWidgetName
(
widget
);
module_config_t
*
p_item
=
config_FindConfig
(
VLC_OBJECT
(
p_intf
),
option
.
toStdString
().
c_str
()
);
if
(
p_item
)
{
int
i_type
=
p_item
->
i_type
&
CONFIG_ITEM
;
for
(
int
i_index
=
0
;
i_index
<
p_item
->
i_list
;
i_index
++
)
{
if
(
i_type
==
CONFIG_ITEM_INTEGER
||
i_type
==
CONFIG_ITEM_BOOL
)
combobox
->
addItem
(
qfu
(
p_item
->
ppsz_list_text
[
i_index
]
),
p_item
->
pi_list
[
i_index
]
);
else
if
(
i_type
==
CONFIG_ITEM_STRING
)
combobox
->
addItem
(
qfu
(
p_item
->
ppsz_list_text
[
i_index
]
),
p_item
->
ppsz_list
[
i_index
]
);
}
}
else
{
msg_Err
(
p_intf
,
"Couldn't find option
\"
%s
\"
."
,
option
.
toStdString
().
c_str
()
);
}
}
void
ExtVideo
::
setWidgetValue
(
QObject
*
widget
)
{
QString
module
=
ModuleFromWidgetName
(
widget
->
parent
()
);
...
...
@@ -384,6 +411,8 @@ void ExtVideo::setWidgetValue( QObject *widget )
sprintf
(
str
,
"%06X"
,
val
.
i_int
);
lineedit
->
setText
(
str
);
}
else
if
(
combobox
)
combobox
->
setCurrentIndex
(
combobox
->
findData
(
val
.
i_int
)
);
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
}
else
if
(
i_type
==
VLC_VAR_FLOAT
)
...
...
@@ -397,6 +426,8 @@ void ExtVideo::setWidgetValue( QObject *widget )
{
const
char
*
psz_string
=
NULL
;
if
(
lineedit
)
lineedit
->
setText
(
qfu
(
val
.
psz_string
)
);
else
if
(
combobox
)
combobox
->
setCurrentIndex
(
combobox
->
findData
(
qfu
(
val
.
psz_string
)
)
);
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
free
(
val
.
psz_string
);
}
...
...
@@ -426,13 +457,13 @@ void ExtVideo::updateFilterOptions()
}
int
i_type
=
var_Type
(
p_obj
,
option
.
toStdString
().
c_str
()
);
if
(
!
(
i_type
&
VLC_VAR_ISCOMMAND
)
)
bool
b_is_command
=
(
i_type
&
VLC_VAR_ISCOMMAND
);
if
(
!
b_is_command
)
{
vlc_object_release
(
p_obj
);
msg_Err
(
p_intf
,
"Module %s's %s variable isn't a command."
,
msg_Warn
(
p_intf
,
"Module %s's %s variable isn't a command. You'll need to restart the filter to take change into account."
,
module
.
toStdString
().
c_str
(),
option
.
toStdString
().
c_str
()
);
return
;
/* FIXME: restart automatically somewhere near the end of this function */
}
/* Try to cast to all the widgets we're likely to encounter. Only
...
...
@@ -454,13 +485,17 @@ void ExtVideo::updateFilterOptions()
else
if
(
spinbox
)
i_int
=
spinbox
->
value
();
else
if
(
dial
)
i_int
=
(
540
-
dial
->
value
())
%
360
;
else
if
(
lineedit
)
i_int
=
lineedit
->
text
().
toInt
(
NULL
,
16
);
else
if
(
combobox
)
i_int
=
combobox
->
itemData
(
combobox
->
currentIndex
()).
toInt
();
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
config_PutInt
(
p_intf
,
option
.
toStdString
().
c_str
(),
i_int
);
if
(
b_is_command
)
{
if
(
i_type
==
VLC_VAR_INTEGER
)
var_SetInteger
(
p_obj
,
option
.
toStdString
().
c_str
(),
i_int
);
else
var_SetBool
(
p_obj
,
option
.
toStdString
().
c_str
(),
i_int
);
}
}
else
if
(
i_type
==
VLC_VAR_FLOAT
)
{
double
f_float
=
0
;
...
...
@@ -470,15 +505,21 @@ void ExtVideo::updateFilterOptions()
else
if
(
lineedit
)
f_float
=
lineedit
->
text
().
toDouble
();
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
config_PutFloat
(
p_intf
,
option
.
toStdString
().
c_str
(),
f_float
);
if
(
b_is_command
)
var_SetFloat
(
p_obj
,
option
.
toStdString
().
c_str
(),
f_float
);
}
else
if
(
i_type
==
VLC_VAR_STRING
)
{
char
*
psz_string
=
NULL
;
if
(
lineedit
)
psz_string
=
qtu
(
lineedit
->
text
());
else
if
(
combobox
)
psz_string
=
qtu
(
combobox
->
itemData
(
combobox
->
currentIndex
()).
toString
());
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
psz_string
=
strdup
(
psz_string
);
config_PutPsz
(
p_intf
,
option
.
toStdString
().
c_str
(),
psz_string
);
if
(
b_is_command
)
var_SetString
(
p_obj
,
option
.
toStdString
().
c_str
(),
psz_string
);
free
(
psz_string
);
}
else
msg_Err
(
p_intf
,
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
d77ec471
...
...
@@ -45,6 +45,7 @@ private:
Ui
::
ExtVideoWidget
ui
;
QSignalMapper
*
filterMapper
;
intf_thread_t
*
p_intf
;
void
initComboBoxItems
(
QObject
*
);
void
setWidgetValue
(
QObject
*
);
void
ChangeVFiltersString
(
char
*
psz_name
,
vlc_bool_t
b_add
);
private
slots
:
...
...
modules/gui/qt4/ui/video_effects.ui
View file @
d77ec471
...
...
@@ -86,9 +86,24 @@
</item>
<item row="0" column="1" >
<widget class="QSlider" name="sharpenSigmaSlider" >
<property name="maximum" >
<number>200</number>
</property>
<property name="singleStep" >
<number>1</number>
</property>
<property name="pageStep" >
<number>10</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>100</number>
</property>
</widget>
</item>
</layout>
...
...
@@ -123,6 +138,12 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>60</number>
</property>
</widget>
</item>
<item row="4" column="1" >
...
...
@@ -133,6 +154,9 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>50</number>
</property>
...
...
@@ -146,6 +170,9 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>100</number>
</property>
...
...
@@ -159,6 +186,9 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>100</number>
</property>
...
...
@@ -172,6 +202,9 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>100</number>
</property>
...
...
@@ -521,7 +554,7 @@
</widget>
</item>
<item row="0" column="1" >
<widget class="QGroupBox" name="blurEnable" >
<widget class="QGroupBox" name="
motion
blurEnable" >
<property name="title" >
<string>_("Motion blur")</string>
</property>
...
...
@@ -547,9 +580,24 @@
</item>
<item row="0" column="1" >
<widget class="QSlider" name="blurFactorSlider" >
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" >
<number>127</number>
</property>
<property name="value" >
<number>80</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>16</number>
</property>
</widget>
</item>
</layout>
...
...
@@ -852,9 +900,18 @@
</item>
<item row="3" column="1" colspan="2" >
<widget class="QSlider" name="logoTransparencySlider" >
<property name="maximum" >
<number>255</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition" >
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval" >
<number>32</number>
</property>
</widget>
</item>
<item row="2" column="2" >
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment