Fixed: #795 #1460 Linux compile of new sound samples

--HG--
branch : sound_dev
This commit is contained in:
kaetemi 2012-04-12 00:27:03 +02:00
parent b486e22a96
commit 1b41357a43
2 changed files with 31 additions and 3 deletions

View file

@ -18,7 +18,11 @@
// STL includes
#include <stdio.h>
#include <conio.h>
#ifdef NL_OS_WINDOWS
# include <conio.h>
#else
# include <curses.h>
#endif
// NeL includes
#include <nel/misc/app_context.h>
@ -110,9 +114,16 @@ static void runSample()
printf("Press ANY other key to exit\n");
for (; ; )
{
#ifdef NL_OS_WINDOWS
if (_kbhit())
{
switch (_getch())
#else
char ch;
if (read(0, &ch, 1))
{
switch (ch)
#endif
{
case '+':
s_GroupController->setUserGain(s_GroupController->getUserGain() + 0.1f);

View file

@ -18,7 +18,11 @@
// STL includes
#include <stdio.h>
#include <conio.h>
#ifdef NL_OS_WINDOWS
# include <conio.h>
#else
# include <curses.h>
#endif
// NeL includes
#include <nel/misc/app_context.h>
@ -138,9 +142,16 @@ static void runSample()
printf("Press ANY other key to exit\n");
while (!s_AudioDecoder->isMusicEnded())
{
#ifdef NL_OS_WINDOWS
if (_kbhit())
{
switch (_getch())
#else
char ch;
if (read(0, &ch, 1))
{
switch (ch)
#endif
{
case '+':
s_GroupController->setUserGain(s_GroupController->getUserGain() + 0.1f);
@ -172,7 +183,13 @@ static void runSample()
printf("End of song\n");
printf("Press ANY key to exit\n");
while (!_kbhit()) { s_AudioMixer->update(); nlSleep(10); } _getch();
#ifdef NL_OS_WINDOWS
while (!_kbhit())
#else
char ch;
while (!read(0, &ch, 1))
#endif
{ s_AudioMixer->update(); nlSleep(10); }
return;
}