}
}
+ /**
+ * Switches to the next playlist item
+ */
public void NextItem ()
{
CheckDisposed ();
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 ()
{
self.Dispose ();
public static extern IntPtr PlaylistGetList (MediaControlHandle self, ref NativeException e);
[DllImport ("libvlc-control.dll", EntryPoint="mediacontrol_playlist_next_item")]
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
foreach (string s in args)
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 ();*/
Console.ReadLine ();
mc.Stop ();
mc.Clear ();
+ mc.SoundVolume = 100;
+ mc.Rate = 100;
mc.Dispose ();
return 0;