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
aa59948d
Commit
aa59948d
authored
Nov 26, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement disc chapter selection widget
parent
496b1f5f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
14 deletions
+108
-14
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+30
-0
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+5
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+41
-0
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+1
-0
modules/gui/qt4/ui/main_interface.ui
modules/gui/qt4/ui/main_interface.ui
+31
-14
No files found.
modules/gui/qt4/input_manager.cpp
View file @
aa59948d
...
@@ -107,7 +107,9 @@ void InputManager::update()
...
@@ -107,7 +107,9 @@ void InputManager::update()
vlc_value_t
val
;
vlc_value_t
val
;
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_CHOICESCOUNT
,
&
val
,
NULL
);
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_CHOICESCOUNT
,
&
val
,
NULL
);
if
(
val
.
i_int
>
0
)
if
(
val
.
i_int
>
0
)
{
emit
navigationChanged
(
1
);
// 1 = chapter, 2 = title, 0 = NO
emit
navigationChanged
(
1
);
// 1 = chapter, 2 = title, 0 = NO
}
else
else
emit
navigationChanged
(
2
);
emit
navigationChanged
(
2
);
}
}
...
@@ -166,6 +168,34 @@ void InputManager::togglePlayPause()
...
@@ -166,6 +168,34 @@ void InputManager::togglePlayPause()
emit
statusChanged
(
state
.
i_int
);
emit
statusChanged
(
state
.
i_int
);
}
}
void
InputManager
::
sectionPrev
()
{
if
(
hasInput
()
)
{
int
i_type
=
var_Type
(
p_input
,
"prev-chapter"
);
vlc_value_t
val
;
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_input
,
(
i_type
&
VLC_VAR_TYPE
)
!=
0
?
"prev-chapter"
:
"prev-title"
,
val
);
}
}
void
InputManager
::
sectionNext
()
{
if
(
hasInput
()
)
{
int
i_type
=
var_Type
(
p_input
,
"prev-chapter"
);
vlc_value_t
val
;
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_input
,
(
i_type
&
VLC_VAR_TYPE
)
!=
0
?
"next-chapter"
:
"next-title"
,
val
);
}
}
void
InputManager
::
sectionMenu
()
{
if
(
hasInput
()
)
var_SetInteger
(
p_input
,
"title 0"
,
2
);
}
void
InputManager
::
slower
()
void
InputManager
::
slower
()
{
{
if
(
hasInput
()
)
if
(
hasInput
()
)
...
...
modules/gui/qt4/input_manager.hpp
View file @
aa59948d
...
@@ -53,11 +53,16 @@ public slots:
...
@@ -53,11 +53,16 @@ public slots:
void
slower
();
void
slower
();
void
faster
();
void
faster
();
void
normalRate
();
void
normalRate
();
void
sectionNext
();
void
sectionPrev
();
void
sectionMenu
();
signals:
signals:
/// Send new position, new time and new length
/// Send new position, new time and new length
void
positionUpdated
(
float
,
int
,
int
);
void
positionUpdated
(
float
,
int
,
int
);
void
nameChanged
(
QString
);
void
nameChanged
(
QString
);
/// Used to signal whether we should show navigation buttons
void
navigationChanged
(
int
);
void
navigationChanged
(
int
);
/// Play/pause status
void
statusChanged
(
int
);
void
statusChanged
(
int
);
void
audioStarted
();
void
audioStarted
();
void
videoStarted
();
void
videoStarted
();
...
...
modules/gui/qt4/main_interface.cpp
View file @
aa59948d
...
@@ -126,9 +126,17 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
...
@@ -126,9 +126,17 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
this
,
setDisplay
(
float
,
int
,
int
)
);
this
,
setDisplay
(
float
,
int
,
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
nameChanged
(
QString
),
this
,
setName
(
QString
)
);
CONNECT
(
THEMIM
->
getIM
(),
nameChanged
(
QString
),
this
,
setName
(
QString
)
);
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
setStatus
(
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
setStatus
(
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
navigationChanged
(
int
),
this
,
setNavigation
(
int
)
);
CONNECT
(
slider
,
sliderDragged
(
float
),
CONNECT
(
slider
,
sliderDragged
(
float
),
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
CONNECT
(
ui
.
prevSectionButton
,
clicked
(),
THEMIM
->
getIM
(),
sectionPrev
()
);
CONNECT
(
ui
.
nextSectionButton
,
clicked
(),
THEMIM
->
getIM
(),
sectionNext
()
);
CONNECT
(
ui
.
menuButton
,
clicked
(),
THEMIM
->
getIM
(),
sectionMenu
()
);
var_Create
(
p_intf
,
"interaction"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_intf
,
"interaction"
,
VLC_VAR_ADDRESS
);
var_AddCallback
(
p_intf
,
"interaction"
,
InteractCallback
,
this
);
var_AddCallback
(
p_intf
,
"interaction"
,
InteractCallback
,
this
);
p_intf
->
b_interaction
=
VLC_TRUE
;
p_intf
->
b_interaction
=
VLC_TRUE
;
...
@@ -157,6 +165,10 @@ void MainInterface::handleMainUi( QSettings *settings )
...
@@ -157,6 +165,10 @@ void MainInterface::handleMainUi( QSettings *settings )
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
NULL
);
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
NULL
);
ui
.
hboxLayout
->
insertWidget
(
0
,
slider
);
ui
.
hboxLayout
->
insertWidget
(
0
,
slider
);
ui
.
discFrame
->
hide
();
BUTTON_SET_IMG
(
ui
.
prevSectionButton
,
""
,
previous
.
png
,
""
);
BUTTON_SET_IMG
(
ui
.
nextSectionButton
,
""
,
next
.
png
,
""
);
BUTTON_SET_IMG
(
ui
.
menuButton
,
""
,
previous
.
png
,
""
);
BUTTON_SET_ACT_I
(
ui
.
prevButton
,
""
,
previous
.
png
,
BUTTON_SET_ACT_I
(
ui
.
prevButton
,
""
,
previous
.
png
,
qtr
(
"Previous"
),
prev
()
);
qtr
(
"Previous"
),
prev
()
);
...
@@ -590,6 +602,35 @@ void MainInterface::setStatus( int status )
...
@@ -590,6 +602,35 @@ void MainInterface::setStatus( int status )
ui
.
playButton
->
setIcon
(
QIcon
(
":/pixmaps/play.png"
)
);
ui
.
playButton
->
setIcon
(
QIcon
(
":/pixmaps/play.png"
)
);
}
}
#define HELP_MENU N_("Menu")
#define HELP_PCH N_("Previous chapter")
#define HELP_NCH N_("Next chapter")
#define HELP_PTR N_("Previous track")
#define HELP_NTR N_("Next track")
void
MainInterface
::
setNavigation
(
int
navigation
)
{
// 1 = chapter, 2 = title, 0 = no
if
(
navigation
==
0
)
{
ui
.
discFrame
->
hide
();
}
else
if
(
navigation
==
1
)
{
ui
.
prevSectionButton
->
show
();
ui
.
prevSectionButton
->
setToolTip
(
qfu
(
HELP_PCH
)
);
ui
.
nextSectionButton
->
show
();
ui
.
nextSectionButton
->
setToolTip
(
qfu
(
HELP_NCH
)
);
ui
.
menuButton
->
show
();
ui
.
discFrame
->
show
();
}
else
{
ui
.
prevSectionButton
->
show
();
ui
.
prevSectionButton
->
setToolTip
(
qfu
(
HELP_PCH
)
);
ui
.
nextSectionButton
->
show
();
ui
.
nextSectionButton
->
setToolTip
(
qfu
(
HELP_NCH
)
);
ui
.
menuButton
->
hide
();
ui
.
discFrame
->
show
();
}
}
static
bool
b_my_volume
;
static
bool
b_my_volume
;
void
MainInterface
::
updateOnTimer
()
void
MainInterface
::
updateOnTimer
()
...
...
modules/gui/qt4/main_interface.hpp
View file @
aa59948d
...
@@ -99,6 +99,7 @@ private:
...
@@ -99,6 +99,7 @@ private:
public
slots
:
public
slots
:
void
undockPlaylist
();
void
undockPlaylist
();
private
slots
:
private
slots
:
void
setNavigation
(
int
);
void
setStatus
(
int
);
void
setStatus
(
int
);
void
setName
(
QString
);
void
setName
(
QString
);
void
setDisplay
(
float
,
int
,
int
);
void
setDisplay
(
float
,
int
,
int
);
...
...
modules/gui/qt4/ui/main_interface.ui
View file @
aa59948d
<ui version="4.0" >
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>MainInterfaceUI</class>
<class>MainInterfaceUI</class>
<widget class="QWidget" name="MainInterfaceUI" >
<widget class="QWidget" name="MainInterfaceUI" >
<property name="geometry" >
<property name="geometry" >
<rect>
<rect>
<x>0</x>
<x>0</x>
<y>0</y>
<y>0</y>
<width>
426
</width>
<width>
819
</width>
<height>
73
</height>
<height>
384
</height>
</rect>
</rect>
</property>
</property>
<property name="sizePolicy" >
<property name="sizePolicy" >
...
@@ -43,17 +40,38 @@
...
@@ -43,17 +40,38 @@
</item>
</item>
<item>
<item>
<widget class="QFrame" name="discFrame" >
<widget class="QFrame" name="discFrame" >
<property name="sizePolicy" >
<layout class="QHBoxLayout" >
<sizepolicy>
<property name="margin" >
<hsizetype>0</hsizetype>
<number>9</number>
<vsizetype>0</vsizetype>
</property>
<horstretch>0</horstretch>
<property name="spacing" >
<verstretch>0</verstretch>
<number>6</number>
</sizepolicy>
</property>
<item>
<widget class="QPushButton" name="menuButton" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="prevSectionButton" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextSectionButton" >
<property name="text" >
<string/>
</property>
</property>
</widget>
</widget>
</item>
</item>
</layout>
</layout>
</widget>
</item>
</layout>
</item>
</item>
<item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout" >
...
@@ -220,7 +238,6 @@
...
@@ -220,7 +238,6 @@
</item>
</item>
</layout>
</layout>
</widget>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<resources/>
<connections/>
<connections/>
</ui>
</ui>
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