Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable capture button #5

Open
parseccentric opened this issue Nov 9, 2021 · 2 comments
Open

Enable capture button #5

parseccentric opened this issue Nov 9, 2021 · 2 comments
Assignees

Comments

@parseccentric
Copy link
Contributor

New Feature Description

Create or enable a capture button in the menu so that you can start and stop captures.

How to Test

Action:

Click the capture button when not recording.

Expected results:

  • A request to start capturing is sent to the server
  • the button indicates that it is currently capturing
  • any errors are reflected somewhere in the menu

Action:

Click the capture button when recording.

Expected result:

  • A request to stop capturing is sent to the server
  • the button indicates that it is not capturing
  • any errors are reflected somewhere in the menu
@parseccentric parseccentric self-assigned this Nov 9, 2021
@parseccentric
Copy link
Contributor Author

(Dev notes)

The relevant function is in socket-funcs.jslib:

    ToggleCapture: function (operation, session_id) {
        if (window.sync == null) {
            return 1;
        }

        if (operation == 0) {
            window.sync.emit("start_recording", session_id);

            return 0;
        }
            
        window.sync.emit("end_recording", session_id);
        
        return 0;
    },

@parseccentric
Copy link
Contributor Author

(Dev notes)

From the final call backwards to the button

Legacy Version

socket-funcs.jslib

  • ToggleCapture
    • window.sync.emit("start_recording", ...);

RecordEvent.cs

  • ToggleCapture

Some Unity UI Event

  • RecordEvent.Start_Record()

Refactored Version

socket-funcs.jslib

  • ToggleCapture
    • window.sync.emit("start_recording", ...);

SocketIOJSLib.cs

  • using
  • (decorator)
  • (extern)

SocketIOAdapter

  • Bus depot to other objects
  • Wrapper for editor vs build

CaptureManager (renamed from RecordEvent)

  • SocketIOAdapter.StartRecording();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant