本文整理汇总了C++中Plugin::copy_from方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::copy_from方法的具体用法?C++ Plugin::copy_from怎么用?C++ Plugin::copy_from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::copy_from方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: move_effect
void Tracks::move_effect(Plugin *plugin,
PluginSet *dest_plugin_set,
Track *dest_track,
int64_t dest_position)
{
Track *source_track = plugin->track;
Plugin *result = 0;
// Insert on an existing plugin set
if(!dest_track && dest_plugin_set)
{
Track *dest_track = dest_plugin_set->track;
// Assume this operation never splits a plugin
// Shift destination plugins back
dest_plugin_set->shift(dest_position, plugin->length);
// Insert new plugin
Plugin *current = 0;
for(current = (Plugin*)dest_plugin_set->first; current; current = (Plugin*)NEXT)
if(current->startproject >= dest_position) break;
result = (Plugin*)dest_plugin_set->insert_before(current,
new Plugin(edl, dest_plugin_set, ""));
}
else
// Create a new plugin set
{
double length = 0;
double start = 0;
if(edl->local_session->get_selectionend() >
edl->local_session->get_selectionstart())
{
start = edl->local_session->get_selectionstart();
length = edl->local_session->get_selectionend() -
start;
}
else
if(dest_track->get_length() > 0)
{
start = 0;
length = dest_track->get_length();
}
else
{
start = 0;
length = dest_track->from_units(plugin->length);
}
result = dest_track->insert_effect("",
&plugin->shared_location,
0,
0,
start,
length,
plugin->plugin_type);
}
result->copy_from(plugin);
result->shift(dest_position - plugin->startproject);
// Clear new plugin from old set
plugin->plugin_set->clear(plugin->startproject,
plugin->startproject + plugin->length,
edl->session->autos_follow_edits);
source_track->optimize();
}