48
48
bool show_warnings = true;
50
std::set<struct Timer> programmed_timers;
51
52
static struct option long_options[] = {
52
53
{ "device", required_argument, nullptr, OptSetDevice },
296
297
return retval == -1 ? e : (retval ? -1 : 0);
300
void print_timers(struct node *node)
303
printf("Timers Set:\n");
304
for (auto &t : programmed_timers) {
305
std::string start = ctime(&t.start_time);
306
time_t end_time = t.start_time + t.duration;
307
std::string end = ctime(&end_time);
308
/* Remove the seconds because timer is precise only to the minute. */
311
/* Remove the new line characters. */
312
start.erase(start.end() - 1);
313
end.erase(end.end() - 1);
314
/* Remove the start year if it is the same as the end year. */
315
if ((start.compare(start.size() - 4, 5, end, end.size() - 4, 5) == 0))
316
start.erase(start.size() - 5, 5);
317
printf("\t%s - %s, ", start.c_str(), end.c_str());
318
/* Find and print the source. */
320
switch (t.src.type) {
321
case CEC_OP_RECORD_SRC_OWN:
324
case CEC_OP_RECORD_SRC_DIGITAL:
327
case CEC_OP_RECORD_SRC_ANALOG:
330
case CEC_OP_RECORD_SRC_EXT_PLUG:
333
case CEC_OP_RECORD_SRC_EXT_PHYS_ADDR:
334
source = "ext phy addr";
339
printf("source: %s, ", source.c_str());
341
printf("rec-seq: 0x%x, ", t.recording_seq);
342
printf("needs: %ld %s\n", t.duration, "MB."); /* 1MB per second. */
344
printf("Total media space available for recording: ");
345
if (node->state.media_space_available >= 0)
346
printf("%d MB.\n\n", node->state.media_space_available);
299
352
void state_init(struct node &node)
301
354
if (options[OptStandby])
319
372
node.state.deck_skip_start = 0;
320
373
node.state.one_touch_record_on = false;
321
374
node.state.record_received_standby = false;
375
node.state.media_space_available = 36000; /* In MB; space for 10 hours @ 1MB/sec */
322
376
tuner_dev_info_init(&node.state);
323
377
node.state.last_aud_rate_rx_ts = 0;