| | |
| | | list_recInfo_.emplace_back(info); |
| | | } |
| | | |
| | | std::unique_ptr<buz::Recorder> rec::startRec(std::string id, std::string dir, const int mind, const int maxd){ |
| | | std::unique_ptr<buz::Recorder> rec::startRec(std::string id, std::string dir, const int mind, const int maxd, const bool audio){ |
| | | if(!recRef_){ |
| | | logIt("Init wrapper first"); |
| | | return nullptr; |
| | |
| | | |
| | | int trycnt = 0; |
| | | while(trycnt < 100){ |
| | | auto ret = rec->Run(dir.c_str(), mind, maxd); |
| | | auto ret = rec->Run(dir.c_str(), mind, maxd, audio); |
| | | if(ret == 0) break; |
| | | usleep(200000); |
| | | } |
| | |
| | | return recRef_ != NULL; |
| | | } |
| | | |
| | | void rec::NewRec(const char* id, const char *output, const int mindur, const int maxdur){ |
| | | void rec::NewRec(const char* id, const char *output, const int mindur, const int maxdur, const bool audio){ |
| | | std::string rid(id); |
| | | std::string dir(output); |
| | | |
| | |
| | | if (map_rec_.find(rid) != map_rec_.end()){ |
| | | map_rec_.erase(rid); |
| | | } |
| | | map_rec_[rid] = startRec(rid, dir, mindur, maxdur); |
| | | map_rec_[rid] = startRec(rid, dir, mindur, maxdur, audio); |
| | | } |
| | | |
| | | } |