本文整理汇总了C++中Recorder类的典型用法代码示例。如果您正苦于以下问题:C++ Recorder类的具体用法?C++ Recorder怎么用?C++ Recorder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Recorder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
int MediaSession::RecorderAttachToVideoMixerPort(int recorderId,int mixerId,int portId)
{
//Get Player
Recorders::iterator it = recorders.find(recorderId);
//If not found
if (it==recorders.end())
//Exit
return Error("Recorder not found\n");
//Get it
Recorder* recorder = it->second;
//Get Player
VideoMixers::iterator itMixer = videoMixers.find(mixerId);
//If not found
if (itMixer==videoMixers.end())
//Exit
return Error("AudioMixerResource not found\n");
//Get it
VideoMixerResource* videoMixer = itMixer->second;
//And attach
return recorder->Attach(MediaFrame::Video,videoMixer->GetJoinable(portId));
}
示例2: main
int main(int argc, char **argv)
{
Recorder rec;
rec.initialiseParameters();
msl_ptgrey_camera::MSLPtGreyCamera cam;
auto error = cam.init();
if(error == -1) {
cout << "Error! Try again!" << endl;
return error;
}
int frame = 0;
while (frame < rec.maxImages)
{
frame++;
string fpath = rec.path;
fpath.append(std::to_string(frame));
fpath.append(".raw");
cout << fpath << endl;
// cout << "frame:" << frame << ", maxImages: " << rec.maxImages << endl;
cam.saveCurrentImageToFile(fpath);
sleep(static_cast<unsigned int>(1 / std::max(0.033, (double)rec.freq)));
}
cout << "finished recording" << endl;
return 0;
}
示例3: getParameters
/* Composite fields are NOT supported so far */
void RecorderControlWidget::getParameters(Recorder& params) const
{
params.setPath (mUi->pathEdit->text().toStdString());
params.setFileTemplate (mUi->fileTemplateEdit->text().toStdString());
}
示例4: calcVolumeEnv
void SampleChannel::calcVolumeEnv(int frame)
{
/* method: check this frame && next frame, then calculate delta */
Recorder::action *a0 = NULL;
Recorder::action *a1 = NULL;
int res;
/* get this action on frame 'frame'. It's unlikely that the action
* is not found. */
res = G_Recorder.getAction(index, ACTION_VOLUME, frame, &a0);
if (res == 0)
return;
/* get the action next to this one.
* res == -1: a1 not found, this is the last one. Rewind the search
* and use action at frame number 0 (actions[0]).
* res == -2 ACTION_VOLUME not found. This should never happen */
res = G_Recorder.getNextAction(index, ACTION_VOLUME, frame, &a1);
if (res == -1)
res = G_Recorder.getAction(index, ACTION_VOLUME, 0, &a1);
volume_i = a0->fValue;
volume_d = ((a1->fValue - a0->fValue) / ((a1->frame - a0->frame) / 2)) * 1.003f;
}
示例5: sendMidiLplay
void SampleChannel::quantize(int index, int localFrame, Mixer *mixer)
{
/* skip if LOOP_ANY or not in quantizer-wait mode */
if ((mode & LOOP_ANY) || !qWait)
return;
/* no fadeout if the sample starts for the first time (from a
* STATUS_OFF), it would be meaningless. */
if (status == STATUS_OFF) {
status = STATUS_PLAY;
sendMidiLplay();
qWait = false;
tracker = fillChan(vChan, tracker, localFrame); /// FIXME: ???
}
else
//setXFade(localFrame);
reset(localFrame);
/* this is the moment in which we record the keypress, if the
* quantizer is on. SINGLE_PRESS needs overdub */
if (G_Recorder.canRec(this, mixer)) {
if (mode == SINGLE_PRESS) {
G_Recorder.startOverdub(index, ACTION_KEYS, mixer->currentFrame,
G_KernelAudio.realBufsize);
readActions = false; // don't read actions while overdubbing
}
else
G_Recorder.rec(index, ACTION_KEYPRESS, mixer->currentFrame);
hasActions = true;
}
}
示例6: setParameters
void RecorderControlWidget::setParameters(const Recorder &input)
{
// Block signals to send them all at once
bool wasBlocked = blockSignals(true);
mUi->pathEdit->setText(QString::fromStdString(input.path()));
mUi->fileTemplateEdit->setText(QString::fromStdString(input.fileTemplate()));
blockSignals(wasBlocked);
emit paramsChanged();
}
示例7: __declspec
__declspec(dllexport) Status Recorder_create(Recorder*& rec, const char* fileName)
{
Recorder* vsl = new Recorder();
Status status = vsl->create(fileName);
if (status == STATUS_OK)
rec = vsl;
else
Recorder_destroy(vsl);
return status;
}
示例8: record
//----------------------------------------------------------------------------------------------------------------------
void CTRNN::record(Recorder& recorder)
{
for(int i = 0; i < size; ++i)
{
recorder.push_back("NeuralInput" + toString(i), inputs[i]);
recorder.push_back("NeuralState" + toString(i), states[i]);
recorder.push_back("NeuralOutput" + toString(i), outputs[i]);
recorder.push_back("NeuralExtInput" + toString(i), externalinputs[i]);
}
}
示例9: Recorder
void Recorder::newWindow() {
if (recorderWindow_ == Secondary || secondaryRecorderPresent_)
return; // only allow a single secondary window
if (administrationAllowed()) {
Recorder* newRecorder = new Recorder(study_, currentDisk_,
user(), options(), false, Secondary,
this);
newRecorder->restore();
secondaryRecorderPresent_ = true;
}
}
示例10: threadMain
XN_THREAD_PROC Recorder::threadMain(XN_THREAD_PARAM pThreadParam)
{
Recorder* pSelf = reinterpret_cast<Recorder*>(pThreadParam);
if (NULL != pSelf)
{
pSelf->m_running = TRUE;
while (pSelf->m_running)
{
pSelf->messagePump();
}
}
XN_THREAD_PROC_RETURN(XN_STATUS_OK);
}
示例11: main
int main(int argc, char *argv[])
{
Network yarp;
if (!yarp.checkNetwork())
{
yError()<<"YARP network seems unavailable!";
return 1;
}
ResourceFinder rf;
rf.configure(argc,argv);
Recorder recorder;
return recorder.runModule(rf);
}
示例12: main
int
main(int argc, const char* const* argv)
{
Recorder recorder;
while (true) {
static struct option sLongOptions[] = {
{ "help", no_argument, 0, 'h' },
{ 0, 0, 0, 0 }
};
opterr = 0; // don't print errors
int c = getopt_long(argc, (char**)argv, "+hl", sLongOptions, NULL);
if (c == -1)
break;
switch (c) {
case 'h':
print_usage_and_exit(false);
break;
case 'l':
recorder.SetSkipLoading(false);
break;
default:
print_usage_and_exit(true);
break;
}
}
// Remaining arguments should be the output file and the optional command
// line.
if (optind >= argc)
print_usage_and_exit(true);
const char* outputFile = argv[optind++];
const char* const* programArgs = argv + optind;
int programArgCount = argc - optind;
// prepare for battle
if (recorder.Init(outputFile) != B_OK)
exit(1);
// start the action
recorder.Run(programArgs, programArgCount);
return 0;
}
示例13: msgData
int
ShadowSubdomain::addRecorder(Recorder &theRecorder)
{
msgData(0) = ShadowActorSubdomain_addRecorder;
msgData(1) = theRecorder.getClassTag();
this->sendID(msgData);
this->sendObject(theRecorder);
return 0;
}
示例14: main
int main(int argc, char* argv[]) {
cout << argc << endl;
for (int h = 0; h<argc; h++)
cout << argv[h] << endl;
cout << endl;
Recorder* rec = Recorder::GetInstance();
//One of each device
TestDevice* dev = new TestDevice("dev");
Relay* rel = new Relay();
SpeedController* ctrl = new SpeedController();
Servo* serv = new Servo();
DoubleSolenoid* ds = new DoubleSolenoid();
Solenoid* sol = new Solenoid();
//Add all devices to recorder
rec->AddDevice("Relay",rel);
rec->AddDevice("Speed Controller",ctrl);
rec->AddDevice("Servo",serv);
rec->AddDevice("Double Solenoid",ds);
rec->AddDevice("Solenoid",sol);
rec->AddDevice(dev);
//Creates macro
cout << dev->GetName() << endl;
Macro* mac = rec -> macro();
int iterations = 5;
for (int i = 0; i<iterations; i++) {
mac->Record();
}
mac->WriteFile("auto.csv");
mac->Reset();
mac->ReadFile("auto.csv");
while (!mac->IsFinished())
{
mac->PlayBack();
}
cout << "plz work" << endl;
mac->Reset();
Command* recCom = mac->NewRecordFileCommand("auto2.csv");
recCom->Initialize();
for (int i = 0; i < 30; i ++) recCom->Execute();
recCom->End();
return 0;
}
示例15: setRecorder
//----------------------------------------------------
// レコーダーの設定
//----------------------------------------------------
XnStatus setRecorder(Recorder recorder, XnStatus rc){
//XnStatus rc;
// レコーダーの作成
rc = recorder.Create(g_context);
if (rc != XN_STATUS_OK) {
cout << "error!" << endl;
throw std::runtime_error(xnGetStatusString(rc));
}
// 記録設定
rc = recorder.SetDestination(XN_RECORD_MEDIUM_FILE, OUT_RECORDE_PATH);
if (rc != XN_STATUS_OK) {
cout << "error!" << endl;
throw std::runtime_error(xnGetStatusString(rc));
}
// イメージを記録対象に追加
rc = recorder.AddNodeToRecording(g_image, XN_CODEC_JPEG);
if (rc != XN_STATUS_OK) {
cout << "error!" << endl;
throw std::runtime_error(xnGetStatusString(rc));
}
// デプスを記録対象に追加
rc = recorder.AddNodeToRecording(g_depth, XN_CODEC_UNCOMPRESSED);
if (rc != XN_STATUS_OK) {
cout << "error!" << endl;
std::cout << __LINE__ << std::endl;
throw std::runtime_error(xnGetStatusString(rc));
}
// 記録開始(WaitOneUpdateAllのタイミングで記録される)
rc = recorder.Record();
if (rc != XN_STATUS_OK) {
cout << "error!" << endl;
throw std::runtime_error(xnGetStatusString(rc));
}
cout << "record set ok!" << endl;
return rc;
}