// ******* PGMUS SECTION *************************************
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

void InitMusic()
{
	int n = 0;
	ref tmpref;

	//============ MAIN MENU ========================
	// added by NK so it can be done in code.
	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_main_menu";
	tmpref.files.l1.name = "MUSIC\PGMUS\TITLE.ogg";
	//============ MAIN THEME ========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_main_theme";
	tmpref.files.l1.name = "MUSIC\Main_Theme.ogg";
	//============ FINAL THEME  ======================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_final_theme";
	tmpref.files.l1.name = "MUSIC\March.ogg";
	//============ GOROD, PORT, ======================
	n++;

	//=========================| MUSIC FROM SEADOGS |=========================//MAXIMUS -->
	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_eng_town";
	tmpref.files.l1.name = "MUSIC\Eng_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_fra_town";
	tmpref.files.l1.name = "MUSIC\Fra_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_spa_town";
	tmpref.files.l1.name = "MUSIC\Spa_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_pir_town";
	tmpref.files.l1.name = "MUSIC\Pir_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_hol_town";
	tmpref.files.l1.name = "MUSIC\Hol_Town.ogg";
	n++;
	//=========================| MUSIC FROM SEADOGS |=========================//MAXIMUS <--

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gorod";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\VISTOWN1.ogg";
	tmpref.files.l2.name = "MUSIC\PGMUS\VISTOWN2.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gorod_2";
	tmpref.files.l1.name = "MUSIC\Gorod-2.ogg";
	//============ SHOP, TAVERN, SHIPYARD ============
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_shop";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\MERCHANT.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_shipyard";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\SHIPRITE.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_tavern";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\TAVERN1.ogg";
	tmpref.files.l2.name = "MUSIC\PGMUS\TAVERN2.ogg";
	tmpref.files.l3.name = "MUSIC\PGMUS\TAVERN3.ogg";
	tmpref.files.l4.name = "MUSIC\PGMUS\TAVERN4.ogg";
	//============ CHURCH ============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_church";
	tmpref.files.l1.name = "MUSIC\Church_Theme.ogg";
	tmpref.files.l2.name = "MUSIC\Sobor.ogg";
	//============ INCA TEMPLE, CAVES, DUNGEON, JAIL =======
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_coridor";
	tmpref.files.l1.name = "MUSIC\Cave_or_Dungeon_Walking.ogg";
	tmpref.files.l2.name = "MUSIC\Coridor.ogg";
	//============= GUBERNATOR =========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gubernator";
	tmpref.files.l1.name = "MUSIC\Governors_Theme.ogg";
	tmpref.files.l2.name = "MUSIC\Gubernator.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_govfriend";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\GOVFREND.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_govenemy";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\GOVENEMY.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_govreward";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\GOVREWRD.ogg";
	//============= JUNGLE SHORE, JUNGLE ===============
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_jungle";
	tmpref.files.l1.name = "MUSIC\Jungle.ogg";
	tmpref.files.l2.name = "MUSIC\Jungle_Shore_Exploration.ogg";
	//============= SPOKPLAVANIE =======================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_spokplavanie";
	tmpref.files.l1.name = "MUSIC\Spokplavanie.ogg";
	tmpref.files.l2.name = "MUSIC\Sailing01.ogg";
	//============= ENPLAVANIE =========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_enplavanie";
	tmpref.files.l1.name = "MUSIC\Enplavanie.ogg";
	tmpref.files.l2.name = "MUSIC\Sailing02.ogg";
	//============= STORM ==============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_storm";
	tmpref.files.l1.name = "MUSIC\Storm.ogg";
	//============= END_STORM ==============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_End_storm";
	tmpref.files.l1.name = "MUSIC\End_storm.ogg";
	//============= MAP ================================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_map";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\BIGTREAS.ogg";
	//============= FIGHTING ===========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_bitva";
	tmpref.files.l1.name = "MUSIC\Bitva1.ogg";
	tmpref.files.l2.name = "MUSIC\Bitva2.ogg";
	//============= ABORDAGE ============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_abordage";
	tmpref.files.l1.name = "MUSIC\Abordage.ogg";
	tmpref.files.l2.name = "MUSIC\Board_&_Capture.ogg";
	tmpref.files.l3.name = "MUSIC\Paluba.ogg";
	//============= SEA BATTLE =========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_sea_battle";
	tmpref.files.l1.name = "MUSIC\Sea_battle01.ogg";
	tmpref.files.l2.name = "MUSIC\Sea_battle02.ogg";
	tmpref.files.l3.name = "MUSIC\Sea_battle03.ogg";
	//============== SHIP_VICTORY ======================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_ship_victory";
	tmpref.files.l1.name = "MUSIC\Ship_victory01.ogg";
	tmpref.files.l2.name = "MUSIC\Ship_victory03.ogg";
	//============== SHIP_DEAD ==========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_ship_dead";
	tmpref.files.l1.name = "MUSIC\Ship_dead.ogg";
	//============== VICTORY ============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_victory";
	tmpref.files.l1.name = "MUSIC\Victori.ogg";
	//============== DEATH ===============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_death";
	tmpref.files.l1.name = "MUSIC\Death.ogg";
	//============== PLUNDER ===============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_plunder";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\PLUNDER.ogg";
	//============== DIVIDE PLUNDER ========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_divide";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\DIVPLUND.ogg";
	//============== GOV MR ========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_niece";
	tmpref.volume = "2.0";
	tmpref.files.l1.name = "MUSIC\PGMUS\NIECE.ogg";
	n++;

	trace("InitMusic: created " + n + " entries.");
}

void RegisterMusicScheme()
{
	//if (CheckDirectory("RESOURCE\Sounds\MUSIC\CTI", ".ogg") == 0) return;
	ref rms; makeref(rms, registered_music_schemes);
	int n = GetAttributesNum(rms);
	string lnode = "l" + n;
	rms.(lnode).id = "pgmus";
	rms.(lnode).resdir = "PGMUS";
	switch (LanguageGetLanguage())
	{
		case "Polish":
			rms.(lnode).name = "Piraci Gold!";
		break;
		// default:
			rms.(lnode).name = "Pirates Gold!";
	}
}
