本文整理汇总了C++中Hydrogen::startExportSong方法的典型用法代码示例。如果您正苦于以下问题:C++ Hydrogen::startExportSong方法的具体用法?C++ Hydrogen::startExportSong怎么用?C++ Hydrogen::startExportSong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hydrogen
的用法示例。
在下文中一共展示了Hydrogen::startExportSong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
if ( drumkitInfo ) {
pHydrogen->loadDrumkit( drumkitInfo );
} else {
___ERRORLOG ( "Error loading the drumkit" );
}
}
AudioEngine* AudioEngine = AudioEngine::get_instance();
Sampler* sampler = AudioEngine->get_sampler();
switch ( interpolation ) {
case 1:
sampler->setInterpolateMode( Sampler::COSINE );
break;
case 2:
sampler->setInterpolateMode( Sampler::THIRD );
break;
case 3:
sampler->setInterpolateMode( Sampler::CUBIC );
break;
case 4:
sampler->setInterpolateMode( Sampler::HERMITE );
break;
case 0:
default:
sampler->setInterpolateMode( Sampler::LINEAR );
}
EventQueue *pQueue = EventQueue::get_instance();
signal(SIGINT, signal_handler);
bool ExportMode = false;
if ( ! outFilename.isEmpty() ) {
pHydrogen->startExportSong ( outFilename, rate, bits );
cout << "Export Progress ... ";
bool ExportMode = true;
}
// Interactive mode
while ( ! quit ) {
/* FIXME: Someday here will be The Real CLI ;-) */
Event event = pQueue->pop_event();
// if ( event.type > 0) cout << "EVENT TYPE: " << event.type << endl;
/* Event handler */
switch ( event.type ) {
case EVENT_PROGRESS: /* event used only in export mode */
if ( ! ExportMode ) break;
if ( event.value < 100 ) {
cout << "\rExport Progress ... " << event.value << "%";
} else {
cout << "\rExport Progress ... DONE" << endl;
quit = true;
}
break;
case EVENT_PLAYLIST_LOADSONG: /* Load new song on MIDI event */
if ( pPlaylist->loadSong ( event.value ) ) {
pSong = pHydrogen->getSong();
show_playlist ( pHydrogen, pPlaylist->getActiveSongNumber() );
}
break;
case EVENT_NONE: /* Sleep if there is no more events */
Sleeper::msleep ( 100 );
break;
}