Revision 59be6a47 src/controlledconnection.cpp

View differences:

src/controlledconnection.cpp
142 142
    // TUNE <type> <channel> <priority>
143 143
    // (Used to tune/retune)
144 144
    else if (words[0] == "TUNE") {
145
      if (words.size() != 4) 
146
	writeControl("ERROR TUNE WRONG NUMBER OF ARGS (Expected 3, got " +
145
      if (words.size() != 5) 
146
	writeControl("ERROR TUNE WRONG NUMBER OF ARGS (Expected 4, got " +
147 147
		     ::toString(words.size() - 1) + ")\n");
148 148
      else {
149 149
	const std::string &type = words[1];
150 150
	std::string channel = unescapeWS(words[2]);
151
	int priority = toInt(words[3]);
151
	bool convertToPS = toBool(words[3]);
152
	int priority = toInt(words[4]);
152 153

  
153 154
	// Check the arguments
154 155
	if (!isValidType(type)) 
......
159 160
	  writeControl( "ERROR TUNE INSUFFICIENT PRIORITY ("+::toString(priority)+")\n");
160 161
	}
161 162
	else {
162
	  bool result = tune(type, channel, priority);
163
	  bool result = tune(type, channel, convertToPS, priority);
163 164
	  if (result)
164 165
	    writeControl( "OK\n");
165 166
	  else 
......
169 170
    }
170 171
    // SCHEDULE <date> <time> <type> <channel> <priority> <duration> <path>
171 172
    else if (words[0] == "SCHEDULE") {
172
      if (words.size() != 8) 
173
	writeControl("ERROR SCHEDULE WRONG NUMBER OF ARGS (Expected 7, got " +
173
      if (words.size() != 9) 
174
	writeControl("ERROR SCHEDULE WRONG NUMBER OF ARGS (Expected 8, got " +
174 175
		     ::toString(words.size() - 1) + ")\n");
175 176
      else {
176 177
	std::string dateTime = words[1] + " " + words[2];
......
183 184

  
184 185
	  const std::string &type = words[3];
185 186
	  const std::string channel = unescapeWS(words[4]);
186
	  int priority = toInt(words[5]);
187
	  int duration = toInt(words[6]);	// duration in seconds
188
	  const std::string path = unescapeWS(words[7]);
187
	  bool convertToPS = toBool(words[5]);
188
	  int priority = toInt(words[6]);
189
	  int duration = toInt(words[7]);	// duration in seconds
190
	  const std::string path = unescapeWS(words[8]);
189 191
	  pid_t pid = 0;
190 192
	  uid_t uid = 0;
191 193
	  gid_t gid = 0;
......
205 207
	    std::cerr << "Scheduling recording for " << theTime 
206 208
		      << " (now " << time(NULL) << ")\n";
207 209

  
208
	    Recording r(type, channel, priority, theTime, duration, path, uid);
210
	    Recording r(type, channel, convertToPS, priority, theTime, duration, path, uid);
209 211
	    scheduler->add(r);
210 212
	    std::cerr << "Job number is " << r.getJob() << "\n";
211 213
	    writeControl("JOB " + ::toString(r.getJob()) + "\n");

Also available in: Unified diff