Exemple #1
0
        //-------------------------------------------------------------
        // コンストラクタ
        //-------------------------------------------------------------
        public PlayerView()
        {
            InitializeComponent();

            // Toastの初期化
            ToastMessage.Init(this.statusBar);

            // コマンドライン引数のログ出力
            string[] commandLine = Environment.GetCommandLineArgs();
            foreach (string arg in commandLine)
            {
                Logger.Instance.InfoFormat("コマンドライン引数[{0}]", arg);
            }

            // チャンネル名表示
            if (Environment.GetCommandLineArgs().Length > 3)
            {
                string name = commandLine[3];
                Logger.Instance.InfoFormat("チャンネル名:{0}", name);
                statusBar.ChannelDetail = name;
                Win32API.SetWindowText(Handle, String.Format("{0} - PeerstPlayer", name));
            }
            else
            {
                // タイトル設定
                Win32API.SetWindowText(Handle, "PeerstPlayer");
            }

            // イベントの初期化
            InitEvent();

            // 設定の読み込み
            LoadSetting();

            Shown += (senderObject, eventArg) =>
            {
                Logger.Instance.InfoFormat("画面表示 - Shownイベント開始");

                // グローを表示する
                if (IsWindowsTen() && !PlayerSettings.FrameInvisible)
                {
                    ShowGlow();
                }

                // 設定の反映
                // 書き込み欄の非表示
                statusBar.WriteFieldVisible = PlayerSettings.WriteFieldVisible;
                if (statusBar.WriteFieldVisible)
                {
                    statusBar.Focus();
                }

                // チャンネル名設定後、画面表示
                Application.DoEvents();

                // プレイヤーをフォーカス
                pecaPlayer.Focus();

                // 動画再生
                if (Environment.GetCommandLineArgs().Length > 1)
                {
                    string url = commandLine[1];
                    Logger.Instance.InfoFormat("動画再生[url:{0}]", url);
                    Open(url);
                }

                // ショートカットの初期化
                shortcut.Init(this, pecaPlayer, statusBar);

                // ウィンドウスナップ
                new WindowSnap(this, pecaPlayer);

                // アスペクト比維持
                new AspectRateKeepWindow(this, pecaPlayer);

                // WMPを使用していなければ「WMPメニュー」を非表示にする
                if (!pecaPlayer.UsedWMP)
                {
                    wmpMenuToolStripMenuItem.Visible = false;
                }
                // FLV用のメニューを非表示にする
                else
                {
                    showDebugToolStripMenuItem.Visible = false;
                }
            };
        }