コード例 #1
0
        public GoXLRPlugin(ITouchPortalClientFactory clientFactory,
                           GoXLRServer goXLRServer,
                           ILogger <GoXLRPlugin> logger)
        {
            //Set the event handler for TouchPortal:
            _client = clientFactory.Create(this);
            //Set the event handler for GoXLR connected:
            _server         = goXLRServer;
            _logger         = logger;
            _localAddresses = GetLocalAddresses();

            //Set the event handler for GoXLR Clients connected:
            _server.UpdateConnectedClientsEvent = UpdateClientState;
        }
コード例 #2
0
        public MainViewModel(ILogger <MainViewModel> logger,
                             GoXLRServer server)
        {
            _logger = logger;

            Clients = new List <ClientIdentifier>();

            Inputs        = new [] { "Mic", "Chat", "Music", "Game", "Console", "Line In", "System", "Samples" };
            SelectedInput = Inputs.First();

            Outputs        = new [] { "Headphones", "Broadcast Mix", "Line Out", "Chat Mic", "Sampler" };
            SelectedOutput = Outputs.First();

            Actions        = new [] { "Turn On", "Turn Off", "Toggle" };
            SelectedAction = Actions.First();

            _server = server;

            _server.UpdateConnectedClientsEvent = UpdateClientState;
        }
コード例 #3
0
        public TouchPortalClient(ILogger <TouchPortalClient> logger,
                                 GoXLRServer server,
                                 MessageProcessor messageProcessor)
        {
            _logger           = logger;
            _server           = server;
            _messageProcessor = messageProcessor;
            _localAddresses   = GetLocalAddresses();

            //Set the event handler for GoXLR Clients connected:
            _server.UpdateConnectedClientsEvent = UpdateClientState;
            _messageProcessor.OnInfo            = (infoMessage) =>
            {
                _logger.LogInformation("Connect Event: Plugin Connected to TouchPortal.");
                UpdateClientState();
            };
            _messageProcessor.OnDisconnect = (exception) =>
            {
                _logger.LogInformation("Close Event: Plugin Disconnected from TouchPortal.");
                Environment.Exit(0);
            };
            _messageProcessor.OnListChange  = OnListChangeEventHandler;
            _messageProcessor.OnActionEvent = OnActionEvent;
        }