public bool TuneIntoGroupRadio(string groupname_)
        {
            string TuneGroup = AudioscrobblerBase.getValidURLLastFMString(groupname_);

            if (
                SendCommandRequest(@"http://ws.audioscrobbler.com/radio/adjust.php?session=" + _currentSession +
                                   @"&url=lastfm://group/" + TuneGroup))
            {
                _currentTuneType = StreamType.Group;
                Log.Info("StreamControl: Tune into group radio for: {0}", groupname_);

                // GUIPropertyManager.SetProperty("#Play.Current.Lastfm.CurrentStream", "Group radio of: " + groupname_);

                return(true);
            }
            else
            {
                return(false);
            }
        }
        // 4. http.request.uri = Request URI: http://ws.audioscrobbler.com/ass/upgrade.php?platform=win&version=1.0.7&lang=en&user=
        // 5. http.request.uri = Request URI: http://ws.audioscrobbler.com/radio/np.php?session=
        // 6. http.request.uri = Request URI: http://ws.audioscrobbler.com/ass/artistmetadata.php?artist=Sportfreunde%20Stiller&lang=en
        // 7. http.request.uri = Request URI: http://ws.audioscrobbler.com/ass/metadata.php?artist=Sportfreunde%20Stiller&track=Alles%20Das&album=Macht%20doch%20was%20ihr%20wollt%20-%20Ich%20geh%2527%20jetzt%2521

        //price=
        //shopname=
        //clickthrulink=
        //streaming=true
        //discovery=0
        //station=Global Tag Radio: metal, viking metal, Melodic Death Metal
        //artist=Sonata Arctica
        //artist_url=http://www.last.fm/music/Sonata+Arctica
        //track=8th Commandment
        //track_url=http://www.last.fm/music/Sonata+Arctica/_/8th+Commandment
        //album=Ecliptica
        //album_url=http://www.last.fm/music/Sonata+Arctica/Ecliptica
        //albumcover_small=http://images.amazon.com/images/P/B00004T40X.01._SCMZZZZZZZ_.jpg
        //albumcover_medium=http://images.amazon.com/images/P/B00004T40X.01._SCMZZZZZZZ_.jpg
        //albumcover_large=http://images.amazon.com/images/P/B00004T40X.01._SCMZZZZZZZ_.jpg
        //trackduration=222
        //radiomode=1
        //recordtoprofile=1

        #endregion

        #region Serialisation

        public void LoadSettings(bool aForceRequired)
        {
            httpcommand = new AsyncGetRequest();
            httpcommand.workerFinished += new AsyncGetRequest.AsyncGetRequestCompleted(OnParseAsyncResponse);
            httpcommand.workerError    += new AsyncGetRequest.AsyncGetRequestError(OnAsyncRequestError);

            _currentUser = AudioscrobblerBase.Username;
            using (Profile.Settings xmlreader = new Profile.MPSettings())
            {
                _discoveryMode = xmlreader.GetValueAsBool("audioscrobbler", "discoveryenabled", false);
            }

            if (_currentUser.Length > 0)
            {
                AudioscrobblerBase.DoRadioHandshake(aForceRequired);
            }
            else
            {
                OnRadioLoginFailed();
            }
        }
        public bool TuneIntoArtists(List <String> artists_)
        {
            string TuneArtists = String.Empty;

            foreach (string singleArtist in artists_)
            {
                TuneArtists += AudioscrobblerBase.getValidURLLastFMString(singleArtist) + ",";
            }
            // remove trailing comma
            TuneArtists = TuneArtists.Remove(TuneArtists.Length - 1);
            if (
                SendCommandRequest(@"http://ws.audioscrobbler.com/radio/adjust.php?session=" + _currentSession +
                                   @"&url=lastfm://artist/" + TuneArtists + "/similarartists&lang=de"))
            {
                _currentTuneType = StreamType.Artist;
                Log.Info("StreamControl: Tune into artists similar to: {0}", TuneArtists);
                // GUIPropertyManager.SetProperty("#Play.Current.Lastfm.CurrentStream", "Artists similar to: " + TuneArtists);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #4
0
 private void OnManualConnect(object sender, EventArgs args)
 {
     AudioscrobblerBase.Connect();
 }