예제 #1
0
        public void SendSongList(List <IPreviewBeatmapLevel> levels)
        {
            if (client != null && client.Connected)
            {
                var subpacketList = new List <PreviewBeatmapLevel>();
                subpacketList.AddRange(
                    levels.Select(x =>
                {
                    var level     = new PreviewBeatmapLevel();
                    level.LevelId = x.levelID;
                    level.Name    = x.songName;
                    return(level);
                })
                    );

                var songList = new SongList();
                songList.Levels = subpacketList.ToArray();

                client.Send(new Packet(songList).ToBytes());
            }
            else
            {
                Logger.Debug("Skipped sending songs because there is no server connected");
            }
        }
예제 #2
0
        private static unsafe int GetSpecialModeBySceneDetour(BasicBGMPlayer *player, byte specialModeType)
        {
            // Let the game do what it needs to do
            if (player->bgmScene != PlayingScene ||
                player->bgmId != PlayingSongId ||
                specialModeType == 0)
            {
                return(GetSpecialModeForSceneHook.Original(player, specialModeType));
            }

            if (!SongList.TryGetSong((int)player->bgmId, out var song))
            {
                return(GetSpecialModeForSceneHook.Original(player, specialModeType));
            }

            // Default to scene 10 behavior, but if the mode is mount mode, use the mount scene
            uint newScene = 10;

            if (song.SpecialMode == 2)
            {
                newScene = 6;
            }

            // Trick the game into giving us the result we want for the scene our song should actually be playing on
            var tempScene = player->bgmScene;

            player->bgmScene = newScene;
            var result = GetSpecialModeForSceneHook.Original(player, specialModeType);

            player->bgmScene = tempScene;
            return(result);
        }
        private void btnAddSong_Click(object sender, EventArgs e)
        {
            string     name       = isTextValid(tbName.Text);
            string     artist     = isTextValid(tbArtist.Text);
            string     tuning     = (string)cbTuning.SelectedValue;
            Difficulty difficulty = (Difficulty)Enum.Parse(typeof(Difficulty), cbDifficulty.Text);

            switch (addOrEdit)
            {
            case AddOrEdit.Add:
            {
                SongList.AddNewSong(name, artist, tuning, difficulty);
                break;
            }

            case AddOrEdit.Edit:
            {
                songToEdit.Name       = name;
                songToEdit.Artist     = artist;
                songToEdit.Difficulty = difficulty;
                songToEdit.Tuning     = tuning;
                break;
            }
            }
            mainUIForm.UpdateUIDisplay();
            this.Close();
        }
예제 #4
0
 private void Init()
 {
     background = CreateChild <Background>("background", 0);
     {
         background.Anchor  = AnchorType.Fill;
         background.RawSize = Vector2.zero;
     }
     songList = CreateChild <SongList>("song-list", 1);
     {
         songList.Anchor = AnchorType.Fill;
         songList.Offset = new Offset(0f, 120f, 0f, 72f);
     }
     songMenu = CreateChild <SongMenu>("song-menu", 2);
     {
         songMenu.Anchor = AnchorType.BottomStretch;
         songMenu.Pivot  = PivotType.Bottom;
         songMenu.SetOffsetHorizontal(0f);
         songMenu.Y      = 0f;
         songMenu.Height = 72f;
     }
     searchMenu = CreateChild <SearchMenu>("search-menu", 3);
     {
         searchMenu.Anchor = AnchorType.TopStretch;
         searchMenu.Pivot  = PivotType.Top;
         searchMenu.SetOffsetHorizontal(0f);
         searchMenu.Y      = -MenuBarHeight;
         searchMenu.Height = 56;
     }
 }
예제 #5
0
    public static void CreateSongs()
    {
        string classDefinition = string.Empty;

        classDefinition += "public class Songs\n";

        classDefinition += "{\n";

        classDefinition += "\tpublic enum SongName\n";
        classDefinition += "\t{\n";

        SongList songList = SongList.LoadSongsList(InputConfigPath);

        foreach (string songName in songList.Songs)
        {
            byte[] sceneAsByteArray  = System.Text.Encoding.UTF8.GetBytes(songName.ToCharArray());
            byte   songEnumByteValue = 0;
            foreach (byte b in sceneAsByteArray)
            {
                songEnumByteValue += b;
            }
            classDefinition += string.Format("\t\t{0} = {1},\n", songName, songEnumByteValue);
        }

        classDefinition += "\t}\n";
        classDefinition += "}\n";

        File.WriteAllText(OutputPath, classDefinition);
    }
예제 #6
0
        /// <summary>
        /// Saves a list of Songs to a user's profile
        /// </summary>
        /// <returns>Profilepage of current user</returns>
        public ActionResult Save()
        {
            int songsUploadedSucessfully = 0;

            //Request.Files is the list of files uploaded by the form
            for (int i = 0; i < Request.Files.Count; i++)
            {
                var file = Request.Files[i];
                string fileName = System.IO.Path.GetFileName(file.FileName);
                string fileExtension = System.IO.Path.GetExtension(file.FileName);
                bool isValidFormat = fileExtension == ".mp3" || fileExtension == ".m4a" ? true : false;
                if (isValidFormat)
                {
                    SongList model = new SongList(1, 100);
                    model.Add(User.Identity.Name, fileName, file);
                    ++songsUploadedSucessfully;
                }
            }
            if (songsUploadedSucessfully > 0)
            {
                if (songsUploadedSucessfully == 1)
                {
                    TempData["message"] = "You have successfully added " + songsUploadedSucessfully + " song to your profile!";
                }
                else
                {
                    TempData["message"] = "You have successfully added " + songsUploadedSucessfully + " songs to your profile!";
                }
            }
            else
            {
                TempData["error"] = "Whoops! Something went wrong. Please try uploading your music again.";
            }
            return RedirectToAction("Profile", "Account", new { username = User.Identity.Name });
        }
예제 #7
0
        private void ConnectToServer()
        {
            try
            {
                client = new Network.Client(10155);
                client.PacketRecieved     += Client_PacketRecieved;
                client.ServerDisconnected += Client_ServerDisconnected;
                client.Start();

                //Send the server the master list if we can
                if (Plugin.masterLevelList != null)
                {
                    var subpacketList = new List <PreviewBeatmapLevel>();
                    subpacketList.AddRange(
                        Plugin.masterLevelList.Select(x => {
                        var level     = new PreviewBeatmapLevel();
                        level.Name    = x.songName;
                        level.LevelId = x.levelID;
                        return(level);
                    })
                        );

                    var songList = new SongList();
                    songList.Levels = subpacketList.ToArray();

                    client.Send(new Packet(songList).ToBytes());
                }
            }
            catch (Exception e)
            {
                Logger.Debug(e.ToString());
            }
        }
예제 #8
0
        private SongList CreateSongList(IRepositoryContext <SongList> ctx, SongListForEditContract contract, UploadedFileContract uploadedFile)
        {
            var user    = GetLoggedUser(ctx);
            var newList = new SongList(contract.Name, user);

            newList.Description = contract.Description;

            if (EntryPermissionManager.CanManageFeaturedLists(permissionContext))
            {
                newList.FeaturedCategory = contract.FeaturedCategory;
            }

            ctx.Save(newList);

            var songDiff = newList.SyncSongs(contract.SongLinks, c => ctx.OfType <Song>().Load(c.Song.Id));

            ctx.OfType <SongInList>().Sync(songDiff);

            SetThumb(newList, uploadedFile);

            ctx.Update(newList);

            ctx.AuditLogger.AuditLog(string.Format("created song list {0}", entryLinkFactory.CreateEntryLink(newList)), user);
            Archive(ctx, newList, new SongListDiff(), EntryEditEvent.Created);

            return(newList);
        }
예제 #9
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Artist,Comments,Rating")] SongList songList)
        {
            if (id != songList.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(songList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SongListExists(songList.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(songList));
        }
        public static void Update(string oldSinger, string newSinger, string newSong, string songLength, int rating, string songText)
        {
            using (var context = new MusColectionContext())
            {
                SongList songList = context.SongLists.FirstOrDefault(treck => treck.Singer == oldSinger);
                if (songList != null)
                {
                    songList.Singer = newSinger;
                    songList.Song   = newSong;
                    context.Entry(songList).State = EntityState.Modified;
                    context.SaveChanges();
                }

                SongDescription songDescription = context.SongDescriptions.FirstOrDefault(description => description.SongList.Singer == oldSinger);
                if (songDescription != null)
                {
                    songDescription.SongLehgth = songLength;
                    songDescription.Rating     = rating;
                    songDescription.SongText   = songText;
                    context.SaveChanges();
                }
                Console.Clear();
                ShowCollection();
            }
        }
예제 #11
0
        public int CreateSongListFromWVR(string url, bool parseAll)
        {
            PermissionContext.VerifyPermission(PermissionToken.EditProfile);

            var parsed = new NNDWVRParser().GetSongs(url, parseAll);

            return(HandleTransaction(session => {
                var user = GetLoggedUser(session);
                var list = new SongList("Weekly Vocaloid ranking #" + parsed.WVRId, user)
                {
                    Description = parsed.Name,
                    FeaturedCategory = SongListFeaturedCategory.VocaloidRanking
                };
                session.Save(list);

                foreach (var entry in parsed.Songs)
                {
                    var song = session.Query <PVForSong>()
                               .Where(p => p.Service == PVService.NicoNicoDouga && p.PVId == entry.NicoId)
                               .First().Song;

                    session.Save(list.AddSong(song));
                }

                AuditLog(string.Format("created {0}", EntryLinkFactory.CreateEntryLink(list)), session, user);
                return list.Id;
            }));
        }
예제 #12
0
        public void When_PlayModeSet_MovePreviousFollowingSongsContainsCorrectSongs()
        {
            // Arrange
            int goBack   = 5;
            var songList = new SongList
            {
                PlayMode = _noShuffleLoopPlaylist,
                Playlist = _bigPlaylist
            };

            for (int i = 0; i < _nbSongs; i++) // play some songs
            {
                songList.MoveNext();
            }
            for (int i = 0; i < goBack; i++) // go back 5 songs
            {
                songList.MovePrevious();
            }

            // Act
            songList.PlayMode = _noShuffleNoLoop;
            var songs = songList.GetFollowingSongs(_queueSize);

            // Assert
            for (int i = _nbSongs - goBack; i < _nbSongs; i++)
            {
                Assert.AreEqual($"{_songPrefixBig}{i}", songs[i - (_nbSongs - goBack)].Title);
            }
        }
예제 #13
0
        public void When_MovePrevious_SongListHasPreviousSongs_ReturnsCorrectSongs()
        {
            // Arrange
            var songList = new SongList
            {
                PlayMode = _noShuffleNoLoop,
                Playlist = _bigPlaylist
            };

            for (int i = 0; i < _nbSongs; i++)
            {
                songList.MoveNext();
            }

            // Act
            var previousSongs = new List <SongDto>();

            for (int i = 0; i < _nbSongs; i++)
            {
                var song = songList.MovePrevious().CurrentSong;
                previousSongs.Add(song);
            }

            // Assert
            for (int i = 0; i < _nbSongs; i++)
            {
                Assert.AreEqual($"{_songPrefixBig}{_nbSongs - 1 - i}", previousSongs[i].Title);
            }
        }
예제 #14
0
        private void Button_AddSong_Click(object sender, EventArgs e)
        {
            var songs  = new Songs();
            var dialog = new OpenFileDialog();

            dialog.Title  = Properties.SystemMessage.OpenSongs;
            dialog.Filter = string.Format("{0}, {1}|*{2};*{3}", Properties.Common.TJAExtensionDescription, Properties.Common.ExtensionDescription, Properties.Common.TJAExtensionName, Properties.Common.ExtensionName);
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var extension = Path.GetExtension(dialog.FileName);
                if (extension == Properties.Common.ExtensionName)
                {
                    songs = FromProjectFile(dialog.FileName);
                }
                else
                {
                    songs = FromTJAFile(dialog.FileName);
                }
                if (songs != null)
                {
                    songs.FilePath = dialog.FileName;
                    SongList.Add(songs);
                }
                else
                {
                    var taskDialog = Dialog.ItsNotTJAFile(Path.GetFileName(dialog.FileName));
                    taskDialog.OwnerWindowHandle = Handle;
                    taskDialog.Show();
                    taskDialog.Dispose();
                }
            }
            dialog.Dispose();

            SetCoursesFromList();
        }
예제 #15
0
        public string MusicUpLoad()
        {
            try
            {
                HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"]; //获取传统context
                HttpRequestBase request = context.Request;                                       //定义传统request对象
                                                                                                 //string resultUrl = Upload(request.Files[0], "Music");
                SongList s = new SongList()
                {
                    WYID   = "",
                    S_Name = request.Form["sname"].ToString(),
                    S_Type = 1,
                    //先上传文件 在添加到歌手表
                    S_Url   = uri + Upload(request.Files[0], "Music"),
                    S_Cover = uri + Upload(request.Files[1], "MusicCover"),

                    //添加到数据库  这里直接接收返回的歌手id
                    S_Singer       = SongListService.AddSinger(UserInfoService.SelUserInfoByID(int.Parse(request.Form["uid"].ToString()))),
                    S_PlayCount    = 0,
                    S_CollectCount = 0,
                    S_UpTime       = DateTime.Now,
                    S_Lyric        = "",
                    S_Album        = 0
                };
                if (SongListService.AddSongList(s))
                {
                    return("添加成功");
                }
                return("添加失败");
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
예제 #16
0
        public void TestMethod_SongList()
        {
            var songList = new SongList();

            songList = new SongList(new System.Collections.Generic.List <Song>());
            Assert.AreEqual(songList.Songs.Count, new System.Collections.Generic.List <Song>().Count);
        }
예제 #17
0
        public void UpdateSelectedSongTitle()
        {
            SongList.SelectedIndexChanged -= SongList_SelectedIndexChanged;
            SongList.BeginUpdate();

            List <int>       selected = SongList.SelectedIndices.Cast <int>().ToList();
            List <SongEntry> songs    = SelectedSongs.ToList();

            if (selected.Count != songs.Count)
            {
                return;
            }

            SongList.ClearSelected();

            for (int i = 0; i < songs.Count; ++i)
            {
                SongList.Items[selected[i]] = songs[i];
            }
            foreach (int i in selected)
            {
                SongList.SetSelected(i, true);
            }

            SongList.EndUpdate();
            SongList.SelectedIndexChanged += SongList_SelectedIndexChanged;
        }
        public static void Add()
        {
            using (var context = new MusColectionContext())
            {
                SongList        songList        = new SongList();
                SongDescription songDescription = new SongDescription();

                Console.Write("Ввдите исполнителя песни: ");
                songList.Singer = Console.ReadLine();
                Console.Write("Введите композицию: ");
                songList.Song = Console.ReadLine();
                Console.WriteLine("Описание");
                Console.Write("\tдлительность трека: ");
                songDescription.SongLehgth = Console.ReadLine();
                Console.Write("\tвведите рейтинг трека: ");
                int rating = 0;
                int.TryParse(Console.ReadLine(), out rating);
                if (rating == 0)
                {
                    Console.WriteLine("Вы не отметили рейтинг песни?");
                }
                Console.WriteLine("Слова песни по умолчанию. Cлова наиболее любимых треков можно будет занести позже");
                songDescription.SongText = "";

                context.SongLists.Add(songList);


                context.SongDescriptions.Add(songDescription);
                context.SaveChanges();
            }
        }
예제 #19
0
        protected void AddEntryEditedEntry(IDatabaseContext <ActivityEntry> ctx, SongList entry, EntryEditEvent editEvent, ArchivedSongListVersion archivedVersion)
        {
            var user          = ctx.OfType <User>().GetLoggedUser(PermissionContext);
            var activityEntry = new SongListActivityEntry(entry, editEvent, user, archivedVersion);

            AddActivityfeedEntry(ctx, activityEntry);
        }
예제 #20
0
        public void Archive(IRepositoryContext <SongList> ctx, SongList songList, SongListDiff diff, EntryEditEvent reason)
        {
            var agentLoginData = ctx.CreateAgentLoginData(PermissionContext);
            var archived       = songList.CreateArchivedVersion(diff, agentLoginData, reason);

            ctx.OfType <ArchivedSongListVersion>().Save(archived);
        }
예제 #21
0
    public LinkedSongList()
    {
        SongList defaultSongList = new SongList(); //默认播放列表

        lastPlaySongList = defaultSongList;
        linkedlist.AddFirst(defaultSongList);
    }
        public SongListForApiContract(SongList list, ContentLanguagePreference languagePreference, IUserIconFactory userIconFactory, IAggregatedEntryImageUrlFactory imagePersister,
                                      SongListOptionalFields fields) : base(list)
        {
            ParamIs.NotNull(() => list);

            Author    = new UserForApiContract(list.Author, userIconFactory, UserOptionalFields.None);
            Deleted   = list.Deleted;
            EventDate = list.EventDate;
            Status    = list.Status;

            if (fields.HasFlag(SongListOptionalFields.Description))
            {
                Description = list.Description;
            }

            if (fields.HasFlag(SongListOptionalFields.Events))
            {
                Events = list.Events.Select(e => new ReleaseEventForApiContract(e, languagePreference, ReleaseEventOptionalFields.Venue, imagePersister)).OrderBy(e => e.Date).ThenBy(e => e.Name).ToArray();
            }

            if (fields.HasFlag(SongListOptionalFields.MainPicture))
            {
                MainPicture = list.Thumb != null ? new EntryThumbForApiContract(list.Thumb, imagePersister) : null;
            }

            if (fields.HasFlag(SongListOptionalFields.Tags))
            {
                Tags = list.Tags.ActiveUsages.Select(u => new TagUsageForApiContract(u, languagePreference)).OrderByDescending(u => u.Count).ToArray();
            }
        }
예제 #23
0
 public void UpdateSongList(SongList songList)
 {
     using (var db = DbContext.Instance.GetDbConnection())
     {
         db.Update(songList);
     }
 }
예제 #24
0
 private void ApplyMusicsToDataGrid()
 {
     if (SongList != null && SongList.Count > 0)
     {
         string keywords = tbPesquisar.Text;
         if (string.IsNullOrEmpty(keywords))
         {
             SongListView = SongList.ToSongList();
         }
         else
         {
             SongListView = SongList.Where(m => string.Format("{0} {1}", m.Song.Name, m.Song.Album).ToUpper().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Any(e => keywords.ToUpper().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Contains(e))).ToSongList();
         }
         if (SongListView.Count > 0)
         {
             ShowResults(SongListView);
         }
         else
         {
             HideResults("Nenhuma música para a pesquisa feita.");
         }
         StateConfiguration.Keywords = keywords;
         StateConfiguration.Save();
     }
     else
     {
         HideResults("Não foram encontradas letras nas configurações atuais.");
     }
 }
        private void Image_ImageOpened(object sender, RoutedEventArgs e)
        {
            TitleGridMargin.X   = Image.ActualWidth + 48;
            Col1.Width          = new GridLength(Image.ActualWidth);
            ToolbarTitle.Margin = new Thickness(Image.ActualWidth * 80 / 200 + 32, 8, 0, 8);

            var scrollviewer         = SongList.GetScrollViewer();
            var _scrollerPropertySet = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(scrollviewer);
            var _compositor          = _scrollerPropertySet.Compositor;
            var moving = 80f;

            // Get references to our property sets for use with ExpressionNodes
            var scrollingProperties = _scrollerPropertySet.GetSpecializedReference <ManipulationPropertySetReferenceNode>();

            var horiMovingAni = EF.Clamp(-scrollingProperties.Translation.Y / moving, 0, 1);

            horiMovingAni = EF.Lerp(0, (float)((80f / ImageGrid.ActualHeight * ImageGrid.ActualWidth) - ImageGrid.ActualWidth), horiMovingAni);

            var scaleAnimation     = EF.Clamp(-scrollingProperties.Translation.Y / moving, 0, 1);
            var textScaleAnimation = EF.Lerp(1, (float)(ToolbarTitle.ActualHeight / TitleText.ActualHeight), scaleAnimation);

            var titleVisual = ElementCompositionPreview.GetElementVisual(Title);

            titleVisual.StopAnimation("offset.X");
            titleVisual.StartAnimation("Offset.X", horiMovingAni);
        }
예제 #26
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            List <SongEntry> selected = (from SongEntry s in SongList.SelectedItems select s).ToList();

            List <string> path  = PathToSelectedGroup();
            TreeNode      group = GroupList.SelectedNode;

            if (group.ForeColor != Color.RoyalBlue)
            {
                group = group.Parent;
            }

            GroupList.BeginUpdate();
            SongList.BeginUpdate();

            foreach (var s in selected)
            {
                Metadata.AddSongToGroup(path, s.UniqueId);
                AddTreeViewSong(group, s);

                SongList.Items.Remove(s);
            }

            GroupList.EndUpdate();
            SongList.EndUpdate();

            MadeChanges = true;
        }
예제 #27
0
 public void DelectSongList(SongList list)
 {
     using (var db = DbContext.Instance.GetDbConnection())
     {
         db.Delete <SongList>(list.Id);
     }
 }
예제 #28
0
 /// <summary>
 /// pobiera index wybranego elementu z listboxa i go usuwa
 /// </summary>
 private void DeleteSongFromList()
 {
     if (SongList.Count > 0 && SelectedIndex >= 0)
     {
         SongList.RemoveAt(SelectedIndex);
     }
 }
 public SongListForEditContract(SongList songList, IUserPermissionContext permissionContext)
     : base(songList, permissionContext)
 {
     SongLinks = songList.SongLinks
                 .OrderBy(s => s.Order)
                 .Select(s => new SongInListEditContract(s, permissionContext.LanguagePreference))
                 .ToArray();
 }
예제 #30
0
        public SongListWithArchivedVersionsContract(SongList songList, IUserPermissionContext permissionContext)
            : base(songList)
        {
            ArchivedVersions = songList.ArchivedVersionsManager.Versions.Select(
                a => new ArchivedSongListVersionContract(a)).ToArray();

            Version = songList.Version;
        }
예제 #31
0
 public SongInList(Song song, SongList list, int order, string notes)
     : this()
 {
     Song = song;
     List = list;
     Order = order;
     Notes = notes;
 }
예제 #32
0
 public SongInList(Song song, SongList list, int order, string notes)
     : this()
 {
     Song  = song;
     List  = list;
     Order = order;
     Notes = notes;
 }
예제 #33
0
        //********************************************
        // Constructors
        //********************************************
        public AudioManager(Main game)
        {
            z_game = game;
            MediaPlayer.IsRepeating = true;
            z_currentSong = SongList.None;

            z_volMusic = 1.0f;
            z_volSoundFX = 1.0f;
            MasterVolume = 1.0f;
            MusicOn = true;
            SoundFXOn = true;
            SoundOn = true;
        }
예제 #34
0
        public bool askserver(Interface theint, string serverip) // return true on succeed, return false on fail.
        {
            Connector con = new Connector();
            if (con.Connect(serverip) == true)
            {
                matches = con.SendFingerprint(fingerprint);

                this.showmatches(theint);

                //UI_SongList uiSongList = new UI_SongList(theint);
                //uiSongList.SL = matches;
                //uiSongList.Show();
                return true;
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("failed to connect");//should be replaced with statusbar.
                //how to change status bar here?
                if (this.matches.Count >0)
                    this.showmatches(theint); //do this in both cases, one button.
                return false;
            }
            
        }
예제 #35
0
 public LinkedSongList()
 {
     SongList defaultSongList = new SongList(); //默认播放列表
     lastPlaySongList = defaultSongList;
     linkedlist.AddFirst(defaultSongList);
 }
예제 #36
0
 /// <summary>
 /// 移动播放列表
 /// </summary>
 /// <param name="previousSonglist">前一个播放列表</param>
 public void Move(SongList previousSonglist, SongList songlist)
 {
     linkedlist.Remove(songlist);
     linkedlist.AddAfter(linkedlist.Find(previousSonglist), songlist);
 }
예제 #37
0
 /// <summary>
 /// 移除播放列表
 /// </summary>
 public void Remove(SongList songlist)
 {
     linkedlist.Remove(songlist);
 }
예제 #38
0
        public static List<songinstance> load()
        {
            string fileName = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
            fileName = Path.GetDirectoryName(fileName);
            fileName = Path.Combine(fileName, SAVEFILE);
            List<songinstance> returnlist = new List<songinstance>();
            try
            {
                TextReader tr = new StreamReader(fileName);
                string line;
                string value;
                while ((line = tr.ReadLine()) != null)
                {

//#if VERBOSE
//                    MessageBox.Show("csv loader: "+ line);
//#endif
                    songinstance si = new songinstance();

                    value = line.Substring(0, line.IndexOf(","));
                    line = line.Substring(line.IndexOf(",") + 1);
                    si.setwaveurl(value);

                    value = line.Substring(0, line.IndexOf(","));
                    line = line.Substring(line.IndexOf(",") + 1);
                    si.setdatetime(value);

                    value = line.Substring(0, line.IndexOf(","));
                    line = line.Substring(line.IndexOf(",") + 1);
                    si.setfingerprint(value); //this will not handle error.

                    SongList sl = new SongList();
                    int cindex;
                    while ((cindex = line.IndexOf(",")) != -1) //-1?
                    {
//#if VERBOSE
//                        MessageBox.Show(line);
//#endif                       
                        
                        Song s = new Song();
                        value = line.Substring(0, line.IndexOf(","));
                        line = line.Substring(line.IndexOf(",")+1);
                        s.artist = value;
                        value = line.Substring(0, line.IndexOf(","));
                        line = line.Substring(line.IndexOf(",") + 1);
                        s.title = value;
                        value = line.Substring(0, line.IndexOf(","));
//#if VERBOSE
//                        MessageBox.Show(line);
//#endif
                        line = line.Substring(line.IndexOf(",") + 1);
                        s.match = Int32.Parse(value);
//#if VERBOSE
//                        MessageBox.Show("csv adding match");
//#endif

                        //sl.Add(s); //add doesnt work.
                        sl.Insert(0, s);
                    } //this will not handle error. and is untested.
                    si.setmatches(sl);
#if VERBOSE
                    MessageBox.Show("csv matches count :"+sl.Count.ToString());
#endif

                    returnlist.Add(si);
                   
                }
#if VERBOSE
                MessageBox.Show("csv loader: list<instance>.lengith " + returnlist.Count.ToString());
#endif
                return returnlist;
            }
            catch (FileNotFoundException) { return returnlist; }//returnlist is empty, that should be fine.
            catch (IOException)
            {
                System.Windows.Forms.MessageBox.Show("IOException, this is odd.");
                return returnlist;
            }
        }
예제 #39
0
 public songinstance()
 {
     matches= new SongList();
 }
예제 #40
0
 public void setmatches(SongList sl) { matches = sl; }
예제 #41
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 161:
                    this.NumberOfItemsCookedRecently = reader.ReadInt();
                    this.CookingXpLastAwardedOn = reader.ReadDateTime();
                    goto case 160;
                case 160:
                    this.lastSecondWind = reader.ReadDateTime();
                    goto case 159;
                case 159:
                    {
                        this.lastCharge = reader.ReadDateTime();
                        this.chargeCooldown = reader.ReadInt();
                        goto case 158;
                    }
                case 158: SmithTesting = reader.ReadBool(); goto case 157;
                case 157: m_ConsecratedItems = reader.ReadInt(); goto case 156;
                case 156: m_CanBeFaithful = reader.ReadBool();goto case 155;
                case 155: m_HCWound = reader.ReadDateTime(); goto case 154;
                case 154: m_Maimings = reader.ReadInt(); goto case 153;

                case 153:
                {
                        m_CustomAvatarID1 = reader.ReadInt();
                        m_CustomAvatarID2 = reader.ReadInt();
                        m_CustomAvatarID3 = reader.ReadInt();
                        m_IsHardcore = reader.ReadBool(); goto case 152;

                }

                case 152: GroupInfo.Deserialize(reader, Group); goto case 151;
                case 151: m_IsApprentice = reader.ReadBool(); goto case 150;
                case 150: m_AvatarID = reader.ReadInt(); goto case 149;
                case 149:
                case 148:
                case 147:
                case 146:
                case 145:
                case 144:
                {
                    Disguise.Deserialize( reader );
                    MyDisguises.Deserialize( reader );
                    goto case 143;
                }
                case 143: m_GemHarvesting = reader.ReadBool(); goto case 142;
                case 142:
                {
                    m_CanBeThief = reader.ReadBool();
                    m_LastCottonFlaxHarvest = reader.ReadDateTime();
                    goto case 141;
                }
                case 141:
                case 140: m_CraftingSpecialization = reader.ReadString(); goto case 139;
                case 139: m_Forging = reader.ReadBool(); goto case 138;
                case 138: m_ImperialGuard = reader.ReadBool(); goto case 137;
                case 137: m_ExtraCPRewards = reader.ReadInt(); goto case 136;
                case 136: m_EmptyBankBoxOn = reader.ReadDateTime(); goto case 135;
                case 135: m_OldMapChar = reader.ReadBool(); goto case 134;
                case 134:
                {
                    int guilds = reader.ReadInt();

                    for( int i = 0; i < guilds; i++ )
                    {
                        CustomGuildInfo guild = new CustomGuildInfo( reader );

                        if( guild != null && guild.GuildStone != null )
                            CustomGuilds.Add( guild.GuildStone, guild );
                    }

                    goto case 133;
                }
                case 133: m_ChosenDeity = (ChosenDeity)reader.ReadInt(); goto case 132;
                case 132: m_WikiConfig = reader.ReadString(); goto case 131;
                case 131:
                case 130:
                case 129:
                {
                    m_ReforgeLocation = reader.ReadPoint3D();
                    m_ReforgeMap = reader.ReadMap();
                    m_Reforging = reader.ReadBool();
                    m_ReforgesLeft = reader.ReadInt();
                    goto case 128;
                }
                case 128:
                case 127:
                {
                    m_Technique = reader.ReadString();
                    m_TechniqueLevel = reader.ReadInt();
                    m_MediumPieces = reader.ReadInt();
                    m_HeavyPieces = reader.ReadInt();
                    goto case 126;
                }
                case 126: m_VampSight = reader.ReadBool(); goto case 125;
                case 125: m_FreeForRP = reader.ReadBool(); goto case 124;
                case 124: m_VampSafety = reader.ReadBool(); goto case 123;
                case 123:
                {
                    m_LastTimeGhouled = reader.ReadDateTime();
                    m_YearOfDeath = reader.ReadInt();
                    m_MonthOfDeath = reader.ReadInt();
                    m_DayOfDeath = reader.ReadInt();
                    m_IsVampire = reader.ReadBool();
                    m_MaxBPs = reader.ReadInt();
                    m_BPs = reader.ReadInt();
                    m_AutoVampHeal = reader.ReadBool();

                    goto case 122;
                }
                case 122:
                case 121: m_LogMsgs = reader.ReadBool(); goto case 120;
                case 120: m_PureDodge = reader.ReadBool(); goto case 119;
                case 119: m_Tents = reader.ReadStrongItemList(); goto case 118;
                case 118: m_CraftContainer = (Container)reader.ReadItem(); goto case 117;
                case 117:
                case 116: m_SpellBook = (CustomSpellBook)reader.ReadItem(); goto case 115;
                case 115:
                case 114:
                {
                    CustomGuildInfo test = null;

                    if( version < 134 )
                        test = new CustomGuildInfo( reader );

                    goto case 113;
                }
                case 113:
                case 112:
                case 111:
                case 110:
                case 109:
                {
                    m_CurrentCommand = (SongList)reader.ReadInt();
                    goto case 108;
                }
                case 108:
                {
                    m_SpeedHack = reader.ReadBool();
                    goto case 107;
                }
                case 107:
                {
                    m_LogoutTime = reader.ReadDateTime();
                    goto case 106;
                }
                case 106:
                {
                    m_FakeAge = reader.ReadString();
                    m_FakeLooks = reader.ReadString();
                    goto case 105;
                }
                case 105:
                {
                    this.NameMod = reader.ReadString();
                    m_AutoPicking = reader.ReadBool();
                    goto case 104;
                }
                case 104: goto case 103;
                case 103:
                {
                    m_SmoothPicking = reader.ReadBool();
                    goto case 102;
                }
                case 102:
                {
                    m_HasStash = reader.ReadBool();
                    goto case 101;
                }
                case 101:
                {
                    m_FakeHair = reader.ReadInt();
                    m_FakeHairHue = reader.ReadInt();
                    m_FakeFacialHair = reader.ReadInt();
                    m_FakeFacialHairHue = reader.ReadInt();
                    m_FakeHue = reader.ReadInt();
                    m_FakeRPTitle = reader.ReadString();
                    m_FakeTitlePrefix = reader.ReadString();
                    goto case 100;
                }
                case 100: goto case 99;
                case 99: goto case 98;
                case 98: goto case 97;
                case 97: goto case 96;
                case 96:
                {
                    m_FixedRun = reader.ReadBool();
                    goto case 95;
                }
                case 95:
                {
                    m_LightPieces = reader.ReadInt();
                    goto case 94;
                }
                case 94:
                {
                    m_ArmourPieces = reader.ReadInt();
                    goto case 93;
                }
                case 93:
                {
                    m_LightPenalty = reader.ReadInt();
                    m_MediumPenalty = reader.ReadInt();
                    m_HeavyPenalty = reader.ReadInt();
                    goto case 92;
                }
                case 92: goto case 91;
                case 91:
                {
                    m_FixedRage = reader.ReadBool();
                    goto case 90;
                }

                case 90: goto case 89;
                case 89: goto case 88;
                case 88: goto case 87;
                case 87: goto case 86;

                case 86:
                {
                    m_FixedReflexes = reader.ReadBool();
                    goto case 85;
                }
                case 85:
                {
                    m_FixedStyles = reader.ReadBool();
                    goto case 84;
                }
                case 84:
                {
                    m_NextMending = reader.ReadDateTime();
                    goto case 83;
                }
                case 83:
                {
                    m_FixedStatPoints = reader.ReadBool();
                    goto case 82;
                }
                case 82:
                {
                    m_XPFromCrafting = reader.ReadBool();
                    m_XPFromKilling = reader.ReadBool();
                    goto case 81;
                }
                case 81:
                {
                    m_HarvestedCrops = reader.ReadInt();
                    m_NextHarvestAllowed = reader.ReadDateTime();
                    goto case 80;
                }
                case 80:
                {
                    m_Spar = reader.ReadBool();
                    goto case 79;
                }
                case 79:
                {
                    m_HideStatus = reader.ReadBool();
                    goto case 78;
                }
                case 78:
                {
                    m_DayOfBirth = reader.ReadString();
                    m_MonthOfBirth = reader.ReadString();
                    m_YearOfBirth = reader.ReadString();
                    goto case 77;
                }
                case 77:
                {
                    m_AlyrianGuard = reader.ReadBool();
                    m_AzhuranGuard = reader.ReadBool();
                    m_KhemetarGuard = reader.ReadBool();
                    m_MhordulGuard = reader.ReadBool();
                    m_TyreanGuard = reader.ReadBool();
                    m_VhalurianGuard = reader.ReadBool();
                    goto case 76;
                }
                case 76:
                {
                    m_HearAll = reader.ReadInt();
                    goto case 75;
                }
                case 75:
                {
                    m_Friendship = new Friendship( reader );
                    goto case 74;
                }
                case 74:
                {
                    m_CPCapOffset = reader.ReadInt();
                    m_CPSpent = reader.ReadInt();
                    goto case 73;
                }
                case 73:
                {
                    m_Description2 = reader.ReadString();
                    m_Description3 = reader.ReadString();
                    goto case 72;
                }
                case 72:
                {
                    m_NextBirthday = reader.ReadDateTime();
                    m_MaxAge = reader.ReadInt();
                    goto case 71;
                }
                case 71:
                {
                    m_Age = reader.ReadInt();
                    goto case 70;
                }
                case 70:
                {
                    m_LoggedOutPets = reader.ReadStrongMobileList();
                    goto case 69;
                }
                case 69:
                {
                    m_RecreateXP = reader.ReadInt();
                    m_RecreateCP = reader.ReadInt();
                    goto case 68;
                }
                case 68:
                {
                    m_LastOffenseToNature = reader.ReadDateTime();
                    goto case 66;
                }

                case 66:
                {
                    Mobile mob = null;

                    if( version < 92 )
                        mob = reader.ReadMobile();

                    goto case 65;
                }

                case 65:
                {
                    m_LastDonationLife = reader.ReadDateTime();
                    goto case 64;
                }

                case 64:
                {
                    m_Lives = reader.ReadInt();
                    goto case 63;
                }

                case 63:
                {
                    m_AllyList = reader.ReadStrongMobileList();
                    goto case 62;
                }

                case 62:
                {
                    m_Height = reader.ReadInt();
                    m_Weight = reader.ReadInt();
                    goto case 61;
                }

                case 61:
                {
                    m_NextAllowance = reader.ReadDateTime();
                    goto case 60;
                }

                case 60:
                {
                    m_Backgrounds = new Backgrounds( reader );
                    goto case 59;
                }

                case 59:
                {
                    m_Description = reader.ReadString();
                    goto case 58;
                }

                case 58:
                {
                    m_Masterwork = new Masterwork( reader );
                    goto case 57;
                }

                case 57:
                {
                    m_RacialResources = new RacialResources( reader );
                    goto case 56;
                }

                case 56:
                {
                    m_KnownLanguages = new KnownLanguages( reader );
                    goto case 55;
                }

                case 55:
                {
                    m_SpokenLanguage = (KnownLanguage)reader.ReadInt();
                    goto case 54;
                }

                case 54:
                {
                    m_RPTitle = reader.ReadString();
                    m_TitlePrefix = reader.ReadString();
                    goto case 53;
                }

                case 53:
                {
                    m_FocusedShot = reader.ReadInt();
                    m_SwiftShot = reader.ReadInt();
                    goto case 52;
                }

                case 52:
                {
                    m_WeaponSpecialization = reader.ReadString();
                    m_SecondSpecialization = reader.ReadString();
                    goto case 51;
                }

                case 51:
                {
                    m_CombatStyles = new CombatStyles( reader );
                    m_SearingBreath = reader.ReadInt();
                    m_SwipingClaws = reader.ReadInt();
                    m_TempestuousSea = reader.ReadInt();
                    m_SilentHowl = reader.ReadInt();
                    m_ThunderingHooves = reader.ReadInt();
                    m_VenomousWay = reader.ReadInt();
                    goto case 50;
                }

                case 50:
                {
                    m_RageHits = reader.ReadInt();
                    m_RageFeatLevel = reader.ReadInt();
                    goto case 49;
                }

                case 49:
                {
                    int test = reader.ReadInt();
                    goto case 48;
                }

                case 48:
                {
                    m_LastChargeStep = reader.ReadDateTime();
                    goto case 47;
                }

                case 47:
                {
                    m_FormerDirection = (Direction)reader.ReadInt();
                    m_ChargeSteps = reader.ReadInt();
                    goto case 46;
                }

                case 46:
                {
                   m_Trample = reader.ReadBool();
                   goto case 45;
                }

                case 45:
                {
                    m_FlurryOfBlows = reader.ReadInt();
                    goto case 44;
                }

                case 44:
                {
                    m_FocusedAttack = reader.ReadInt();
                    m_FightingStance = (FeatList)reader.ReadInt();
                    goto case 43;
                }

                case 43:
                {
                    m_Intimidated = reader.ReadInt();
                    goto case 42;
                }

                case 42:
                {
                    m_HasHuntingHoundBonus = reader.ReadBool();
                    goto case 41;
                }

                case 41:
                {
                    m_HuntingHound = reader.ReadMobile();
                    m_FreeToUse = reader.ReadBool();
                    goto case 40;
                }

                case 40:
                {
                    m_Informants = new Informants( reader );
                    goto case 39;
                }

                case 39:
                {
                    m_EscortPrisoner = reader.ReadMobile();
                    goto case 38;
                }

                case 38:
                {
                    m_CanBeReplaced = reader.ReadBool();
                    goto case 37;
                }

                case 37:
                {
                    m_BackToBack = reader.ReadBool();
                    goto case 36;
                }

                case 36:
                {
                    m_Crippled = reader.ReadBool();
                    goto case 35;
                }

                case 35:
                {
                    m_CleaveAttack = reader.ReadBool();
                    goto case 34;
                }

                case 34: goto case 33;

                case 33:
                {
                    goto case 32;
                }

                case 32:
                {
                    m_SpecialAttack = (FeatList)reader.ReadInt();
                    m_OffensiveFeat = (FeatList)reader.ReadInt();
                    goto case 31;
                }

                case 31:
                {
                    m_Feats = new Feats( reader );
                    goto case 30;
                }

                case 30:
                {
                    m_Subclass = (Subclass)reader.ReadInt();
                    m_Advanced = (Advanced)reader.ReadInt();
                    goto case 29;
                }
                case 29:
                {
                    m_CanBeMage = reader.ReadBool();
                    goto case 28;
                }

                case 28:
                {
                    m_Level = reader.ReadInt();
                    m_XP = reader.ReadInt();
                    m_NextLevel = reader.ReadInt();
                    m_CP = reader.ReadInt();
                    goto case 27;
                }

                case 27:
                {
                    m_StatPoints = reader.ReadInt();
                    m_SkillPoints = reader.ReadInt();
                    m_FeatSlots = reader.ReadInt();
                    goto case 26;
                }
                case 26:
                {
                    m_Class = (Class)reader.ReadInt();
                    m_Nation = (Nation)reader.ReadInt();
                    goto case 25;
                }
                case 25:
                {
                    int recipeCount = reader.ReadInt();

                    if( recipeCount > 0 )
                    {
                        m_AcquiredRecipes = new Dictionary<int, bool>();

                        for( int i = 0; i < recipeCount; i++ )
                        {
                            int r = reader.ReadInt();
                            if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
                                m_AcquiredRecipes.Add( r, true );
                        }
                    }
                    goto case 24;
                }
                case 24:
                {
                    m_LastHonorLoss = reader.ReadDeltaTime();
                    goto case 23;
                }
                case 23:
                {
                    m_ChampionTitles = new ChampionTitleInfo( reader );
                    goto case 22;
                }
                case 22:
                {
                    m_LastValorLoss = reader.ReadDateTime();
                    goto case 21;
                }
                case 21:
                {
                    m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                    m_ToTTotalMonsterFame = reader.ReadInt();
                    goto case 20;
                }
                case 20:
                {
                    m_AllianceMessageHue = reader.ReadEncodedInt();
                    m_GuildMessageHue = reader.ReadEncodedInt();

                    goto case 19;
                }
                case 19:
                {
                    int rank = reader.ReadEncodedInt();
                    int maxRank = Guilds.RankDefinition.Ranks.Length -1;
                    if( rank > maxRank )
                        rank = maxRank;

                    m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                    m_LastOnline = reader.ReadDateTime();
                    goto case 18;
                }
                case 18:
                {
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new List<QuestRestartInfo>();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PayedInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        List<Item> payed = reader.ReadStrongItemList();

                        for ( int i = 0; i < payed.Count; ++i )
                            payed[i].PayedInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();

                        // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                        Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadStrongMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadStrongMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();

                    if (version < 147) m_Crimes = reader.ReadInt();
                    //CrimesList
                    if (version < 148)
                    {
                        m_CrimesList = new Dictionary<Mobiles.Nation, int>();
                        m_CrimesList.Add(Nation.Alyrian, 0);
                        m_CrimesList.Add(Nation.Azhuran, 0);
                        m_CrimesList.Add(Nation.Khemetar, 0);
                        m_CrimesList.Add(Nation.Mhordul, 0);
                        m_CrimesList.Add(Nation.Tyrean, 0);
                        m_CrimesList.Add(Nation.Vhalurian, 0);
                        m_CrimesList.Add(Nation.Imperial, 0);
                        m_CrimesList.Add(Nation.Sovereign, 0);
                        m_CrimesList.Add(Nation.Society, 0);

                        int count = reader.ReadInt();
                        for (int i = 0; i < count; i++)
                        {
                            Nation n = (Nation)reader.ReadInt();
                            int c = reader.ReadInt();
                            //m_CrimesList.Add(n, c);
                        }
                    }
                    else
                    {
                        m_CrimesList = new Dictionary<Mobiles.Nation, int>();
                        int count = reader.ReadInt();
                        for (int i = 0; i < count; i++)
                        {
                            Nation n = (Nation)reader.ReadInt();
                            int c = reader.ReadInt();
                            m_CrimesList.Add(n, c);
                        }
                    }

                    m_NextCriminalAct = reader.ReadDateTime();
                    m_CriminalActivity = reader.ReadBool();
                    m_Disguised = reader.ReadBool();
                    m_LastDisguiseTime = reader.ReadDateTime();

                    if (version < 149)
                    {
                        m_LastDeath = DateTime.Now - TimeSpan.FromDays(1);
                    }
                    else
                        m_LastDeath = reader.ReadDateTime();

                    goto case 0;
                }
                case 0:
                {
                    break;
                }
            }

            if (m_AvatarID == 0)
            m_AvatarID = 1076;

            //m_CrimesList.Add(Nation.Insularii, 0);

            if (m_CustomAvatarID1 == 0)
            m_CustomAvatarID1 = 1076;

            if (m_CustomAvatarID2 == 0)
            m_CustomAvatarID2 = 1076;

            if (m_CustomAvatarID3 == 0)
            m_CustomAvatarID3 = 1076;

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new List<Mobile>();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new List<Mobile>();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if( m_GuildRank == null )
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if( m_LastOnline == DateTime.MinValue && Account != null )
                m_LastOnline = ((Account)Account).LastLogin;

            if( m_ChampionTitles == null )
                m_ChampionTitles = new ChampionTitleInfo();

            List<Mobile> list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }

            CheckAtrophies( this );

            /*if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );*/

            if( this.Lives >= 0 && !this.Alive && this.Corpse != null )
                this.SendGump( new DeathGump( this, 15, this.Corpse ) );

            if( this.Backpack is ArmourBackpack )
            {
                ArmourBackpack pack = this.Backpack as ArmourBackpack;
                pack.Attributes.NightSight = 0;
            }

            if( version < 135 && AccessLevel < AccessLevel.GameMaster )
                OldMapChar = true;

            if( version < 141 )
            {
                FixSkillCost( FeatInfo.FeatCost.High, FeatInfo.FeatCost.Medium, Feats.GetFeatLevel(FeatList.Magery) );
                FixSkillCost( FeatInfo.FeatCost.High, FeatInfo.FeatCost.Low, Feats.GetFeatLevel(FeatList.Concentration) );
            }

            if( version < 145 )
            {
                m_TitlePrefix = null;
                m_RPTitle = "the Alyrian";

                if( m_Nation == Nation.Alyrian )
                    m_RPTitle = "the Alyrian";
                else if( m_Nation == Nation.Azhuran )
                    m_RPTitle = "the Azhuran";
                else if( m_Nation == Nation.Khemetar )
                    m_RPTitle = "the Khemetar";
                else if( m_Nation == Nation.Mhordul )
                    m_RPTitle = "the Mhordul";
                else if( m_Nation == Nation.Tyrean )
                    m_RPTitle = "the Tyrean";
                else if( m_Nation == Nation.Vhalurian )
                    m_RPTitle = "the Vhalurian";
            }

            m_Intimidated = 0;

            #region Removing Healing and HairStyling as feats and returning to players their CP
            if (Feats.GetFeatLevel(FeatList.Healing) == 3)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 3, true);
            }
            if (Feats.GetFeatLevel(FeatList.Healing) == 2)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 2, true);
            }
            if (Feats.GetFeatLevel(FeatList.Healing) == 1)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 1, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 3)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 3, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 2)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 2, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 1)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 1, true);
            }
            #endregion

            m_Deserialized = true;
        }
예제 #42
0
 private void Recordtimer_Tick(object sender, EventArgs e)
 {
     if (UI_progressBar.Value <= 29)
     {
         UI_progressBar.Value += 1;
     }
     UI_progressBar.Show();
     if (UI_progressBar.Value == 29)
     {
         string fingerprint = calcfinger.generate(FilePath);
         UI_Statusbar.Text = "Processing";
         if (conn.Connect(AppSettings.server) == false)
         {
             UI_Statusbar.Text = "Connected to Server";
             //sl.Add(new Song("Hard", "Gay", 95));
             sl = conn.SendFingerprint(fingerprint);
             UI_SongList uiSongList = new UI_SongList(this);
             uiSongList.SL = sl;
             uiSongList.Show();
             //panel1.Show();
             //hideResults.Show();
             //resultLabelTitle.Show();
             //resultLabelArtist.Show();
             //resultLabelTitle.Text += sl.Songs[0].Title;
             //resultLabelArtist.Text += sl.Songs[0].Artist;
             Recordtimer.Enabled = false;
             //SongList SongList = new SongList();
             //SongList.Show();
             //this.Hide();
             //GC.Collect();
         }
         else
         {
             UI_Statusbar.Text = "Connection to Server failed";
         }
     }
 }
예제 #43
0
 private void AddSortContextMenuButton(Gtk.Menu menu, SongList.SortColumnEnum sortColumn, string title)
 {
     Gtk.MenuItem item = new MenuItem(title);
     item.ButtonPressEvent +=new ButtonPressEventHandler(contextMenu_ButtonPressEvent);
     item.Data["key"] = "sort";
     item.Data["sort"] = sortColumn;
     menu.Add(item);
 }
예제 #44
0
 public void Play(SongList song)
 {
     Song newSong = null;
     z_currentSong = song;
     switch (z_currentSong)
     {
         case SongList.Theme:
             newSong = z_theme;
             break;
         case SongList.Boss:
             newSong = z_boss;
             break;
         case SongList.Credits:
             newSong = z_credits;
             break;
         case SongList.Dialog:
             newSong = z_dialog;
             break;
         case SongList.GameOver:
             newSong = z_gameOver;
             break;
         case SongList.MissionComplete:
             newSong = z_missionComplete;
             break;
         case SongList.Mission1:
             newSong = z_mission1;
             break;
         case SongList.Mission2:
             newSong = z_mission2;
             break;
         case SongList.Mission3:
             newSong = z_mission3;
             break;
         case SongList.Mission4:
             newSong = z_mission4;
             break;
         case SongList.Mission5:
             newSong = z_mission5;
             break;
         case SongList.None:
             if(MediaPlayer.State!= MediaState.Stopped)
                 MediaPlayer.Stop();
             return;
         default:
             break;
     }
     if (MediaPlayer.Queue.ActiveSong != newSong)
     {
         MediaPlayer.Play(newSong);
     }
 }
예제 #45
0
 /// <summary>
 /// 添加播放列表
 /// </summary>
 public void Add(SongList songlist)
 {
     linkedlist.AddLast(songlist);
     lastPlaySongList = songlist;
 }
예제 #46
0
 public BBResponse(List<SongParameters> songs)
 {
     responseType = new SongList(songs);
 }
예제 #47
0
        public Options()
        {
            int portable = ServiceScope.Get<ISettingsManager>().GetPortable();
              if (portable == 0)
            _configDir = String.Format(@"{0}\MPTagThat\Config",
                                   Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
              else
            _configDir = String.Format(@"{0}\Config", Application.StartupPath);

              MaximumNumberOfSongsInList = ServiceScope.Get<ISettingsManager>().GetMaxSongs();

              _MPTagThatSettings = new MPTagThatSettings();
              ServiceScope.Get<ISettingsManager>().Load(_MPTagThatSettings);

              _caseConversionSettings = new CaseConversionSettings();
              ServiceScope.Get<ISettingsManager>().Load(_caseConversionSettings);
              // Set Default Values, when starting the first Time
              if (_caseConversionSettings.CaseConvExceptions.Count == 0)
              {
            _caseConversionSettings.CaseConvExceptions.Add("I");
            _caseConversionSettings.CaseConvExceptions.Add("II");
            _caseConversionSettings.CaseConvExceptions.Add("III");
            _caseConversionSettings.CaseConvExceptions.Add("IV");
            _caseConversionSettings.CaseConvExceptions.Add("V");
            _caseConversionSettings.CaseConvExceptions.Add("VI");
            _caseConversionSettings.CaseConvExceptions.Add("VII");
            _caseConversionSettings.CaseConvExceptions.Add("VIII");
            _caseConversionSettings.CaseConvExceptions.Add("IX");
            _caseConversionSettings.CaseConvExceptions.Add("X");
            _caseConversionSettings.CaseConvExceptions.Add("XI");
            _caseConversionSettings.CaseConvExceptions.Add("XII");
            _caseConversionSettings.CaseConvExceptions.Add("feat.");
            _caseConversionSettings.CaseConvExceptions.Add("vs.");
            _caseConversionSettings.CaseConvExceptions.Add("DJ");
            _caseConversionSettings.CaseConvExceptions.Add("I'm");
            _caseConversionSettings.CaseConvExceptions.Add("I'll");
            _caseConversionSettings.CaseConvExceptions.Add("I'd");
            _caseConversionSettings.CaseConvExceptions.Add("UB40");
            _caseConversionSettings.CaseConvExceptions.Add("U2");
            _caseConversionSettings.CaseConvExceptions.Add("NRG");
            _caseConversionSettings.CaseConvExceptions.Add("ZZ");
            _caseConversionSettings.CaseConvExceptions.Add("OMD");
            _caseConversionSettings.CaseConvExceptions.Add("A1");
            _caseConversionSettings.CaseConvExceptions.Add("U96");
            _caseConversionSettings.CaseConvExceptions.Add("2XLC");
            _caseConversionSettings.CaseConvExceptions.Add("ATB");
            _caseConversionSettings.CaseConvExceptions.Add("EMF");
            _caseConversionSettings.CaseConvExceptions.Add("CD");
            _caseConversionSettings.CaseConvExceptions.Add("CD1");
            _caseConversionSettings.CaseConvExceptions.Add("CD2");
            _caseConversionSettings.CaseConvExceptions.Add("MC");
            _caseConversionSettings.CaseConvExceptions.Add("USA");
            _caseConversionSettings.CaseConvExceptions.Add("UK");
            _caseConversionSettings.CaseConvExceptions.Add("TLC");
            _caseConversionSettings.CaseConvExceptions.Add("UFO");
            _caseConversionSettings.CaseConvExceptions.Add("AC");
            _caseConversionSettings.CaseConvExceptions.Add("DC");
            _caseConversionSettings.CaseConvExceptions.Add("DMX");
            _caseConversionSettings.CaseConvExceptions.Add("ABBA");
              }

              _fileNameToTagSettings = new FileNameToTagFormatSettings();
              ServiceScope.Get<ISettingsManager>().Load(_fileNameToTagSettings);

              // Set Default Values, when starting the first Time
              if (_fileNameToTagSettings.FormatValues.Count == 0)
              {
            // Add Default Values
            _fileNameToTagSettings.FormatValues.Add(@"<K> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<A> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<K> - <A> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<A> - <K> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<A>\<B>\<K> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<A>\<B>\<A> - <K> - <T>");
            _fileNameToTagSettings.FormatValues.Add(@"<A>\<B>\<K> - <A> - <T>");
              }

              _fileNameToTagSettingsTemp = new List<string>(_fileNameToTagSettings.FormatValues);

              _tagToFileNameSettings = new TagToFileNameFormatSettings();
              ServiceScope.Get<ISettingsManager>().Load(_tagToFileNameSettings);

              // Set Default Values, when starting the first Time
              if (_tagToFileNameSettings.FormatValues.Count == 0)
              {
            // Add Default Values
            _tagToFileNameSettings.FormatValues.Add(@"<K> - <T>");
            _tagToFileNameSettings.FormatValues.Add(@"<A> - <T>");
            _tagToFileNameSettings.FormatValues.Add(@"<K> - <A> - <T>");
            _tagToFileNameSettings.FormatValues.Add(@"<A> - <K> - <T>");
              }

              _tagToFileNameSettingsTemp = new List<string>(_tagToFileNameSettings.FormatValues);

              _organiseSettings = new OrganiseFormatSettings();
              ServiceScope.Get<ISettingsManager>().Load(_organiseSettings);

              // Set Default Values, when starting the first Time
              if (_organiseSettings.FormatValues.Count == 0)
              {
            // Add Default values
            _organiseSettings.FormatValues.Add(@"<A>\<B>\<K> - <T>");
            _organiseSettings.FormatValues.Add(@"<A:1>\<A>\<B>\<K> - <T>");
            _organiseSettings.FormatValues.Add(@"<O>\<B>\<K> - <A> - <T>");
            _organiseSettings.FormatValues.Add(@"<O:1>\<A>\<B>\<K> - <T>");
              }

              _organiseSettingsTemp = new List<string>(_organiseSettings.FormatValues);

              _treeViewFilterSettings = new TreeViewFilterSettings();
              ServiceScope.Get<ISettingsManager>().Load(_treeViewFilterSettings);

              // Set default values
              if (_treeViewFilterSettings.Filter.Count == 0)
              {
            TreeViewFilter filter = new TreeViewFilter();
            filter.Name = "";
            filter.FileMask = "";
            filter.FileFilter = "*.*";
            _treeViewFilterSettings.Filter.Add(filter);
              }

              // Load Artists / AlbumArtists for Auto Completion
              if (_MPTagThatSettings.UseMediaPortalDatabase)
              {
            ReadArtistDatabase();
              }

              _copyPasteBuffer = new List<TrackData>();

              ReadOnlyFileHandling = 2; // Don't change attribute as a default.

              Songlist = new SongList();
        }