Changeset 117
- Timestamp:
- 03/03/07 14:54:09 (2 years ago)
- Files:
-
- dmp/trunk/BadClient/Form1.Designer.cs (modified) (17 diffs)
- dmp/trunk/BadClient/Form1.cs (modified) (4 diffs)
- dmp/trunk/BadClient/Form1.resx (modified) (1 diff)
- dmp/trunk/vlc.NET/VlcUserControl.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmp/trunk/BadClient/Form1.Designer.cs
r97 r117 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 System.Windows.Forms.TreeNode treeNode 1= new System.Windows.Forms.TreeNode("Servers");26 System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Servers"); 27 27 this.label1 = new System.Windows.Forms.Label(); 28 28 this.txtHost = new System.Windows.Forms.TextBox(); … … 32 32 this.lblStatus = new System.Windows.Forms.Label(); 33 33 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 34 this.button4 = new System.Windows.Forms.Button(); 34 35 this.button3 = new System.Windows.Forms.Button(); 35 36 this.btnListServers = new System.Windows.Forms.Button(); 36 37 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 37 38 this.button2 = new System.Windows.Forms.Button(); 39 this.vlcPlayer = new VLanControl.VlcUserControl(); 38 40 this.splitContainer3 = new System.Windows.Forms.SplitContainer(); 39 41 this.panel1 = new System.Windows.Forms.Panel(); … … 42 44 this.colID = new System.Windows.Forms.DataGridViewTextBoxColumn(); 43 45 this.colLibID = new System.Windows.Forms.DataGridViewTextBoxColumn(); 46 this.RemoteSongId = new System.Windows.Forms.DataGridViewTextBoxColumn(); 44 47 this.colArtist = new System.Windows.Forms.DataGridViewTextBoxColumn(); 45 48 this.colAlbum = new System.Windows.Forms.DataGridViewTextBoxColumn(); 46 49 this.colTrack = new System.Windows.Forms.DataGridViewTextBoxColumn(); 47 this.vlcPlayer = new VLanControl.VlcUserControl();48 50 this.splitContainer1.Panel1.SuspendLayout(); 49 51 this.splitContainer1.Panel2.SuspendLayout(); … … 120 122 // splitContainer1.Panel1 121 123 // 124 this.splitContainer1.Panel1.Controls.Add(this.button4); 122 125 this.splitContainer1.Panel1.Controls.Add(this.button3); 123 126 this.splitContainer1.Panel1.Controls.Add(this.btnListServers); … … 139 142 this.splitContainer1.TabIndex = 8; 140 143 // 144 // button4 145 // 146 this.button4.Location = new System.Drawing.Point(820, 7); 147 this.button4.Name = "button4"; 148 this.button4.Size = new System.Drawing.Size(46, 21); 149 this.button4.TabIndex = 11; 150 this.button4.Text = "Stop"; 151 this.button4.UseVisualStyleBackColor = true; 152 this.button4.Click += new System.EventHandler(this.button4_Click); 153 // 141 154 // button3 142 155 // 143 this.button3.Location = new System.Drawing.Point(7 78, 7);156 this.button3.Location = new System.Drawing.Point(769, 7); 144 157 this.button3.Name = "button3"; 145 this.button3.Size = new System.Drawing.Size( 88, 22);158 this.button3.Size = new System.Drawing.Size(45, 22); 146 159 this.button3.TabIndex = 9; 147 160 this.button3.Text = "Play"; … … 151 164 // btnListServers 152 165 // 153 this.btnListServers.Location = new System.Drawing.Point(6 97, 7);166 this.btnListServers.Location = new System.Drawing.Point(688, 7); 154 167 this.btnListServers.Name = "btnListServers"; 155 168 this.btnListServers.Size = new System.Drawing.Size(75, 23); … … 169 182 // button2 170 183 // 171 this.button2.Location = new System.Drawing.Point(5 83, 8);184 this.button2.Location = new System.Drawing.Point(574, 7); 172 185 this.button2.Name = "button2"; 173 186 this.button2.Size = new System.Drawing.Size(108, 23); … … 177 190 this.button2.Click += new System.EventHandler(this.button2_Click); 178 191 // 192 // vlcPlayer 193 // 194 this.vlcPlayer.Location = new System.Drawing.Point(430, 3); 195 this.vlcPlayer.Name = "vlcPlayer"; 196 this.vlcPlayer.Size = new System.Drawing.Size(150, 31); 197 this.vlcPlayer.TabIndex = 10; 198 this.vlcPlayer.UseMpegVbrOffset = false; 199 // 179 200 // splitContainer3 180 201 // … … 191 212 this.splitContainer3.Panel2.Controls.Add(this.dgvSongs); 192 213 this.splitContainer3.Size = new System.Drawing.Size(878, 407); 193 this.splitContainer3.SplitterDistance = 21 2;214 this.splitContainer3.SplitterDistance = 211; 194 215 this.splitContainer3.TabIndex = 0; 195 216 // … … 200 221 this.panel1.Location = new System.Drawing.Point(0, 0); 201 222 this.panel1.Name = "panel1"; 202 this.panel1.Size = new System.Drawing.Size(21 2, 407);223 this.panel1.Size = new System.Drawing.Size(211, 407); 203 224 this.panel1.TabIndex = 0; 204 225 // … … 208 229 this.treeView1.Location = new System.Drawing.Point(0, 0); 209 230 this.treeView1.Name = "treeView1"; 210 treeNode 1.Name = "Node0";211 treeNode 1.Text = "Servers";231 treeNode2.Name = "Node0"; 232 treeNode2.Text = "Servers"; 212 233 this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { 213 treeNode 1});214 this.treeView1.Size = new System.Drawing.Size(21 2, 407);234 treeNode2}); 235 this.treeView1.Size = new System.Drawing.Size(211, 407); 215 236 this.treeView1.TabIndex = 0; 216 237 // … … 221 242 this.colID, 222 243 this.colLibID, 244 this.RemoteSongId, 223 245 this.colArtist, 224 246 this.colAlbum, … … 228 250 this.dgvSongs.Name = "dgvSongs"; 229 251 this.dgvSongs.ReadOnly = true; 230 this.dgvSongs.Size = new System.Drawing.Size(66 2, 407);252 this.dgvSongs.Size = new System.Drawing.Size(663, 407); 231 253 this.dgvSongs.TabIndex = 7; 254 this.dgvSongs.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.playSelectedSong); 232 255 // 233 256 // colID … … 243 266 this.colLibID.ReadOnly = true; 244 267 // 268 // RemoteSongId 269 // 270 this.RemoteSongId.HeaderText = "RemoteSongId"; 271 this.RemoteSongId.Name = "RemoteSongId"; 272 this.RemoteSongId.ReadOnly = true; 273 // 245 274 // colArtist 246 275 // … … 260 289 this.colTrack.Name = "colTrack"; 261 290 this.colTrack.ReadOnly = true; 262 //263 // vlcPlayer264 //265 this.vlcPlayer.Location = new System.Drawing.Point(430, 3);266 this.vlcPlayer.Name = "vlcPlayer";267 this.vlcPlayer.Size = new System.Drawing.Size(150, 31);268 this.vlcPlayer.TabIndex = 10;269 this.vlcPlayer.UseMpegVbrOffset = false;270 291 // 271 292 // Form1 … … 303 324 private System.Windows.Forms.SplitContainer splitContainer2; 304 325 private System.Windows.Forms.SplitContainer splitContainer3; 305 private System.Windows.Forms.DataGridView dgvSongs; 306 private System.Windows.Forms.DataGridViewTextBoxColumn colID; 307 private System.Windows.Forms.DataGridViewTextBoxColumn colLibID; 308 private System.Windows.Forms.DataGridViewTextBoxColumn colArtist; 309 private System.Windows.Forms.DataGridViewTextBoxColumn colAlbum; 310 private System.Windows.Forms.DataGridViewTextBoxColumn colTrack; 326 private System.Windows.Forms.DataGridView dgvSongs; 311 327 private System.Windows.Forms.Panel panel1; 312 328 private System.Windows.Forms.TreeView treeView1; … … 315 331 private System.Windows.Forms.Button button3; 316 332 private VLanControl.VlcUserControl vlcPlayer; 333 private System.Windows.Forms.DataGridViewTextBoxColumn colID; 334 private System.Windows.Forms.DataGridViewTextBoxColumn colLibID; 335 private System.Windows.Forms.DataGridViewTextBoxColumn RemoteSongId; 336 private System.Windows.Forms.DataGridViewTextBoxColumn colArtist; 337 private System.Windows.Forms.DataGridViewTextBoxColumn colAlbum; 338 private System.Windows.Forms.DataGridViewTextBoxColumn colTrack; 339 private System.Windows.Forms.Button button4; 317 340 } 318 341 } dmp/trunk/BadClient/Form1.cs
r110 r117 3 3 using System.ComponentModel; 4 4 using System.Data; 5 using System.Diagnostics; 5 6 using System.Drawing; 6 7 using System.Text; … … 10 11 public partial class Form1 : Form { 11 12 private Bridge myBridge; 13 private System.Collections.Hashtable playlistHash; 12 14 public Form1() { 13 15 InitializeComponent(); 14 16 myBridge = new Bridge(); 17 playlistHash = new System.Collections.Hashtable(); 15 18 if( myBridge.isDatabaseUp() ) 16 19 lblStatus.Text = "Status: Bridge constructed and db up!"; … … 31 34 { 32 35 dgvSongs.Rows.Add(row.ItemArray); 36 int songId = int.Parse(row.ItemArray[0].ToString()); 37 if (!playlistHash.Contains(songId)) 38 { 39 String songURL = this.myBridge.getSongURL(songId); 40 playlistHash.Add(songId, vlcPlayer.AddToPlayList(songURL, songURL, null)); 41 } 33 42 } 34 43 } … … 64 73 private void button3_Click(object sender, EventArgs e) 65 74 { 66 75 if (vlcPlayer.IsPaused) 76 { 77 vlcPlayer.TogglePause(); 78 this.button3.Text = "Pause"; 79 } 80 else if (vlcPlayer.IsPlaying) 81 { 82 vlcPlayer.TogglePause(); 83 this.button3.Text = "Play"; 84 } 85 else 86 { 87 playSelectedSong(); 88 } 89 } 90 91 private void button4_Click(object sender, EventArgs e) 92 { 93 vlcPlayer.Stop(); 94 this.button3.Text = "Play"; 95 } 96 97 private void playSelectedSong(object sender, DataGridViewCellEventArgs e) 98 { 99 playSelectedSong(); 100 } 101 102 private void playSelectedSong() 103 { 67 104 int songId = int.Parse(dgvSongs.CurrentRow.Cells[0].Value.ToString()); 68 String songURL = this.myBridge.getSongURL(songId); 69 70 vlcPlayer.AddAndPlay(songURL,""); 105 //String songURL = this.myBridge.getSongURL(songId); 106 //vlcPlayer.AddAndPlay(songURL,""); 107 108 int playlistId = (int)playlistHash[songId]; 109 Debug.WriteLine("Playing song with id " + playlistId.ToString()); 110 vlcPlayer.PlayItem(playlistId); 111 this.button3.Text = "Pause"; 71 112 } 72 113 } dmp/trunk/BadClient/Form1.resx
r58 r117 124 124 <value>True</value> 125 125 </metadata> 126 <metadata name="RemoteSongId.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 127 <value>True</value> 128 </metadata> 129 <metadata name="colArtist.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 130 <value>True</value> 131 </metadata> 132 <metadata name="colAlbum.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 133 <value>True</value> 134 </metadata> 135 <metadata name="colTrack.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 136 <value>True</value> 137 </metadata> 138 <metadata name="colID.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 139 <value>True</value> 140 </metadata> 141 <metadata name="colLibID.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 142 <value>True</value> 143 </metadata> 144 <metadata name="RemoteSongId.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 145 <value>True</value> 146 </metadata> 126 147 <metadata name="colArtist.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 127 148 <value>True</value> dmp/trunk/vlc.NET/VlcUserControl.cs
r50 r117 1027 1027 int currentIndex = this.nativeVlc.PlaylistIndex; 1028 1028 Debug.WriteLine("PlayItem index = " + itemId.ToString(), " currentIndex = " + currentIndex.ToString()); 1029 this.nativeVlc.Play(itemId); 1030 /* I'm not sure why they had this, but it doesn't seem necessary to call Play() when currentIndex < 0 1029 1031 if(currentIndex < 0) 1030 1032 { … … 1035 1037 //this.nativeVlc.PlaylistPrevious(); 1036 1038 this.nativeVlc.Play(itemId); 1037 } 1039 }*/ 1038 1040 } 1039 1041
