protected virtual void getItemsUp()
        {
            for (int i = itemNumber - 1; i >= 0; i--)
            {
                int m, n;

                m = x - 5;
                n = y + verticalFactor * i;

                string temp = "";

                if (i == 0 && index < itemNumber)
                {
                    temp = "(Select All)";
                }
                else
                {
                    temp = MediaLibraryFunctions.getItemName(State, songs, (index) - (itemNumber - i));
                }


                options[i]           = new OptionType(temp, Font, Color, new Vector2(x, n), State, m, n - 5);
                options[i].Selected += AddSong;
            }
        }
        protected virtual void getItemsDown()
        {
            for (int i = 0; i < itemNumber; i++)
            {
                int m, n;

                m = x - 5;
                n = y + verticalFactor * i;

                string temp;

                if (i + index == 0)
                {
                    temp = "(Select All)";
                }
                else
                {
                    try
                    {
                        temp = MediaLibraryFunctions.getItemName(State, songs, (i - 1) + index);
                    }
                    catch
                    {
                        options[i] = null;
                        continue;
                    }
                }

                options[i]           = new OptionType(temp, Font, Color, new Vector2(x, n), State, m, n - 5);
                options[i].Selected += AddSong;
            }
        }
        protected void setSubMenu()
        {
            subMenu.setSongs(MediaLibraryFunctions.getSongs(State, mediaLibrary, index), Title,
                             MediaLibraryFunctions.getItemName(State, mediaLibrary, index));

            activeSubMenu = true;
        }
        protected virtual void getItemsUp()
        {
            for (int i = 0; i < itemNumber; i++)
            {
                int m, n;

                m = x - 5;
                n = y + verticalFactor * (itemNumber - 1 - i);

                string temp = MediaLibraryFunctions.getItemName(State, mediaLibrary, index - i);

                options[itemNumber - 1 - i]           = new OptionType(temp, Font, Color, new Vector2(x, n), State, m, n - 5);
                options[itemNumber - 1 - i].Selected += ActivateSubMenu;
            }
        }
        public void SelectMusic(object sender, EventArgs e)
        {
            MediaLibrarySubMenuType menu = sender as MediaLibrarySubMenuType;

            if (menu != null)
            {
                if (menu.CurrentSong == 0)
                {
                    MediaLibraryFunctions.addCollection(playList, menu.songs);
                }
                else
                {
                    MediaLibraryFunctions.addSong(playList, menu.songs[menu.CurrentSong - 1]);
                }
            }
            else
            {
                MediaLibraryMenuType songMenu = sender as MediaLibraryMenuType;

                MediaLibraryFunctions.addToPlaylist(songMenu, playList);
            }
        }
        public void RemoveMusic(object sender, EventArgs e)
        {
            MediaLibraryPlaylistMenu menu = sender as MediaLibraryPlaylistMenu;

            MediaLibraryFunctions.removeFromPlaylist(menu, playList);
        }
        public override void movement(InputHandlerComponent input)
        {
            if (!activeSubMenu)
            {
                if (input.getButton(ButtonType.down, false) && (Position != options.Count) && (Counter > 10) &&
                    MediaLibraryFunctions.canMoveDown(State, mediaLibrary, index))
                {
                    options[Position].Highlight = false;

                    if (Position == itemNumber - 1)
                    {
                        index++;
                        getItemsDown();
                        Position = 0;
                    }
                    else
                    {
                        if (options[Position + 1] != null)
                        {
                            index++;
                            Position++;
                        }
                        else
                        {
                            return;
                        }
                    }

                    options[Position].Highlight = true;
                    Counter = 0;
                    return;
                }
                else if (input.getButton(ButtonType.up, false) && (index != 0) && (Counter > 10))
                {
                    options[Position].Highlight = false;

                    if (Position == 0)
                    {
                        if (index != 0)
                        {
                            index--;
                            getItemsUp();
                            Position = itemNumber - 1;
                        }
                    }
                    else
                    {
                        if (options[Position - 1] != null)
                        {
                            index--;
                            Position--;
                        }
                        else
                        {
                            return;
                        }
                    }

                    options[Position].Highlight = true;
                    Counter = 0;
                    return;
                }
            }
            else
            {
                subMenu.movement(input);
            }
        }