Ejemplo n.º 1
0
        public VMonApplicationContext()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            icon = new NotifyIcon();
            UpdateIconText("!", Color.Tomato, 10);
            icon.Visible = true;

            ContextMenu menu = new ContextMenu();

            MenuItem exit = new MenuItem("Exit");

            exit.Click += Exit_Click;

            menu.MenuItems.Add(exit);
            icon.ContextMenu = menu;

            Controller = new CoreAudioController();

            var volObserver = new VolumeObserver(this);

            volObserver.Subscribe(Controller.DefaultPlaybackDevice.VolumeChanged);
            var muteObserver = new MuteObserver(this);

            muteObserver.Subscribe(Controller.DefaultPlaybackDevice.MuteChanged);

            var devObserver = new DeviceObserver(volObserver, muteObserver, this);

            devObserver.Subscribe(Controller.AudioDeviceChanged);
        }
Ejemplo n.º 2
0
 public DeviceObserver(VolumeObserver volObserver, MuteObserver muteObserver, VMonApplicationContext context)
 {
     this.volObserver  = volObserver;
     this.muteObserver = muteObserver;
     this.context      = context;
 }