openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
laserdisc
LaserdiscPlayerCLI.cc
Go to the documentation of this file.
1
#include "
LaserdiscPlayerCLI.hh
"
2
#include "
CommandLineParser.hh
"
3
#include "
GlobalCommandController.hh
"
4
#include "
MSXException.hh
"
5
#include "
TclObject.hh
"
6
7
using
std::deque;
8
using
std::string;
9
10
namespace
openmsx {
11
12
LaserdiscPlayerCLI::LaserdiscPlayerCLI
(
CommandLineParser
& parser_)
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
24
string_ref
LaserdiscPlayerCLI::optionHelp
()
const
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
}
36
TclObject
command(parser.
getGlobalCommandController
().
getInterpreter
());
37
command.
addListElement
(
"laserdiscplayer"
);
38
command.addListElement(
"insert"
);
39
command.addListElement(filename);
40
command.executeCommand();
41
}
42
43
string_ref
LaserdiscPlayerCLI::fileTypeHelp
()
const
44
{
45
return
"Laserdisc image, Ogg Vorbis/Theora"
;
46
}
47
48
}
// namespace openmsx
Generated on Mon May 20 2013 12:16:58 for openMSX by
1.8.1.2