[Configuration] Plugin start when are disabled (1 Viewer)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,955
    5,628
    France - IDF
    Home Country
    France France
    • Thread starter
    • Moderator
    • #11
    Initital Atmolight Atmolight plugin .
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using MediaPortal.GUI.Library;
    using MediaPortal.Profile;
    using MediaPortal.Player;
    using System.Diagnostics;
    using System.Threading;
    using System.Runtime.InteropServices;
    using AtmoWinRemoteControl;
    using System.Drawing;
    using System.IO;
    using Microsoft.DirectX.Direct3D;
    using MediaPortal.Dialogs;
    namespace MediaPortal.ProcessPlugins.Atmolight
    {
    public class AtmolightPlugin: ISetupForm, IPlugin
    {
    #region Variables
    private IAtmoRemoteControl2 atmoCtrl=null;
    private IAtmoLiveViewControl atmoLiveViewCtrl = null;
    private int captureWidth = 0;
    private int captureHeight = 0;
    private Surface rgbSurface = null;
    private ContentEffect currentEffect = ContentEffect.LEDs_disabled;
    #endregion
    [DllImport("AtmoDXUtil.dll", PreserveSig = false, CharSet = CharSet.Auto)]
    private static extern void VideoSurfaceToRGBSurfaceExt(IntPtr src,int srcWidth,int srcHeight, IntPtr dst,int dstWidth,int dstHeight);
    public AtmolightPlugin()
    {
    AtmolightSettings.LoadSettings();
    Log.Info("atmolight: Trying to connect to atmowina.exe...");
    if (!ConnectToAtmoWinA())
    {
    Log.Warn("atmolight: AtmoWinA.exe not started. Trying to launch...");
    if (!StartAtmoWinA())
    {
    Log.Error("atmolight: Can't start atmowin.exe. Atmolight control won't work :(");
    return;
    }
    if (!ConnectToAtmoWinA())
    {
    Log.Error("atmolight: AtmoWinA started but still can't connect. Atmolight control won't work :(");
    return;
    }
    }
    }

    Start code, if AtmowinA.exe is not detected !
    Code:
     private bool StartAtmoWinA()
    {
    if (!System.IO.File.Exists(AtmolightSettings.atmowinExe))
    {
    Log.Error("atmolight: atmowina.exe not found.");
    return false;
    }
    Process app = new Process();
    app.StartInfo.FileName = AtmolightSettings.atmowinExe;
    app.StartInfo.UseShellExecute = true;
    app.StartInfo.Verb = "open";
    bool ret = true;
    try
    {
    ret = app.Start();
    }
    catch (Exception)
    {
    return false;
    }
    System.Threading.Thread.Sleep(1000);
    return ret;

    @tourettes , you see an error in code ?
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    AtmoWinA.exe gets started when the plugin in constructed. Not a bug in MP.
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,955
    5,628
    France - IDF
    Home Country
    France France
    • Thread starter
    • Moderator
    • #13
    For information : when Atmolight start AtmowinA.exe, icon is never display as minimized to tray (normally must be always visible)
     

    legnod

    MP Donator
  • Premium Supporter
  • September 24, 2011
    1,115
    323
    Stuttgart
    Home Country
    Germany Germany
    the atmowin icon is visible inside the tray icon bar....at least at my computer
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,955
    5,628
    France - IDF
    Home Country
    France France
    • Thread starter
    • Moderator
    • #15
    the atmowin icon is visible inside the tray icon bar....at least at my computer
    because i start MP as Shell (explorer not visible)
    and is when re-enter to explorer shell, is not displayed in tray.
     

    Users who are viewing this thread

    Top Bottom