2 * Copyright (c) 2004 Matthijs Hollemans
3 * Copyright (c) 2008-2014 Haiku, Inc. All rights reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 #include "MidiPlayerApp.h"
27 #include <AboutWindow.h>
31 #include <StorageKit.h>
33 #include "MidiPlayerWindow.h"
36 #undef B_TRANSLATION_CONTEXT
37 #define B_TRANSLATION_CONTEXT "Main Application"
40 // #pragma mark - MidiPlayerApp
43 MidiPlayerApp::MidiPlayerApp()
45 BApplication(MIDI_PLAYER_SIGNATURE
)
47 window
= new MidiPlayerWindow();
52 MidiPlayerApp::ReadyToRun()
59 MidiPlayerApp::AboutRequested()
61 BAboutWindow
* window
= new BAboutWindow("MidiPlayer",
62 MIDI_PLAYER_SIGNATURE
);
64 const char* extraCopyrights
[] = {
65 "2008-2014 Haiku, Inc.",
68 window
->AddCopyright(2004, "Matthijs Hollemans", extraCopyrights
);
70 const char* authors
[] = {
82 window
->AddAuthors(authors
);
84 window
->AddDescription(B_TRANSLATE_COMMENT(
86 "Knows how to play thousands of\n"
87 "Cheesy sounding songs",
88 "This is a haiku. First line has five syllables, "
89 "second has seven and last has five again. "
97 MidiPlayerApp::RefsReceived(BMessage
* message
)
99 message
->what
= B_SIMPLE_DATA
;
100 window
->PostMessage(message
);
105 MidiPlayerApp::ArgvReceived(int32 argc
, char** argv
)
107 // Note: we only load the first file, even if more than one is specified.
108 // For some reason, BeOS R5 MidiPlayer loads them all but will only play
109 // the last one. That's not very useful.
113 msg
.what
= B_SIMPLE_DATA
;
115 BEntry
entry(argv
[1]);
118 msg
.AddRef("refs", &ref
);
120 window
->PostMessage(&msg
);
125 // #pragma mark - main method