本文整理汇总了C++中fmod::System::attachFileSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ System::attachFileSystem方法的具体用法?C++ System::attachFileSystem怎么用?C++ System::attachFileSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::System
的用法示例。
在下文中一共展示了System::attachFileSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel = 0;
FMOD_RESULT result;
int key;
unsigned int version;
memset(gCurrentTrackArtist, 0, 256);
memset(gCurrentTrackTitle, 0, 256);
strcpy(gOutputFileName, "output.mp3"); /* Start off like this then rename if a title tag comes along */
printf("======================================================================\n");
printf("RipNetStream Example. Copyright (c) Firelight Technologies 2004-2014.\n");
printf("======================================================================\n\n");
if (argc < 2)
{
printf("Usage: ripnetstream <url>\n");
return -1;
}
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION);
return 0;
}
result = system->init(100, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);
result = system->setStreamBufferSize(gFileBufferSize, FMOD_TIMEUNIT_RAWBYTES);
ERRCHECK(result);
result = system->attachFileSystem(myopen, myclose, myread, 0);
ERRCHECK(result);
printf("Buffering...\n\n");
result = system->createSound(argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound);
ERRCHECK(result);
/*
Main loop
*/
do
{
static bool mute = false;
if (sound && !channel)
{
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
}
if (_kbhit())
{
key = _getch();
switch (key)
{
case ' ' :
{
if (channel)
{
bool paused;
channel->getPaused(&paused);
channel->setPaused(!paused);
}
break;
}
case 'm' :
case 'M' :
{
if (channel)
{
channel->getMute(&mute);
channel->setMute(!mute);
}
break;
}
}
}
system->update();
if (channel)
{
bool playing = false;
int tagsupdated = 0;
//.........这里部分代码省略.........