Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
5c524ec7
Commit
5c524ec7
authored
Apr 17, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: use QVLCBool for random and repeat/loop
parent
2fba1b05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
45 deletions
+17
-45
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+12
-43
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+5
-2
No files found.
modules/gui/qt4/input_manager.cpp
View file @
5c524ec7
...
...
@@ -56,11 +56,6 @@ static int VolumeChanged( vlc_object_t *, const char *,
static
int
SoundMuteChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
RandomChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
LoopOrRepeatChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
InputEvent
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
VbiEvent
(
vlc_object_t
*
,
const
char
*
,
...
...
@@ -929,7 +924,9 @@ void InputManager::AtoBLoop( float, int64_t i_time, int )
**********************************************************************/
MainInputManager
::
MainInputManager
(
intf_thread_t
*
_p_intf
)
:
QObject
(
NULL
),
p_intf
(
_p_intf
)
:
QObject
(
NULL
),
p_intf
(
_p_intf
),
random
(
VLC_OBJECT
(
THEPL
),
"random"
),
repeat
(
VLC_OBJECT
(
THEPL
),
"repeat"
),
loop
(
VLC_OBJECT
(
THEPL
),
"loop"
)
{
p_input
=
NULL
;
im
=
new
InputManager
(
this
,
p_intf
);
...
...
@@ -940,9 +937,9 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback
(
THEPL
,
"leaf-to-parent"
,
LeafToParent
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
var_AddCallback
(
THEPL
,
"random"
,
RandomChanged
,
this
);
var_AddCallback
(
THEPL
,
"repeat"
,
LoopOrRepeatChanged
,
this
);
var_AddCallback
(
THEPL
,
"loop"
,
LoopOrRepeatChanged
,
this
);
random
.
addCallback
(
this
,
SLOT
(
notifyRandom
(
bool
))
);
repeat
.
addCallback
(
this
,
SLOT
(
notifyRepeatLoop
(
bool
))
);
loop
.
addCallback
(
this
,
SLOT
(
notifyRepeatLoop
(
bool
))
);
var_AddCallback
(
THEPL
,
"volume"
,
VolumeChanged
,
this
);
var_AddCallback
(
THEPL
,
"mute"
,
SoundMuteChanged
,
this
);
...
...
@@ -980,9 +977,6 @@ MainInputManager::~MainInputManager()
var_DelCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
var_DelCallback
(
THEPL
,
"random"
,
RandomChanged
,
this
);
var_DelCallback
(
THEPL
,
"repeat"
,
LoopOrRepeatChanged
,
this
);
var_DelCallback
(
THEPL
,
"loop"
,
LoopOrRepeatChanged
,
this
);
/* Save some interface state in configuration, at module quit */
config_PutInt
(
p_intf
,
"random"
,
var_GetBool
(
THEPL
,
"random"
)
);
...
...
@@ -1030,12 +1024,6 @@ void MainInputManager::customEvent( QEvent *event )
plEv
=
static_cast
<
PLEvent
*>
(
event
);
emit
playlistNotEmpty
(
plEv
->
i_item
>=
0
);
return
;
case
RandomChanged_Type
:
emit
randomChanged
(
var_GetBool
(
THEPL
,
"random"
)
);
return
;
case
LoopOrRepeatChanged_Type
:
notifyRepeatLoop
();
return
;
case
LeafToParent_Type
:
plEv
=
static_cast
<
PLEvent
*>
(
event
);
emit
leafBecameParent
(
plEv
->
i_item
);
...
...
@@ -1143,7 +1131,12 @@ void MainInputManager::toggleRandom()
var_ToggleBool
(
THEPL
,
"random"
);
}
void
MainInputManager
::
notifyRepeatLoop
()
void
MainInputManager
::
notifyRandom
(
bool
value
)
{
emit
randomChanged
(
value
);
}
void
MainInputManager
::
notifyRepeatLoop
(
bool
)
{
int
i_value
=
var_GetBool
(
THEPL
,
"loop"
)
*
REPEAT_ALL
+
var_GetBool
(
THEPL
,
"repeat"
)
*
REPEAT_ONE
;
...
...
@@ -1265,27 +1258,3 @@ static int PLItemRemoved
}
return
VLC_SUCCESS
;
}
static
int
RandomChanged
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
VLC_UNUSED
(
obj
);
VLC_UNUSED
(
var
);
VLC_UNUSED
(
old
);
VLC_UNUSED
(
cur
);
MainInputManager
*
mim
=
static_cast
<
MainInputManager
*>
(
data
);
IMEvent
*
event
=
new
IMEvent
(
RandomChanged_Type
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
static
int
LoopOrRepeatChanged
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
VLC_UNUSED
(
obj
);
VLC_UNUSED
(
var
);
VLC_UNUSED
(
old
);
VLC_UNUSED
(
cur
);
MainInputManager
*
mim
=
static_cast
<
MainInputManager
*>
(
data
);
IMEvent
*
event
=
new
IMEvent
(
LoopOrRepeatChanged_Type
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
modules/gui/qt4/input_manager.hpp
View file @
5c524ec7
...
...
@@ -33,6 +33,7 @@
#include "qt4.hpp"
#include "util/singleton.hpp"
#include "variables.hpp"
#include <QObject>
#include <QEvent>
...
...
@@ -273,8 +274,8 @@ private:
InputManager
*
im
;
input_thread_t
*
p_input
;
intf_thread_t
*
p_intf
;
QVLCBool
random
,
repeat
,
loop
;
void
notifyRepeatLoop
();
public
slots
:
void
togglePlayPause
();
void
play
();
...
...
@@ -287,7 +288,9 @@ public slots:
void
activatePlayQuit
(
bool
);
void
loopRepeatLoopStatus
();
private
slots
:
void
notifyRandom
(
bool
);
void
notifyRepeatLoop
(
bool
);
signals:
void
inputChanged
(
input_thread_t
*
);
void
volumeChanged
();
...
...
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