openMSX
LaserdiscPlayerCLI.cc
Go to the documentation of this file.
1 #include "LaserdiscPlayerCLI.hh"
2 #include "CommandLineParser.hh"
4 #include "MSXException.hh"
5 #include "TclObject.hh"
6 
7 using std::deque;
8 using std::string;
9 
10 namespace openmsx {
11 
13  : parser(parser_)
14 {
15  parser.registerOption("-laserdisc", *this);
16  parser.registerFileClass("laserdiscimage", *this);
17 }
18 
19 void LaserdiscPlayerCLI::parseOption(const string& option, deque<string>& cmdLine)
20 {
21  parseFileType(getArgument(option, cmdLine), cmdLine);
22 }
23 
25 {
26  return "Put laserdisc image specified in argument in "
27  "virtual laserdiscplayer";
28 }
29 
30 void LaserdiscPlayerCLI::parseFileType(const string& filename,
31  deque<string>& /*cmdLine*/)
32 {
33  if (!parser.getGlobalCommandController().hasCommand("laserdiscplayer")) {
34  throw MSXException("No laserdiscplayer.");
35  }
37  command.addListElement("laserdiscplayer");
38  command.addListElement("insert");
39  command.addListElement(filename);
40  command.executeCommand();
41 }
42 
44 {
45  return "Laserdisc image, Ogg Vorbis/Theora";
46 }
47 
48 } // namespace openmsx