private void OnJobSetEvent(ReaPi.ConnectionIdentifier connection, int job, string jobFileName) { SendToDashboard(MessageType.EVENT, $"Job: <{jobFileName}>", null, null); if (!string.IsNullOrEmpty(jobFileName)) { try { rjConnection.Job = new RJJob(job, jobFileName); if (rjConnection.Job.VariableContents.Count > 0) { ISet <string> groups = rjConnection.Job.GetGroups(); //subskrypcja dla każdej grupy foreach (var group in groups) { ReaPi.SubscribeInvalidContent(connection, job, group).ToString(); ReaPi.SubscribeBufferFull(connection, job, group).ToString(); } } } catch (Exception) { } string logError; logError = ReaPi.SubscribeJobStarted(connection, job).ToString(); logError += ReaPi.SubscribeJobStopped(connection, job).ToString(); logError += ReaPi.SubscribeIOConfigurationSet(connection, job).ToString(); logError += ReaPi.SubscribePrintTrigger(connection, job).ToString(); logError += ReaPi.SubscribePrintStart(connection, job).ToString(); logError += ReaPi.SubscribePrintRejected(connection, job).ToString(); logError += ReaPi.SubscribePrintEnd(connection, job).ToString(); logError += ReaPi.SubscribePrintAborted(connection, job).ToString(); logError += ReaPi.SubscribePrintSpeedError(connection, job).ToString(); logError += ReaPi.SubscribeMissingContent(connection, job).ToString(); SendToDashboard(MessageType.ERROR, logError, "", ""); } else { ShowProblemSolution(ErrorType.nullJob); } }