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
4931a926
Commit
4931a926
authored
Oct 20, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sound volume, rate, and fullscreen support
parent
2edb3900
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
1 deletion
+101
-1
bindings/cil/libvlc.cs
bindings/cil/libvlc.cs
+78
-0
bindings/cil/marshal.cs
bindings/cil/marshal.cs
+16
-1
bindings/cil/testvlc.cs
bindings/cil/testvlc.cs
+7
-0
No files found.
bindings/cil/libvlc.cs
View file @
4931a926
...
@@ -153,6 +153,9 @@ namespace VideoLAN.VLC
...
@@ -153,6 +153,9 @@ namespace VideoLAN.VLC
}
}
}
}
/**
* Switches to the next playlist item
*/
public
void
NextItem
()
public
void
NextItem
()
{
{
CheckDisposed
();
CheckDisposed
();
...
@@ -162,6 +165,81 @@ namespace VideoLAN.VLC
...
@@ -162,6 +165,81 @@ namespace VideoLAN.VLC
e
.
Consume
();
e
.
Consume
();
}
}
/**
* Normalized audio output volume in percent (must be [0..100]).
*/
public
short
SoundVolume
{
get
{
CheckDisposed
();
NativeException
e
=
NativeException
.
Prepare
();
short
vol
=
MediaControlAPI
.
SoundGetVolume
(
self
,
ref
e
);
e
.
Consume
();
return
vol
;
}
set
{
CheckDisposed
();
if
((
value
<
0
)
||
(
value
>
100
))
throw
new
ArgumentOutOfRangeException
(
"Volume not within [0..100]"
);
NativeException
e
=
NativeException
.
Prepare
();
MediaControlAPI
.
SoundSetVolume
(
self
,
value
,
ref
e
);
e
.
Consume
();
}
}
/**
* Performance speed rate in percent.
*/
public
int
Rate
{
get
{
CheckDisposed
();
NativeException
e
=
NativeException
.
Prepare
();
int
rate
=
MediaControlAPI
.
GetRate
(
self
,
ref
e
);
e
.
Consume
();
return
rate
;
}
set
{
CheckDisposed
();
NativeException
e
=
NativeException
.
Prepare
();
MediaControlAPI
.
SetRate
(
self
,
value
,
ref
e
);
e
.
Consume
();
}
}
/**
* Fullscreen flag.
*/
public
bool
Fullscreen
{
get
{
CheckDisposed
();
NativeException
e
=
NativeException
.
Prepare
();
int
ret
=
MediaControlAPI
.
GetFullscreen
(
self
,
ref
e
);
e
.
Consume
();
return
ret
!=
0
;
}
set
{
CheckDisposed
();
NativeException
e
=
NativeException
.
Prepare
();
MediaControlAPI
.
SetFullscreen
(
self
,
value
?
1
:
0
,
ref
e
);
e
.
Consume
();
}
}
public
void
Dispose
()
public
void
Dispose
()
{
{
self
.
Dispose
();
self
.
Dispose
();
...
...
bindings/cil/marshal.cs
View file @
4931a926
...
@@ -50,7 +50,22 @@ namespace VideoLAN.VLC
...
@@ -50,7 +50,22 @@ namespace VideoLAN.VLC
public
static
extern
IntPtr
PlaylistGetList
(
MediaControlHandle
self
,
ref
NativeException
e
);
public
static
extern
IntPtr
PlaylistGetList
(
MediaControlHandle
self
,
ref
NativeException
e
);
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_playlist_next_item"
)]
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_playlist_next_item"
)]
public
static
extern
void
PlaylistNextItem
(
MediaControlHandle
self
,
ref
NativeException
e
);
public
static
extern
void
PlaylistNextItem
(
MediaControlHandle
self
,
ref
NativeException
e
);
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_sound_get_volume"
)]
public
static
extern
short
SoundGetVolume
(
MediaControlHandle
self
,
ref
NativeException
e
);
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_sound_set_volume"
)]
public
static
extern
void
SoundSetVolume
(
MediaControlHandle
self
,
short
volume
,
ref
NativeException
e
);
/* SetVisual */
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_get_rate"
)]
public
static
extern
short
GetRate
(
MediaControlHandle
self
,
ref
NativeException
e
);
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_set_rate"
)]
public
static
extern
void
SetRate
(
MediaControlHandle
self
,
int
rate
,
ref
NativeException
e
);
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_get_fullscreen"
)]
public
static
extern
int
GetFullscreen
(
MediaControlHandle
self
,
ref
NativeException
e
);
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"mediacontrol_set_fullscreen"
)]
public
static
extern
void
SetFullscreen
(
MediaControlHandle
self
,
int
full
,
ref
NativeException
e
);
};
/**
/**
* Abstract safe handle class for non-NULL pointers
* Abstract safe handle class for non-NULL pointers
...
...
bindings/cil/testvlc.cs
View file @
4931a926
...
@@ -34,11 +34,18 @@ namespace VideoLAN.VLC
...
@@ -34,11 +34,18 @@ namespace VideoLAN.VLC
foreach
(
string
s
in
args
)
foreach
(
string
s
in
args
)
mc
.
AddItem
(
s
);
mc
.
AddItem
(
s
);
Console
.
WriteLine
(
"Volume : {0}%"
,
mc
.
SoundVolume
);
Console
.
WriteLine
(
"Rate : {0}%"
,
mc
.
Rate
);
Console
.
WriteLine
(
"Fullscreen: {0}"
,
mc
.
Fullscreen
);
mc
.
Fullscreen
=
false
;
/*mc.Play ();*/
/*mc.Play ();*/
Console
.
ReadLine
();
Console
.
ReadLine
();
mc
.
Stop
();
mc
.
Stop
();
mc
.
Clear
();
mc
.
Clear
();
mc
.
SoundVolume
=
100
;
mc
.
Rate
=
100
;
mc
.
Dispose
();
mc
.
Dispose
();
return
0
;
return
0
;
...
...
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