protected void CheckForStationTags(PandoraSong song) { if (!RemoveStationTags) return; foreach (string currTag in specialStationTags) { if (song.Artist.EndsWith(currTag)) { song.Artist = song.Artist.Remove(song.Artist.LastIndexOf(currTag)).Trim(); return; } } }
/// <summary> /// Ban this song from playing on any of the users stations for one month. /// </summary> /// <param name="song"></param> public void TemporarilyBanSong(PandoraSong song) { VerifyAndExecute(delegate { pandora.AddTiredSong(Session, song, Proxy); }); }
/// <summary> /// Rate the specified song. A positive or negative rating will influence future songs /// played from the current station. /// </summary> /// <param name="rating"></param> /// <param name="song"></param> public void RateSong(PandoraSong song, PandoraRating rating) { VerifyAndExecute(delegate { pandora.RateSong(Session, CurrentStation, song, rating); }); }
/** * Constructor for Player Object */ public DirectShowPlayer() { graphBuilder = null; _IsPlaying = false; PreviousVolume = null; loadedSong = null; }
public void Close() { // store current volume so it persists from track to track if (loadedSong != null) PreviousVolume = Volume; Stop(); lock (lockingToken) { mediaEventEx = null; mediaSeeking = null; mediaControl = null; mediaPosition = null; basicAudio = null; if (this.graphBuilder != null) Marshal.ReleaseComObject(this.graphBuilder); this.graphBuilder = null; } loadedSong = null; _IsPlaying = false; }
public bool Open(PandoraSong file) { try { Close(); graphBuilder = (IGraphBuilder)new FilterGraph(); // create interface objects for various actions mediaControl = (IMediaControl)graphBuilder; mediaEventEx = (IMediaEventEx)graphBuilder; mediaSeeking = (IMediaSeeking)graphBuilder; mediaPosition = (IMediaPosition)graphBuilder; basicAudio = (IBasicAudio)graphBuilder; int hr = 0; StartEventLoop(); //hr = graphBuilder.AddFilter( // Have the graph builder construct its the appropriate graph automatically hr = graphBuilder.RenderFile(file.AudioURL, null); DsError.ThrowExceptionForHR(hr); // maintain previous volume level so it persists from track to track if (PreviousVolume != null) Volume = (double)PreviousVolume; loadedSong = file; return true; } catch (Exception) { return false; } }