*gotto remember this thread*
Instead of streaming the title of the song that is currently playing, the port number used is statically displayed.
Make an InternetRadio Directory, i.e. My Documents/My Music/Internet Radio.
Go to www.shoutcast.com, and pick your style of music.
Right Click on the Tune-In button and save the download file shortcut.
Save it in your InternetRadio Directory, renaming it accordingly, i.e. Jazz.pls.
Start MediaPortal, Goto: Tools, Options [F2], MyRadio.
Set the StreamList Folder to your InternetRadio Directory
No Off-Air Radio Stations need to be setup for this to function.
Close the Setup dialog boxes.
burdell1 said:Instead of streaming the title of the song that is currently playing, the port number used is statically displayed.
I second that one.... also, I am curious how to listen radio stations as well that are on the internet (like local radio stations that don't use shoutcast.) How can i do this?
void OnClick(int itemIndex)
{
GUIListItem item = GetSelectedItem();
if (item == null) return;
if (item.IsFolder)
{
if (currentPlayList != null)
{
currentPlayList = null;
}
selectedItemIndex = -1;
LoadDirectory(item.Path);
}
else
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
string shoutcastpath = item.Path;
string shoutcastfirstfourletters = (shoutcastpath.Substring(0, 4));
if (shoutcastfirstfourletters == "http")
{
TextWriter tw = new StreamWriter("tempshoutcast.txt");
tw.WriteLine(shoutcastpath);
tw.Close();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "shoutcastinfo";
proc.Start();
}
Play(item);
GUIPropertyManager.SetProperty("#selecteditem", item.Label);
}
}
void Play(GUIListItem item)
{
if (MediaPortal.Util.Utils.IsPlayList(item.Path))
{
currentPlayList = new PlayList();
IPlayListIO loader = PlayListFactory.CreateIO(item.Path);
loader.Load(currentPlayList, item.Path);
if (currentPlayList.Count == 1)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
string shoutcastpath = item.Path;
TextWriter tw = new StreamWriter("tempshoutcast.txt");
tw.WriteLine(shoutcastpath);
tw.Close();
proc.EnableRaisingEvents = true;
proc.StartInfo.FileName = "shoutcastinfo";
proc.Start();
// add current directory 2 playlist and play this item
string strURL = currentPlayList[0].FileName;
currentPlayList = null;
FillPlayList();
playlistPlayer.Play(strURL);
return;
}
if (currentPlayList.Count == 0)
{
currentPlayList = null;
}
LoadDirectory(currentFolder);
}
else
{
if (currentPlayList != null)
{
// add current playlist->playlist and play selected item
string strURL = item.Path;
FillPlayList();
playlistPlayer.Play(strURL);
return;
}
// add current directory 2 playlist and play this item
RadioStation station = item.MusicTag as RadioStation;
FillPlayList();
PlayList playlist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC_TEMP);
for (int i = 0; i < playlist.Count; ++i)
{
PlayListItem playItem = playlist[i];
if (playItem.Description.Equals(item.Label))
{
playlistPlayer.Play(i);
break;
}
}
}
}
public static void Stop()
{
if (_player != null)
{
Log.Info("g_Player.Stop()");
OnStopped();
GUIGraphicsContext.ShowBackground = true;
_player.Stop();
if (GUIGraphicsContext.form != null)
{
GUIGraphicsContext.form.Invalidate(true);
}
GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED, 0, 0, 0, 0, 0, null);
GUIWindowManager.SendThreadMessage(msg);
GUIGraphicsContext.IsFullScreenVideo = false;
GUIGraphicsContext.IsPlaying = false;
GUIGraphicsContext.IsPlayingVideo = false;
CachePlayer();
TextWriter tw = new StreamWriter("tempshoutcast.txt");
tw.WriteLine("Stopped");
tw.Close();
}
}