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
a47f5608
Commit
a47f5608
authored
May 29, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start handling input
Quit
parent
6309ebbf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
8 deletions
+63
-8
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+1
-4
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+6
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+44
-3
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+8
-0
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+4
-1
No files found.
modules/gui/qt4/dialogs_provider.cpp
View file @
a47f5608
...
@@ -33,7 +33,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
...
@@ -33,7 +33,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
QObject
(
NULL
),
p_intf
(
_p_intf
)
QObject
(
NULL
),
p_intf
(
_p_intf
)
{
{
idle_timer
=
new
QTimer
(
this
);
idle_timer
=
new
QTimer
(
this
);
idle_timer
->
start
(
0
);
//
idle_timer->start( 0 );
fixed_timer
=
new
QTimer
(
this
);
fixed_timer
=
new
QTimer
(
this
);
fixed_timer
->
start
(
100
/* milliseconds */
);
fixed_timer
->
start
(
100
/* milliseconds */
);
...
@@ -90,17 +90,14 @@ void DialogsProvider::openDialog( int i_dialog )
...
@@ -90,17 +90,14 @@ void DialogsProvider::openDialog( int i_dialog )
void
DialogsProvider
::
streaminfoDialog
()
void
DialogsProvider
::
streaminfoDialog
()
{
{
StreamInfoDialog
::
getInstance
(
p_intf
)
->
toggleVisible
();
StreamInfoDialog
::
getInstance
(
p_intf
)
->
toggleVisible
();
QObject
::
connect
(
DialogsProvider
::
getInstance
(
NULL
)
->
fixed_timer
,
SIGNAL
(
timeout
()
),
this
,
SLOT
(
prefsDialog
()
))
;
}
}
void
DialogsProvider
::
prefsDialog
()
void
DialogsProvider
::
prefsDialog
()
{
{
fprintf
(
stderr
,
"P
\n
"
);
}
}
void
DialogsProvider
::
messagesDialog
()
void
DialogsProvider
::
messagesDialog
()
{
{
fprintf
(
stderr
,
"M
\n
"
);
}
}
void
DialogsProvider
::
popupMenu
(
int
i_dialog
)
void
DialogsProvider
::
popupMenu
(
int
i_dialog
)
...
...
modules/gui/qt4/input_manager.cpp
View file @
a47f5608
...
@@ -40,6 +40,7 @@ InputManager::~InputManager()
...
@@ -40,6 +40,7 @@ InputManager::~InputManager()
void
InputManager
::
setInput
(
input_thread_t
*
_p_input
)
void
InputManager
::
setInput
(
input_thread_t
*
_p_input
)
{
{
fprintf
(
stderr
,
"[IM] Got input
\n
"
);
p_input
=
_p_input
;
p_input
=
_p_input
;
emit
reset
();
emit
reset
();
}
}
...
@@ -58,5 +59,10 @@ void InputManager::update()
...
@@ -58,5 +59,10 @@ void InputManager::update()
i_time
=
var_GetTime
(
p_input
,
"time"
)
/
1000000
;
i_time
=
var_GetTime
(
p_input
,
"time"
)
/
1000000
;
f_pos
=
var_GetFloat
(
p_input
,
"position"
);
f_pos
=
var_GetFloat
(
p_input
,
"position"
);
fprintf
(
stderr
,
"Changing pos
\n
"
);
emit
positionUpdated
(
f_pos
,
i_time
,
i_length
);
emit
positionUpdated
(
f_pos
,
i_time
,
i_length
);
}
}
void
InputManager
::
sliderUpdate
(
float
new_pos
)
{
}
modules/gui/qt4/main_interface.cpp
View file @
a47f5608
...
@@ -23,14 +23,18 @@
...
@@ -23,14 +23,18 @@
#include "main_interface.hpp"
#include "main_interface.hpp"
#include "input_manager.hpp"
#include "input_manager.hpp"
#include "dialogs_provider.hpp"
#include "dialogs_provider.hpp"
#include <QCloseEvent>
MainInterface
::
MainInterface
(
intf_thread_t
*
p_intf
)
:
QWidget
(
NULL
)
MainInterface
::
MainInterface
(
intf_thread_t
*
_p_intf
)
:
QWidget
(
NULL
),
p_intf
(
_p_intf
)
{
{
fprintf
(
stderr
,
"QT Main interface
\n
"
);
fprintf
(
stderr
,
"QT Main interface
\n
"
);
/* Init UI */
/* Init UI */
/* Init input manager */
/* Init input manager */
p_input
=
NULL
;
main_input_manager
=
new
InputManager
(
this
,
p_intf
);
}
}
void
MainInterface
::
init
()
void
MainInterface
::
init
()
...
@@ -41,6 +45,7 @@ void MainInterface::init()
...
@@ -41,6 +45,7 @@ void MainInterface::init()
/* Tell input manager about the input changes */
/* Tell input manager about the input changes */
QObject
::
connect
(
this
,
SIGNAL
(
inputChanged
(
input_thread_t
*
)
),
QObject
::
connect
(
this
,
SIGNAL
(
inputChanged
(
input_thread_t
*
)
),
main_input_manager
,
SLOT
(
setInput
(
input_thread_t
*
)
)
);
main_input_manager
,
SLOT
(
setInput
(
input_thread_t
*
)
)
);
}
}
MainInterface
::~
MainInterface
()
MainInterface
::~
MainInterface
()
...
@@ -49,5 +54,41 @@ MainInterface::~MainInterface()
...
@@ -49,5 +54,41 @@ MainInterface::~MainInterface()
void
MainInterface
::
updateOnTimer
()
void
MainInterface
::
updateOnTimer
()
{
{
if
(
p_intf
->
b_die
)
{
QApplication
::
quit
();
}
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
p_input
&&
p_input
->
b_dead
)
{
vlc_object_release
(
p_input
);
p_input
=
NULL
;
emit
inputChanged
(
NULL
);
}
if
(
!
p_input
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
assert
(
p_playlist
);
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
if
(
p_input
)
{
vlc_object_yield
(
p_input
);
fprintf
(
stderr
,
"Sending input
\n
"
);
emit
inputChanged
(
p_input
);
}
PL_UNLOCK
;
vlc_object_release
(
p_playlist
);
}
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
}
void
MainInterface
::
closeEvent
(
QCloseEvent
*
e
)
{
hide
();
p_intf
->
b_die
=
VLC_TRUE
;
}
}
modules/gui/qt4/main_interface.hpp
View file @
a47f5608
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <QWidget>
#include <QWidget>
class
InputManager
;
class
InputManager
;
class
QCloseEvent
;
class
MainInterface
:
public
QWidget
class
MainInterface
:
public
QWidget
{
{
...
@@ -35,10 +36,17 @@ public:
...
@@ -35,10 +36,17 @@ public:
MainInterface
(
intf_thread_t
*
);
MainInterface
(
intf_thread_t
*
);
virtual
~
MainInterface
();
virtual
~
MainInterface
();
void
init
();
void
init
();
protected:
void
closeEvent
(
QCloseEvent
*
);
private:
private:
InputManager
*
main_input_manager
;
InputManager
*
main_input_manager
;
intf_thread_t
*
p_intf
;
/// Main input associated to the playlist
input_thread_t
*
p_input
;
private
slots
:
private
slots
:
void
updateOnTimer
();
void
updateOnTimer
();
signals:
void
inputChanged
(
input_thread_t
*
);
};
};
#endif
#endif
modules/gui/qt4/qt4.cpp
View file @
a47f5608
...
@@ -115,15 +115,18 @@ static void Init( intf_thread_t *p_intf )
...
@@ -115,15 +115,18 @@ static void Init( intf_thread_t *p_intf )
QApplication
*
app
=
new
QApplication
(
argc
,
argv
,
true
);
QApplication
*
app
=
new
QApplication
(
argc
,
argv
,
true
);
p_intf
->
p_sys
->
p_app
=
app
;
p_intf
->
p_sys
->
p_app
=
app
;
// Initialize timers
DialogsProvider
::
getInstance
(
p_intf
);
/* Normal interface */
/* Normal interface */
if
(
!
p_intf
->
pf_show_dialog
)
if
(
!
p_intf
->
pf_show_dialog
)
{
{
MainInterface
*
p_mi
=
new
MainInterface
(
p_intf
);
MainInterface
*
p_mi
=
new
MainInterface
(
p_intf
);
p_intf
->
p_sys
->
p_mi
=
p_mi
;
p_intf
->
p_sys
->
p_mi
=
p_mi
;
p_mi
->
init
();
p_mi
->
show
();
p_mi
->
show
();
}
}
DialogsProvider
::
getInstance
(
p_intf
);
if
(
p_intf
->
pf_show_dialog
)
if
(
p_intf
->
pf_show_dialog
)
vlc_thread_ready
(
p_intf
);
vlc_thread_ready
(
p_intf
);
...
...
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