6 // Channel table entry for the TV tuner
13 Channel::Channel(Channel *channel)
16 printf("Channel::Channel(Channel *channel) not supported\n");
49 printf("Channel::dump title=%s\n"
63 Channel& Channel::operator=(Channel &channel)
65 printf("Channel::operator= is not supported.\n");
69 void Channel::copy_settings(Channel *channel)
71 strcpy(this->title, channel->title);
72 this->entry = channel->entry;
73 this->freqtable = channel->freqtable;
74 this->fine_tune = channel->fine_tune;
75 this->input = channel->input;
76 this->norm = channel->norm;
77 this->device_index = channel->device_index;
78 this->tuner = channel->tuner;
79 this->audio_pid = channel->audio_pid;
80 this->video_pid = channel->video_pid;
83 void Channel::copy_usage(Channel *channel)
85 this->use_frequency = channel->use_frequency;
86 this->use_fine = channel->use_fine;
87 this->use_norm = channel->use_norm;
88 this->use_input = channel->use_input;
89 this->has_scanning = channel->has_scanning;
92 int Channel::load(FileXML *file)
100 done = file->read_tag();
103 if(file->tag.title_is("CHANNEL"))
105 entry = file->tag.get_property("ENTRY", entry);
106 freqtable = file->tag.get_property("FREQTABLE", freqtable);
107 fine_tune = file->tag.get_property("FINE_TUNE", fine_tune);
108 input = file->tag.get_property("INPUT", input);
109 norm = file->tag.get_property("NORM", norm);
110 device_index = file->tag.get_property("DEVICE_INDEX", device_index);
111 tuner = file->tag.get_property("TUNER", tuner);
112 audio_pid = file->tag.get_property("AUDIO_PID", audio_pid);
113 video_pid = file->tag.get_property("VIDEO_PID", video_pid);
114 text = file->read_text();
118 if(file->tag.title_is("/CHANNEL"))
125 int Channel::save(FileXML *file)
127 file->tag.set_title("CHANNEL");
128 file->tag.set_property("ENTRY", entry);
129 file->tag.set_property("FREQTABLE", freqtable);
130 file->tag.set_property("FINE_TUNE", fine_tune);
131 file->tag.set_property("INPUT", input);
132 file->tag.set_property("NORM", norm);
133 file->tag.set_property("DEVICE_INDEX", device_index);
134 file->tag.set_property("TUNER", tuner);
135 file->tag.set_property("AUDIO_PID", audio_pid);
136 file->tag.set_property("VIDEO_PID", video_pid);
138 file->append_text(title);
139 file->tag.set_title("/CHANNEL");
141 file->append_newline();
146 void Channel::load_defaults(BC_Hash *defaults)
148 freqtable = defaults->get("SCAN_FREQTABLE", freqtable);
149 input = defaults->get("SCAN_INPUT", input);
150 norm = defaults->get("SCAN_NORM", norm);
153 void Channel::save_defaults(BC_Hash *defaults)
155 defaults->update("SCAN_FREQTABLE", freqtable);
156 defaults->update("SCAN_INPUT", input);
157 defaults->update("SCAN_NORM", norm);
164 // c-file-style: "linux"