+ else if(keyword=="audio_count")
+ resize_list(audio_channels, args.toInt());
+ else if(keyword=="audio")
+ {
+ space = args.indexOf(' ');
+ audio_channels[args.mid(0, space).toInt()] = args.mid(space+1);
+ }
+ else if(keyword=="spu_count")
+ resize_list(spu_channels, args.toInt());
+ else if(keyword=="spu")
+ {
+ space = args.indexOf(' ');
+ spu_channels[args.mid(0, space).toInt()] = args.mid(space+1);
+ }
+ else if(keyword=="channels_end")
+ emit channels_changed();
+ else if(keyword=="current_audio")
+ {
+ current_audio_channel = convert_channel(args);
+ emit current_audio_channel_changed(current_audio_channel);
+ }
+ else if(keyword=="current_spu")
+ {
+ current_spu_channel = convert_channel(args);
+ emit current_spu_channel_changed(current_spu_channel);
+ }
+}
+
+int XinemaControl::convert_channel(const QString &arg)
+{
+ if(arg=="off")
+ return OFF;
+ else
+ return arg.toInt();
+}
+
+void XinemaControl::resize_list(QStringList &list, int size)
+{
+ while(list.size()>size)
+ list.removeLast();
+ while(list.size()<size)
+ list.append(QString());