Changeset 145
- Timestamp:
- 03/07/07 17:07:57 (2 years ago)
- Files:
-
- dmp/trunk/BadClient/Form1.Designer.cs (modified) (7 diffs)
- dmp/trunk/BadClient/Form1.cs (modified) (1 diff)
- dmp/trunk/vlc.NET/NativeLibVlc.cs (modified) (2 diffs)
- dmp/trunk/vlc.NET/VlcUserControl.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmp/trunk/BadClient/Form1.Designer.cs
r134 r145 32 32 this.lblStatus = new System.Windows.Forms.Label(); 33 33 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 34 this.button5 = new System.Windows.Forms.Button(); 34 35 this.button4 = new System.Windows.Forms.Button(); 35 36 this.button3 = new System.Windows.Forms.Button(); … … 48 49 this.colAlbum = new System.Windows.Forms.DataGridViewTextBoxColumn(); 49 50 this.colTrack = new System.Windows.Forms.DataGridViewTextBoxColumn(); 51 this.button6 = new System.Windows.Forms.Button(); 50 52 this.splitContainer1.Panel1.SuspendLayout(); 51 53 this.splitContainer1.Panel2.SuspendLayout(); … … 122 124 // splitContainer1.Panel1 123 125 // 126 this.splitContainer1.Panel1.Controls.Add(this.button5); 124 127 this.splitContainer1.Panel1.Controls.Add(this.button4); 128 this.splitContainer1.Panel1.Controls.Add(this.button6); 125 129 this.splitContainer1.Panel1.Controls.Add(this.button3); 126 130 this.splitContainer1.Panel1.Controls.Add(this.btnListServers); … … 142 146 this.splitContainer1.TabIndex = 8; 143 147 // 148 // button5 149 // 150 this.button5.Location = new System.Drawing.Point(412, 8); 151 this.button5.Name = "button5"; 152 this.button5.Size = new System.Drawing.Size(75, 23); 153 this.button5.TabIndex = 12; 154 this.button5.Text = "Previous"; 155 this.button5.UseVisualStyleBackColor = true; 156 this.button5.Click += new System.EventHandler(this.button5_Click); 157 // 144 158 // button4 145 159 // … … 186 200 this.button2.Size = new System.Drawing.Size(108, 23); 187 201 this.button2.TabIndex = 6; 188 this.button2.Text = "Songs I 'm Conn To";202 this.button2.Text = "Songs I\'m Conn To"; 189 203 this.button2.UseVisualStyleBackColor = true; 190 204 this.button2.Click += new System.EventHandler(this.button2_Click); … … 289 303 this.colTrack.Name = "colTrack"; 290 304 this.colTrack.ReadOnly = true; 305 // 306 // button6 307 // 308 this.button6.Location = new System.Drawing.Point(493, 7); 309 this.button6.Name = "button6"; 310 this.button6.Size = new System.Drawing.Size(75, 23); 311 this.button6.TabIndex = 13; 312 this.button6.Text = "Next"; 313 this.button6.UseVisualStyleBackColor = true; 314 this.button6.Click += new System.EventHandler(this.button6_Click); 291 315 // 292 316 // Form1 … … 338 362 private System.Windows.Forms.DataGridViewTextBoxColumn colTrack; 339 363 private System.Windows.Forms.Button button4; 364 private System.Windows.Forms.Button button5; 365 private System.Windows.Forms.Button button6; 340 366 } 341 367 } dmp/trunk/BadClient/Form1.cs
r134 r145 126 126 this.button3.Text = "Pause"; 127 127 } 128 129 private void button5_Click(object sender, EventArgs e) 130 { 131 this.vlcPlayer.PrevPlaylistTrack(); 132 } 133 134 private void button6_Click(object sender, EventArgs e) 135 { 136 this.vlcPlayer.NextPlaylistTrack(); 137 } 128 138 } 129 139 } dmp/trunk/vlc.NET/NativeLibVlc.cs
r143 r145 399 399 static extern void libvlc_playlist_play(ref libvlc_instance_t libvlc, Int32 id, 400 400 Int32 optionsCount, IntPtr optionsAlwaysNull, ref libvlc_exception_t p_exception); 401 [DllImport("libvlc")] 402 static extern void libvlc_playlist_next(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception); 403 [DllImport("libvlc")] 404 static extern void libvlc_playlist_prev(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception); 401 405 [DllImport("libvlc")] 402 406 static extern IntPtr libvlc_playlist_get_input(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception); … … 1550 1554 } 1551 1555 1556 public VlcError NextTrack() 1557 { 1558 try 1559 { 1560 using (VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle)) 1561 { 1562 if (vpobj.SubObject != IntPtr.Zero) 1563 { 1564 libvlc_playlist_next(ref vpobj.libvlc, ref vpobj.exception); 1565 if (!vpobj.exception.WasExceptionRaised()) 1566 { 1567 return VlcError.Success; 1568 } 1569 } 1570 } 1571 return VlcError.Generic; 1572 } 1573 catch (Exception ex) 1574 { 1575 this.lastErrorMessage = ex.Message; 1576 return VlcError.Exception; 1577 } 1578 } 1579 1580 public VlcError PrevTrack() 1581 { 1582 try 1583 { 1584 using (VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle)) 1585 { 1586 if (vpobj.SubObject != IntPtr.Zero) 1587 { 1588 libvlc_playlist_prev(ref vpobj.libvlc, ref vpobj.exception); 1589 if (!vpobj.exception.WasExceptionRaised()) 1590 { 1591 return VlcError.Success; 1592 } 1593 } 1594 } 1595 return VlcError.Generic; 1596 } 1597 catch (Exception ex) 1598 { 1599 this.lastErrorMessage = ex.Message; 1600 return VlcError.Exception; 1601 } 1602 } 1603 1552 1604 public VlcError Stop() 1553 1605 { dmp/trunk/vlc.NET/VlcUserControl.cs
r143 r145 1181 1181 } 1182 1182 1183 public void NextPlaylistTrack() 1184 { 1185 this.nativeVlc.NextTrack(); 1186 } 1187 1188 public void PrevPlaylistTrack() 1189 { 1190 this.nativeVlc.PrevTrack(); 1191 } 1192 1183 1193 public event MetaDataEventHandler NowPlaying; 1184 1194 // this 2nd event is a non-standard prototype needed for Com Interop event sourcing
