コード例 #1
0
ファイル: MainForm.cs プロジェクト: Samarkin/iTunesManager
 public MainForm(PlayerControllerService control)
 {
     if (control == null) return;
     _control = control;
     InitializeComponent();
     Icon = new Icon(GetType(), "Main.ico");
 }
コード例 #2
0
ファイル: OSDService.cs プロジェクト: Samarkin/iTunesManager
        public OSDService(PlayerControllerService controller)
        {
            if (controller == null) return;
            _controller = controller;
            _controller.Player.OnPlayerPlayEvent += OnPlayerEvent;
            _controller.Player.OnPlayerPlayingTrackChangedEvent += OnPlayerEvent;
            _controller.Player.OnPlayerStopEvent += OnPlayerEvent;
            _osd = new OSDForm();
            ApplySettings();

            Settings.Default.SettingsSaving += SettingsSaving;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: Samarkin/iTunesManager
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            using (var control = new PlayerControllerService())
            {
                control.Player.OnAboutToPromptUserToQuitEvent += Application.Exit;

                // Hotkey service
                using (var hotkeyService = new HotkeyService())
                {
                    control.RegisterHotkeyService(hotkeyService);

                    var selectSongVisualService = new VisualService
                    {
                        Form = new SelectSongForm(control.Player),
                        MenuEntry = "&Select song"
                    };
                    hotkeyService.RegisterHotKey("SelectSong",
                        (o, e) => selectSongVisualService.Activate());

                    // Tray service
                    using (var trayService = new TrayService(new[] { selectSongVisualService,
                        new VisualService {
                            Form = new MainForm(control),
                            MenuEntry = "Show &MiniPlayer"
                        },
                        new VisualService {
                            Form = new SettingsForm(),
                            MenuEntry = "S&ettings"
                        }
                    }))
                    {
                        control.RegisterNotificationService(trayService);
                        using (new OSDService(control))
                        {
                            Application.Run();
                        }
                    }
                }
            }
        }