MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Watch / Listen Media » Listen Music » Tips and Tricks


Tips and Tricks Post your Tips and Tricks here.

Reply
 
Thread Tools Display Modes
Old 2006-06-23, 20:58   #41 (permalink)
Super Moderator
 
Spragleknas's Avatar
 
Join Date: Dec 2005
Location: Rogaland
Age: 32
Posts: 3,810
Thanks: 179
Thanked 90 Times in 76 Posts

Country:

My System

Default

*gotto remember this thread*
__________________
Please read -> HOW TO START A SUPPORT THREAD !!!
Support MediaPortal! Donate by clicking HERE
Dedicated HTPC board (Norway) -> MSPC.no
Spragleknas is offline   Reply With Quote
Old 2006-07-07, 04:36   #42 (permalink)
Portal Member
 
Join Date: Jun 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
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?
burdell1 is offline   Reply With Quote
Old 2006-07-07, 12:41   #43 (permalink)
Portal Member
 
Join Date: Apr 2006
Location: Coin, Spain
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
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.
Sorry to be so feeble, but I am trying to setup internet radio following this guide and have got stuck at the point above.

Now I can't find "Tools/Options/Myradio in either MP or mediaportal setup. I see this thread is quite old - has this section been changed in anyway or am I just being thick?

Thnx

RJ
arjay is offline   Reply With Quote
Old 2006-07-11, 12:59   #44 (permalink)
Portal Member
 
Join Date: Apr 2006
Location: Coin, Spain
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts


Default

bump - can't anyone help?

RJ
arjay is offline   Reply With Quote
Old 2006-07-19, 20:31   #45 (permalink)
Portal Member
 
Join Date: Jun 2006
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
Originally Posted by burdell1
Quote:
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?
Does anybody have this working?
deppeler is offline   Reply With Quote
Old 2006-07-19, 21:31   #46 (permalink)
Retired Team Member
 
mzemina's Avatar
 
Join Date: Feb 2005
Location: Ft Smith, AR
Posts: 2,045
Thanks: 35
Thanked 12 Times in 12 Posts

Country:


Default

Maybe (if he wants to) aal could assist in this area? See what he provided here: http://forum.team-mediaportal.com/viewtopic.php?t=17118
mzemina is online now   Reply With Quote
Old 2006-08-10, 00:55   #47 (permalink)
Portal Member
 
Join Date: Jun 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Been mulling over the internet radio display problem so I re-wrote the VB6 code I wrote for parsing Station name, track title and bitrate from a shoutcast stream and compiled it into an activex dll. This is in the hope that it's more use to someone as I suspect it can be imported or used quite easily in a C# application (I haven't the time to figure out how to actually code it in C#). If it doesn't work in C#, then sorry!

The dll has 2 publicly available methods. 1 called Tune which requires the server IP as a String, and the port as a Long. The VB syntax is object.Tune IPaddress, Port.
The other is Stop and just closes the connection to the station (object.Stop).
The results are returned in global strings named Bitrate, Station and TrackTitle.
The dll listens to the data stream once opened and so updates the strings when the station changes the data (e.g. track title) but I cannot find a way of getting the dll to automatically resend the data as I don't think you can specify runtime paths to send variables to from a module. The easy way round is to just set up a timer to fetch the strings from the host application every 200 milliseconds or so.

You can download the dll and sample VB project to show how it works here. It's not pretty to look at but functional and only 18 lines of code including the timer to update the labels.
Don't forget to register and reference the dll before trying to run the app from source code.

Here's hoping it's of use!!
Spagbol is offline   Reply With Quote
Old 2006-08-31, 16:11   #48 (permalink)
Portal Member
 
Join Date: Aug 2006
Location: Melbourne
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Love this plugin / add-on / what-ever-its-called...

I have added a heap of internet radion stations, internet TV stations, web cams... everything was hunky-dory and i was fast falling in love with Media Portal...

then one day i woke up and the "video" for streaming Internet TV doesn't work, likewise the video for streaming web cams... i still get audio for the internet TV, but no visual.

thinking it was probably a codec failure / corruption / hicup / full moon, i installed ffdshow and whallah! back to perfect "i love media portal" performance...

then one day i woke up and the "video" for streaming internet TV blah blah blah... not working again!!!

whats going on here? any suggestion guys?

Thanks

Last edited by CHACAL; 2006-08-31 at 16:20.
CHACAL is offline   Reply With Quote
Old 2006-12-30, 00:14   #49 (permalink)
Portal Member
 
Join Date: Jun 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Well, after a brief chat with the devs in which I was (quite rightly) told that only C# source could be used, I PM'd rtv the code for the dll, and the original VB program in the hopes he could port it to C#.
That was a while back and have heard nothing since. A post in another thread prompted me to re-look at the problem and I have a hack/workaround.

As mentioned before, I don't program in C# but wrote a program in VB6 to do the work and worked out how to integrate it.
A couple of points to bear in mind... many shoutcast streams don't include artist, title etc. information; the formatting of the C# code isn't perfectly neat; shoutcast data is often streamed up to 15 seconds before the audio and so changes of track don't always coincide with the display - this is not a bug; this was coded and tested with version 0.2.2.0 using the internal audio player only; and lastly, for obvious reasons, this will not work if 'MediaPortal always on top" is checked (might look for a solution to this one...)

Changes needed...
1) Changes to GUIRadio.cs
2) Changes to g-player.cs
3) Put shoutcastinfo.exe and shoutcastinfo.ini in the root of your MediaPortal install (usually C:\Program files\Team Mediaportal\MediaPortal)

Lastly, you need MSWinSck.ocx registered on your machine.

1) In GUIRadio.cs:

change void OnClick(int itemIndex) to

Code:
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);
              }
          }
and change void Play(GUIListItem item) to
Code:
   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;
          }
        }  
      }        
    }
These changes will write a temporary text file containing either the http path or the .pls file of the radio station.
It will then launch shoutcastinfo.exe that I wrote which will parse the correct info from the text file, connect to the stream and show the relevant data.

2) In g_player.cs

add using System.IO; at the top...

And change public static void Stop() to

Code:
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();
      }
    }
This will unload the module when shoutcast playback is stopped, through any means including exiting MediaPortal.

3) Place the shoutcastinfo.exe and .ini files in your MediaPortal directory. The files can be downloaded from here.

The way the information box displays can be controlled by editing the ini file - font size, width of the module, height of the module and positioning on screen. You will have to experiment with those for your system!
Screenshots here and here.

I have a 10 day old baby so not much spare time, but any problems I will try and sort out. Works fine for me

Last edited by Spagbol; 2006-12-31 at 02:55.
Spagbol is offline   Reply With Quote
Old 2006-12-30, 15:43   #50 (permalink)
Portal Member
 
Join Date: Jun 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts


Default

OK, I've updated the .exe and .ini files for more customizability(!).
Available here.

You can now set font size, font style, font colour, background colour, border colour, set border on or off, border size, width, height and position of the module, set the scroll speed and turn the scroll on or off all from the ini file.
Screenshot with foul colours and a wide border here.

With a bit of careful positioning and settings you can make it seem part of MediaPortal like here.

For those of you who don't want to mess with SVN code, here are the compiled files.
Make sure you backup the originals just in case...
Core.dll which goes in your root MediaPortal directory
WindowsPlugins.dll which goes in MediaPortal/Plugins/Windows
Remember, they are from SVN code so not guaranteed stable.

If you try it and can't see the module, check the following things:
Check MP isn't always on top
Check the Top and Left settings in the ini file - you may be showing it off screen

Last edited by Spagbol; 2007-01-01 at 00:10. Reason: added compiled files and more customise options
Spagbol is offline   Reply With Quote
Reply

Bookmarks

Tags
internet, radio

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to start timeshifting Unable to create graph Topher5000 General Support 31 2008-09-06 18:35
KNC 1 DVB-C / cannot tune channels lutz General Support 15 2006-10-01 12:04
TV recording question/problem 'Arry Installation, configuration support 9 2006-09-22 14:14
Recording from TV 'Arry General Support 2 2006-09-20 01:12
Internet radio streams get tangled up with Trailers... Taipan The old Bugreport Forum 7 2006-08-26 13:39


All times are GMT +1. The time now is 19:02.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden