Giter Club home page Giter Club logo

Comments (4)

cboulay avatar cboulay commented on June 12, 2024

It's currently not possible as you describe.

Without changing LabRecorder, the best you can do is use the remote control socket control and send it a command to start recording via another application. I'll post a C# sample on how to do that when I find it a little later.

I think this is a worthwhile feature to have though. Rather, I would add a checkbox that enables automatic recording start when all required streams are found. This isn't too difficult to do but I don't have time to do it today. If you want to try to modify LabRecorder this way then I can direct you.

from app-labrecorder.

cboulay avatar cboulay commented on June 12, 2024

I should also mention that there is a command-line-interface (CLI) version of LabRecorder. Here is an example from @agricolab on controlling / configuring LabRecorder CLI from a Python program: https://github.com/pyreiz/pyliesl/blob/master/liesl/files/labrecorder/cli_wrapper.py

from app-labrecorder.

cboulay avatar cboulay commented on June 12, 2024

Here are a few snippets of C# code we use to control LabRecorder through the remote-control-server:

For setting filename:

using System.Net.Sockets;

private Socket lrSocket;
private IPEndPoint ipe;

ipe = new IPEndPoint(IPAddress.Parse(LRInIP), LRInPort);
lrSocket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
lrSocket.Connect(ipe);

For filename control:

            string msg = "filename ";
            if (LRStudyRoot != "")
                msg += "{root:" + LRStudyRoot + "}";
            if (currentExperiment != "")
                msg += "{task:" + currentExperiment + "}";
            if (patientID != "")
                msg += "{participant:" + patientID + "}";
            if (sessionID != "")
                msg += "{session:" + sessionID + "}";
            if (acquisitionParams != "")
                msg += "{acquisition:" + acquisitionParams + "}";
            msg += "{modality:" + bidsModality.ToString() + "}";
            msg += "\n";

            Byte[] bytesSend = Encoding.UTF8.GetBytes(msg);
            return lrSocket.Send(bytesSend);

To start / stop recording:

string msg = "start\n";  // Or "stop\n";
Byte[] bytesSend = Encoding.UTF8.GetBytes(msg);
return lrSocket.Send(bytesSend);

from app-labrecorder.

cboulay avatar cboulay commented on June 12, 2024

I think the way I would modify LabRecorder is as follows...

here, I would add an else block with the following:

refreshStreams();
if (missing.empty() && ui->check_autostart->isChecked()) {
    startRecording();
}

We'd still need to add that checkbox to the GUI (default unchecked) and then hook it up to some config file parameters, but that's mostly copy-paste-modify examples that are already there.

from app-labrecorder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.