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
54f91faa
Commit
54f91faa
authored
Oct 21, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic playlist controls
parent
77015ab4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
1 deletion
+120
-1
bindings/cil/libvlc.cs
bindings/cil/libvlc.cs
+110
-0
bindings/cil/testvlc.cs
bindings/cil/testvlc.cs
+7
-1
bindings/cil/ustring.cs
bindings/cil/ustring.cs
+3
-0
No files found.
bindings/cil/libvlc.cs
View file @
54f91faa
...
...
@@ -64,6 +64,9 @@ namespace VideoLAN.LibVLC
}
};
/**
* Managed class for LibVLC instance (including playlist)
*/
public
class
Instance
:
BaseObject
<
InstanceHandle
>
{
internal
Instance
(
InstanceHandle
self
)
:
base
(
self
)
...
...
@@ -78,6 +81,113 @@ namespace VideoLAN.LibVLC
return
new
MediaDescriptor
(
dh
);
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_loop"
)]
static
extern
void
PlaylistLoop
(
InstanceHandle
self
,
int
b
,
NativeException
ex
);
/** Sets the playlist loop flag */
public
bool
Loop
{
set
{
PlaylistLoop
(
self
,
value
?
1
:
0
,
ex
);
ex
.
Raise
();
}
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_play"
)]
static
extern
void
PlaylistPlay
(
InstanceHandle
self
,
int
id
,
int
optc
,
U8String
[]
optv
,
NativeException
ex
);
/** Plays the next playlist item */
public
void
Play
()
{
PlaylistPlay
(
self
,
-
1
,
0
,
new
U8String
[
0
],
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_pause"
)]
static
extern
void
PlaylistPause
(
InstanceHandle
self
,
NativeException
ex
);
/** Toggles pause */
public
void
TogglePause
()
{
PlaylistPause
(
self
,
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_isplaying"
)]
static
extern
int
PlaylistIsPlaying
(
InstanceHandle
self
,
NativeException
ex
);
/** Whether the playlist is running, or in pause/stop */
public
bool
IsPlaying
{
get
{
int
ret
=
PlaylistIsPlaying
(
self
,
ex
);
ex
.
Raise
();
return
ret
!=
0
;
}
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_stop"
)]
static
extern
void
PlaylistStop
(
InstanceHandle
self
,
NativeException
ex
);
/** Stops playing */
public
void
Stop
()
{
PlaylistStop
(
self
,
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_next"
)]
static
extern
void
PlaylistNext
(
InstanceHandle
self
,
NativeException
ex
);
/** Goes to next playlist item (and start playing it) */
public
void
Next
()
{
PlaylistNext
(
self
,
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_prev"
)]
static
extern
void
PlaylistPrev
(
InstanceHandle
self
,
NativeException
ex
);
/** Goes to previous playlist item (and start playing it) */
public
void
Prev
()
{
PlaylistPrev
(
self
,
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_clear"
)]
static
extern
void
PlaylistClear
(
InstanceHandle
self
,
NativeException
ex
);
/** Clears the whole playlist */
public
void
Clear
()
{
PlaylistClear
(
self
,
ex
);
ex
.
Raise
();
}
[
DllImport
(
"libvlc-control.dll"
,
EntryPoint
=
"libvlc_playlist_add"
)]
static
extern
void
PlaylistAdd
(
InstanceHandle
self
,
U8String
uri
,
U8String
name
,
NativeException
e
);
/** Appends an item to the playlist */
public
void
Add
(
string
mrl
)
{
Add
(
mrl
,
null
);
}
/** Appends an item to the playlist */
public
void
Add
(
string
mrl
,
string
name
)
{
U8String
umrl
=
new
U8String
(
mrl
);
U8String
uname
=
new
U8String
(
name
);
PlaylistAdd
(
self
,
umrl
,
uname
,
ex
);
ex
.
Raise
();
}
};
/** Safe handle for unmanaged LibVLC media descriptor */
...
...
bindings/cil/testvlc.cs
View file @
54f91faa
...
...
@@ -34,8 +34,14 @@ namespace VideoLAN.LibVLC.Test
Instance
vlc
=
VLC
.
CreateInstance
(
argv
);
MediaDescriptor
md
=
vlc
.
CreateDescriptor
(
args
[
0
]);
md
.
Dispose
();
foreach
(
string
s
in
args
)
vlc
.
Add
(
s
);
vlc
.
Loop
=
false
;
vlc
.
TogglePause
();
Console
.
ReadLine
();
vlc
.
Dispose
();
return
0
;
}
...
...
bindings/cil/ustring.cs
View file @
54f91faa
...
...
@@ -36,6 +36,9 @@ namespace VideoLAN.LibVLC
public
U8String
(
string
value
)
{
if
(
value
==
null
)
return
;
byte
[]
bytes
=
System
.
Text
.
Encoding
.
UTF8
.
GetBytes
(
value
);
mb_str
=
new
byte
[
bytes
.
Length
+
1
];
Array
.
Copy
(
bytes
,
mb_str
,
bytes
.
Length
);
...
...
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