Example #1
0
            public void tPlay()
            {
                if (this.bReadNotTried)
                {
                    try
                    {
                        tRead();
                    }
                    catch
                    {
                        this.bReadNotTried = false;
                    }
                }
                if (this.bExclusive)
                {
                    if (rLastPlayedExclusiveSystemSound != null)
                    {
                        rLastPlayedExclusiveSystemSound.t停止する();
                    }

                    rLastPlayedExclusiveSystemSound = this;
                }
                CSound sound = this.rSound[this.n次に鳴るサウンド番号];

                if (sound != null)
                {
                    sound.tStartPlaying(this.bループ);
                }

                this.n次に鳴るサウンド番号 = 1 - this.n次に鳴るサウンド番号;
            }
Example #2
0
            public void t停止する()
            {
                if (this.rSound[0] != null)
                {
                    this.rSound[0].tStopPlayback();
                }

                if (this.rSound[1] != null)
                {
                    this.rSound[1].tStopPlayback();
                }

                if (rLastPlayedExclusiveSystemSound == this)
                {
                    rLastPlayedExclusiveSystemSound = null;
                }
            }
Example #3
0
        /// <summary>
        /// songlist.dbからの曲リスト構築
        /// </summary>
        public void t曲リストの構築1()
        {
            // !注意!
            // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、
            // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16)
            // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9)
            DateTime now = DateTime.Now;

            try
            {
                #region [ 0) システムサウンドの構築  ]
                //-----------------------------
                CDTXMania.stageStartup.ePhaseID = CStage.EPhase.起動0_システムサウンドを構築;

                Trace.TraceInformation("0) システムサウンドを構築します。");
                Trace.Indent();

                try
                {
                    CDTXMania.Skin.bgm起動画面.tPlay();
                    for (int i = 0; i < CDTXMania.Skin.nシステムサウンド数; i++)
                    {
                        if (!CDTXMania.Skin[i].bExclusive)      // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む)
                        {
                            CSkin.CSystemSound cシステムサウンド = CDTXMania.Skin[i];
                            if (!CDTXMania.bCompactMode || cシステムサウンド.bCompact対象)
                            {
                                try
                                {
                                    cシステムサウンド.tRead();
                                    Trace.TraceInformation("システムサウンドを読み込みました。({0})", cシステムサウンド.strFilename);
                                    //if ( ( cシステムサウンド == CDTXMania.Skin.bgm起動画面 ) && cシステムサウンド.b読み込み成功 )
                                    //{
                                    //	cシステムサウンド.tPlay();
                                    //}
                                }
                                catch (FileNotFoundException)
                                {
                                    Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFilename);
                                }
                                catch (Exception e)
                                {
                                    Trace.TraceError(e.Message);
                                    Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFilename);
                                }
                            }
                        }
                    }
                    lock (CDTXMania.stageStartup.list進行文字列)
                    {
                        CDTXMania.stageStartup.list進行文字列.Add("Loading system sounds ... OK ");
                    }
                }
                finally
                {
                    Trace.Unindent();
                }
                //-----------------------------
                #endregion

                if (CDTXMania.bCompactMode)
                {
                    Trace.TraceInformation("コンパクトモードなので残りの起動処理は省略します。");
                    return;
                }

                #region [ 00) songlist.dbの読み込みによる曲リストの構築  ]
                //-----------------------------
                CDTXMania.stageStartup.ePhaseID = CStage.EPhase.起動00_songlistから曲リストを作成する;

                Trace.TraceInformation("1) songlist.dbを読み込みます。");
                Trace.Indent();

                try
                {
                    if (!CDTXMania.ConfigIni.bConfigIniがないかDTXManiaのバージョンが異なる)
                    {
                        CSongManager s = new CSongManager();
                        s = Deserialize(strPathSongList);               // 直接this.Songs管理にdeserialize()結果を代入するのは避ける。nullにされてしまうことがあるため。
                        if (s != null)
                        {
                            this.Songs管理 = s;
                        }

                        int scores = this.Songs管理.nNbScoresFound;
                        Trace.TraceInformation("songlist.db の読み込みを完了しました。[{0}スコア]", scores);
                        lock (CDTXMania.stageStartup.list進行文字列)
                        {
                            CDTXMania.stageStartup.list進行文字列.Add("Loading songlist.db ... OK");
                        }
                    }
                    else
                    {
                        Trace.TraceInformation("初回の起動であるかまたはDTXManiaのバージョンが上がったため、songlist.db の読み込みをスキップします。");
                        lock (CDTXMania.stageStartup.list進行文字列)
                        {
                            CDTXMania.stageStartup.list進行文字列.Add("Loading songlist.db ... Skip");
                        }
                    }
                }
                finally
                {
                    Trace.Unindent();
                }

                #endregion

                #region [ 1) songs.db の読み込み ]
                //-----------------------------
                CDTXMania.stageStartup.ePhaseID = CStage.EPhase.起動1_SongsDBからスコアキャッシュを構築;

                Trace.TraceInformation("2) songs.db を読み込みます。");
                Trace.Indent();

                try
                {
                    if (!CDTXMania.ConfigIni.bConfigIniがないかDTXManiaのバージョンが異なる)
                    {
                        try
                        {
                            this.Songs管理.tReadSongsDB(strPathSongsDB);
                        }
                        catch
                        {
                            Trace.TraceError("songs.db の読み込みに失敗しました。");
                        }

                        int scores = (this.Songs管理 == null) ? 0 : this.Songs管理.nNbScoresFromSongsDB;    // 読み込み途中でアプリ終了した場合など、CDTXMania.SongManager がnullの場合があるので注意
                        Trace.TraceInformation("songs.db の読み込みを完了しました。[{0}スコア]", scores);
                        lock (CDTXMania.stageStartup.list進行文字列)
                        {
                            CDTXMania.stageStartup.list進行文字列.Add("Loading songs.db ... OK");
                        }
                    }
                    else
                    {
                        Trace.TraceInformation("初回の起動であるかまたはDTXManiaのバージョンが上がったため、songs.db の読み込みをスキップします。");
                        lock (CDTXMania.stageStartup.list進行文字列)
                        {
                            CDTXMania.stageStartup.list進行文字列.Add("Loading songs.db ... Skip");
                        }
                    }
                }
                finally
                {
                    Trace.Unindent();
                }
                //-----------------------------
                #endregion
            }
            finally
            {
                CDTXMania.stageStartup.ePhaseID = CStage.EPhase.起動7_完了;
                TimeSpan span = (TimeSpan)(DateTime.Now - now);
                Trace.TraceInformation("起動所要時間: {0}", span.ToString());
                lock (this)                                                     // #28700 2012.6.12 yyagi; state change must be in finally{} for exiting as of compact mode.
                {
                    state = DTXEnumState.CompletelyDone;
                }
            }
        }