当前位置: 首页>>代码示例>>C++>>正文


C++ Controller::choose_clip方法代码示例

本文整理汇总了C++中Controller::choose_clip方法的典型用法代码示例。如果您正苦于以下问题:C++ Controller::choose_clip方法的具体用法?C++ Controller::choose_clip怎么用?C++ Controller::choose_clip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller::choose_clip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: key_press_event


//.........这里部分代码省略.........
        case CLUTTER_KEY_0:
        case CLUTTER_KEY_1:
        case CLUTTER_KEY_2:
        case CLUTTER_KEY_3:
        case CLUTTER_KEY_4:
        case CLUTTER_KEY_5:
        case CLUTTER_KEY_6:
        case CLUTTER_KEY_7:
        case CLUTTER_KEY_8:
        case CLUTTER_KEY_9:
        {   // need to use brackets when declaring variable inside case
            //* Switch the current clip according to a gdk key value from 0 to 9
            //* keyval should be one of :
            //* GDK_0 GDK_1 GDK_2 GDK_3 GDK_4 GDK_5 GDK_6 GDK_7 GDK_8 GDK_9
            //* Of course, any other value might lead to a crash.
            // FIXME:2010-08-17:aalex:Doing arithmetics with a gdk keyval is a hack
            unsigned int number_pressed = (keyval & 0x0F);
            if (ctrl_pressed)
            {
                if (number_pressed == 0)
                    context->set_layout(LAYOUT_SPLITSCREEN);
                else if (number_pressed == 1)
                    context->set_layout(LAYOUT_PLAYBACK_ONLY);
                else if (number_pressed == 2)
                    context->set_layout(LAYOUT_OVERLAY);
                else if (number_pressed == 3)
                    context->set_layout(LAYOUT_PORTRAIT);
                else if (number_pressed == 4)
                    context->set_layout(LAYOUT_LIVEFEED_ONLY);
                else
                    std::cout << "No layout with number " << number_pressed << std::endl;
            }
            else if (shift_pressed)
                controller->choose_clip_and_add_frame(number_pressed);
            else
                controller->choose_clip(number_pressed);
            break;
        }
        case CLUTTER_KEY_q:
            // Quit application on ctrl-q, this quits the main loop
            // (if there is one)
            if (ctrl_pressed)
            {
                if (verbose)
                    g_print("Ctrl-Q key pressed, quitting.\n");
                context->owner_->quit();
            }
            break;
        case CLUTTER_KEY_s:
            // Ctrl-s: Save the whole project
            if (ctrl_pressed)
            {
                //if (verbose)
                controller->save_project();
                g_print("Saved the whole project.\n");
            } else // no Ctrl pressed
                g_print("Warning: Use Ctrl-E to export the current clip as a movie file, or Ctrl-s to save the whole project.\n");
            break;
        case CLUTTER_KEY_e:
            // Ctrl-e: Exports the current clip
            // (if there is one)
            if (ctrl_pressed)
            {
                if (verbose)
                    g_print("Exporting the current clip.");
                controller->save_current_clip();
开发者ID:AmineYaiche,项目名称:toonloop,代码行数:67,代码来源:gui.cpp


注:本文中的Controller::choose_clip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。