Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
c6300505
Commit
c6300505
authored
Dec 28, 2011
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Dec 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: Add aspect ratio combobox to toolbar editor
Close #4127 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
dae3915c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
0 deletions
+59
-0
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+3
-0
modules/gui/qt4/components/controller.hpp
modules/gui/qt4/components/controller.hpp
+1
-0
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.cpp
+23
-0
modules/gui/qt4/components/controller_widget.hpp
modules/gui/qt4/components/controller_widget.hpp
+24
-0
modules/gui/qt4/dialogs/toolbar.cpp
modules/gui/qt4/dialogs/toolbar.cpp
+8
-0
No files found.
modules/gui/qt4/components/controller.cpp
View file @
c6300505
...
...
@@ -465,6 +465,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
CONNECT_MAP_SET
(
play
,
PLAY_ACTION
);
}
break
;
case
ASPECT_RATIO_COMBOBOX
:
widget
=
new
AspectRatioComboBox
(
p_intf
);
break
;
default:
msg_Warn
(
p_intf
,
"This should not happen %i"
,
button
);
break
;
...
...
modules/gui/qt4/components/controller.hpp
View file @
c6300505
...
...
@@ -99,6 +99,7 @@ typedef enum buttonType_e
TELETEXT_BUTTONS
,
ADVANCED_CONTROLLER
,
PLAYBACK_BUTTONS
,
ASPECT_RATIO_COMBOBOX
,
SPECIAL_MAX
,
WIDGET_SPACER
=
0x40
,
...
...
modules/gui/qt4/components/controller_widget.cpp
View file @
c6300505
...
...
@@ -267,3 +267,26 @@ void LoopButton::updateButtonIcons( int value )
setIcon
(
(
value
==
REPEAT_ONE
)
?
QIcon
(
":/buttons/playlist/repeat_one"
)
:
QIcon
(
":/buttons/playlist/repeat_all"
)
);
}
void
AspectRatioComboBox
::
updateRatios
()
{
/* Clear the list before updating */
this
->
clear
();
vlc_value_t
val_list
,
text_list
;
vout_thread_t
*
p_vout
=
THEMIM
->
getVout
();
/* Disable if there is no vout */
if
(
p_vout
==
NULL
)
{
addItem
(
"Aspect Ratio"
);
setDisabled
(
true
);
return
;
}
var_Change
(
p_vout
,
"aspect-ratio"
,
VLC_VAR_GETLIST
,
&
val_list
,
&
text_list
);
for
(
int
i
=
0
;
i
<
val_list
.
p_list
->
i_count
;
i
++
)
addItem
(
QString
(
text_list
.
p_list
->
p_values
[
i
].
psz_string
),
QString
(
val_list
.
p_list
->
p_values
[
i
].
psz_string
)
);
setEnabled
(
true
);
var_FreeList
(
&
val_list
,
&
text_list
);
}
void
AspectRatioComboBox
::
updateAspectRatio
(
int
x
)
{
vout_thread_t
*
p_vout
=
THEMIM
->
getVout
();
if
(
p_vout
&&
x
>=
0
)
var_SetString
(
p_vout
,
"aspect-ratio"
,
qtu
(
itemData
(
x
).
toString
()
)
);
}
modules/gui/qt4/components/controller_widget.hpp
View file @
c6300505
...
...
@@ -29,9 +29,12 @@
#endif
#include "qt4.hpp"
#include "input_manager.hpp"
#include <vlc_vout.h>
/* vout_thread_t for aspect ratio combobox */
#include <QWidget>
#include <QToolButton>
#include <QComboBox>
class
QLabel
;
class
QFrame
;
...
...
@@ -67,6 +70,27 @@ private slots:
void
updateButtonIcons
(
bool
,
bool
);
};
class
AspectRatioComboBox
:
public
QComboBox
{
Q_OBJECT
public:
AspectRatioComboBox
(
intf_thread_t
*
_p_intf
)
{
p_intf
=
_p_intf
;
CONNECT
(
THEMIM
->
getIM
(),
voutChanged
(
bool
),
this
,
updateRatios
()
);
CONNECT
(
this
,
currentIndexChanged
(
int
),
this
,
updateAspectRatio
(
int
)
);
this
->
updateRatios
();
}
public
slots
:
void
updateRatios
();
void
updateAspectRatio
(
int
);
private:
intf_thread_t
*
p_intf
;
};
#define VOLUME_MAX 200
class
SoundWidget
:
public
QWidget
{
...
...
modules/gui/qt4/dialogs/toolbar.cpp
View file @
c6300505
...
...
@@ -35,6 +35,10 @@
#include "util/buttons/BrowseButton.hpp"
#include "util/buttons/RoundButton.hpp"
#include "qt4.hpp"
#include "input_manager.hpp"
#include <vlc_vout.h>
/* vout_thread_t for aspect ratio combobox */
#include <QScrollArea>
#include <QGroupBox>
#include <QLabel>
...
...
@@ -441,6 +445,10 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
}
widgetItem
->
setText
(
qtr
(
"Playback Buttons"
)
);
break
;
case
ASPECT_RATIO_COMBOBOX
:
widget
=
new
AspectRatioComboBox
(
p_intf
);
widgetItem
->
setText
(
qtr
(
"Aspect ratio selector"
)
);
break
;
default:
msg_Warn
(
p_intf
,
"This should not happen %i"
,
i
);
break
;
...
...
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