Ejemplo n.º 1
0
 private void trayIcon_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         Osu.Show();
     }
 }
Ejemplo n.º 2
0
        private static void Main()
        {
            bool createdNew;

            using (new Mutex(true, Settings._MutexName, out createdNew))
            {
                Osu.Show();
                if (createdNew)
                {
                    // 업데이트 전의 파일 삭제
                    Task.Run(() => PostDel(Application.ExecutablePath + Settings._BakExt));

                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Lyrics());
                }
            }
        }
Ejemplo n.º 3
0
        private async void Lyrics_Shown(object sender, EventArgs e)
        {
            // 초기 설정을 위해 대화 상자 열기
            if (!File.Exists(Settings._Path))
            {
                BeginInvoke(new MethodInvoker(menuSetting.PerformClick));
            }
            while (!Osu.Process.HasExited)
            {
                if (Osu.IsForeground())
                {
                    if (!Location.Equals(Osu.ClientLocation))
                    {
                        Location = Osu.ClientLocation;
                    }
                    if (!Size.Equals(Osu.ClientSize))
                    {
                        Size = Osu.ClientSize;
                        Settings.DrawingOrigin = Point.Empty;
                    }
                    if (!(Settings?.Visible ?? false))
                    {
                        TopMost = true;
                    }
                    Visible = true;
                }
                else if (Settings?.Visible ?? false)
                {
                    Visible = true;
                }
                else if (Settings.ShowWhileOsuTop)
                {
                    Visible = false;
                }

                if (NewLyricAvailable())
                {
                    Refresh();
                }

                await Task.Delay(Settings.RefreshRate);
            }
            Close();
        }
Ejemplo n.º 4
0
        private async void Lyrics_Shown(object sender, EventArgs e)
        {
            // 초기 설정을 위해 대화 상자 열기
            if (!File.Exists(Settings._Path))
            {
                Task.Run(() => Invoke(new MethodInvoker(menuSetting.PerformClick)));
            }
            while (!Osu.Process.HasExited)
            {
                if (!Osu.Show(true))
                {
                    var osu = Osu.WindowInfo();
                    if (!Location.Equals(osu.Location))
                    {
                        Location = osu.Location;
                    }
                    if (!ClientSize.Equals(osu.ClientSize))
                    {
                        ClientSize             = osu.ClientSize;
                        Settings.DrawingOrigin = Point.Empty;
                    }
                    if (Settings == null)
                    {
                        TopMost = true;
                    }
                    Visible = true;
                }
                else if (Settings.ShowWhileOsuTop)
                {
                    Visible = false;
                }

                if (NewLyricAvailable())
                {
                    Refresh();
                }

                await Task.Delay(Settings.RefreshRate);
            }
            Close();
        }
Ejemplo n.º 5
0
        private static void Main()
        {
            using (new Mutex(true, Constants._MutexName, out bool createdNew))
            {
                Osu.Show();
                if (createdNew)
                {
                    // 업데이트 전의 파일 삭제
                    Task.Run(() => IO.FileEx.PostDel(Application.ExecutablePath + Constants._BakExt));

                    Osu.RunMessageServer();
                    Osu.ListenMessageAsync();
                    Osu.HookKeyboard();

                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new CanvasForm());

                    Osu.UnhookKeyboard();
                }
            }
        }
Ejemplo n.º 6
0
 private void Lyrics_FormClosing(object sender, FormClosingEventArgs e)
 {
     Osu.UnhookKeyboard();
 }
Ejemplo n.º 7
0
 private void Lyrics_Load(object sender, EventArgs e)
 {
     Notice(Osu.Listen(Osu_Signal) ? Constants._MutexName : "초기화 실패");
     Osu.HookKeyboard(Osu_KeyDown);
 }