|
-
Dec 5th, 2008, 09:35 AM
#1
Thread Starter
New Member
[RESOLVED] [2008] Phunny Problem?
Wells, I'm working on a program for work. I'll give a quick lo-down and then get to my problem.
I work at a FM/Online Radio station (Music Director) and, since I'm currently also doing a BA Engineering / IT degree at uni, I was asked if I would be able to make a Vista Sidebar Gadget and an executable program.. both have pretty much the same purpose - connect to the online stream. The gadget is done and happily available, although I haven't released the latest version 
Ok. Not focusing on the gadget as it doesn't employ any VB..
The stand-alone program which I've started is 90% complete. Everything required is there. It plays the stream, and grabs the currently playing track info. As well as a few other nifty abilities.
This is where the problem lies. I've decided to include a Recently Played window.
Ex. The user is happily listening to the sexy choons, the tracks change and each time, I keep the previous 5 tracks' info as well as the currently playing track.
The user clicks the Recently Played link, up pops the window, and.. well, it is suppose to be displaying the 5 recently played tracks and now playing..
Hmmm.. but it's not.
The way I coded this is:
The application checks our server every 'update'. This is based on the user setting (I've coded Options). If the currently displayed info (application side) if different to the currently playing info (our server side) then it will call this:
Code:
'IN MAIN.FORM
Public Sub getCompare()
Try
If tempInfo1 IsNot RecentlyPlayed.nowPlaying = True Then
tempInfo1 = RecentlyPlayed.nowPlaying
RecentlyPlayed.nowPlaying = artistInfo.ToUpper & " - " & titleInfo.ToUpper
tempInfo2 = RecentlyPlayed.firstPreviousSong
RecentlyPlayed.firstPreviousSong = tempInfo1
tempInfo3 = RecentlyPlayed.secondPreviousSong
RecentlyPlayed.secondPreviousSong = tempInfo2
tempInfo4 = RecentlyPlayed.thirdPreviousSong
RecentlyPlayed.thirdPreviousSong = tempInfo3
tempInfo5 = RecentlyPlayed.fourthPreviousSong
RecentlyPlayed.fourthPreviousSong = tempInfo4
tempInfo6 = RecentlyPlayed.firstPreviousSong
RecentlyPlayed.fithPreviousSong = tempInfo5
RecentlyPlayed.finishCompare()
End If
Catch
'yeah yeah blah
End Try
End Sub
The TRY is in-case the return string is NULL, we all know what happens there.. sigh.
You'll notice I have tempInfoX. I presume that everything in that part of code is correct!?
The tempInfoX variables are changed to save the 'data of the previous song' .. thus allowing for the next info to be used as the one above?
Hopefully this is making sense.. it's 11:40pm..
So, a new track is played, and the variables are changed.. you'll notice it is calling RecentlyPlayed.finishCompare()
This is because, after much frustration of it not working, I coded the hell out of it and tried anything.. it's working better than it did without this sub.
NB: RecentlyPlayed is another form.
Code:
'IN RECENTLYPLAYED.FORM
Public Class RecentlyPlayed
Public nowPlaying As String = "No Information Available.."
Public firstPreviousSong As String = "No Information Available.."
Public secondPreviousSong As String = "No Information Available.."
Public thirdPreviousSong As String = "No Information Available.."
Public fourthPreviousSong As String = "No Information Available.."
Public fithPreviousSong As String = "No Information Available.."
Private Sub RecentlyPlayed_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Main.getCompare()
finishCompare()
End Sub
Public Sub finishCompare()
nowPlaying = Main.lbl_ArtistInfo.Text & " - " & Main.lbl_TitleInfo.Text
lbl_NowPlaying.Text = nowPlaying
lbl_Previous1.Text = firstPreviousSong
lbl_Previous2.Text = secondPreviousSong
lbl_Previous3.Text = thirdPreviousSong
lbl_Previous4.Text = fourthPreviousSong
lbl_Previous5.Text = fithPreviousSong
End Sub
That's it all..
I have no idea why it isn't working.
When I first open Recently Played - Now Playing, FirstPrevious and SecondPrevious are the currently playing songs.. then I close it and only NP and FirstPrevious are the same..
But if I keep the window open, it works fine.. then I close it, re-open and its still working.. however! If I have closed the window and then the track changes, I open Recently Played and it's back to only displaying Now Playing and FirstPrevious (where FirstPrevious is the same as Now Playing)
Screenie of the app being a wang..

Screenie of the app actually working.. (this is when I keep the window open and the tracks change and stuff like..)

Well! That was a huge first post.
Hopefully someone has enough time to read it all, and hopefully my jaber is understandable 
lol..
If you are confused, which I'm presuming you potentially maybe, then please ask - I'll try and be 'un-tired' for my response and make it a reasonable reply 
Also!
I was reading about PING. I would like to include a PING metre showing the response time between our server and the user.. just to make it look fancy.
I had a look, and boy was it heaps of code!!
Is there a short way of pinging a www server and getting the response time to use??
Don't want any in-between bits :P
Thanks!
Clancy Bird.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|