Ejemplo n.º 1
0
        // Constructor
        public MainPage()
        {
            //client = new MegaStarzClient();
            client = new MegaStarzClient("http://localhost:82/Services/WP7");

            InitializeComponent();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //var client = new MegaStarzClient("http://*****:*****@"C:\1020.log", FileMode.Open, FileAccess.Read);
                        }
                        catch (Exception e)
                        {
                            
                        }


                        client.UploadRecordingAsync(response.Ticket.ticket, 1, fs, (recResponse) =>
                                                                              {
                                                                                  Console.WriteLine(recResponse.playUrl);
                                                                              });




                });

//            client.GetSongsAsync((response) =>
//                                     {
//                                         foreach (var songResponse in response)
//                                         {
//                                             Console.WriteLine(string.Format("Song ({0}): \"{1}\", ({2}). Length {3}, PlayUrl: {4}", songResponse.id, songResponse.name, songResponse.artistName, songResponse.length, songResponse.playUrl));
//                                         }
//                                     });

            System.Threading.Thread.CurrentThread.Suspend();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Start the process of Loading the songs from the server
        /// </summary>
        public void LoadSongs()
        {
            MegaStarzClient client = new MegaStarzClient();

            //Get song list from server
            try
            {
                client.GetSongsAsync((result) =>
                                         {

                                             if (result != null)
                                                 LoadSongList(result);

                                         });
            }
            catch (Exception e)
            {
                MessageBox.Show("Could not get song list from server");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Login Success. Get a ticket from the Azure Cloud
        /// </summary>
        private void loginSucceeded()
        {
            TitlePanel.Visibility = Visibility.Visible;
            FacebookLoginBrowser.Visibility = Visibility.Collapsed;

            var client = new MegaStarzClient();

            //Get a ticket from the clod
            client.GetTicketAsync(new GetTicketRequest()
                                      {
                                          AccessToken = _fbClient.AccessToken
                                      },
                                   (response) =>        //Callback when we have a ticket
                                       {
                                           if (response != null)
                                           {
                                               //Save ticket & star object
                                               ((App) Application.Current).starTicket = response.Ticket.ticket;
                                               ((App) Application.Current).star = response.Star;

                                               //Navigate to MegaStarzViewModelInstance Page
                                               NavigationService.Navigate(new Uri("/SongListPage.xaml", UriKind.Relative));

                                           }
                                           else //Azure could error
                                           {
                                               Dispatcher.BeginInvoke(() => MessageBox.Show("Could not contact Azure server. Please try again later"));
                                           }
                                       });
        }
Ejemplo n.º 5
0
        private void OnFuncButtonClick(object sender, RoutedEventArgs e)
        {
            //case recording stop the recorde
            if (!startRecored)
            {
                funcBtn.Style = (Style)Resources["stopButton"];
                startRecored = true;
                captureSource.Start();
                var animation = (Storyboard)Resources["lyricsAnimation"];
                animation.Begin();
            }
            //case record stopped after recording
            else if(startRecored && (captureSource.State == CaptureState.Stopped))
            {
                

                MessageBox.Show("Please wait while song is beign shared");

                var client = new MegaStarzClient();

                var t = ((App) (App.Current)).starTicket;

                var stream = FilesManager.GetFileStream("MegaStarz\\myVideo.mp4");
                
                    client.UploadRecordingAsync(t, 3, stream, (response) =>
                                                                  {
                                                                      stream.Close();
                                                                      stream.Dispose();

                                                                      if (response != null)
                                                                      {
                                                                          Dispatcher.BeginInvoke(() =>
                                                                                                     {
                                                                                                         MessageBox.Show
                                                                                                             ("Uploaded!");
                                                                                                     });
                                                                      }
                                                                      
                                                                  });
                
                
            }
            //case the record didn't started yet
            else
            {
                funcBtn.Style = (Style)Resources["shareButton"];
                captureSource.Stop();
                var animation = (Storyboard)Resources["lyricsAnimation"];
                animation.Stop();
            }
        }