Esempio n. 1
0
        /// <summary>
        /// Sends the request.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="recording">The recording.</param>
        /// <returns></returns>
        public bool SendRequest(string action, Recording recording)
        {
            try
            {
                Rock.Net.RockWebResponse response = RecordingService.SendRecordingRequest(recording.App, recording.StreamName, recording.RecordingName, action.ToLower());

                if (response != null && response.HttpStatusCode == System.Net.HttpStatusCode.OK)
                {
                    if (action.ToLower() == "start")
                    {
                        recording.StartTime     = DateTime.Now;
                        recording.StartResponse = RecordingService.ParseResponse(response.Message);
                    }
                    else
                    {
                        recording.StopTime     = DateTime.Now;
                        recording.StopResponse = RecordingService.ParseResponse(response.Message);
                    }

                    return(true);
                }
            }
            catch (System.Exception ex)
            {
                mdGridWarning.Show(ex.Message, ModalAlertType.Alert);
            }

            return(false);
        }
Esempio n. 2
0
        public IEnumerable <DateTime> Dates(string qualifier)
        {
            var user = this.CurrentUser();

            if (user != null)
            {
                var RecordingService = new RecordingService();
                var dates            = RecordingService.Queryable()
                                       .Where(r => r.StartTime.HasValue)
                                       .OrderByDescending(r => r.StartTime.Value)
                                       .Select(r => r.StartTime.Value)
                                       .ToList();

                if (string.Equals(qualifier, "distinct", StringComparison.CurrentCultureIgnoreCase))
                {
                    return(dates.Select(d => d.Date).Distinct());
                }
                else
                {
                    return(dates);
                }
            }

            throw new HttpResponseException(HttpStatusCode.Unauthorized);
        }
Esempio n. 3
0
        /// <summary>
        /// Binds the grid.
        /// </summary>
        private void BindGrid()
        {
            var service      = new RecordingService();
            var sortProperty = gRecordings.SortProperty;

            var queryable = new RecordingService().Queryable();

            int campusId = int.MinValue;

            if (int.TryParse(rFilter.GetUserPreference("Campus"), out campusId) && campusId > 0)
            {
                queryable = queryable.Where(r => r.CampusId == campusId);
            }

            DateTime fromDate = DateTime.MinValue;

            if (DateTime.TryParse(rFilter.GetUserPreference("From Date"), out fromDate))
            {
                queryable = queryable.Where(r => r.Date >= fromDate);
            }

            DateTime toDate = DateTime.MinValue;

            if (DateTime.TryParse(rFilter.GetUserPreference("To Date"), out toDate))
            {
                queryable = queryable.Where(r => r.Date <= toDate);
            }

            string stream = rFilter.GetUserPreference("Stream");

            if (!string.IsNullOrWhiteSpace(stream))
            {
                queryable = queryable.Where(r => r.StreamName.StartsWith(stream));
            }

            string label = rFilter.GetUserPreference("Label");

            if (!string.IsNullOrWhiteSpace(label))
            {
                queryable = queryable.Where(r => r.Label.StartsWith(label));
            }

            string recording = rFilter.GetUserPreference("Recording");

            if (!string.IsNullOrWhiteSpace(recording))
            {
                queryable = queryable.Where(r => r.RecordingName.StartsWith(recording));
            }

            if (sortProperty != null)
            {
                gRecordings.DataSource = queryable.Sort(sortProperty).ToList();
            }
            else
            {
                gRecordings.DataSource = queryable.OrderByDescending(s => s.Date).ToList();
            }

            gRecordings.DataBind();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class.
        /// </summary>
        /// <param name="baseAddress">The base address of the webservice (default = <see cref="ServiceBaseAddress"/>).</param>
        /// <param name="proxy">The <see cref="IWebProxy"/> used to connect to the webservice.</param>
        public MusicBrainzClient(string baseAddress, IWebProxy proxy)
        {
            var urlBuilder = new UrlBuilder(true);

            Artists       = new ArtistService(this, urlBuilder);
            Recordings    = new RecordingService(this, urlBuilder);
            Releases      = new ReleaseService(this, urlBuilder);
            ReleaseGroups = new ReleaseGroupService(this, urlBuilder);
            Work          = new WorkService(this, urlBuilder);

            client = CreateHttpClient(new Uri(baseAddress), true, proxy);
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class.
        /// </summary>
        /// <param name="httpClient">The <see cref="HttpClient"/> used for request to the webservice.</param>
        public MusicBrainzClient(HttpClient httpClient)
        {
            var urlBuilder = new UrlBuilder(true);

            Artists       = new ArtistService(this, urlBuilder);
            Recordings    = new RecordingService(this, urlBuilder);
            Releases      = new ReleaseService(this, urlBuilder);
            ReleaseGroups = new ReleaseGroupService(this, urlBuilder);
            Work          = new WorkService(this, urlBuilder);

            client = httpClient;
        }
Esempio n. 6
0
        private void DrawRecordingGUI()
        {
            if (!Application.isPlaying)
            {
                EditorGUILayout.HelpBox("Input test recording is only available in play mode", MessageType.Info);
                return;
            }
            if (RecordingService == null)
            {
                EditorGUILayout.HelpBox("No input recording service found", MessageType.Info);
                return;
            }

            using (new GUILayout.HorizontalScope())
            {
                bool newUseTimeLimit = GUILayout.Toggle(RecordingService.UseBufferTimeLimit, "Use buffer time limit");
                if (newUseTimeLimit != RecordingService.UseBufferTimeLimit)
                {
                    RecordingService.UseBufferTimeLimit = newUseTimeLimit;
                }

                using (new GUIEnabledWrapper(RecordingService.UseBufferTimeLimit))
                {
                    float newTimeLimit = EditorGUILayout.FloatField(RecordingService.RecordingBufferTimeLimit);
                    if (newTimeLimit != RecordingService.RecordingBufferTimeLimit)
                    {
                        RecordingService.RecordingBufferTimeLimit = newTimeLimit;
                    }
                }
            }

            bool wasRecording        = RecordingService.IsRecording;
            var  recordButtonContent = wasRecording
                ? new GUIContent(iconRecordActive, "Stop recording input animation")
                : new GUIContent(iconRecord, "Record new input animation");
            bool record = GUILayout.Toggle(wasRecording, recordButtonContent, "Button");

            if (record != wasRecording)
            {
                if (record)
                {
                    RecordingService.StartRecording();
                }
                else
                {
                    RecordingService.StopRecording();

                    SaveAnimation(true);
                }
            }

            DrawAnimationInfo();
        }
        public async Task Create_and_start_timing_session()
        {
            var messageHub = new ChannelMessageHub();

            using var storageService = new StorageService(Options.Create(new StorageServiceOptions { StorageConnectionString = storageConnectionString }), MessageHub);
            var upstreamDataStorage     = new UpstreamDataRepository(storageService);
            var eventRepository         = new EventRepository(storageService, upstreamDataStorage);
            var recordingRepository     = new RecordingServiceRepository(storageService, SystemClock);
            var upstreamDataSyncService = new UpstreamDataSyncService(Options.Create(upstreamDataSyncServiceOptions), new FakeMainClient(),
                                                                      upstreamDataStorage, messageHub);
            var downloadResult = await upstreamDataSyncService.Download(true);

            downloadResult.Should().BeTrue();
            upstreamDataStorage.ListSeries().Should().HaveCount(4);

            var tagSub = new FakeCheckpointSubscription();
            var cpf    = Substitute.For <ICheckpointServiceClientFactory>();
            var cps    = Substitute.For <ICheckpointServiceClient>();

            cpf.CreateClient(Arg.Any <string>()).Returns(cps);
            cps.CreateSubscription(Arg.Any <DateTime>()).Returns(tagSub);

            storageService.Repo.Query <CheckpointDto>().Count().Should().Be(0);

            using var recordingService = new RecordingService(Options.Create(new RecordingServiceOptions { CheckpointServiceAddress = "http://localhost:6000" }), recordingRepository, eventRepository, cpf, new AutoMapperProvider(),
                                                              messageHub, SystemClock);

            var timingSessionService = new TimingSessionService(eventRepository, recordingService, recordingRepository, MessageHub, new AutoMapperProvider(),
                                                                new DefaultSystemClock());

            var ev = upstreamDataStorage.ListEvents().First(x => x.Name == "Тучково кантри 12.09.2020");

            var session       = upstreamDataStorage.ListSessions(ev.Id).First(x => x.Name == "Эксперт и Опен");
            var timingSession = timingSessionService.CreateSession("timing sess", session.Id);

            timingSession.Start(tagSub.Now.AddSeconds(-10));
            await Task.Delay(100);

            tagSub.SendTags((1, "11"), (2, "12"));
            await Task.Delay(100);

            storageService.Repo.Query <CheckpointDto>().Count().Should().Be(2);
            //recordingRepository.GetActiveRecordingSession().Should().NotBeNull();

            // timingSession.Track.Rating.Should().HaveCount(2);
            // timingSession.Track.Rating[0].RiderId.Should().Be("11");
            // timingSession.Track.Rating[1].RiderId.Should().Be("12");


            //recordingService.StopRecording();
            //recordingRepository.GetActiveRecordingSession().Should().BeNull();
        }
        public ActionResult Edit([Bind(Include = "Id,Title,ReleaseDate,SelectedLabelId,SelectedArtistId,TrackTitles,Durations")] CreateViewModel vm)
        {
            var service = RecordingService.GetInstance(_repos);

            if (ModelState.IsValid)
            {
                service.Update(vm);
                return(RedirectToAction("Index"));
            }

            service.SetListItemSources(vm);
            return(View(vm));
        }
Esempio n. 9
0
        /// <summary>
        /// Handles the RowCommand event of the gRecordings control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewCommandEventArgs" /> instance containing the event data.</param>
        protected void gRecordings_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "START" || e.CommandName == "STOP")
            {
                var service   = new RecordingService();
                var recording = service.Get(Int32.Parse(e.CommandArgument.ToString()));
                if (recording != null && SendRequest(e.CommandName.ToString().ToLower(), recording))
                {
                    service.Save(recording, CurrentPersonId);
                }
            }

            BindGrid();
        }
Esempio n. 10
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var service = RecordingService.GetInstance(_repos);
            var key     = (int)id;

            if (service.IsExists(key) == false)
            {
                return(HttpNotFound());
            }
            DetailViewModel recording = service.GetDetail(key);

            return(View(recording));
        }
Esempio n. 11
0
        public Recording Stop(int campusId, string label, string app, string stream, string recording)
        {
            var user = this.CurrentUser();

            if (user != null)
            {
                var RecordingService = new RecordingService();
                var Recording        = RecordingService.StopRecording(campusId, label, app, stream, recording, user.PersonId);

                if (Recording != null)
                {
                    return(Recording);
                }
                else
                {
                    throw new HttpResponseException(HttpStatusCode.BadRequest);
                }
            }
            throw new HttpResponseException(HttpStatusCode.Unauthorized);
        }
Esempio n. 12
0
        /// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Recording recording;
            var       service = new RecordingService();

            int recordingId = 0;

            if (!Int32.TryParse(hfRecordingId.Value, out recordingId))
            {
                recordingId = 0;
            }

            if (recordingId == 0)
            {
                recording = new Recording();
                service.Add(recording, CurrentPersonId);
            }
            else
            {
                recording = service.Get(recordingId);
            }

            recording.CampusId      = cpCampus.SelectedCampusId;
            recording.App           = tbApp.Text;
            recording.Date          = dpDate.SelectedDate;
            recording.StreamName    = tbStream.Text;
            recording.Label         = tbLabel.Text;
            recording.RecordingName = tbRecording.Text;

            if (recordingId == 0 && cbStartRecording.Visible && cbStartRecording.Checked)
            {
                SendRequest("start", recording);
            }

            RockTransactionScope.WrapTransaction(() =>
            {
                service.Save(recording, CurrentPersonId);
            });

            NavigateToParentPage();
        }
Esempio n. 13
0
        private async void OnStartup(object sender, StartupEventArgs e)
        {
            var windowTypes = new Dictionary <string, Type>
            {
                { nameof(ExampleWindow), typeof(ExampleWindow) },
                { nameof(ExampleDialog), typeof(ExampleDialog) }
            };

            SimpleIoc.Default.Register <IDictionary <string, Type> >(() =>
            {
                return(windowTypes);
            });
            SimpleIoc.Default.Register <IViewModelLocator, ViewModelLocator>();
            SimpleIoc.Default.Register <IWindowService, WindowService>();
            SimpleIoc.Default.Register <MainViewModel>();
            var mainViewWindow = SimpleIoc.Default.GetInstance <MainViewModel>();

            _app = new MainWindow
            {
                DataContext = mainViewWindow
            };
            _app.Show();

            var windowService = SimpleIoc.Default.GetInstance <IWindowService>();

            object[] ctorArgs         = { windowService };
            var      recordingService = new RecordingService
            {
                IsEnabled = true
            };

            recordingService.RecordBefore(
                mainViewWindow.ShowExampleDialogCmd,
                mainViewWindow,
                ctorArgs);
            mainViewWindow.ShowExampleDialogCmd.Execute(null);
            recordingService.RecordAfter(
                mainViewWindow,
                ctorArgs);
            await recordingService.SaveAsync();
        }
Esempio n. 14
0
        /// <summary>
        /// Sends the request.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="recording">The recording.</param>
        /// <returns></returns>
        public bool SendRequest(string action, Recording recording)
        {
            Rock.Net.RockWebResponse response = RecordingService.SendRecordingRequest(recording.App, recording.StreamName, recording.RecordingName, action.ToLower());

            if (response != null && response.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                if (action.ToLower() == "start")
                {
                    recording.StartTime     = DateTime.Now;
                    recording.StartResponse = RecordingService.ParseResponse(response.Message);
                }
                else
                {
                    recording.StopTime     = DateTime.Now;
                    recording.StopResponse = RecordingService.ParseResponse(response.Message);
                }

                return(true);
            }

            return(false);
        }
Esempio n. 15
0
        /// <summary>
        /// Handles the Delete event of the gRecordings control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RowEventArgs" /> instance containing the event data.</param>
        protected void gRecordings_Delete(object sender, RowEventArgs e)
        {
            RockTransactionScope.WrapTransaction(() =>
            {
                var service   = new RecordingService();
                var recording = service.Get((int)gRecordings.DataKeys[e.RowIndex]["id"]);
                if (recording != null)
                {
                    string errorMessage;
                    if (!service.CanDelete(recording, out errorMessage))
                    {
                        mdGridWarning.Show(errorMessage, ModalAlertType.Information);
                        return;
                    }

                    service.Delete(recording, CurrentPersonId);
                    service.Save(recording, CurrentPersonId);
                }
            });

            BindGrid();
        }
        private void SaveAnimation(bool loadAfterExport)
        {
            string outputPath;

            if (loadedFilePath.Length > 0)
            {
                string loadedDirectory = Path.GetDirectoryName(loadedFilePath);
                outputPath = EditorUtility.SaveFilePanel(
                    "Select output path",
                    loadedDirectory,
                    InputAnimationSerializationUtils.GetOutputFilename(),
                    InputAnimationSerializationUtils.Extension);
            }
            else
            {
                outputPath = EditorUtility.SaveFilePanelInProject(
                    "Select output path",
                    InputAnimationSerializationUtils.GetOutputFilename(),
                    InputAnimationSerializationUtils.Extension,
                    "Enter filename for exporting input animation");
            }

            if (outputPath.Length > 0)
            {
                string filename  = Path.GetFileName(outputPath);
                string directory = Path.GetDirectoryName(outputPath);

                string result = RecordingService.SaveInputAnimation(filename, directory);
                RecordingService.DiscardRecordedInput();

                if (loadAfterExport)
                {
                    LoadAnimation(result);
                }
            }
        }
Esempio n. 17
0
        static void Main(string[] args)
        {
            RecordingService recordingService = new RecordingService();
            DetectionService detectionService = new DetectionService();

            detectionService.DownloadGameDetections();
            detectionService.DownloadNonGameDetections();

            LTCProcess ltc = new LTCProcess();

            ltc.Log += (sender, msg) => {
                ConsoleColor consoleColor = ConsoleColor.White;
                switch (msg.Title)
                {
                case "LTCPROCESS":
                    consoleColor = ConsoleColor.DarkCyan;
                    break;

                case "RECEIVED":
                    consoleColor = ConsoleColor.Cyan;
                    break;

                case "SENT":
                    consoleColor = ConsoleColor.Green;
                    break;

                case "INFO":
                    consoleColor = ConsoleColor.Magenta;
                    break;

                case "WARNING":
                    consoleColor = ConsoleColor.Yellow;
                    break;

                case "ERROR":
                    consoleColor = ConsoleColor.Red;
                    break;

                default:
                    break;
                }
                Logger.WriteLine(consoleColor, msg.Title + ": ", msg.Message);
            };

            ltc.ConnectionHandshake += (sender, msg) => {
                ltc.SetCaptureMode(49152);      //ORB_GAMEDVR_SET_CAPTURE_MODE ?????
                ltc.SetGameDVRCaptureEngine(1); //1 = nvidia ?????
            };

            ltc.ProcessCreated += (sender, msg) => {
                if (!recordingService.IsRecording)   // If we aren't already recording something, lets look for a process to record
                {
                    bool isGame    = detectionService.IsMatchedGame(msg.ExeFile);
                    bool isNonGame = detectionService.IsMatchedNonGame(msg.ExeFile);

                    if (isGame && !isNonGame)
                    {
                        Logger.WriteLine(ConsoleColor.Magenta, "INFO: ", "This is a recordable game, preparing to LoadGameModule");

                        string gameTitle = detectionService.GetGameTitle(msg.ExeFile);
                        recordingService.SetCurrentSession(msg.Pid, gameTitle);
                        ltc.SetGameName(gameTitle);
                        ltc.LoadGameModule(msg.Pid);
                    }
                    else if (!isGame && !isNonGame)
                    {
                        Logger.WriteLine(ConsoleColor.Magenta, "INFO: ", "This is an unknown application, lets try to ScanForGraphLib");

                        recordingService.SetCurrentSession(msg.Pid, "Game Unknown");
                        ltc.ScanForGraphLib(msg.Pid); // the response will be sent to GraphicsLibLoaded if successful
                    }
                    else
                    {
                        Logger.WriteLine(ConsoleColor.Magenta, "INFO: ", "This is a non-game");
                    }
                }
                else
                {
                    Logger.WriteLine(ConsoleColor.Magenta, "INFO: ", "Current recording a game right now, ignoring detection checks.");
                }
            };

            ltc.GraphicsLibLoaded += (sender, msg) => {
                ltc.SetGameName("Game Unknown");
                ltc.LoadGameModule(msg.Pid);
            };

            ltc.GameBehaviorDetected += (sender, msg) => {
                ltc.StartAutoHookedGame(msg.Pid);
            };

            ltc.VideoCaptureReady += (sender, msg) => {
                //if (AutomaticRecording == true)
                if (!recordingService.IsRecording)
                {
                    ltc.SetKeyBinds();
                    ltc.StartRecording();
                    recordingService.StartRecording();
                }
            };

            ltc.ProcessTerminated += (sender, msg) => {
                if (recordingService.IsRecording)
                {
                    if (recordingService.GetCurrentSession().Pid == msg.Pid)
                    {
                        ltc.StopRecording();
                        recordingService.StopRecording();
                    }
                }
            };

            ltc.Connect();

            Console.ReadKey();
        }
Esempio n. 18
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="itemKey">The item key.</param>
        /// <param name="itemKeyValue">The item key value.</param>
        public void ShowDetail(string itemKey, int itemKeyValue)
        {
            // return if unexpected itemKey
            if (itemKey != "recordingId")
            {
                return;
            }

            pnlDetails.Visible = true;

            Recording recording = null;

            if (!itemKeyValue.Equals(0))
            {
                recording         = new RecordingService().Get(itemKeyValue);
                lActionTitle.Text = ActionTitle.Edit(Recording.FriendlyTypeName);
            }
            else
            {
                recording = new Recording {
                    Id = 0
                };
                lActionTitle.Text = ActionTitle.Add(Recording.FriendlyTypeName);
            }

            hfRecordingId.Value = recording.Id.ToString();

            cpCampus.SelectedCampusId = recording.CampusId;
            tbApp.Text          = recording.App ?? string.Empty;
            dpDate.SelectedDate = recording.Date;
            tbStream.Text       = recording.StreamName ?? string.Empty;
            tbLabel.Text        = recording.Label ?? string.Empty;
            tbRecording.Text    = recording.RecordingName ?? string.Empty;
            lStarted.Text       = recording.StartTime.HasValue ? recording.StartTime.Value.ToString() : string.Empty;
            lStartResponse.Text = recording.StartResponse ?? string.Empty;
            lStopped.Text       = recording.StopTime.HasValue ? recording.StopTime.Value.ToString() : string.Empty;
            lStopResponse.Text  = recording.StopResponse ?? string.Empty;

            lStarted.Visible       = recording.StartTime.HasValue;
            lStartResponse.Visible = !string.IsNullOrEmpty(recording.StartResponse);
            lStopped.Visible       = recording.StopTime.HasValue;
            lStopResponse.Visible  = !string.IsNullOrEmpty(recording.StopResponse);

            cbStartRecording.Visible = false;

            bool readOnly = !IsUserAuthorized("Edit");

            nbEditModeMessage.Text = string.Empty;

            if (readOnly)
            {
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed(Recording.FriendlyTypeName);
                lActionTitle.Text      = ActionTitle.View(Recording.FriendlyTypeName);
                btnCancel.Text         = "Close";
            }

            cpCampus.Enabled     = !readOnly;
            tbApp.ReadOnly       = readOnly;
            dpDate.ReadOnly      = readOnly;
            tbStream.ReadOnly    = readOnly;
            tbLabel.ReadOnly     = readOnly;
            tbRecording.ReadOnly = readOnly;

            btnSave.Visible = !readOnly;
        }
Esempio n. 19
0
        private void MapServices()
        {
            #region Audio
            AudioPeerService audioPeerService = (contextView as GameObject)?.GetComponentInChildren <AudioPeerService>();
            if (audioPeerService != null)
            {
                injectionBinder.Bind <IAudioPeerService>().ToValue(audioPeerService);
            }
            #endregion

            #region Brush
            BrushService brushService = (contextView as GameObject)?.GetComponentInChildren <BrushService>();
            if (brushService != null)
            {
                injectionBinder.Bind <IBrushService>().ToValue(brushService);
            }
            #endregion

            #region Camera

            CameraService cameraService = (contextView as GameObject)?.GetComponentInChildren <CameraService>();
            if (cameraService != null)
            {
                injectionBinder.Bind <ICameraService>().ToValue(cameraService);
            }

            #endregion

            #region MyRegion

            CurveService curveService = (contextView as GameObject)?.GetComponentInChildren <CurveService>();
            if (curveService != null)
            {
                injectionBinder.Bind <ICurveService>().ToValue(curveService);
            }

            #endregion

            #region Draw

            DrawService drawService = (contextView as GameObject)?.GetComponentInChildren <DrawService>();
            if (drawService != null)
            {
                injectionBinder.Bind <IDrawService>().ToValue(drawService);
            }

            #endregion

            #region ViewManager

            ViewManager viewManager = (contextView as GameObject)?.GetComponentInChildren <ViewManager>();
            if (viewManager != null)
            {
                injectionBinder.Bind <IViewManager>().ToValue(viewManager);
            }

            #endregion

            #region Background

            BackgroundService backgroundService = (contextView as GameObject)?.GetComponentInChildren <BackgroundService>();
            if (cameraService != null)
            {
                injectionBinder.Bind <IBackgroundService>().ToValue(backgroundService);
            }

            #endregion

            #region Project

            ProjectService projectService = (contextView as GameObject)?.GetComponentInChildren <ProjectService>();
            if (cameraService != null)
            {
                injectionBinder.Bind <IProjectService>().ToValue(projectService);
            }

            #endregion

            #region Shortcut

            ShortcutService shortcutService = (contextView as GameObject)?.GetComponentInChildren <ShortcutService>();
            if (shortcutService != null)
            {
                injectionBinder.Bind <IShortcutService>().ToValue(shortcutService);
            }

            #endregion

            #region Save

            SaveManager saveManager = (contextView as GameObject)?.GetComponentInChildren <SaveManager>();
            if (shortcutService != null)
            {
                injectionBinder.Bind <ISaveManager>().ToValue(saveManager);
            }

            #endregion

            #region Recording

            RecordingService recordingService = (contextView as GameObject)?.GetComponentInChildren <RecordingService>();
            if (recordingService != null)
            {
                injectionBinder.Bind <IRecordingService>().ToValue(recordingService);
            }

            #endregion
        }
Esempio n. 20
0
        // GET: Recordings/Create
        public ActionResult Create()
        {
            var service = RecordingService.GetInstance(_repos);

            return(View(service.CreateCreateViewModel()));
        }
Esempio n. 21
0
        public ActionResult Index()
        {
            var service = RecordingService.GetInstance(_repos);

            return(View(service.GetAll()));
        }
Esempio n. 22
0
 public DataHub(RecordingService recordingService)
 {
     this.recordingService = recordingService;
 }
Esempio n. 23
0
        public void ParentSetUp()
        {
            //不要データを残さない
            var service = RecordingService.GetInstance(_repos);

            service.DeleteAll();

            //コントローラーのテストで使用
            _controller = new RecordingsController(_repos);

            //参照テストで使用
            var newrec = new Recording()
            {
                Title       = "Are You Experienced",
                ReleaseDate = new DateTime(1967, 5, 12),
                Artist      = new Artist()
                {
                    Name = "Jimi Hendrix"
                },
                Label = new Label()
                {
                    Name = "Track Record"
                },
                Tracks = new List <Track>()
                {
                    new Track()
                    {
                        Title    = "Foxy Lady",
                        Duration = 199
                    },
                    new Track()
                    {
                        Title    = "Manic Depression",
                        Duration = 210
                    },
                    new Track()
                    {
                        Title    = "Red House",
                        Duration = 224
                    }
                }
            };

            _repos.Add(newrec);
            _repos.Save();
            _repos.Reload();
            _initial = newrec;

            //更新のテストで使用
            _vm = new CreateViewModel()
            {
                Title       = "Sgt. Peppers Lonely Hearts Club Band",
                ReleaseDate = new DateTime(1967, 5, 26),
                TrackTitles = new List <string>()
                {
                    "Sgt. Pepper's Lonely Hearts Club Band",
                    "With a Little Help from My Friends",
                    "Lucy in the Sky with Diamonds"
                },
                Durations = new List <int?>()
                {
                    122,
                    163,
                    208
                },
                SelectedArtistId = 1,
                SelectedLabelId  = 2
            };
        }
Esempio n. 24
0
 public RecordingController(RecordingService recordingService, SavingService savingService)
 {
     this.savingService    = savingService;
     this.recordingService = recordingService;
 }
Esempio n. 25
0
        static void Main(string[] args)
        {
            RecordingService recordingService = new RecordingService();
            DetectionService detectionService = new DetectionService();

            detectionService.DownloadGameDetections();
            detectionService.DownloadNonGameDetections();

            LTCProcess ltc = new LTCProcess();

            ltc.ConnectionHandshake += (sender, msg) => {
                Console.WriteLine("Connection Handshake: {0}, {1}", msg.Version, msg.IntegrityCheck);
                ltc.SetCaptureMode(49152);      //ORB_GAMEDVR_SET_CAPTURE_MODE ?????
                ltc.SetGameDVRCaptureEngine(1); //1 = nvidia ?????
            };

            ltc.ProcessCreated += (sender, msg) => {
                Console.WriteLine("Process Created: {0}, {1}", msg.Pid, msg.ExeFile, msg.CmdLine);

                if (!recordingService.IsRecording)   // If we aren't already recording something, lets look for a process to record
                {
                    bool isGame    = detectionService.IsMatchedGame(msg.ExeFile);
                    bool isNonGame = detectionService.IsMatchedNonGame(msg.ExeFile);

                    if (isGame && !isNonGame)
                    {
                        Console.WriteLine("This is a recordable game, preparing to LoadGameModule");

                        string gameTitle = detectionService.GetGameTitle(msg.ExeFile);
                        recordingService.SetCurrentSession(msg.Pid, gameTitle);
                        ltc.SetGameName(gameTitle);
                        ltc.LoadGameModule(msg.Pid);
                    }
                    else if (!isGame && !isNonGame)
                    {
                        Console.WriteLine("This is an unknown application, lets try to ScanForGraphLib");

                        recordingService.SetCurrentSession(msg.Pid, "Game Unknown");
                        ltc.ScanForGraphLib(msg.Pid); // the response will be sent to GraphicsLibLoaded if successful
                    }
                    else
                    {
                        Console.WriteLine("This is a non-game");
                    }
                }
                else
                {
                    Console.WriteLine("Current recording a game right now, ignoring detection checks.");
                }
            };

            ltc.GraphicsLibLoaded += (sender, msg) => {
                Console.WriteLine("Graphics Lib Loaded: {0}, {1}", msg.Pid, msg.ModuleName);
                ltc.SetGameName("Game Unknown");
                ltc.LoadGameModule(msg.Pid);
            };

            ltc.ModuleLoaded += (sender, msg) => {
                Console.WriteLine("Plays-ltc Recording Module Loaded: {0}, {1}", msg.Pid, msg.ModuleName);
            };

            ltc.GameLoaded += (sender, msg) => {
                Console.WriteLine("Game finished loading: {0}, {1}x{2}", msg.Pid, msg.Width, msg.Height);
            };

            ltc.VideoCaptureReady += (sender, msg) => {
                Console.WriteLine("Video capture ready, can start recording: {0}", msg.Pid);

                //if (AutomaticRecording == true)
                if (!recordingService.IsRecording)
                {
                    ltc.SetKeyBinds();
                    ltc.StartRecording();
                    recordingService.StartRecording();
                }
            };

            ltc.ProcessTerminated += (sender, msg) => {
                Console.WriteLine("Process Terminated: {0}", msg.Pid);

                if (recordingService.IsRecording)
                {
                    if (recordingService.GetCurrentSession().Pid == msg.Pid)
                    {
                        ltc.StopRecording();
                        recordingService.StopRecording();
                    }
                }
            };

            ltc.Connect();

            Console.ReadKey();
        }