diff --git a/MyAudioPlaybackAgent/AudioPlayer.cs b/MyAudioPlaybackAgent/AudioPlayer.cs new file mode 100644 index 0000000..d22d482 --- /dev/null +++ b/MyAudioPlaybackAgent/AudioPlayer.cs @@ -0,0 +1,214 @@ +using System; +using System.Diagnostics; +using System.Windows; +using Microsoft.Phone.BackgroundAudio; + +namespace MyAudioPlaybackAgent +{ + public class AudioPlayer : AudioPlayerAgent + { + /// + /// Le istanze di AudioPlayer possono condividere lo stesso processo. + /// I campi statici possono essere utilizzati per condividere lo stato tra le istanze di AudioPlayer + /// o per comunicare con l'agente di flusso audio. + /// + static AudioPlayer() + { + // La sottoscrizione del gestore eccezioni gestite + Deployment.Current.Dispatcher.BeginInvoke(delegate + { + Application.Current.UnhandledException += UnhandledException; + }); + } + + /// Codice da eseguire in caso di eccezioni non gestite + private static void UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (Debugger.IsAttached) + { + // Si è verificata un'eccezione non gestita; inserire un'interruzione nel debugger + Debugger.Break(); + } + } + + /// + /// Chiamata eseguita quando cambia lo stato della riproduzione, eccetto che per lo stato di errore (vedere OnError) + /// + /// BackgroundAudioPlayer + /// La traccia riprodotta in corrispondenza del cambiamento di stato della riproduzione + /// Il nuovo stato della riproduzione del lettore + /// + /// Impossibile annullare i cambiamenti di stato della riproduzione. I cambiamenti vengono generati anche se l'applicazione + /// ha causato il cambiamento dello stato stesso, presupponendo che l'applicazione abbia acconsentito esplicitamente al callback. + /// + /// Eventi rilevanti dello stato della riproduzione: + /// (a) TrackEnded: richiamato quando il lettore non contiene una traccia corrente. L'agente può impostare la traccia successiva. + /// (b) TrackReady: è stata impostata una traccia audio, la quale è pronta per la riproduzione. + /// + /// Chiamare NotifyComplete() solo una volta, dopo il completamento della richiesta dell'agente, inclusi i callback asincroni. + /// + protected override void OnPlayStateChanged(BackgroundAudioPlayer player, AudioTrack track, PlayState playState) + { + switch (playState) + { + case PlayState.TrackEnded: + player.Track = GetPreviousTrack(); + break; + case PlayState.TrackReady: + player.Play(); + break; + case PlayState.Shutdown: + // TODO: Gestire qui lo stato di arresto (ad esempio, salvare lo stato) + break; + case PlayState.Unknown: + break; + case PlayState.Stopped: + break; + case PlayState.Paused: + break; + case PlayState.Playing: + break; + case PlayState.BufferingStarted: + break; + case PlayState.BufferingStopped: + break; + case PlayState.Rewinding: + break; + case PlayState.FastForwarding: + break; + } + + NotifyComplete(); + } + + /// + /// Chiamata eseguita quando l'utente richiede un'azione tramite l'interfaccia utente fornita dall'applicazione o dal sistema + /// + /// BackgroundAudioPlayer + /// La traccia riprodotta in corrispondenza del cambiamento di stato della riproduzione + /// L'azione richiesta dall'utente + /// I dati associati all'azione richiesta. + /// Nella versione corrente questo parametro può essere utilizzato solo con l'azione Seek, + /// per indicare la posizione richiesta di una traccia audio + /// + /// Le azioni dell'utente non apportano automaticamente cambiamenti nello stato del sistema. L'agente è responsabile + /// dell'esecuzione delle azioni dell'utente, se supportate. + /// + /// Chiamare NotifyComplete() solo una volta, dopo il completamento della richiesta dell'agente, inclusi i callback asincroni. + /// + protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param) + { + switch (action) + { + case UserAction.Play: + if (player.PlayerState != PlayState.Playing) + { + try + { + player.Play(); + } + catch + { + + } + } + break; + case UserAction.Stop: + try + { + player.Stop(); + } + catch + { + + } + break; + case UserAction.Pause: + player.Pause(); + break; + + } + + NotifyComplete(); + } + + /// + /// Implementa la logica necessaria per ottenere l'istanza di AudioTrack successiva. + /// In una playlist l'origine può essere un file, una richiesta Web, ecc. + /// + /// + /// L'URI di AudioTrack determina l'origine, che può essere: + /// (a) File di spazio di memorizzazione isolato (URI relativo, rappresenta il percorso nello spazio di memorizzazione isolato) + /// (b) URL HTTP (URI assoluto) + /// (c) MediaStreamSource (null) + /// + /// istanza di AudioTrack o null se la riproduzione è stata completata + private AudioTrack GetNextTrack() + { + // TODO: aggiungere la logica per ottenere la traccia audio successiva + + AudioTrack track = null; + + // specificare la traccia + + return track; + } + + /// + /// Implementa la logica necessaria per ottenere l'istanza di AudioTrack precedente. + /// + /// + /// L'URI di AudioTrack determina l'origine, che può essere: + /// (a) File di spazio di memorizzazione isolato (URI relativo, rappresenta il percorso nello spazio di memorizzazione isolato) + /// (b) URL HTTP (URI assoluto) + /// (c) MediaStreamSource (null) + /// + /// istanza di AudioTrack o null se la traccia precedente non è consentita + private AudioTrack GetPreviousTrack() + { + // TODO: aggiungere la logica per ottenere la traccia audio precedente + + AudioTrack track = null; + + // specificare la traccia + + return track; + } + + /// + /// Chiamata eseguita quando si verifica un errore relativo alla riproduzione, ad esempio quando il download di AudioTrack non viene eseguito correttamente + /// + /// BackgroundAudioPlayer + /// La traccia che ha restituito l'errore + /// L'errore che si è verificato + /// Se true, la riproduzione non può continuare e la riproduzione della traccia verrà interrotta + /// + /// Questo metodo non viene chiamato in tutti i casi. Ad esempio, se l'agente in background + /// stesso rileva un'eccezione non gestita, non verrà richiamato per gestire i propri errori. + /// + protected override void OnError(BackgroundAudioPlayer player, AudioTrack track, Exception error, bool isFatal) + { + if (isFatal) + { + Abort(); + } + else + { + NotifyComplete(); + } + + } + + /// + /// Chiamata eseguita quando la richiesta dell'agente viene annullata + /// + /// + /// Dopo l'annullamento della richiesta, l'agente impiega 5 secondi per completare l'operazione, + /// chiamando NotifyComplete()/Abort(). + /// + protected override void OnCancel() + { + + } + } +} \ No newline at end of file diff --git a/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.dll b/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.dll new file mode 100644 index 0000000..2fe5e6d Binary files /dev/null and b/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.dll differ diff --git a/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.pdb b/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.pdb new file mode 100644 index 0000000..b70e532 Binary files /dev/null and b/MyAudioPlaybackAgent/Bin/Debug/MyAudioPlaybackAgent.pdb differ diff --git a/Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj b/MyAudioPlaybackAgent/MyAudioPlaybackAgent.csproj similarity index 67% rename from Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj rename to MyAudioPlaybackAgent/MyAudioPlaybackAgent.csproj index 8bcee24..60a9ec1 100644 --- a/Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj +++ b/MyAudioPlaybackAgent/MyAudioPlaybackAgent.csproj @@ -1,40 +1,24 @@  - + Debug AnyCPU 10.0.20506 2.0 - {12F8E56D-728C-4073-BDA5-058E6222DE51} + {408FDA62-9BCB-4BE0-9F74-D82B4A902468} {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - Shoutcast.Sample.Phone.Background.PlaybackAgent - Shoutcast.Sample.Phone.Background.PlaybackAgent - v8.0 - - - - + MyAudioPlaybackAgent + MyAudioPlaybackAgent WindowsPhone + v8.0 + $(TargetFrameworkVersion) false true true - AgentLibrary - - - - - - - - - - - - - 4.0 11.0 + AgentLibrary true @@ -57,43 +41,52 @@ prompt 4 - - - Bin\x86\Debug + true full false + Bin\x86\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 - - - Bin\x86\Release + pdbonly true + Bin\x86\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 - - - Bin\ARM\Debug + true full false + Bin\ARM\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 - - - Bin\ARM\Release + pdbonly true + Bin\ARM\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 - - - - {05CC4102-451C-4EB5-8FEA-614F5B49AB2D} - Silverlight.Media.Shoutcast.Phone - - diff --git a/MyAudioPlaybackAgent/Properties/AssemblyInfo.cs b/MyAudioPlaybackAgent/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..cae5c85 --- /dev/null +++ b/MyAudioPlaybackAgent/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// Le informazioni generali relative a un assembly sono controllate dal seguente +// set di attributi. Modificare i valori di questi attributi per modificare le informazioni +// associate a un assembly. +[assembly: AssemblyTitle("MyAudioPlaybackAgent")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyAudioPlaybackAgent")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili +// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da +// COM, impostare su true l'attributo ComVisible per tale tipo. +[assembly: ComVisible(false)] + +// Se il progetto viene esposto a COM, il seguente GUID verrà utilizzato come ID della libreria dei tipi +[assembly: Guid("408fda62-9bcb-4be0-9f74-d82b4a902468")] + +// Le informazioni sulla versione di un assembly sono costituite dai quattro valori seguenti: +// +// Versione principale +// Versione secondaria +// Numero build +// Revisione +// +// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build +// utilizzando l'asterisco (*) come illustrato di seguito: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("it-IT")] diff --git a/MyAudioPlaybackAgent/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/MyAudioPlaybackAgent/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..194dc8f Binary files /dev/null and b/MyAudioPlaybackAgent/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.csproj.FileListAbsolute.txt b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..72a2c8a --- /dev/null +++ b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Francesco\Desktop\strillone-spl-WindowsPhone-StreamingRadios\MyAudioPlaybackAgent\Bin\Debug\MyAudioPlaybackAgent.dll +C:\Users\Francesco\Desktop\strillone-spl-WindowsPhone-StreamingRadios\MyAudioPlaybackAgent\Bin\Debug\MyAudioPlaybackAgent.pdb +C:\Users\Francesco\Desktop\strillone-spl-WindowsPhone-StreamingRadios\MyAudioPlaybackAgent\obj\Debug\MyAudioPlaybackAgent.dll +C:\Users\Francesco\Desktop\strillone-spl-WindowsPhone-StreamingRadios\MyAudioPlaybackAgent\obj\Debug\MyAudioPlaybackAgent.pdb diff --git a/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.dll b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.dll new file mode 100644 index 0000000..2fe5e6d Binary files /dev/null and b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.dll differ diff --git a/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.pdb b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.pdb new file mode 100644 index 0000000..b70e532 Binary files /dev/null and b/MyAudioPlaybackAgent/obj/Debug/MyAudioPlaybackAgent.pdb differ diff --git a/Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs rename to MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs rename to MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from Src/Shoutcast.Sample.Phone.Background.PlaybackAgent/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs rename to MyAudioPlaybackAgent/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioPlayer.cs b/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioPlayer.cs deleted file mode 100644 index c64360b..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioPlayer.cs +++ /dev/null @@ -1,203 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -namespace Shoutcast.Sample.Phone.Background.Playback -{ - using System; - using System.Windows; - using Microsoft.Phone.BackgroundAudio; - - /// - /// Shoutcast audio player for background audio. - /// - public class AudioPlayer : AudioPlayerAgent - { - /// - /// Static field that denotes if this class has been initialized. - /// - private static volatile bool classInitialized; - - /// - /// Initializes a new instance of the AudioPlayer class. - /// - /// - /// AudioPlayer instances can share the same process. - /// Static fields can be used to share state between AudioPlayer instances - /// or to communicate with the Audio Streaming agent. - /// - public AudioPlayer() - { - if (!AudioPlayer.classInitialized) - { - AudioPlayer.classInitialized = true; - - // Subscribe to the managed exception handler - Deployment.Current.Dispatcher.BeginInvoke(delegate - { - Application.Current.UnhandledException += this.AudioPlayer_UnhandledException; - }); - } - } - - /// - /// Called when the playstate changes, except for the Error state (see OnError) - /// - /// The BackgroundAudioPlayer - /// The track playing at the time the playstate changed - /// The new playstate of the player - /// - /// - /// Play State changes cannot be cancelled. They are raised even if the application - /// caused the state change itself, assuming the application has opted-in to the callback. - /// - /// - /// Notable playstate events: - /// (a) TrackEnded: invoked when the player has no current track. The agent can set the next track. - /// (b) TrackReady: an audio track has been set and it is now ready for playack. - /// - /// - /// Call NotifyComplete() only once, after the agent request has been completed, including async callbacks. - /// - /// - protected override void OnPlayStateChanged(BackgroundAudioPlayer player, AudioTrack track, PlayState playState) - { - System.Diagnostics.Debug.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ": OnPlayStateChanged() - {0}", playState); - switch (playState) - { - case PlayState.TrackEnded: - break; - case PlayState.TrackReady: - player.Play(); - break; - case PlayState.Shutdown: - // TODO: Handle the shutdown state here (e.g. save state) - break; - case PlayState.Unknown: - break; - case PlayState.Stopped: - break; - case PlayState.Paused: - break; - case PlayState.Playing: - break; - case PlayState.BufferingStarted: - break; - case PlayState.BufferingStopped: - break; - case PlayState.Rewinding: - break; - case PlayState.FastForwarding: - break; - } - - NotifyComplete(); - } - - /// - /// Called when the user requests an action using application/system provided UI - /// - /// The BackgroundAudioPlayer - /// The track playing at the time of the user action - /// The action the user has requested - /// The data associated with the requested action. - /// In the current version this parameter is only for use with the Seek action, - /// to indicate the requested position of an audio track - /// - /// User actions do not automatically make any changes in system state; the agent is responsible - /// for carrying out the user actions if they are supported. - /// Call NotifyComplete() only once, after the agent request has been completed, including async callbacks. - /// - protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param) - { - System.Diagnostics.Debug.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ": OnUserAction() - {0}", action); - switch (action) - { - case UserAction.Play: - // Since we are just restarting the same stream, this should be fine. - player.Track = track; - break; - case UserAction.Stop: - case UserAction.Pause: - player.Stop(); - - // Stop the background streaming agent. - Shoutcast.Sample.Phone.Background.Playback.AudioTrackStreamer.ShutdownMediaStreamSource(); - break; - case UserAction.FastForward: - break; - case UserAction.Rewind: - break; - case UserAction.Seek: - break; - case UserAction.SkipNext: - break; - case UserAction.SkipPrevious: - break; - } - - NotifyComplete(); - } - - /// - /// Called whenever there is an error with playback, such as an AudioTrack not downloading correctly - /// - /// The BackgroundAudioPlayer - /// The track that had the error - /// The error that occured - /// If true, playback cannot continue and playback of the track will stop - /// - /// This method is not guaranteed to be called in all cases. For example, if the background agent - /// itself has an unhandled exception, it won't get called back to handle its own errors. - /// - protected override void OnError(BackgroundAudioPlayer player, AudioTrack track, Exception error, bool isFatal) - { - if (isFatal) - { - Abort(); - } - else - { - player.Track = null; - NotifyComplete(); - } - } - - /// - /// Called by the operating system to alert a background agent that it is going to be put into a dormant state or terminated. - /// - protected override void OnCancel() - { - base.OnCancel(); - this.NotifyComplete(); - } - - /// - /// Code to execute unhandled exceptions. - /// - /// Sender of the event. - /// ApplicationUnhandledExceptionEventArgs associated with this event. - private void AudioPlayer_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - } -} diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioTrackStreamer.cs b/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioTrackStreamer.cs deleted file mode 100644 index 32587eb..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/AudioTrackStreamer.cs +++ /dev/null @@ -1,130 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -namespace Shoutcast.Sample.Phone.Background.Playback -{ - using System; - using System.Windows; - using Microsoft.Phone.BackgroundAudio; - using Silverlight.Media; - - /// - /// A background agent that performs per-track streaming for playback - /// - public class AudioTrackStreamer : AudioStreamingAgent - { - /// - /// Static field that contains the ShoutcastMediaStreamSource associated with this AudioStreamingAgent. - /// - private static ShoutcastMediaStreamSource mss; - - /// - /// Static field used to synchronize access to the ShoutcastMediaStreamSource associated with this AudioStreamingAgent. - /// - private static object syncRoot = new object(); - - /// - /// Initializes a new instance of the AudioTrackStreamer class. - /// - public AudioTrackStreamer() - : base() - { - } - - /// - /// Completely shuts down the AudioTrackStreamer. - /// - public static void ShutdownMediaStreamSource() - { - if (AudioTrackStreamer.mss != null) - { - lock (AudioTrackStreamer.syncRoot) - { - if (AudioTrackStreamer.mss != null) - { - // Because of the NotifyComplete(), we need to set this BEFORE the MSS ends. - ShoutcastMediaStreamSource temp = AudioTrackStreamer.mss; - AudioTrackStreamer.mss = null; - temp.MetadataChanged -= new System.Windows.RoutedEventHandler(AudioTrackStreamer.MetadataChanged); - temp.Dispose(); - } - } - } - } - - /// - /// Called when a new track requires audio decoding - /// (typically because it is about to start playing) - /// - /// - /// The track that needs audio streaming - /// - /// - /// The AudioStreamer object to which a MediaStreamSource should be - /// attached to commence playback - /// - /// - /// To invoke this method for a track set the Source parameter of the AudioTrack to null - /// before setting into the Track property of the BackgroundAudioPlayer instance - /// property set to true; - /// otherwise it is assumed that the system will perform all streaming - /// and decoding - /// - protected override void OnBeginStreaming(AudioTrack track, AudioStreamer streamer) - { - lock (AudioTrackStreamer.syncRoot) - { - AudioTrackStreamer.mss = new ShoutcastMediaStreamSource(new Uri(track.Tag)); - AudioTrackStreamer.mss.MetadataChanged += new RoutedEventHandler(AudioTrackStreamer.MetadataChanged); - AudioTrackStreamer.mss.Closed += (s, e) => - { - this.NotifyComplete(); - }; - streamer.SetSource(AudioTrackStreamer.mss); - } - } - - /// - /// Called when the agent request is getting cancelled - /// The call to base.OnCancel() is necessary to release the background streaming resources - /// - protected override void OnCancel() - { - base.OnCancel(); - - // The shutdown calls NotifyComplete(), so we don't have to call it here. - AudioTrackStreamer.ShutdownMediaStreamSource(); - } - - /// - /// Code to execute when the Shoutcast stream metadata changes. - /// - /// Send of the event. - /// RoutedEventArgs associated with this event. - private static void MetadataChanged(object sender, RoutedEventArgs e) - { - var track = BackgroundAudioPlayer.Instance.Track; - if (track != null) - { - track.BeginEdit(); - track.Artist = AudioTrackStreamer.mss.CurrentMetadata.Title; - track.EndEdit(); - } - } - } -} diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Properties/AssemblyInfo.cs b/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Properties/AssemblyInfo.cs deleted file mode 100644 index 5db5cb1..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,54 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Shoutcast.Sample.Phone.Background.PlaybackAgent")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Shoutcast.Sample.Phone.Background.PlaybackAgent")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3903187c-bc99-40ff-a64c-750a0e462243")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj b/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj deleted file mode 100644 index 9d397f0..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {12F8E56D-728C-4073-BDA5-058E6222DE51} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Shoutcast.Sample.Phone.Background.PlaybackAgent - Shoutcast.Sample.Phone.Background.PlaybackAgent - v4.0 - $(TargetFrameworkVersion) - WindowsPhone71 - Silverlight - false - true - true - AudioPlayerAgent - - - - - - - - - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - - - - - - - - - - - - - - {05CC4102-451C-4EB5-8FEA-614F5B49AB2D} - Silverlight.Media.Shoutcast.Phone - - - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj.user b/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj.user deleted file mode 100644 index ac8712b..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background.PlaybackAgent/Shoutcast.Sample.Phone.Background.Playback.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - True - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml b/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml deleted file mode 100644 index 4047f50..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml.cs b/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml.cs deleted file mode 100644 index 12466d7..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/App.xaml.cs +++ /dev/null @@ -1,192 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -namespace Shoutcast.Sample.Phone.Background -{ - using System.Windows; - using System.Windows.Navigation; - using Microsoft.Phone.BackgroundAudio; - using Microsoft.Phone.Controls; - using Microsoft.Phone.Shell; - - /// - /// This class represents our Windows Phone application. - /// - public partial class App : Application - { - /// - /// Field used to avoid double-initialization. - /// - private bool phoneApplicationInitialized = false; - - /// - /// Initializes a new instance of the App class. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += this.Application_UnhandledException; - - // Standard Silverlight initialization - InitializeComponent(); - - // Phone-specific initialization - this.InitializePhoneApplication(); - - // Show graphics profiling information while debugging. - if (System.Diagnostics.Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - // Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are handed off to GPU with a colored overlay. - // Application.Current.Host.Settings.EnableCacheVisualization = true; - - // Disable the application idle detection by setting the UserIdleDetectionMode property of the - // application's PhoneApplicationService object to Disabled. - // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run - // and consume battery power when the user is not using the phone. - PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; - - // Make sure we aren't attached to the background agent - BackgroundAudioPlayer.Instance.Close(); - } - } - - /// - /// Gets the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public PhoneApplicationFrame RootFrame { get; private set; } - - /// - /// Method that is called when the application is launching (eg, from Start). - /// This code will not execute when the application is reactivated. - /// - /// Sender of the event. - /// LaunchingEventArgs associated with this event. - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - /// - /// Method that is called when the application is activated (brought to foreground). - /// This code will not execute when the application is first launched. - /// - /// Sender of the event. - /// ActivatedEventArgs associated with this event. - private void Application_Activated(object sender, ActivatedEventArgs e) - { - } - - /// - /// Method that is called when the application is deactivated (sent to background). - /// This code will not execute when the application is closing. - /// - /// Sender of the event. - /// DeactivatedEventArgs associated with this event. - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - } - - /// - /// Method that is called when the application is closing (eg, user hit Back). - /// This code will not execute when the application is deactivated. - /// - /// Sender of the event. - /// ClosingEventArgs associated with this event. - private void Application_Closing(object sender, ClosingEventArgs e) - { - } - - /// - /// Method that is called if a navigation fails. - /// - /// Sender of the event. - /// NavigationFailedEventArgs associated with this event. - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - /// - /// Method that is called on Unhandled Exceptions. - /// - /// Sender of the event. - /// ApplicationUnhandledExceptionEventArgs associated with this event. - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - #region Phone application initialization - - /// - /// Initializes the Windows Phone application. Do not add any additional code to this method! - /// - private void InitializePhoneApplication() - { - if (this.phoneApplicationInitialized) - { - return; - } - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - this.RootFrame = new PhoneApplicationFrame(); - this.RootFrame.Navigated += this.CompleteInitializePhoneApplication; - - // Handle navigation failures - this.RootFrame.NavigationFailed += this.RootFrame_NavigationFailed; - - // Ensure we don't initialize again - this.phoneApplicationInitialized = true; - } - - /// - /// Finalizes the initialization of the Windows Phone application. Do not add any additional code to this method! - /// - /// Sender of the event. - /// NavigationEventArgs associated with this event. - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != this.RootFrame) - { - RootVisual = this.RootFrame; - } - - // Remove this handler since it is no longer needed - this.RootFrame.Navigated -= this.CompleteInitializePhoneApplication; - } - - #endregion - } -} \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/ApplicationIcon.png b/Src/Backup/Shoutcast.Sample.Phone.Background/ApplicationIcon.png deleted file mode 100644 index 5859393..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone.Background/ApplicationIcon.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Background.png b/Src/Backup/Shoutcast.Sample.Phone.Background/Background.png deleted file mode 100644 index e46f21d..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone.Background/Background.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.pause.rest.png b/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.pause.rest.png deleted file mode 100644 index 1df8283..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.pause.rest.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.play.rest.png b/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.play.rest.png deleted file mode 100644 index 5cf7d9c..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone.Background/Images/appbar.transport.play.rest.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml b/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml deleted file mode 100644 index de4be19..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml.cs b/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml.cs deleted file mode 100644 index 975b8cd..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/MainPage.xaml.cs +++ /dev/null @@ -1,203 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -namespace Shoutcast.Sample.Phone.Background -{ - using System; - using System.Windows; - using System.Windows.Threading; - using Microsoft.Phone.BackgroundAudio; - using Microsoft.Phone.Controls; - using Microsoft.Phone.Shell; - - /// - /// This class represents the main page of our Windows Phone application. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "When the page is unloaded, the ShoutcastMediaStreamSource is disposed.")] - public partial class MainPage : PhoneApplicationPage - { - /// - /// Index for the play button in the ApplicationBar.Buttons. - /// - private const int PlayButtonIndex = 0; - - /// - /// Index for the pause button in the ApplicationBar.Buttons. - /// - private const int PauseButtonIndex = 1; - - /// - /// Private field that stores the timer for updating the UI - /// - private DispatcherTimer timer; - - /// - /// Initializes a new instance of the MainPage class. - /// - public MainPage() - { - InitializeComponent(); - Loaded += new RoutedEventHandler(this.MainPage_Loaded); - } - - /// - /// Method called when the main page is loaded. - /// - /// Sender of the event. - /// The RoutedEventArgs instance associated with this event. - private void MainPage_Loaded(object sender, RoutedEventArgs e) - { - // Initialize a timer to update the UI every half-second. - this.timer = new DispatcherTimer(); - this.timer.Interval = TimeSpan.FromSeconds(0.5); - this.timer.Tick += new EventHandler(this.UpdateState); - - BackgroundAudioPlayer.Instance.PlayStateChanged += new EventHandler(this.Instance_PlayStateChanged); - - if (BackgroundAudioPlayer.Instance.PlayerState == PlayState.Playing) - { - // If audio was already playing when the app was launched, update the UI. - // positionIndicator.IsIndeterminate = false; - // positionIndicator.Maximum = BackgroundAudioPlayer.Instance.Track.Duration.TotalSeconds; - this.UpdateButtons(false, true); - this.UpdateState(null, null); - } - } - - /// - /// PlayStateChanged event handler. - /// - /// Sender of the event. - /// The EventArgs instance associated with this event. - private void Instance_PlayStateChanged(object sender, EventArgs e) - { - // This is wonky - PlayState playState = PlayState.Unknown; - try - { - playState = BackgroundAudioPlayer.Instance.PlayerState; - } - catch (InvalidOperationException) - { - playState = PlayState.Stopped; - } - - switch (playState) - { - case PlayState.Playing: - // Update the UI. - // positionIndicator.IsIndeterminate = false; - // positionIndicator.Maximum = BackgroundAudioPlayer.Instance.Track.Duration.TotalSeconds; - this.UpdateButtons(false, true); - this.UpdateState(null, null); - - // Start the timer for updating the UI. - this.timer.Start(); - break; - - case PlayState.Paused: - // Stop the timer for updating the UI. - this.timer.Stop(); - - // Update the UI. - this.UpdateButtons(true, false); - this.UpdateState(null, null); - break; - case PlayState.Stopped: - // Stop the timer for updating the UI. - this.timer.Stop(); - - // Update the UI. - this.UpdateButtons(true, false); - this.UpdateState(null, null); - break; - default: - break; - } - } - - /// - /// Helper method to update the state of the ApplicationBar.Buttons - /// - /// true if the Play button should be enabled, otherwise, false. - /// true if the Pause button should be enabled, otherwise, false. - private void UpdateButtons(bool playBtnEnabled, bool pauseBtnEnabled) - { - // Set the IsEnabled state of the ApplicationBar.Buttons array - ((ApplicationBarIconButton)ApplicationBar.Buttons[PlayButtonIndex]).IsEnabled = playBtnEnabled; - ((ApplicationBarIconButton)ApplicationBar.Buttons[PauseButtonIndex]).IsEnabled = pauseBtnEnabled; - } - - /// - /// Updates the status indicators including the State, Track title, - /// - /// Sender of the event. - /// The EventArgs instance associated with this event. - private void UpdateState(object sender, EventArgs e) - { - txtState.Text = string.Format("State: {0}", BackgroundAudioPlayer.Instance.PlayerState); - - AudioTrack audioTrack = BackgroundAudioPlayer.Instance.Track; - - if (audioTrack != null) - { - txtTitle.Text = string.Format("Title: {0}", audioTrack.Title); - txtArtist.Text = string.Format("Artist: {0}", audioTrack.Artist); - - // Set the current position on the ProgressBar. - // positionIndicator.Value = BackgroundAudioPlayer.Instance.Position.TotalSeconds; - - // Update the current playback position. - TimeSpan position = new TimeSpan(); - position = BackgroundAudioPlayer.Instance.Position; - textPosition.Text = String.Format("{0:d2}:{1:d2}:{2:d2}", position.Hours, position.Minutes, position.Seconds); - - // Update the time remaining digits. - // TimeSpan timeRemaining = new TimeSpan(); - // timeRemaining = audioTrack.Duration - position; - // textRemaining.Text = String.Format("-{0:d2}:{1:d2}:{2:d2}", timeRemaining.Hours, timeRemaining.Minutes, timeRemaining.Seconds); - } - } - - /// - /// Click handler for the Play button - /// - /// Sender of the event. - /// The EventArgs instance associated with this event. - private void PlayButtonClick(object sender, EventArgs e) - { - // Tell the backgound audio agent to play the current track. - BackgroundAudioPlayer.Instance.Track = new AudioTrack(null, "SKY.FM", null, null, null, "http://scfire-ntc-aa05.stream.aol.com:80/stream/1006", EnabledPlayerControls.Pause); - BackgroundAudioPlayer.Instance.Volume = 1.0d; - } - - /// - /// Click handler for the Pause button - /// - /// Sender of the event. - /// The EventArgs instance associated with this event. - private void PauseButtonClick(object sender, EventArgs e) - { - // Tell the backgound audio agent to pause the current track. - // We need to stop the timer before anything - this.timer.Stop(); - BackgroundAudioPlayer.Instance.Stop(); - this.UpdateState(null, null); - } - } -} \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AppManifest.xml b/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AppManifest.xml deleted file mode 100644 index 6712a11..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AssemblyInfo.cs b/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AssemblyInfo.cs deleted file mode 100644 index 72a9fca..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,54 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Shoutcast.Sample.Phone.Background")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Shoutcast.Sample.Phone.Background")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cfe4a6f4-f696-41a2-875a-fdca146921dd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/WMAppManifest.xml b/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/WMAppManifest.xml deleted file mode 100644 index 6808a8d..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/Properties/WMAppManifest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - ApplicationIcon.png - - - - - - - - - - - - - - - - - - - - - - - - - - - Background.png - 0 - Shoutcast.Sample.Phone.Background - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj b/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj deleted file mode 100644 index a4497e9..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {A80155C6-79E1-4EFE-B473-D6F9E0A49609} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Shoutcast.Sample.Phone.Background - Shoutcast.Sample.Phone.Background - v4.0 - $(TargetFrameworkVersion) - WindowsPhone71 - Silverlight - true - - - true - true - Shoutcast.Sample.Phone.Background.xap - Properties\AppManifest.xml - Shoutcast.Sample.Phone.Background.App - true - true - - - - - - - - - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - - - - - - - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - {12F8E56D-728C-4073-BDA5-058E6222DE51} - Shoutcast.Sample.Phone.Background.Playback - - - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj.user b/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj.user deleted file mode 100644 index ac8712b..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone.Background/Shoutcast.Sample.Phone.Background.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - True - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone.Background/SplashScreenImage.jpg b/Src/Backup/Shoutcast.Sample.Phone.Background/SplashScreenImage.jpg deleted file mode 100644 index 353b192..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone.Background/SplashScreenImage.jpg and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone/App.xaml b/Src/Backup/Shoutcast.Sample.Phone/App.xaml deleted file mode 100644 index 34e443f..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone/App.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone/App.xaml.cs b/Src/Backup/Shoutcast.Sample.Phone/App.xaml.cs deleted file mode 100644 index 03d603c..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone/App.xaml.cs +++ /dev/null @@ -1,188 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Andrew Oakley -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses. -// -//----------------------------------------------------------------------- - -namespace Shoutcast.Sample.Phone -{ - using System.Windows; - using System.Windows.Navigation; - using Microsoft.Phone.Controls; - using Microsoft.Phone.Shell; - - /// - /// This class represents our Windows Phone application. - /// - public partial class App : Application - { - /// - /// Field used to avoid double-initialization. - /// - private bool phoneApplicationInitialized = false; - - /// - /// Initializes a new instance of the App class. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += this.Application_UnhandledException; - - // Standard Silverlight initialization - InitializeComponent(); - - // Phone-specific initialization - this.InitializePhoneApplication(); - - // Show graphics profiling information while debugging. - if (System.Diagnostics.Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - // Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are handed off to GPU with a colored overlay. - // Application.Current.Host.Settings.EnableCacheVisualization = true; - - // Disable the application idle detection by setting the UserIdleDetectionMode property of the - // application's PhoneApplicationService object to Disabled. - // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run - // and consume battery power when the user is not using the phone. - PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; - } - } - - /// - /// Gets the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public PhoneApplicationFrame RootFrame { get; private set; } - - /// - /// Method that is called when the application is launching (eg, from Start). - /// This code will not execute when the application is reactivated. - /// - /// Sender of the event. - /// LaunchingEventArgs associated with this event. - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - /// - /// Method that is called when the application is activated (brought to foreground). - /// This code will not execute when the application is first launched. - /// - /// Sender of the event. - /// ActivatedEventArgs associated with this event. - private void Application_Activated(object sender, ActivatedEventArgs e) - { - } - - /// - /// Method that is called when the application is deactivated (sent to background). - /// This code will not execute when the application is closing. - /// - /// Sender of the event. - /// DeactivatedEventArgs associated with this event. - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - } - - /// - /// Method that is called when the application is closing (eg, user hit Back). - /// This code will not execute when the application is deactivated. - /// - /// Sender of the event. - /// ClosingEventArgs associated with this event. - private void Application_Closing(object sender, ClosingEventArgs e) - { - } - - /// - /// Method that is called if a navigation fails. - /// - /// Sender of the event. - /// NavigationFailedEventArgs associated with this event. - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - /// - /// Method that is called on Unhandled Exceptions. - /// - /// Sender of the event. - /// ApplicationUnhandledExceptionEventArgs associated with this event. - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - #region Phone application initialization - - /// - /// Initializes the Windows Phone application. Do not add any additional code to this method! - /// - private void InitializePhoneApplication() - { - if (this.phoneApplicationInitialized) - { - return; - } - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - this.RootFrame = new PhoneApplicationFrame(); - this.RootFrame.Navigated += this.CompleteInitializePhoneApplication; - - // Handle navigation failures - this.RootFrame.NavigationFailed += this.RootFrame_NavigationFailed; - - // Ensure we don't initialize again - this.phoneApplicationInitialized = true; - } - - /// - /// Finalizes the initialization of the Windows Phone application. Do not add any additional code to this method! - /// - /// Sender of the event. - /// NavigationEventArgs associated with this event. - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != this.RootFrame) - { - RootVisual = this.RootFrame; - } - - // Remove this handler since it is no longer needed - this.RootFrame.Navigated -= this.CompleteInitializePhoneApplication; - } - - #endregion - } -} \ No newline at end of file diff --git a/Src/Backup/Shoutcast.Sample.Phone/ApplicationIcon.png b/Src/Backup/Shoutcast.Sample.Phone/ApplicationIcon.png deleted file mode 100644 index 5859393..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone/ApplicationIcon.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone/Background.png b/Src/Backup/Shoutcast.Sample.Phone/Background.png deleted file mode 100644 index e46f21d..0000000 Binary files a/Src/Backup/Shoutcast.Sample.Phone/Background.png and /dev/null differ diff --git a/Src/Backup/Shoutcast.Sample.Phone/MainPage.xaml b/Src/Backup/Shoutcast.Sample.Phone/MainPage.xaml deleted file mode 100644 index e0faa8b..0000000 --- a/Src/Backup/Shoutcast.Sample.Phone/MainPage.xaml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -