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
6e554f8d
Commit
6e554f8d
authored
Aug 04, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: extend interactive command set
parent
07aea022
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
bindings/python-ctypes/footer.py
bindings/python-ctypes/footer.py
+29
-4
No files found.
bindings/python-ctypes/footer.py
View file @
6e554f8d
...
@@ -81,14 +81,29 @@ if __name__ == '__main__':
...
@@ -81,14 +81,29 @@ if __name__ == '__main__':
def
print_info
():
def
print_info
():
"""Print information about the media."""
"""Print information about the media."""
m
=
p
.
get_media
()
m
=
p
.
get_media
()
print
"Playing "
,
m
.
get_mrl
()
print
"State:"
,
p
.
get_state
()
print
"Current time:"
,
p
.
get_time
(),
"/"
,
m
.
get_duration
()
print
"Media:"
,
m
.
get_mrl
()
print
"Position"
,
p
.
get_position
()
try
:
print
"Current time:"
,
p
.
get_time
(),
"/"
,
m
.
get_duration
()
print
"Position:"
,
p
.
get_position
()
print
"FPS:"
,
p
.
get_fps
()
print
"Rate:"
,
p
.
get_rate
()
print
"Video size: (%d, %d)"
%
(
p
.
video_get_width
(),
p
.
video_get_height
())
except
Exception
:
pass
def
forward
():
def
forward
():
"""Go forward 1s"""
"""Go forward 1s"""
p
.
set_time
(
p
.
get_time
()
+
1000
)
p
.
set_time
(
p
.
get_time
()
+
1000
)
def
one_frame_forward
():
"""Go forward one frame"""
p
.
set_time
(
p
.
get_time
()
+
long
(
1000
/
(
p
.
get_fps
()
or
25
)))
def
one_frame_backward
():
"""Go backward one frame"""
p
.
set_time
(
p
.
get_time
()
-
long
(
1000
/
(
p
.
get_fps
()
or
25
)))
def
backward
():
def
backward
():
"""Go backward 1s"""
"""Go backward 1s"""
p
.
set_time
(
p
.
get_time
()
-
1000
)
p
.
set_time
(
p
.
get_time
()
-
1000
)
...
@@ -99,6 +114,7 @@ if __name__ == '__main__':
...
@@ -99,6 +114,7 @@ if __name__ == '__main__':
print
"Commands:"
print
"Commands:"
for
k
,
m
in
keybindings
.
iteritems
():
for
k
,
m
in
keybindings
.
iteritems
():
print
" %s: %s"
%
(
k
,
(
m
.
__doc__
or
m
.
__name__
).
splitlines
()[
0
])
print
" %s: %s"
%
(
k
,
(
m
.
__doc__
or
m
.
__name__
).
splitlines
()[
0
])
print
" 1-9: go to the given fraction of the movie"
def
quit
():
def
quit
():
"""Exit."""
"""Exit."""
...
@@ -109,6 +125,8 @@ if __name__ == '__main__':
...
@@ -109,6 +125,8 @@ if __name__ == '__main__':
' '
:
p
.
pause
,
' '
:
p
.
pause
,
'+'
:
forward
,
'+'
:
forward
,
'-'
:
backward
,
'-'
:
backward
,
'.'
:
one_frame_forward
,
','
:
one_frame_backward
,
'?'
:
print_help
,
'?'
:
print_help
,
'i'
:
print_info
,
'i'
:
print_info
,
'q'
:
quit
,
'q'
:
quit
,
...
@@ -117,6 +135,13 @@ if __name__ == '__main__':
...
@@ -117,6 +135,13 @@ if __name__ == '__main__':
print
"Press q to quit, ? to get help."
print
"Press q to quit, ? to get help."
while
True
:
while
True
:
k
=
getch
()
k
=
getch
()
o
=
ord
(
k
)
method
=
keybindings
.
get
(
k
,
None
)
method
=
keybindings
.
get
(
k
,
None
)
if
method
is
not
None
:
if
method
is
not
None
:
method
()
method
()
elif
o
>=
49
and
o
<=
57
:
# Numeric value. Jump to a fraction of the movie.
v
=
0.1
*
(
o
-
48
)
p
.
set_position
(
v
)
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