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
25323bcd
Commit
25323bcd
authored
Sep 04, 2006
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mozilla: more clean-ups
parent
f8cece22
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
36 deletions
+101
-36
mozilla/control/npolibvlc.cpp
mozilla/control/npolibvlc.cpp
+76
-14
mozilla/test.html
mozilla/test.html
+24
-19
mozilla/vlcshell.cpp
mozilla/vlcshell.cpp
+1
-3
No files found.
mozilla/control/npolibvlc.cpp
View file @
25323bcd
...
...
@@ -202,7 +202,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
const
NPUTF8
*
const
LibvlcAudioNPObject
::
methodNames
[]
=
{
"toggle
m
ute"
,
"toggle
M
ute"
,
};
const
int
LibvlcAudioNPObject
::
methodCount
=
sizeof
(
LibvlcAudioNPObject
::
methodNames
)
/
sizeof
(
NPUTF8
*
);
...
...
@@ -255,8 +255,10 @@ const NPUTF8 * const LibvlcInputNPObject::propertyNames[] =
"length"
,
"position"
,
"time"
,
"state"
,
"rate"
,
"fps"
,
"has
v
out"
,
"has
V
out"
,
};
const
int
LibvlcInputNPObject
::
propertyCount
=
sizeof
(
LibvlcInputNPObject
::
propertyNames
)
/
sizeof
(
NPUTF8
*
);
...
...
@@ -266,6 +268,8 @@ enum LibvlcInputNPObjectPropertyIds
ID_length
,
ID_position
,
ID_time
,
ID_state
,
ID_rate
,
ID_fps
,
ID_hasvout
,
};
...
...
@@ -280,11 +284,20 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_plugin
->
getVLC
(),
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
if
(
index
!=
ID_state
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
else
{
/* for input state, return CLOSED rather than an exception */
INT32_TO_NPVARIANT
(
0
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
}
switch
(
index
)
{
...
...
@@ -327,6 +340,32 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_state
:
{
int
val
=
libvlc_input_get_state
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
INT32_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_rate
:
{
float
val
=
libvlc_input_get_rate
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_fps
:
{
double
val
=
libvlc_input_get_fps
(
p_input
,
&
ex
);
...
...
@@ -419,6 +458,29 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_rate
:
{
float
val
;
if
(
NPVARIANT_IS_INT32
(
value
)
)
val
=
(
float
)
NPVARIANT_TO_INT32
(
value
);
else
if
(
NPVARIANT_IS_DOUBLE
(
value
)
)
val
=
(
float
)
NPVARIANT_TO_DOUBLE
(
value
);
else
{
libvlc_input_free
(
p_input
);
return
INVOKERESULT_INVALID_VALUE
;
}
libvlc_input_set_rate
(
p_input
,
val
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
}
}
libvlc_input_free
(
p_input
);
}
...
...
@@ -439,15 +501,15 @@ const int LibvlcInputNPObject::methodCount = sizeof(LibvlcInputNPObject::methodN
const
NPUTF8
*
const
LibvlcPlaylistNPObject
::
propertyNames
[]
=
{
"item
sc
ount"
,
"is
p
laying"
,
"item
C
ount"
,
"is
P
laying"
,
};
const
int
LibvlcPlaylistNPObject
::
propertyCount
=
sizeof
(
LibvlcPlaylistNPObject
::
propertyNames
)
/
sizeof
(
NPUTF8
*
);
enum
LibvlcPlaylistNPObjectPropertyIds
{
ID_item
s
count
,
ID_itemcount
,
ID_isplaying
,
};
...
...
@@ -461,7 +523,7 @@ RuntimeNPObject::InvokeResult LibvlcPlaylistNPObject::getProperty(int index, NPV
switch
(
index
)
{
case
ID_item
s
count
:
case
ID_itemcount
:
{
int
val
=
libvlc_playlist_items_count
(
p_plugin
->
getVLC
(),
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
...
...
@@ -494,12 +556,12 @@ const NPUTF8 * const LibvlcPlaylistNPObject::methodNames[] =
{
"add"
,
"play"
,
"toggle
p
ause"
,
"toggle
P
ause"
,
"stop"
,
"next"
,
"prev"
,
"clear"
,
"
deletei
tem"
"
removeI
tem"
};
const
int
LibvlcPlaylistNPObject
::
methodCount
=
sizeof
(
LibvlcPlaylistNPObject
::
methodNames
)
/
sizeof
(
NPUTF8
*
);
...
...
@@ -513,7 +575,7 @@ enum LibvlcPlaylistNPObjectMethodIds
ID_next
,
ID_prev
,
ID_clear
,
ID_
delet
eitem
,
ID_
remov
eitem
,
};
RuntimeNPObject
::
InvokeResult
LibvlcPlaylistNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
...
...
@@ -718,7 +780,7 @@ RuntimeNPObject::InvokeResult LibvlcPlaylistNPObject::invoke(int index, const NP
}
}
return
INVOKERESULT_NO_SUCH_METHOD
;
case
ID_
delet
eitem
:
case
ID_
remov
eitem
:
if
(
(
argCount
==
1
)
&&
isNumberValue
(
args
[
0
])
)
{
libvlc_playlist_delete_item
(
p_plugin
->
getVLC
(),
numberValue
(
args
[
0
]),
&
ex
);
...
...
@@ -997,7 +1059,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
const
NPUTF8
*
const
LibvlcVideoNPObject
::
methodNames
[]
=
{
"toggle
f
ullscreen"
,
"toggle
F
ullscreen"
,
};
enum
LibvlcVideoNPObjectMethodIds
...
...
mozilla/test.html
View file @
25323bcd
...
...
@@ -14,27 +14,22 @@ MRL:
id=
"vlc"
>
</EMBED>
</TD></TR>
</TD><TD
width=
"15%"
>
<DIV
id=
"info"
style=
"text-align:center"
>
-:--:--/-:--:--
</DIV>
</TD></TR>
<TR><TD
colspan=
"2"
>
<TR><TD>
<INPUT
type=
button
id=
"PlayOrPause"
value=
" Play "
onClick=
'doPlayOrPause()'
>
<INPUT
type=
button
value=
"Stop"
onClick=
'document.getElementById("vlc").playlist.stop();'
>
<INPUT
type=
button
value=
" << "
onClick=
'do
cument.getElementById("vlc").playlist.p
laySlower();'
>
<INPUT
type=
button
value=
" >> "
onClick=
'do
cument.getElementById("vlc").playlist.p
layFaster();'
>
<INPUT
type=
button
value=
" << "
onClick=
'do
P
laySlower();'
>
<INPUT
type=
button
value=
" >> "
onClick=
'do
P
layFaster();'
>
<INPUT
type=
button
value=
"Show"
onClick=
'document.getElementById("vlc").visible = true;'
>
<INPUT
type=
button
value=
"Hide"
onClick=
'document.getElementById("vlc").visible = false;'
>
<INPUT
type=
button
value=
"Version"
onClick=
'alert(document.getElementById("vlc").VersionInfo);'
>
<INPUT
type=
button
value=
"Version"
onClick=
'alert(document.getElementById("vlc"));'
>
<SPAN
style=
"text-align:center"
>
Volume:
</SPAN>
<INPUT
type=
button
value=
" - "
onClick=
'updateVolume(-10)'
>
<SPAN
id=
"volumeTextField"
style=
"text-align: center"
>
--
</SPAN>
<INPUT
type=
button
value=
" + "
onClick=
'updateVolume(+10)'
>
<INPUT
type=
button
value=
"Mute"
onClick=
'document.getElementById("vlc").audio.togglemute();'
>
</TD>
</TR>
<INPUT
type=
button
value=
"Mute"
onClick=
'document.getElementById("vlc").audio.toggleMute();'
>
</TD><TD
width=
"15%"
>
<DIV
id=
"info"
style=
"text-align:center"
>
-:--:--/-:--:--
</DIV>
</TD></TR>
</TABLE>
<SCRIPT
LANGUAGE=
"Javascript"
>
<!--
...
...
@@ -44,7 +39,7 @@ function updateVolume(deltaVol)
{
var vlc = document.getElementById("vlc");
vlc.audio.volume += deltaVol;
volumeTextField.innerText
= vlc.audio.volume+"%";
document.getElementById("volumeTextField").innerHTML
= vlc.audio.volume+"%";
};
function formatTime(timeVal)
{
...
...
@@ -72,7 +67,7 @@ function onPause()
};
function onStop()
{
info.innerText
= "-:--:--/-:--:--";
document.getElementById("info").innerHTML
= "-:--:--/-:--:--";
document.getElementById("PlayOrPause").value = " Play ";
};
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
...
...
@@ -81,17 +76,17 @@ var liveFeedRoll = 0;
function doUpdate()
{
var vlc = document.getElementById("vlc");
if( vlc.playlist.is
p
laying )
if( vlc.playlist.is
P
laying )
{
if( vlc.input.length > 0 )
{
// seekable stream
info.innerText
= formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000);
document.getElementById("info").innerHTML
= formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000);
document.getElementById("PlayOrPause").Enabled = true;
}
else {
liveFeedRoll = liveFeedRoll & 3;
info
.innerText = liveFeedText[liveFeedRoll++];
document.getElementById("info")
.innerText = liveFeedText[liveFeedRoll++];
}
timerId = setTimeout("doUpdate()", 1000);
}
...
...
@@ -109,7 +104,7 @@ function doGo(targetURL)
function doPlayOrPause()
{
var vlc = document.getElementById("vlc");
if( vlc.playlist.is
p
laying )
if( vlc.playlist.is
P
laying )
{
vlc.playlist.pause();
}
...
...
@@ -118,6 +113,16 @@ function doPlayOrPause()
vlc.playlist.play();
}
};
function doPlaySlower()
{
var vlc = document.getElementById("vlc");
vlc.input.rate = vlc.input.rate / 2;
};
function doPlayFaster()
{
var vlc = document.getElementById("vlc");
vlc.input.rate = vlc.input.rate * 2;
};
function vlcPlayEvent()
{
if( ! timerId )
...
...
mozilla/vlcshell.cpp
View file @
25323bcd
...
...
@@ -621,9 +621,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
FillRect
(
hdc
,
&
rect
,
(
HBRUSH
)
GetStockObject
(
BLACK_BRUSH
)
);
SetTextColor
(
hdc
,
RGB
(
255
,
255
,
255
));
SetBkColor
(
hdc
,
RGB
(
0
,
0
,
0
));
TextOut
(
hdc
,
(
rect
.
right
-
rect
.
left
)
/
2
-
40
,
(
rect
.
bottom
-
rect
.
top
)
/
2
,
WINDOW_TEXT
,
strlen
(
WINDOW_TEXT
)
);
DrawText
(
hdc
,
WINDOW_TEXT
,
strlen
(
WINDOW_TEXT
),
&
rect
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
EndPaint
(
p_hwnd
,
&
paintstruct
);
return
0L
;
...
...
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