Beispiel #1
0
void manager_t::get_views( const std::string& display, std::vector<std::string>& views, int& default_index) const
{
    OCIO::ConstConfigRcPtr cfg = config();
    int num_views = cfg->getNumViews( display.c_str());
    std::string default_view = cfg->getDefaultView( display.c_str());
	default_index = 0;
	views.clear();

    for( int i = 0; i < num_views; ++i)
    {
        std::string vname = cfg->getView( display.c_str(), i);
        views.push_back( vname);

        if( default_view == vname)
            default_index = i;
    }
}
Beispiel #2
0
void viewer_t::change_display_device( int index)
{
    display_device_ = display_devices_[index];

    // refresh the list of transforms
    ocio_transform_combo_->blockSignals( true);
    ocio_transform_combo_->clear();

    OCIO::ConstConfigRcPtr config = app().ocio_manager().config();

    std::string default_transform = config->getDefaultView( display_device_.c_str());
    int num_transform_names = config->getNumViews( display_device_.c_str());

    int default_index = 0, new_index = -1;
    QStringList slist;

    for( int i = 0; i < num_transform_names; ++i)
    {
        std::string trname = config->getView( display_device_.c_str(), i);
        display_transforms_.push_back( trname);
        slist << trname.c_str();

        if( display_transform_ == trname)
            new_index = i;

        if( default_transform == trname)
            default_index = i;
    }

    ocio_transform_combo_->addItems( slist);

    if( new_index < 0)
        new_index = default_index;

    ocio_transform_combo_->setCurrentIndex( new_index);
    display_transform_ = ocio_transform_combo_->itemText( new_index).toStdString();
    ocio_transform_combo_->blockSignals( false);
	view_->display_transform_changed();
}
Beispiel #3
0
std::string manager_t::default_view( const std::string& display) const
{
    OCIO::ConstConfigRcPtr cfg = config();
	return cfg->getDefaultView( display.c_str());
}