music_gui.c
changeset 341 e41bddf39d9a
parent 193 0a7025304867
child 507 04b5403aaf6b
equal deleted inserted replaced
340:c1e4c28a90f2 341:e41bddf39d9a
    32 	_playlist_ezy_street,
    32 	_playlist_ezy_street,
    33 	msf.custom_1,
    33 	msf.custom_1,
    34 	msf.custom_2,
    34 	msf.custom_2,
    35 };
    35 };
    36 
    36 
       
    37 // Map the order of the song names to the numbers of the midi filenames
       
    38 static const int midi_idx[] = {
       
    39 	 0, // Tycoon DELUXE Theme
       
    40 	 2, // Easy Driver
       
    41 	 3, // Little Red Diesel
       
    42 	17, // Cruise Control
       
    43 	 7, // Don't Walk!
       
    44 	 9, // Fell Apart On Me
       
    45 	 4, // City Groove
       
    46 	19, // Funk Central
       
    47 	 6, // Stoke It
       
    48 	12, // Road Hog
       
    49 	 5, // Aliens Ate My Railway
       
    50 	 1, // Snarl Up
       
    51 	18, // Stroll On
       
    52 	10, // Can't Get There From Here
       
    53 	 8, // Sawyer's Tune
       
    54 	13, // Hold That Train!
       
    55 	21, // Movin' On
       
    56 	15, // Goss Groove
       
    57 	16, // Small Town
       
    58 	14, // Broomer's Oil Rag
       
    59 	20, // Jammit
       
    60 	11  // Hard Drivin'
       
    61 };
       
    62 
    37 
    63 
    38 static void SkipToPrevSong()
    64 static void SkipToPrevSong()
    39 {
    65 {
    40 	byte *b = _cur_playlist;
    66 	byte *b = _cur_playlist;
    41 	byte *p = b;
    67 	byte *p = b;
    80 }
   106 }
    81 
   107 
    82 static void DoPlaySong()
   108 static void DoPlaySong()
    83 {
   109 {
    84 	char filename[256];
   110 	char filename[256];
    85 	sprintf(filename, "%sgm_tt%.2d.gm",  _path.gm_dir, _music_wnd_cursong - 1);
   111 	snprintf(filename, sizeof(filename), "%sgm_tt%.2d.gm",
       
   112 		_path.gm_dir, midi_idx[_music_wnd_cursong - 1]);
    86 	_music_driver->play_song(filename);
   113 	_music_driver->play_song(filename);
    87 }
   114 }
    88 
   115 
    89 static void DoStopMusic()
   116 static void DoStopMusic()
    90 {
   117 {