本文整理汇总了C++中SyncDocument::getSetKeyFrameCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncDocument::getSetKeyFrameCommand方法的具体用法?C++ SyncDocument::getSetKeyFrameCommand怎么用?C++ SyncDocument::getSetKeyFrameCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncDocument
的用法示例。
在下文中一共展示了SyncDocument::getSetKeyFrameCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: editToggleInterpolationType
void TrackView::editToggleInterpolationType()
{
SyncDocument *doc = getDocument();
if (NULL == doc) return;
if (editTrack < int(getTrackCount())) {
size_t trackIndex = doc->getTrackIndexFromPos(editTrack);
const sync_track *t = doc->tracks[trackIndex];
int idx = key_idx_floor(t, editRow);
if (idx < 0) {
MessageBeep(~0U);
return;
}
// copy and modify
track_key newKey = t->keys[idx];
newKey.type = (enum key_type)
((newKey.type + 1) % KEY_TYPE_COUNT);
// apply change to data-set
SyncDocument::Command *cmd = doc->getSetKeyFrameCommand(int(trackIndex), newKey);
doc->exec(cmd);
// update user interface
SendMessage(GetParent(getWin()), WM_CURRVALDIRTY, 0, 0);
InvalidateRect(getWin(), NULL, FALSE);
}
else
MessageBeep(~0U);
}
示例2: editEnterValue
void TrackView::editEnterValue()
{
SyncDocument *doc = getDocument();
if (NULL == doc) return;
if (int(editString.size()) > 0 && editTrack < int(getTrackCount()))
{
size_t trackIndex = doc->getTrackIndexFromPos(editTrack);
const sync_track *t = doc->tracks[trackIndex];
track_key newKey;
newKey.type = KEY_STEP;
newKey.row = editRow;
int idx = sync_find_key(t, editRow);
if (idx >= 0)
newKey = t->keys[idx]; // copy old key
newKey.value = float(atof(editString.c_str())); // modify value
editString.clear();
SyncDocument::Command *cmd = doc->getSetKeyFrameCommand(int(trackIndex), newKey);
doc->exec(cmd);
SendMessage(GetParent(getWin()), WM_CURRVALDIRTY, 0, 0);
InvalidateRect(getWin(), NULL, FALSE);
}
else
MessageBeep(~0U);
}
示例3: editBiasValue
void TrackView::editBiasValue(float amount)
{
SyncDocument *doc = getDocument();
if (NULL == doc) return;
int selectLeft = min(selectStartTrack, selectStopTrack);
int selectRight = max(selectStartTrack, selectStopTrack);
int selectTop = min(selectStartRow, selectStopRow);
int selectBottom = max(selectStartRow, selectStopRow);
if (0 == getTrackCount()) {
MessageBeep(~0U);
return;
}
SyncDocument::MultiCommand *multiCmd = new SyncDocument::MultiCommand();
for (int track = selectLeft; track <= selectRight; ++track) {
assert(track < int(getTrackCount()));
size_t trackIndex = doc->getTrackIndexFromPos(track);
const sync_track *t = doc->tracks[trackIndex];
for (int row = selectTop; row <= selectBottom; ++row) {
int idx = sync_find_key(t, row);
if (idx >= 0) {
struct track_key k = t->keys[idx]; // copy old key
k.value += amount; // modify value
// add sub-command
SyncDocument::Command *cmd = doc->getSetKeyFrameCommand(int(trackIndex), k);
multiCmd->addCommand(cmd);
}
}
}
if (0 == multiCmd->getSize()) {
MessageBeep(~0U);
delete multiCmd;
}
else
{
doc->exec(multiCmd);
SendMessage(GetParent(getWin()), WM_CURRVALDIRTY, 0, 0);
invalidateRange(selectLeft, selectRight, selectTop, selectBottom);
}
}