Example #1
0
        private void OnResponseCallback(
            ReaPi.ResponseHandle response,
            ReaPi.ConnectionIdentifier connection,
            ReaPi.ECommandId commandid,
            ReaPi.EErrorCode errorCode,
            IntPtr context)
        {
            int         error       = 0;
            ErrorStatus errorStatus = ReaPi.GetErrorStatus(response, out error);

            switch (commandid)
            {
            case ReaPi.ECommandId.CMD_SUBSCRIBEJOBSET:
                CmdSubscribeJobSetResponse(true);
                break;

            case ReaPi.ECommandId.CMD_UNSUBSCRIBEJOBSET:
                CmdSubscribeJobSetResponse(false);
                break;

            case ReaPi.ECommandId.CMD_GETIOCONFIGURATION:
                CmdGetIOConfigurationResponse(ReaPi.GetIOConfigurationFilename(response, out error));
                break;

            case ReaPi.ECommandId.CMD_GETIOOUTPUTLEVEL:
                CmdGetOutputLevelResponse(response, new GetIOOutputLevelResponseEventArgs(connection, response, commandid, ReaPi.GetErrorStatus(response, out error)));
                break;

            case ReaPi.ECommandId.CMD_SETIOOUTPUTLEVEL:
                CmdSetOutputLevelResponse();
                break;

            default:
                break;
            }
            ShowResponseError(response, connection, commandid.ToString(), errorCode);
        }
Example #2
0
        private void OnEventCallback(
            ReaPi.ResponseHandle response,
            ReaPi.ConnectionIdentifier connection,
            ReaPi.EEventId eventId,
            IntPtr context)
        {
            int error = 0;

            SendToDashboard(MessageType.EVENT, $"{eventId.ToString()}", null, null);

            switch (eventId)
            {
            case ReaPi.EEventId.JOBSET:
                OnJobSetEvent(connection, ReaPi.GetJobId(response, out error), ReaPi.GetJobFilename(response, out error));
                break;

            case ReaPi.EEventId.JOBSTARTED:
                OnJobStartedEvent();
                break;

            case ReaPi.EEventId.JOBSTOPPED:
                OnJobStoppedEvent();
                break;

            case ReaPi.EEventId.PRINTTRIGGER:
                OnJobPrintTriggerEvent(eventId);
                break;

            case ReaPi.EEventId.PRINTSTART:
                OnJobPrintStartEvent(eventId);
                break;

            case ReaPi.EEventId.PRINTREJECTED:
                OnJobPrintRejectEvent();
                break;

            case ReaPi.EEventId.PRINTEND:
                OnJobPrintEndEvent();
                break;

            case ReaPi.EEventId.PRINTABORTED:
                OnJobPrintAbortedEvent();
                break;

            case ReaPi.EEventId.PRINTSPEEDERROR:
                OnJobPrintSpeedErrorEvent();
                break;

            case ReaPi.EEventId.INVALIDCONTENT:
                OnInvalidContentEvent(ReaPi.GetGroupname(response, out error));
                break;

            case ReaPi.EEventId.IOCONFIGURATIONSET:
                OnIOConfigurationSetEvent(ReaPi.GetIOConfigurationFilename(response, out error));
                break;

            case ReaPi.EEventId.MISSINGCONTENT:
                OnMissingContentEvent(ReaPi.GetGroupname(response, out error));
                break;

            case ReaPi.EEventId.BUFFERFULL:
                OnJobBufferFullEvent(ReaPi.GetJobErrorStatus(response, out error));
                break;

            default:
                break;
            }
        }