음악 계속 듣다가 4번 누르면 음악은 계속 틀어 지면서 메인 함수로 빠지고 싶은데...
뭘 어떻게 해야 되지?
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
#include "inc/fmod.hpp"
#pragma comment (lib, "fmodex_vc.lib")
using namespace FMOD;
System* pSystem;
Sound* pSound[2];
Channel* pChannel[2];
////////////////////////////////////////////////////////////////
#define MAX 99
#define KEY_SIZ 5
#define NAME_SIZ 17
#define QUALITY_SIZ 17
#define COUNTRY_SIZ 17
#define DEGREE_SIZ 17
#define YEAR_SIZ 17
#define PRICE_SIZ 17
#define BUY_SIZ 5
#define REVIEW_SIZ 2048
FILE *fp, *fp1, *fp2, *fp3;
void fun_init(void);
void fun_input(void);
void fun_call(void);
void fun_rank(void);
void clrscr(void);
void fun_end(void);
int open(void);
int open2(void);
int open3(void);
int open4(void);
void DEF(void);
void fun_admin(void);
void fun_adminmenu(void);
void fun_del(void);
void fun_backup(void);
void fun_reload(void);
int count=0;
struct MASTER {
char key[KEY_SIZ];
char name[NAME_SIZ];
char quality[QUALITY_SIZ];
char country[COUNTRY_SIZ];
char degree[DEGREE_SIZ];
char year[YEAR_SIZ];
char price[PRICE_SIZ];
char review[REVIEW_SIZ];
} a[MAX], b[MAX];
struct MASTER2 {
char name[NAME_SIZ];
char buy[BUY_SIZ];
} c[MAX];
void setColor( WORD f, WORD b ){
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), f | b );
}
//////////////////////////////////////////////////////////////////////////////////////////////////
int music(void)
{
System_Create(&pSystem);
pSystem->init(2, FMOD_INIT_NORMAL, 0);
pSystem->createSound( "BKSound.MID", FMOD_HARDWARE, 0, &pSound[0]);
pSystem->createSound( "효과음-성공.mp3", FMOD_LOOP_OFF | FMOD_HARDWARE, 0, &pSound[1]);
while(true)
{
int Input;
cout<<"1. 배경음 ON"<<endl;
cout<<"2. 배경음 OFF"<<endl;
cout<<"3. 효과음"<<endl;
cout<<"4. 메인시작"<<endl;
cout<<"입력 : ";
cin>>Input;
switch( Input )
{
case 1:
{
pSystem->playSound(FMOD_CHANNEL_REUSE , pSound[0] , 0 , &pChannel[0] );
break;
}
case 2:
{
pChannel[0]->stop();
break;
}
case 3:
{
pSystem->playSound(FMOD_CHANNEL_REUSE , pSound[1] , 0 , &pChannel[1] );
break;
}
case 4:
{
main();
break;
}
}
}
pSound[0]->release();
pSound[1]->release();
pSystem->release();
pSystem->close();
return false;
}
int main()
{
int num;
bool a;
printf("먼저 음악을 키고 시작 하겠습니다\n");
printf("1.번 음악, 2번 메인");
scanf("%d",&num);
if(num==1)
{
a=music();
}
else if(num==2)
{
}
}
\'main\' Undeclared identifier 뜨는데...아 왜 메인 함수를 호출 못하지? 뭐가 문제지?ㅠㅠ
win32 console application 으로 안만들었을게 뻔하지
콘솔창으로 만들었는데 ㅠㅠ
헉!
아 음악은 겨우 띄웠는데 메인을 호출 못하니 이거 원 음악만 주구장창 듣게 생겼네 작업은 못하고
음악듣다가 4번 누르면 MAIN함수로 오게 어떻게 해야되지? 아무리 생각해도 못짜겠네
아 미치겠네 밤이라 그런가 main 문도 잘못했네 음악듣다가 4번 누르면 메인으로 다시 가서 메인 동작 하고 싶은데.....
걍 첨부터 다시해 main이나 제대로 돌아가는지 보고