Inheritance: MonoBehaviour
        private void SearchByArtist_Click(object sender, RoutedEventArgs e)
        {
            var artist = ArtistName_UserInput.Text;

            SongManager.GetSongsByArtist(Songs, artist);
            SwitchToContentView(ContentView.Home);
        }
Exemple #2
0
        /// <summary>
        /// Serializes the song inventory.
        /// </summary>
        /// <param name="songs">The songs.</param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage SerializeSongInventory(HybridDictionary songs)
        {
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SongsLibraryMessageComposer"));

            if (songs == null)
            {
                serverMessage.AppendInteger(0);
                return(serverMessage);
            }

            serverMessage.StartArray();
            foreach (UserItem userItem in songs.Values)
            {
                if (userItem == null)
                {
                    serverMessage.Clear();
                    continue;
                }
                serverMessage.AppendInteger(userItem.Id);

                var song = SongManager.GetSong(userItem.SongCode);
                serverMessage.AppendInteger(song == null ? 0 : song.Id);

                serverMessage.SaveArray();
            }

            serverMessage.EndArray();
            return(serverMessage);
        }
Exemple #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseSignalR(routes =>
            {
                routes.MapHub <PilotHub>("/pilotHub");
            });
            app.Use(async(context, next) =>
            {
                IHubContext <PilotHub> hubContext = context.RequestServices
                                                    .GetRequiredService <IHubContext <PilotHub> >();
                SongManager.CreateInstance(Configuration, hubContext);
                await next();
            });
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Exemple #4
0
    //  public AudioSource audioPlayer

    void Start()
    {
        eljugador = GameObject.FindWithTag("Player");
        death.SetActive(false);
        eljugadorScript = eljugador.GetComponent <playerScript>();
        aSongManager    = aLevelManager.GetComponent <SongManager>();
    }
Exemple #5
0
        static void BuildSong(BuildOptions options)
        {
            string currentDir  = Directory.GetCurrentDirectory();
            string packagePath = Path.Combine(currentDir, "package");
            string songPath    = Path.Combine(currentDir, "song.json");

            if (!File.Exists(songPath))
            {
                Console.WriteLine($"Can't find \"song.json\" file in {currentDir}");
                return;
            }

            if (!Directory.Exists(packagePath))
            {
                // Create package directory
                Directory.CreateDirectory(packagePath);
            }

            var env = FEnvironment.New(packagePath, "bfforever", 2517);

            env.SavePendingChanges();


            SongManager man = new SongManager(env);

            man.ImportSong(songPath);

            //FusedSong song = FusedSong.Import(songPath);

            // TODO: Calculate audio file checksums to determine if re-encoding is needed
        }
Exemple #6
0
 private void goBack()
 {
     SongManager.GetAllSongs(Songs);
     ItemTextBlock.Text            = "All Songs";
     FeaturesListView.SelectedItem = null;
     BackButton.Visibility         = Visibility.Collapsed;
 }
Exemple #7
0
        void OnClick(int position)
        {
            if (type == ListType.Favs)
            {
                position--;
            }

            if (type == ListType.Queue)
            {
                if (MusicPlayer.instance != null)
                {
                    MusicPlayer.instance.SwitchQueue(position);
                }
                else
                {
                    Intent intent = new Intent(MainActivity.instance, typeof(MusicPlayer));
                    intent.SetAction("SwitchQueue");
                    intent.PutExtra("queueSlot", position);
                    MainActivity.instance.StartService(intent);
                }
            }
            else if (position == -1)
            {
                SongManager.Shuffle(songs);
            }
            else
            {
                SongManager.Play(songs[position]);
            }
        }
Exemple #8
0
 static Assets()
 {
     Texture2D   = new Texture2DManager();
     SpriteFont  = new SpriteFontManager();
     SoundEffect = new SoundEffectManager();
     Song        = new SongManager();
 }
Exemple #9
0
        /// <summary>
        /// Gets the music data.
        /// </summary>
        internal void GetMusicData()
        {
            int num  = this.Request.GetInteger();
            var list = new List <SongData>();

            {
                for (int i = 0; i < num; i++)
                {
                    SongData song = null;
                    try
                    {
                        song = SongManager.GetSong(this.Request.GetUInteger());
                    }
                    catch (Exception e)
                    {
                        song = null;
                    }

                    if (song != null)
                    {
                        list.Add(song);
                    }
                }
                this.Session.SendMessage(JukeboxComposer.Compose(list));
                list.Clear();
            }
        }
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
            player          = new MediaPlayer();
            songs           = new ObservableCollection <Song>();
            playlistManager = new PlaylistManager();
            playlists       = new ObservableCollection <Playlist>(playlistManager.Playlists.Values);
            SongManager.GetAllSongs(songs);
            menuItems = new List <MenuItem>();

            //Load Pane
            menuItems.Add(new MenuItem
            {
                IconFile = "Assets/Icons/adele.png",
                Category = SongCategory.Adele
            });
            menuItems.Add(new MenuItem
            {
                IconFile = "Assets/Icons/Justin.png",
                Category = SongCategory.Justin
            });
            menuItems.Add(new MenuItem
            {
                IconFile = "Assets/Icons/sia.png",
                Category = SongCategory.Sia
            });
            menuItems.Add(new MenuItem
            {
                IconFile = "Assets/Icons/taylor.png",
                Category = SongCategory.Taylor
            });
        }
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     SongManager.GetAllSongs(songs);
     CategoryTextBlock.Text         = "All Songs";
     MenuItemsListView.SelectedItem = null;
     BackButton.Visibility          = Visibility.Collapsed;
 }
        private void MenuItemsListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var menuItem = (MenuItem)e.ClickedItem;

            CategoryTextBlock.Text = menuItem.Category.ToString();
            SongManager.GetSongsByCategory(songs, menuItem.Category);
        }
    protected void BindSong()
    {
        DataTable dt = SongManager.selectAll();

        ListView1.DataSource = dt;
        ListView1.DataBind();
    }
        private void SearchByTitle_Click(object sender, RoutedEventArgs e)
        {
            var title = Title_UserInput.Text;

            SongManager.GetSongsByTitle(Songs, title);
            SwitchToContentView(ContentView.Home);
        }
Exemple #15
0
        private void ParseText(string songText)
        {
            songText = songText.Replace("\r", "\n");
            songText = Regex.Replace(songText, "/{2}(.)*(\\n)+", "");
            songText = songText.Replace("\n", "");

            string[] rules = songText.Split(';');

            foreach (string rule in rules)
            {
                if (rule.IndexOf('#') < 0)
                {
                    continue;
                }
                var    startpoint = rule.IndexOf("#");
                string field      = rule.Substring(startpoint, rule.IndexOf(":") - startpoint).ToUpper();
                string value      = rule.Substring(rule.IndexOf(":") + 1);

                switch (field.ToUpper())
                {
                case "#TITLE":
                    _newSong.Title = value;
                    Log.AddMessage("Attempting to split title: " + value, LogLevel.DEBUG);
                    SongManager.SplitTitle(_newSong);
                    break;

                case "#ARTIST":
                    _newSong.Artist = value;
                    break;

                case "#GAP":
                    _newSong.Offset = Convert.ToDouble(value, CultureInfo.InvariantCulture.NumberFormat) / 1000.0;
                    break;

                case "#BPM":
                    _newSong.StartBPM = Convert.ToDouble(value, CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "#CHANGEBPM":
                    ParseBPMs(value);
                    break;

                case "#FILE":
                    _newSong.AudioFile = value;
                    break;

                case "#SINGLE":
                    AddNotes(value);
                    break;

                case "#FREEZE":
                    ParseStops(value);
                    break;

                case "#BACKGROUND":
                    _newSong.BackgroundFile = value;
                    break;
                }
            }
        }
Exemple #16
0
 void Start()
 {
     sheet = GameObject.Find("Sheet").GetComponent <Sheet>();
     SetQueue();
     songManager = GameObject.Find("SongSelect").GetComponent <SongManager>();
     score       = GameObject.Find("Score").GetComponent <Score>();
 }
Exemple #17
0
 private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     SongManager.GetSongBySearch(Songs, sender.Text);
     ItemTextBlock.Text        = sender.Text;
     SongGridView.SelectedItem = null;
     BackButton.Visibility     = Visibility.Visible;
 }
Exemple #18
0
        static void Main(string[] args)
        {
            if (args == null || args.Length < 2)
            {
                return;
            }

            // Loads texture
            //XPR2 xp = XPR2.FromFile(args[0]);
            //return;

            // Loads song resources
            SongManager sm = new SongManager(args[0]);

            // Loads single rif file
            RiffFile rif = sm.LoadRiffFile(args[1]);

            if (args.Length < 3)
            {
                return;
            }

            // Exports strings to file
            StringKey.ExportToFile(args[2]);
        }
Exemple #19
0
        public MainPage()
        {
            this.InitializeComponent();
            Songs   = new ObservableCollection <Song>();
            Artists = new ObservableCollection <Artist>();
            Albums  = new ObservableCollection <Album>();
            SongManager.GetAllSongs(Songs);
            SongManager.GetAllArtist(Artists); //Artists
            SongManager.GetAllAlbums(Albums);  //Albums

            Features = new List <Feature>();
            Features.Add(new Feature {
                IconFile = "Assets/Icons/Albums.png", Item = FeatureItems.Albums
            });
            Features.Add(new Feature {
                IconFile = "Assets/Icons/Artists.png", Item = FeatureItems.Artists
            });
            Features.Add(new Feature {
                IconFile = "Assets/Icons/Playlist.png", Item = FeatureItems.Playlist
            });

            BackButton.Visibility       = Visibility.Collapsed;
            PlayListGridView.Visibility = Visibility.Collapsed;
            ArtistsGridView.Visibility  = Visibility.Collapsed;
            AlbumsGridView.Visibility   = Visibility.Collapsed;

            MusicFolderPath = "";
        }
    //public void search()
    //{
    //    string keys = txtSearch.Text.Trim();
    //    DataTable dt = SongManager.SelectKeys(keys);
    //    if (dt != null && dt.Rows.Count != 0)
    //    {
    //        DataList1.DataSource = dt;
    //        DataList1.DataBind();
    //    }
    //    else
    //    {
    //        ClientScript.RegisterStartupScript(this.GetType(), "false", "<script>alert('没有找着相关内容!')</script>");
    //    }
    //}

    protected void btnSearch_Click(object sender, ImageClickEventArgs e)
    {
        DataTable dtSearch = SongManager.selectSongName(txtSearch.Text.Trim());

        DataList1.DataSource = dtSearch;
        DataList1.DataBind();
    }
Exemple #21
0
 private SongManager()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemple #22
0
        public override void advance()
        {
            SongManager cutsceneManager = Object.FindObjectOfType <SongManager>();

            cutsceneManager.bandName = band;
            cutsceneManager.songName = sceneID;
        }
Exemple #23
0
 public SongController(SongResources proporties)
 {
     songPlayer = new SongView(proporties);
     Results    = new GameResult();
     CurretSong = FileManager.LoadSong("AFI.xml");
     SetGameTimer(59700);
 }
        public override int Delete(Category category)
        {
            SongManager    noteManager    = new SongManager();
            LikedManager   likedManager   = new LikedManager();
            CommentManager commentManager = new CommentManager();

            // Kategori ile ilişkili notların silinmesi gerekiyor.
            foreach (Song note in category.Songs.ToList())
            {
                // Song ile ilişikili like'ların silinmesi.
                foreach (Liked like in note.Likes.ToList())
                {
                    likedManager.Delete(like);
                }

                // Song ile ilişkili comment'lerin silinmesi
                foreach (Comment comment in note.Comments.ToList())
                {
                    commentManager.Delete(comment);
                }

                noteManager.Delete(note);
            }

            return(base.Delete(category));
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int           num     = Event.PopWiredInt32();
            ServerMessage Message = new ServerMessage(300u);

            Message.AppendInt32(num);
            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    int num2 = Event.PopWiredInt32();
                    if (num2 > 0)
                    {
                        /*Soundtrack @class = HabboIM.GetGame().GetItemManager().method_4(num2);
                         * Message.AppendInt32(@class.Id);
                         * Message.AppendStringWithBreak(@class.Name);
                         * Message.AppendStringWithBreak(@class.Track);
                         * Message.AppendInt32(@class.Length);
                         * Message.AppendStringWithBreak(@class.Author);*/

                        Message.AppendInt32(SongManager.GetSong(num2).Id);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Name);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Track);
                        Message.AppendInt32(SongManager.GetSong(num2).Length);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Author);
                    }
                }
            }
            Session.SendMessage(Message);
        }
Exemple #26
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.CompleteRecycler, container, false);

            view.FindViewById(Resource.Id.loading).Visibility = ViewStates.Visible;
            EmptyView = view.FindViewById <TextView>(Resource.Id.empty);
            ListView  = view.FindViewById <RecyclerView>(Resource.Id.recycler);
            ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context));
            ListView.SetItemAnimator(new DefaultItemAnimator());
            adapter = new BrowseAdapter((song, position) =>
            {
                song = LocalManager.CompleteItem(song);
                SongManager.Play(song);
            }, (song, position) =>
            {
                MainActivity.instance.More(song);
            }, (position) =>
            {
                LocalManager.ShuffleAll();
            });
            ListView.SetAdapter(adapter);

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            PopulateList();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            return(view);
        }
Exemple #27
0
        public void getAllTest()
        {
            SongManager manager = new SongManager();
            List <Song> songs   = manager.getAll();

            Assert.AreEqual(3, songs.Count);
        }
Exemple #28
0
 public MainPage()
 {
     this.InitializeComponent();
     songs          = new ObservableCollection <Song>();
     MyImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/ImageFile/" + "MusicIcon.png", UriKind.RelativeOrAbsolute));
     SongManager.GetAllSongs(songs);
 }
Exemple #29
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            List <UserItem> list = new List <UserItem>();

            foreach (UserItem current in Session.GetHabbo().GetInventoryComponent().Items)
            {
                if (current != null && !(current.GetBaseItem().Name != "song_disk") && !Session.GetHabbo().GetInventoryComponent().list_1.Contains(current.uint_0))
                {
                    list.Add(current);
                }
            }


            ServerMessage Message = new ServerMessage(Outgoing.Inventory); // Updated

            Message.AppendInt32(list.Count);
            foreach (UserItem current2 in list) //MUN OMA
            {
                int int_ = 0;
                if (current2.string_0.Length > 0)
                {
                    int_ = int.Parse(current2.string_0);
                }
                SongData SongData = SongManager.GetSong(int_);
                if (SongData == null)
                {
                    return;
                }
                Message.AppendUInt(current2.uint_0);
                Message.AppendInt32(SongData.Id);
            }
            Session.SendMessage(Message);
        }
Exemple #30
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int num = Event.PopWiredInt32();

            ServerMessage Message = new ServerMessage(Outgoing.SongInfo); // Updated

            Message.AppendInt32(num);
            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    int num2 = Event.PopWiredInt32();


                    if (num2 > 0)
                    {
                        Message.AppendInt32(SongManager.GetSong(num2).Id);
                        Message.AppendString(SongManager.GetSong(num2).Name);
                        Message.AppendString(SongManager.GetSong(num2).Track);
                        Message.AppendInt32(SongManager.GetSong(num2).Length);
                        Message.AppendString(SongManager.GetSong(num2).Author);
                    }
                    else
                    {
                        // Ei lähetetä osittaista pakettia!!
                        return;
                    }
                }
            }

            Session.SendMessage(Message);
        }