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