本文整理汇总了C++中Note函数的典型用法代码示例。如果您正苦于以下问题:C++ Note函数的具体用法?C++ Note怎么用?C++ Note使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Note函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F(TModbusDeviceTest, OnValue)
{
FilterConfig("OnValueTest");
PModbusSlave slave = ModbusServer->SetSlave(
Config->PortConfigs[0]->DeviceConfigs[0]->SlaveId,
TModbusRange(
TServerRegisterRange(),
TServerRegisterRange(),
TServerRegisterRange(0, 1),
TServerRegisterRange()));
ModbusServer->Start();
PMQTTSerialObserver observer(new TMQTTSerialObserver(MQTTClient, Config));
observer->SetUp();
slave->Holding[0] = 0;
Note() << "LoopOnce()";
observer->LoopOnce();
MQTTClient->DoPublish(true, 0, "/devices/OnValueTest/controls/Relay 1/on", "1");
Note() << "LoopOnce()";
observer->LoopOnce();
ASSERT_EQ(500, slave->Holding[0]);
slave->Holding[0] = 0;
Note() << "LoopOnce() after slave update";
observer->LoopOnce();
slave->Holding[0] = 500;
Note() << "LoopOnce() after second slave update";
observer->LoopOnce();
}
示例2: while
void LeitnerNoteGenerator::generateBucket()
{
if (mSessionCurrentNumber != 0 && mSessionCurrentNumber % 2 == 0)
{
mWorkingBucket.clear();
mSuccessBucket.clear();
mSuccesSpeed -= 100;
std::cout << "New Speed:" << mSuccesSpeed << "\n";
}
for (int i = 0; i < mSessionSize; ++i)
{
int proposedNoteNumber = -1;
while (proposedNoteNumber == -1)
{
proposedNoteNumber = (rand() % 12) + mMinNote.getNumber() + 12*(mSessionCurrentNumber%2);
if (mChooseOnlyPlainNotes)
if (Note::isSharpOrFlat(proposedNoteNumber))
proposedNoteNumber = -1;
if (std::find(mWorkingBucket.begin(), mWorkingBucket.end(), Note(proposedNoteNumber)) != mWorkingBucket.end())
{
proposedNoteNumber = -1;
}
}
mWorkingBucket.push_back(Note(proposedNoteNumber));
}
mSessionCurrentNumber += 1;
mNoteHasBeenAnswered = true;
printBucketState();
}
示例3: TModbusRange
void TModbusDeviceTest::VerifyDDL24()
{
PModbusSlave slave = ModbusServer->SetSlave(
Config->PortConfigs[0]->DeviceConfigs[0]->SlaveId,
TModbusRange(
TServerRegisterRange(),
TServerRegisterRange(),
TServerRegisterRange(4, 19),
TServerRegisterRange()));
ModbusServer->Start();
PMQTTSerialObserver observer(new TMQTTSerialObserver(MQTTClient, Config));
observer->SetUp();
Note() << "LoopOnce()";
observer->LoopOnce();
MQTTClient->DoPublish(true, 0, "/devices/ddl24/controls/RGB/on", "10;20;30");
FakeSerial->Flush();
Note() << "LoopOnce()";
observer->LoopOnce();
ASSERT_EQ(10, slave->Holding[4]);
ASSERT_EQ(20, slave->Holding[5]);
ASSERT_EQ(30, slave->Holding[6]);
FakeSerial->Flush();
slave->Holding[4] = 32;
slave->Holding[5] = 64;
slave->Holding[6] = 128;
Note() << "LoopOnce() after slave update";
observer->LoopOnce();
}
示例4: Note
void
TempoDialog::updateBeatLabels(double qpm)
{
Composition &comp = m_doc->getComposition();
// If the time signature's beat is not a crotchet, need to show
// bpm separately
timeT beat = comp.getTimeSignatureAt(m_tempoTime).getBeatDuration();
if (beat == Note(Note::Crotchet).getDuration()) {
m_tempoBeatLabel->setText(tr(" bpm"));
m_tempoBeatLabel->show();
m_tempoBeat->hide();
m_tempoBeatsPerMinute->hide();
} else {
m_tempoBeatLabel->setText(" ");
timeT error = 0;
m_tempoBeat->setPixmap(NotePixmapFactory::makeNoteMenuPixmap(beat, error));
m_tempoBeat->setMaximumWidth(25);
if (error) {
m_tempoBeat->setPixmap
(NotePixmapFactory::makeToolbarPixmap("menu-no-note"));
}
m_tempoBeatsPerMinute->setText
(QString("= %1 ").arg
(int(qpm * Note(Note::Crotchet).getDuration() / beat)));
m_tempoBeatLabel->show();
m_tempoBeat->show();
m_tempoBeatsPerMinute->show();
}
}
示例5: rootKey
ChordPlayer::ChordPlayer(rt::Pitch::Pitch rtKy, rt::Channel::Channel chnnl, rt::Channel::Channel ntOnChnnl)
: rootKey(rtKy)
, Player(chnnl)
, NoteOnCallback(ntOnChnnl)
{
pitches.push_back(Note(rtKy,100));
pitches.push_back(Note(rtKy+4,100));
pitches.push_back(Note(rtKy+7,100));
pitches.push_back(Note(rtKy+12,100));
}
示例6: assert
int MySQL::Update(PSList* _list){
assert(NULL != _list);
try{
Note("=================>Size:%d<================", _list->size());
if(conn_->isClosed()){
Connect();
}
conn_->setAutoCommit(0);
int index = 0;
PSList::iterator it = _list->begin();
for(; it != _list->end(); it++, index++){
(*it)->executeUpdate();
Note("================> %d <=================", index);
}
conn_->commit();
}
catch(sql::SQLException &e){
conn_->rollback();
Error("MySQL exception: func=%s, line=%d, expno=%d, sqlstate=%s, expstr=%s",
__func__, __LINE__, e.getErrorCode(), e.getSQLState().c_str(), e.what());
return -1;
}
catch (std::runtime_error &e) {
conn_->rollback();
Error("Update runtime error: errstr=%s", e.what());
return -1;
}
return 1;
} //Update PSList
示例7: setContextHelpFor
int SegmentPencil::mouseMoveEvent(QMouseEvent *e)
{
// No need to propagate.
e->accept();
QPoint pos = m_canvas->viewportToContents(e->pos());
if (!m_newRect) {
setContextHelpFor(pos);
return RosegardenScrollView::NoFollow;
}
// If shift isn't being held down
if ((e->modifiers() & Qt::ShiftModifier) == 0) {
setContextHelp(tr("Hold Shift to avoid snapping to bar lines"));
} else {
clearContextHelp();
}
QRect tmpRect = m_canvas->getNewSegmentRect();
SnapGrid &snapGrid = m_canvas->grid();
setSnapTime(e, SnapGrid::SnapToBar);
int mouseX = pos.x();
// if mouse X is to the right of the original Press point
if (mouseX >= m_pressX) {
m_startTime = snapGrid.snapX(m_pressX, SnapGrid::SnapLeft);
m_endTime = snapGrid.snapX(mouseX, SnapGrid::SnapRight);
// Make sure the segment is never smaller than the smallest note.
if (m_endTime - m_startTime < Note(Note::Shortest).getDuration())
m_endTime = m_startTime + Note(Note::Shortest).getDuration();
} else { // we are to the left of the original Press point
m_startTime = snapGrid.snapX(mouseX, SnapGrid::SnapLeft);
m_endTime = snapGrid.snapX(m_pressX, SnapGrid::SnapRight);
// Make sure the segment is never smaller than the smallest note.
if (m_endTime - m_startTime < Note(Note::Shortest).getDuration())
m_startTime = m_endTime - Note(Note::Shortest).getDuration();
}
int leftX = snapGrid.getRulerScale()->getXForTime(m_startTime);
int rightX = snapGrid.getRulerScale()->getXForTime(m_endTime);
// Adjust the rectangle to go from leftX to rightX
tmpRect.setLeft(leftX);
tmpRect.setRight(rightX);
m_canvas->drawNewSegment(tmpRect);
return RosegardenScrollView::FollowHorizontal;
}
示例8: assert
void ribi::Music::Note::Test() noexcept
{
//Test exactly once
{
static bool is_tested{false};
if (is_tested) return;
is_tested = true;
}
//Test ToInt
{
assert(Note(Letter::C).ToInt() == 0);
assert(Note(0).ToInt() == 0);
assert(Note(0).ToStr() == "C");
}
}
示例9: switch
/*
@protected
*/
int ClientImpl::init() {
server_ = NULL;
switch(Load()) {
case -1:
Error("ClientImpl init failed");
return -1;
case 0:
server_ = new Client(timeout_, tcpaddr_);
Note("New Client: addr=%p", server_);
if(NULL == server_) {
Error("New Client failed");
return -1;
}
break;
}
return 1;
}
示例10: Note
void QExercise::startCheckAnswer()
{
mState = CheckAnswer;
mAnswerTimeInMs = mTime.elapsed();
mPresenter->setNoteNameVisible(true);
std::string evalMessage = "";
if ( mIgnoreOctaveNumberInAnswer )
{
mNoteAnswered = Note(mNoteToFind.getOctaveNumber(), mNoteAnswered.getIndexInOctave() );
}
bool success = mNoteGenerator->evaluateAnswer(mNoteAnswered, mAnswerTimeInMs, evalMessage);
mPresenter->setText( evalMessage.c_str() );
mNoteCount++;
//mPresenter->getStaff()->setNote( Note() );
QString dateTime = QDateTime::currentDateTime().toString();
QByteArray dateTimeData = dateTime.toUtf8();
mLog << dateTimeData.constData() << ";";
mLog << mNoteCount << ";";
mLog << mNoteToFind.getNumber() << ";";
mLog << mNoteToFind.getName(true) << ";";
mLog << mNoteAnswered.getNumber() << ";";
mLog << mNoteAnswered.getName(true) << ";";
mLog << mAnswerTimeInMs << ";";
mLog << success << ";";
mLog << std::endl;
nextState();
}
示例11: reset_last_notes
void Track_Pattern::reset_last_notes() {
for(int i=0;i<MAX_COLUMNS;i++) {
data.last_note[i]=Note(Note::NOTE_OFF);
}
}
示例12: getCurrentSegment
void
EditViewBase::slotSetSegmentDuration()
{
Segment *s = getCurrentSegment();
if (!s)
return ;
TimeDialog dialog(this, tr("Segment Duration"),
&getDocument()->getComposition(),
s->getStartTime(),
s->getEndMarkerTime() - s->getStartTime(),
Note(Note::Shortest).getDuration(), false);
if (dialog.exec() == QDialog::Accepted) {
SegmentReconfigureCommand *command =
new SegmentReconfigureCommand(tr("Set Segment Duration"),
&getDocument()->getComposition());
command->addSegment
(s, s->getStartTime(),
s->getStartTime() + dialog.getTime(),
s->getTrack());
CommandHistory::getInstance()->addCommand(command);
}
}
示例13: get_block_idx_at_pos
Track_Pattern::Note Track_Pattern::get_note(const Position& p_pos) {
int pb_idx = get_block_idx_at_pos( p_pos.tick );
ERR_FAIL_COND_V(pb_idx==-1,Note());
PatternBlock *bp=get_block(pb_idx);
ERR_FAIL_COND_V(bp==NULL,Note());
Position rel_pos( p_pos.tick-get_block_pos(pb_idx) , p_pos.column );
int tick_idx = bp->get_pattern()->data.get_exact_index(rel_pos);
if (tick_idx==INVALID_STREAM_INDEX)
return Note(); //return empty note, as pos in tick does not exist */
return bp->get_pattern()->data.get_index_value(tick_idx);
}
示例14: addNote
void Analyzer::addNote(char ch)
{
if(vowels.find(ch)!=string::npos)
{
notes.push_back(Note(getRandomDuration(),false));
}
}
示例15: TEXT
void FCompilerResultsLog::InternalLogEvent(const FCompilerEvent& InEvent, int32 InDepth)
{
const int EventTimeMs = (int)((InEvent.FinishTime - InEvent.StartTime) * 1000);
if(EventTimeMs >= EventDisplayThresholdMs)
{
// Skip display of the top-most event since that time has already been logged
if(InDepth > 0)
{
FString EventString = FString::Printf(TEXT("- %s"), *InEvent.Name);
if(InEvent.Counter > 0)
{
EventString.Append(FString::Printf(TEXT(" (%d)"), InEvent.Counter + 1));
}
FFormatNamedArguments Args;
Args.Add(TEXT("EventTimeMs"), EventTimeMs);
EventString.Append(FText::Format(LOCTEXT("PerformanceSummaryEventTime", " [{EventTimeMs} ms]"), Args).ToString());
FString IndentString = FString::Printf(TEXT("%*s"), (InDepth - 1) << 1, TEXT(""));
Note(*FString::Printf(TEXT("%s%s"), *IndentString, *EventString));
}
const int32 NumChildEvents = InEvent.ChildEvents.Num();
for(int32 i = 0; i < NumChildEvents; ++i)
{
InternalLogEvent(InEvent.ChildEvents[i].Get(), InDepth + 1);
}
}
}