CStdString MythProgramInfo::Category()
{
    char* cat = cmyth_proginfo_category(*m_proginfo_t);
    CStdString retval(cat);
    ref_release(cat);
    return retval;
}
Example #2
0
static int
show_proglist(cmyth_proglist_t episodes, int level, int show_card)
{
	int count, i;

	if (episodes == NULL) {
		return -1;
	}

	count = cmyth_proglist_get_count(episodes);

	for (i=0; i<count; i++) {
		char *title;
		char *subtitle=NULL, *channel = NULL;
		char *description=NULL, *category=NULL, *recgroup=NULL;
		char *pathname=NULL;
		cmyth_proginfo_t prog;
		int rec;

		prog = cmyth_proglist_get_item(episodes, i);

		title = cmyth_proginfo_title(prog);

		rec = cmyth_proginfo_check_recording(control, prog);

		if (level > 2) {
			subtitle = cmyth_proginfo_subtitle(prog);
			channel = cmyth_proginfo_channame(prog);
		}

		if (level > 3) {
			description = cmyth_proginfo_description(prog);
			category = cmyth_proginfo_category(prog);
			recgroup = cmyth_proginfo_recgroup(prog);
		}

		if (level > 4) {
			pathname = cmyth_proginfo_pathname(prog);
		}

		if (channel) {
			printf("\tChannel:         %s\n", channel);
		}
		if (title) {
			printf("\tTitle:           %s\n", title);
			if (rec > 0) {
				cmyth_timestamp_t end;
				char str[32];

				end = cmyth_proginfo_rec_end(prog);
				cmyth_timestamp_to_string(str, end);

				printf("\t                 RECORDING on %d until %s\n",
				       rec, str);

				ref_release(end);
			}
		}
		if (subtitle) {
			printf("\tSubtitle:        %s\n", subtitle);
		}
		if (description) {
			printf("\tDescription:     %s\n", description);
		}
		if (category) {
			printf("\tCategory:        %s\n", category);
		}
		if (recgroup) {
			printf("\tRecording Group: %s\n", recgroup);
		}
		if (pathname) {
			printf("\tPathname:        %s\n", pathname);
		}

		if (level > 4) {
			printf("\tBytes:           %lld\n",
			       cmyth_proginfo_length(prog));
		}

		if (level > 1 && show_card) {
			long card = cmyth_proginfo_card_id(prog);

			if (card == 0) {
				printf("\tRecorder:        will not record\n");
			} else {
				printf("\tRecorder:        %ld\n", card);
			}
		}

		ref_release(channel);
		ref_release(title);
		ref_release(subtitle);
		ref_release(description);
		ref_release(category);
		ref_release(recgroup);
		ref_release(pathname);

		ref_release(prog);
	}

	ref_release(episodes);

	return count;
}