/[cebix]/SIDPlayer/src/main_sdl.cpp
ViewVC logotype

Diff of /SIDPlayer/src/main_sdl.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4 by cebix, 2001-01-16T14:12:54Z revision 1.5 by cebix, 2001-01-16T16:53:26Z
# Line 35  Line 35 
35    
36  static void usage(const char *prg_name)  static void usage(const char *prg_name)
37  {  {
38          printf("\nUsage: %s [options] FILE [song_number]]\n", prg_name);          printf("Usage: %s [OPTION...] FILE [song_number]]\n", prg_name);
39            PrefsPrintUsage();
40          exit(0);          exit(0);
41  }  }
42    
# Line 50  int main(int argc, char **argv) Line 51  int main(int argc, char **argv)
51          // Print banner          // Print banner
52          printf(          printf(
53                  PACKAGE " Version " VERSION "\n\n"                  PACKAGE " Version " VERSION "\n\n"
54                  "Copyright (C) 1996-2000 Christian Bauer\n"                  "Copyright (C) 1996-2001 Christian Bauer\n"
55                  "E-mail: Christian.Bauer@uni-mainz.de\n"                  "E-mail: Christian.Bauer@uni-mainz.de\n"
56                  "http://www.uni-mainz.de/~bauec002/\n\n"                  "http://www.uni-mainz.de/~bauec002/\n\n"
57                  "This is free software with ABSOLUTELY NO WARRANTY.\n"                  "This is free software with ABSOLUTELY NO WARRANTY.\n"
# Line 58  int main(int argc, char **argv) Line 59  int main(int argc, char **argv)
59                  "For details, see the file COPYING.\n\n"                  "For details, see the file COPYING.\n\n"
60          );          );
61    
62          // Parse arguments          // Initialize everything
63            if (SDL_Init(SDL_INIT_AUDIO) < 0) {
64                    fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError());
65                    exit(1);
66            }
67            atexit(quit);
68            InitAll(argc, argv);
69            int32 selected_speed = PrefsFindInt32("speed");
70    
71            // Parse non-option arguments
72          if (argc < 2)          if (argc < 2)
73                  usage(argv[0]);                  usage(argv[0]);
74          char *file_name = argv[argc - 1];          char *file_name = argv[argc - 1];
# Line 76  int main(int argc, char **argv) Line 86  int main(int argc, char **argv)
86                  }                  }
87          }          }
88    
         // Initialize everything  
         if (SDL_Init(SDL_INIT_AUDIO) < 0) {  
                 fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError());  
                 exit(1);  
         }  
         atexit(quit);  
         InitAll(argc, argv);  
   
89          // Load given PSID file          // Load given PSID file
90          if (!LoadPSIDFile(file_name)) {          if (!LoadPSIDFile(file_name)) {
91                  fprintf(stderr, "Couldn't load '%s' (not a PSID file?)\n", file_name);                  fprintf(stderr, "Couldn't load '%s' (not a PSID file?)\n", file_name);
# Line 104  int main(int argc, char **argv) Line 106  int main(int argc, char **argv)
106          printf("Playing song %d/%d\n", current_song + 1, number_of_songs);          printf("Playing song %d/%d\n", current_song + 1, number_of_songs);
107    
108          // Start replay and enter main loop          // Start replay and enter main loop
109          SIDAdjustSpeed(PrefsFindInt32("speed"));          SIDAdjustSpeed(selected_speed); // SelectSong resets this to 100%
110          SDL_PauseAudio(false);          SDL_PauseAudio(false);
111          while (true) {          while (true) {
112                  SDL_Event e;                  SDL_Event e;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26