本文整理汇总了C++中Hydrogen::loadDrumkit方法的典型用法代码示例。如果您正苦于以下问题:C++ Hydrogen::loadDrumkit方法的具体用法?C++ Hydrogen::loadDrumkit怎么用?C++ Hydrogen::loadDrumkit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hydrogen
的用法示例。
在下文中一共展示了Hydrogen::loadDrumkit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
/* Load first song */
preferences->setLastPlaylistFilename( playlistFilename );
pPlaylist->loadSong( 0 );
pSong = pHydrogen->getSong();
show_playlist ( pHydrogen, pPlaylist->getActiveSongNumber() );
}
// Load song - if wasn't already loaded with playlist
if ( ! pSong ) {
if ( !songFilename.isEmpty() ) {
pSong = Song::load( songFilename );
} else {
/* Try load last song */
bool restoreLastSong = preferences->isRestoreLastSongEnabled();
QString filename = preferences->getLastSongFilename();
if ( restoreLastSong && ( !filename.isEmpty() ))
pSong = Song::load( filename );
}
/* Still not loaded */
if (! pSong) {
___INFOLOG("Starting with empty song");
pSong = Song::get_empty_song();
pSong->set_filename( "" );
}
pHydrogen->setSong( pSong );
preferences->setLastSongFilename( songFilename );
}
if ( ! drumkitToLoad.isEmpty() ){
Drumkit* drumkitInfo = Drumkit::load_by_name( drumkitToLoad, true );
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 );