mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-23 01:18:46 +00:00
parent
afb32cfe1a
commit
df6213ed79
2 changed files with 31 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue