| | 83 | } |
|---|
| | 84 | |
|---|
| | 85 | |
|---|
| | 86 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_loop")] |
|---|
| | 87 | static extern void PlaylistLoop (InstanceHandle self, int b, |
|---|
| | 88 | NativeException ex); |
|---|
| | 89 | /** Sets the playlist loop flag */ |
|---|
| | 90 | public bool Loop |
|---|
| | 91 | { |
|---|
| | 92 | set |
|---|
| | 93 | { |
|---|
| | 94 | PlaylistLoop (self, value ? 1 : 0, ex); |
|---|
| | 95 | ex.Raise (); |
|---|
| | 96 | } |
|---|
| | 97 | } |
|---|
| | 98 | |
|---|
| | 99 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_play")] |
|---|
| | 100 | static extern void PlaylistPlay (InstanceHandle self, int id, int optc, |
|---|
| | 101 | U8String[] optv, NativeException ex); |
|---|
| | 102 | /** Plays the next playlist item */ |
|---|
| | 103 | public void Play () |
|---|
| | 104 | { |
|---|
| | 105 | PlaylistPlay (self, -1, 0, new U8String[0], ex); |
|---|
| | 106 | ex.Raise (); |
|---|
| | 107 | } |
|---|
| | 108 | |
|---|
| | 109 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_pause")] |
|---|
| | 110 | static extern void PlaylistPause (InstanceHandle self, |
|---|
| | 111 | NativeException ex); |
|---|
| | 112 | /** Toggles pause */ |
|---|
| | 113 | public void TogglePause () |
|---|
| | 114 | { |
|---|
| | 115 | PlaylistPause (self, ex); |
|---|
| | 116 | ex.Raise (); |
|---|
| | 117 | } |
|---|
| | 118 | |
|---|
| | 119 | [DllImport ("libvlc-control.dll", |
|---|
| | 120 | EntryPoint="libvlc_playlist_isplaying")] |
|---|
| | 121 | static extern int PlaylistIsPlaying (InstanceHandle self, |
|---|
| | 122 | NativeException ex); |
|---|
| | 123 | /** Whether the playlist is running, or in pause/stop */ |
|---|
| | 124 | public bool IsPlaying |
|---|
| | 125 | { |
|---|
| | 126 | get |
|---|
| | 127 | { |
|---|
| | 128 | int ret = PlaylistIsPlaying (self, ex); |
|---|
| | 129 | ex.Raise (); |
|---|
| | 130 | return ret != 0; |
|---|
| | 131 | } |
|---|
| | 132 | } |
|---|
| | 133 | |
|---|
| | 134 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_stop")] |
|---|
| | 135 | static extern void PlaylistStop (InstanceHandle self, |
|---|
| | 136 | NativeException ex); |
|---|
| | 137 | /** Stops playing */ |
|---|
| | 138 | public void Stop () |
|---|
| | 139 | { |
|---|
| | 140 | PlaylistStop (self, ex); |
|---|
| | 141 | ex.Raise (); |
|---|
| | 142 | } |
|---|
| | 143 | |
|---|
| | 144 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_next")] |
|---|
| | 145 | static extern void PlaylistNext (InstanceHandle self, |
|---|
| | 146 | NativeException ex); |
|---|
| | 147 | /** Goes to next playlist item (and start playing it) */ |
|---|
| | 148 | public void Next () |
|---|
| | 149 | { |
|---|
| | 150 | PlaylistNext (self, ex); |
|---|
| | 151 | ex.Raise (); |
|---|
| | 152 | } |
|---|
| | 153 | |
|---|
| | 154 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_prev")] |
|---|
| | 155 | static extern void PlaylistPrev (InstanceHandle self, |
|---|
| | 156 | NativeException ex); |
|---|
| | 157 | /** Goes to previous playlist item (and start playing it) */ |
|---|
| | 158 | public void Prev () |
|---|
| | 159 | { |
|---|
| | 160 | PlaylistPrev (self, ex); |
|---|
| | 161 | ex.Raise (); |
|---|
| | 162 | } |
|---|
| | 163 | |
|---|
| | 164 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_clear")] |
|---|
| | 165 | static extern void PlaylistClear (InstanceHandle self, |
|---|
| | 166 | NativeException ex); |
|---|
| | 167 | /** Clears the whole playlist */ |
|---|
| | 168 | public void Clear () |
|---|
| | 169 | { |
|---|
| | 170 | PlaylistClear (self, ex); |
|---|
| | 171 | ex.Raise (); |
|---|
| | 172 | } |
|---|
| | 173 | |
|---|
| | 174 | [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_add")] |
|---|
| | 175 | static extern void PlaylistAdd (InstanceHandle self, U8String uri, |
|---|
| | 176 | U8String name, NativeException e); |
|---|
| | 177 | /** Appends an item to the playlist */ |
|---|
| | 178 | public void Add (string mrl) |
|---|
| | 179 | { |
|---|
| | 180 | Add (mrl, null); |
|---|
| | 181 | } |
|---|
| | 182 | /** Appends an item to the playlist */ |
|---|
| | 183 | public void Add (string mrl, string name) |
|---|
| | 184 | { |
|---|
| | 185 | U8String umrl = new U8String (mrl); |
|---|
| | 186 | U8String uname = new U8String (name); |
|---|
| | 187 | |
|---|
| | 188 | PlaylistAdd (self, umrl, uname, ex); |
|---|
| | 189 | ex.Raise (); |
|---|