Ejemplo n.º 1
0
        public override void OnStart()
        {
            PackageHost.PurgeStateObjects();
            MMDevice MMD = loadDefaultAudioDevice();

            MMD.AudioEndpointVolume.OnVolumeNotification += AudioEndpointVolume_OnVolumeNotification;
            PackageHost.PushStateObject("VolumeLevel", Math.Round(MMD.AudioEndpointVolume.MasterVolumeLevelScalar * 100));
            PushBrightness();

            PackageHost.WriteInfo("Package starting - IsRunning : {0} - IsConnected : {1}", PackageHost.IsRunning, PackageHost.IsConnected);
            string MySentinel_UI  = PackageHost.SentinelName;
            int    sentinelLength = MySentinel_UI.Length;
            string MySentinel     = MySentinel_UI.Substring(0, sentinelLength - 3);
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            PackageHost.PurgeStateObjects("*", "*");
            PackageHost.RegisterStateObjectLinks(this);
            PackageHost.RegisterMessageCallbacks(this);
            PackageHost.DeclarePackageDescriptor();
            player.MediaChange += new AxWMPLib._WMPOCXEvents_MediaChangeEventHandler(player_MediaChange);

            timer.Interval = 1000;
            timer.Elapsed += Timer_Elapsed;
            timer.Enabled  = true;
            PackageHost.PushStateObject("CurrentSong", new TupleList <string, string, string> {
            });


            this.Text = string.Format("MediaPlayer");
        }
Ejemplo n.º 3
0
 public override void OnShutdown()
 {
     PackageHost.PurgeStateObjects();
     Application.Exit();
 }