本文整理汇总了C++中Cue::setEndTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Cue::setEndTime方法的具体用法?C++ Cue::setEndTime怎么用?C++ Cue::setEndTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cue
的用法示例。
在下文中一共展示了Cue::setEndTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(CueSettings,EmptyCue)
{
// Avoid using references to const values in EXPECT_EQ statements
const Cue::Align defaultAlign = Cue::defaultAlign;
const int defaultLine = Cue::defaultLine;
const int defaultPosition = Cue::defaultPosition;
const int defaultSize = Cue::defaultSize;
const bool defaultSnapToLines = Cue::defaultSnapToLines;
const Cue::Vertical defaultVertical = Cue::defaultVertical;
// Trying to set empty cue settings should always fail
Cue cue;
// Id
cue.setId("Phnglui mglw nafh Cthulhu R'lyeh wgah nagl fhtagn");
EXPECT_STREQ("", cue.id());
// Text
cue.setText("Phnglui mglw nafh Cthulhu R'lyeh wgah nagl fhtagn");
EXPECT_STREQ("", cue.text());
// StartTime
cue.setStartTime(68.067);
EXPECT_EQ(MalformedTimestamp, cue.startTime());
// EndTime
cue.setEndTime(98.678);
EXPECT_EQ(MalformedTimestamp, cue.endTime());
// Align
EXPECT_FALSE(cue.setAlign(Cue::Start));
EXPECT_FALSE(cue.setAlign(Cue::Middle));
EXPECT_FALSE(cue.setAlign(Cue::End));
EXPECT_FALSE(cue.setAlign(Cue::Left));
EXPECT_FALSE(cue.setAlign(Cue::Right));
EXPECT_FALSE(cue.setAlign("start"));
EXPECT_FALSE(cue.setAlign("middle"));
EXPECT_FALSE(cue.setAlign("end"));
EXPECT_FALSE(cue.setAlign("left"));
EXPECT_FALSE(cue.setAlign("right"));
EXPECT_EQ(defaultAlign,cue.align());
// Line
EXPECT_FALSE(cue.setLine(0, false));
EXPECT_FALSE(cue.setLine(0, false));
EXPECT_FALSE(cue.setLine(-101, true));
EXPECT_FALSE(cue.setLine(101, true));
EXPECT_FALSE(cue.setLine("0%"));
EXPECT_FALSE(cue.setLine("100%"));
EXPECT_FALSE(cue.setLine("-101"));
EXPECT_FALSE(cue.setLine("1001"));
EXPECT_EQ(defaultLine, cue.line());
EXPECT_EQ(defaultSnapToLines, cue.snapToLines());
// Position
EXPECT_FALSE(cue.setPosition(0));
EXPECT_FALSE(cue.setPosition(100));
EXPECT_FALSE(cue.setPosition("0%"));
EXPECT_FALSE(cue.setPosition("100%"));
EXPECT_EQ(defaultPosition, cue.position());
// Size
EXPECT_FALSE(cue.setSize(0));
EXPECT_FALSE(cue.setSize(100));
EXPECT_FALSE(cue.setSize("0%"));
EXPECT_FALSE(cue.setSize("100%"));
EXPECT_EQ(defaultSize, cue.size());
// Vertical
EXPECT_FALSE(cue.setVertical(Cue::Horizontal));
EXPECT_FALSE(cue.setVertical(Cue::VerticalLeftToRight));
EXPECT_FALSE(cue.setVertical(Cue::VerticalRightToLeft));
EXPECT_FALSE(cue.setVertical(""));
EXPECT_FALSE(cue.setVertical("lr"));
EXPECT_FALSE(cue.setVertical("rl"));
EXPECT_EQ(defaultVertical, cue.vertical());
}