home *** CD-ROM | disk | FTP | other *** search
- /*============================================================
-
- N-Music/Sound Sample program
-
- ============================================================*/
-
- #include "N_Library.h"
-
- short Data_Rsrc = 0;
- short Sounds[] = { 9000,0 }; //Used SND ID
- short Music1[] = { 9000,-1 }; //Music sequance {9000,9000,9000,9000,,,,,,}
-
- void main(void)
- {
- WindowPtr window;
-
- ToolboxInit();
- ColorCheck();
- HideMenuBar();
- window = GetNewWindow (128,nil,(WindowPtr)-1L );
- N_Window_Set(window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
- Open_Resource_File(128,1,&Data_Rsrc);
- N_Pict_Draw(128,0,0,(GrafPtr)window,true);
- N_Sound_Load(&Sounds[0]); //load sounds
- Close_Resource_File(&Data_Rsrc);
- N_Music_Set(1,&Music1[0]); //set up music 1
- N_Music_Play(1); //play music 1
- do
- {
- }
- while (!Button());
- N_Music_Out(180); //fade out (3sec)
- do
- {
- }
- while (FO_Flag == true); //wait for fade out is done.
- N_Music_Kill(); //release music driver
- N_Sound_Close(); //close sound channels
- FlushEvents( everyEvent, 0 );
- ShowMenuBar();
- ColorRevert();
- }
-
-