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


C++ Workspace::stockToList方法代码示例

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


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

示例1: main

int main(int argc, char ** argv){
    QApplication app(argc, argv);
    app.setApplicationName(QObject::tr("ImproGui"));

    QsLogging::Logger& logger  = QsLogging::Logger::instance();
    logger.setLoggingLevel(QsLogging::TraceLevel);
    const QString sLogPath(QDir(app.applicationDirPath()).filePath("log.txt"));
    QsLogging::DestinationPtr fileDestination( QsLogging::DestinationFactory::MakeFileDestination(sLogPath) );
    QsLogging::DestinationPtr debugDestination( QsLogging::DestinationFactory::MakeDebugOutputDestination() );
    logger.addDestination(debugDestination.get());
    logger.addDestination(fileDestination.get());


    QLOG_TRACE() << "Logging initiated";

    // manually set some file paths for scaffolding
    // load it in the workspace using the workspace API
    // with the appropriate settings for all the Track properties
    Workspace * activeWorkspace = new Workspace(0);

    Track * t;

    // scaffholding
    // load file list from ".txt"
    // this is temporary
    QFile file("./filestoload.txt");
    if(!file.open(QIODevice::ReadOnly)) {
        QLOG_ERROR() << file.errorString();
        return 1;
    }

    QLOG_TRACE() << "Loading file " << file.fileName() ;
    QTextStream in(&file);
    int index=0;
    while(!in.atEnd()) {
        QString line = in.readLine();
        QLOG_TRACE() << "Reading line: " << line ;
        QStringList fields = line.split(",");
        if(fields.size() < 8 ){
            QLOG_TRACE() << "Line unreadable";
        }else{
            t = new Track(
                        fields[0], // file name
                        ("true" == fields[1].toLower()), // loop
                        fields[2].toInt(), // start
                        fields[3].toInt(), // stop
                        fields[4].toInt(), // fade in
                        fields[5].toInt(), // fade out
                        ("true" == fields[6].toLower()), // showFilename
                        activeWorkspace
                        );

            index = activeWorkspace->addTrack(t);
            if( ("b" == fields[7].toLower()) ){
                activeWorkspace->stockToButtons(index);
            }else{
                activeWorkspace->stockToList(index);
            }
        };
    }


    // give the workspace to the media player (or use the controller as a broker between them?)
    // the media player should register to the signals triggered when a track is added or remove from the playlist
    // ...

    // create a "Players" object to deal with controlling the players
    MediaPlayerFactory * mediaPlayerFactory = new GstMediaPlayerFactory();
    Players * players = new Players(mediaPlayerFactory);
    UiController controller(players,activeWorkspace);

    BasicUi ui(&controller);
    ui.setWorkspace(activeWorkspace);

    ui.show();
    app.exec();

    delete activeWorkspace;
    //delete player;
    QLOG_TRACE() << "Workspace deleted";

    return 0;
}
开发者ID:jbruggem,项目名称:jingles-impro,代码行数:83,代码来源:main.cpp


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