1 |
|
/* |
2 |
|
* main_beos.cpp - SIDPlayer BeOS main program |
3 |
|
* |
4 |
< |
* SIDPlayer (C) Copyright 1996-2000 Christian Bauer |
4 |
> |
* SIDPlayer (C) Copyright 1996-2004 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
29 |
|
|
30 |
|
#include "main.h" |
31 |
|
#include "prefs_window.h" |
32 |
+ |
#include "sid.h" |
33 |
|
|
34 |
|
|
35 |
|
// Message codes |
187 |
|
|
188 |
|
void SIDPlayer::ArgvReceived(int32 argc, char **argv) |
189 |
|
{ |
190 |
< |
if (argc >= 2) { |
190 |
> |
if (argc < 2) |
191 |
> |
return; |
192 |
> |
|
193 |
> |
for (int i=1; i<argc; i++) { |
194 |
> |
if (argv[i][0] == '-') |
195 |
> |
continue; |
196 |
|
player.Stop(); |
197 |
< |
LoadPSIDFile(argv[1]); |
197 |
> |
LoadPSIDFile(argv[i]); |
198 |
|
player.Start(); |
199 |
|
player_stopped = false; |
200 |
|
if (main_window) |
298 |
|
void SIDPlayer::ReadyToRun(void) |
299 |
|
{ |
300 |
|
main_window = new MainWindow(); |
301 |
< |
if (psid_loaded) |
301 |
> |
if (IsPSIDLoaded()) |
302 |
|
main_window->PostMessage(MSG_NEW_MODULE); |
303 |
|
} |
304 |
|
|
307 |
|
* Show About window |
308 |
|
*/ |
309 |
|
|
310 |
< |
void AboutWindow(void) |
310 |
> |
void AboutWindow() |
311 |
|
{ |
312 |
|
BAlert *theAlert = new BAlert("", |
313 |
|
"SIDPlayer\nVersion " VERSION "\n\n" |
314 |
< |
"Copyright " B_UTF8_COPYRIGHT " 1996-2000 Christian Bauer\n" |
314 |
> |
"Copyright " B_UTF8_COPYRIGHT " 1996-2004 Christian Bauer\n" |
315 |
|
"E-mail: Christian.Bauer@uni-mainz.de\n" |
316 |
< |
"http://www.uni-mainz.de/~bauec002/\n\n" |
316 |
> |
"http://www.uni-mainz.de/~bauec002/SPMain.html\n\n" |
317 |
|
"SIDPlayer comes with ABSOLUTELY NO\n" |
318 |
|
"WARRANTY. This is free software, and\n" |
319 |
|
"you are welcome to redistribute it\n" |
642 |
|
|
643 |
|
|
644 |
|
/* |
645 |
+ |
* Get current value of microsecond timer |
646 |
+ |
*/ |
647 |
+ |
|
648 |
+ |
uint64 GetTicks_usec() |
649 |
+ |
{ |
650 |
+ |
return system_time(); |
651 |
+ |
} |
652 |
+ |
|
653 |
+ |
|
654 |
+ |
/* |
655 |
+ |
* Delay by specified number of microseconds (<1 second) |
656 |
+ |
*/ |
657 |
+ |
|
658 |
+ |
void Delay_usec(uint32 usec) |
659 |
+ |
{ |
660 |
+ |
snooze(usec); |
661 |
+ |
} |
662 |
+ |
|
663 |
+ |
|
664 |
+ |
/* |
665 |
|
* Main program |
666 |
|
*/ |
667 |
|
|
668 |
|
int main(int argc, char **argv) |
669 |
|
{ |
670 |
< |
InitAll(); |
670 |
> |
InitAll(argc, argv); |
671 |
|
SIDPlayer *the_app = new SIDPlayer(); |
672 |
|
the_app->Run(); |
673 |
|
delete the_app; |