Example #1
0
  // This method is called after plugin shutdown to free any resources
  // used by the plugin.
  @Override
  public void destroy() {
    if (Global.IsClient()) {
      Log.getInstance().write(Log.LOGLEVEL_WARN, "destroy: Running in Client mode.");
      Log.getInstance().destroy();
      return;
    }

    Log.getInstance().write(Log.LOGLEVEL_TRACE, "destroy: Destroy received from Plugin Manager.");
    Log.getInstance().destroy();
    registry = null;
    listener = null;
  }
Example #2
0
  // This method is called when the plugin should shutdown.
  @Override
  public void stop() {
    Log.getInstance().write(Log.LOGLEVEL_TRACE, "stop: Stop received from Plugin Manager.");

    if (Global.IsClient()) {
      Log.getInstance().write(Log.LOGLEVEL_WARN, "stop: Running in Client mode.");
      return;
    }

    // registry.eventUnsubscribe(listener, "RecordingCompleted");
    registry.eventUnsubscribe(listener, "RecordingStopped");
    showInFocus = null;
  }
Example #3
0
  @Override
  public void start() {
    System.out.println("LIR: Plugin: Starting. Version = " + VERSION);

    // Set the loglevel to what's in the .properties file.
    Integer DefaultLevel = Log.LOGLEVEL_WARN;
    String CurrentLevel =
        Configuration.GetServerProperty(Log.PROPERTY_LOGLEVEL, DefaultLevel.toString());
    Integer SetLevel = Integer.decode(CurrentLevel);
    Log.getInstance().SetLogLevel(SetLevel);

    switch (Log.getInstance().GetLogLevel()) {
      case Log.LOGLEVEL_ALL:
        System.out.println("LIR: Plugin: LogLevel = Maximum.");
        break;
      case Log.LOGLEVEL_ERROR:
        System.out.println("LIR: Plugin: LogLevel = Error.");
        break;
      case Log.LOGLEVEL_NONE:
        System.out.println("LIR: Plugin: LogLevel = None.");
        break;
      case Log.LOGLEVEL_TRACE:
        System.out.println("LIR: Plugin: LogLevel = Trace.");
        break;
      case Log.LOGLEVEL_VERBOSE:
        System.out.println("LIR: Plugin: LogLevel = Verbose.");
        break;
      case Log.LOGLEVEL_WARN:
        System.out.println("LIR: Plugin: LogLevel = Warn.");
        break;
      default:
        System.out.println("LIR: Plugin: Error.  Unknown LogLevel.");
        break;
    }

    // If we're running on a client we are done.
    if (Global.IsClient()) {
      Log.getInstance().write(Log.LOGLEVEL_WARN, "start: Running in Client mode.");
      return;
    }

    // Subscribe to what we need.
    Log.getInstance().write(Log.LOGLEVEL_TRACE, "start: Subscribing to events.");
    // registry.eventSubscribe(listener, "RecordingCompleted");
    registry.eventSubscribe(listener, "RecordingStopped");
  }
Example #4
0
  public Plugin(sage.SageTVPluginRegistry Registry, boolean Reset) {
    registry = Registry;
    listener = this;

    if (Reset && !Global.IsClient()) resetConfig();
  }