Esempio n. 1
0
        public override void Load()
        {
            //init
            int    selectnum        = 0;
            string initialdirectory = "songs";
            object temp;

            if (PreviousParam.TryGetValue("PPDGameUtility", out temp))
            {
                PPDGameUtility gameutility = temp as PPDGameUtility;
                initialdirectory = gameutility.SongInformation.ParentDirectory;// Directory.GetParent(gameutility.SongInformation.DirectoryPath).Name;
            }
            ssm                   = new SelectSongManager();
            ssm.SongChanged      += new EventHandler(ssm_SongChanged);
            ssm.DirectoryChanged += new EventHandler(ssm_DirectoryChanged);
            resource              = new Dictionary <string, ImageResource>();
            ImageResource ir = new ImageResource("img\\default\\num.png", Device);

            resource.Add("img\\default\\num.png", ir);
            pictureobjects = new ArrayList();
            mb             = new MovieBox(Device);
            mss            = new MenuSelectSong(Device, Sprite, this, ssm.Directory);
            sic            = new SongInfoControl(Device, Sprite);
            cc             = new ConfirmControl(Device, Sprite);
            if (PPDSetting.Setting.LightMode)
            {
                mt = new Moviethumb(Device, Sprite);
            }
            mss.DisapperFinish += new EventHandler(cc.Focus);
            //factory

            factory(selectnum);
            if (temp != null)
            {
                PPDGameUtility gameutility = temp as PPDGameUtility;
                Auto       = gameutility.Auto;
                Speedscale = gameutility.SpeedScale;
                Random     = gameutility.Random;
                changeprofiledisplay();
            }
            ssm.Directory = initialdirectory;
            if (temp != null)
            {
                PPDGameUtility  gameutility = temp as PPDGameUtility;
                SongInformation si          = gameutility.SongInformation;
                selectnum = Array.FindIndex(ssm.SongInformations, (songinfo) => si.DirectoryName == songinfo.DirectoryName);
                if (selectnum < 0)
                {
                    selectnum = 0;
                }
            }
            ssm.SelectedIndex = selectnum;
        }
Esempio n. 2
0
 private void ChangeMovie()
 {
     //mb.releaseCOM();
     if (ssm.SelectedSongInformation == null || !ssm.SelectedSongInformation.IsPPDSong)
     {
         return;
     }
     if (ssm.SelectedSongInformation.MoviePath != null && ssm.SelectedSongInformation.MoviePath != "")
     {
         float rot = mb.Rotation;
         //mb.releaseCOM();
         mb.Dispose();
         mb          = null;
         mb          = new MovieBox(Device);
         mb.Movie    = GameHost.GetMovie(ssm.SelectedSongInformation.MoviePath);
         mb.Rotation = rot;
         mb.FileName = ssm.SelectedSongInformation.MoviePath;
         if (mb.Initialize() != 0)
         {
             MessageBox.Show("動画を開けませんでした\nCould not open movie");
         }
         else
         {
             mb.TrimmingData = ssm.SelectedSongInformation.TrimmingData;
             mb.SetLoop(ssm.SelectedSongInformation.ThumbStartTime, ssm.SelectedSongInformation.ThumbEndTime);
             mb.ChangeCut();
             mb.Play();
             mb.FadeIn();
         }
     }
     else
     {
         Exception e = new Exception("movie.*の動画ファイルがありません(@" + ssm.SelectedSongInformation.DirectoryPath + ")");
         throw e;
     }
 }