4 #include "filesystem.h"
5 #include "loadfile.inc"
8 #include "mwindowgui.h"
9 #include "pluginserver.h"
10 #include "preferences.h"
11 #include "renderfarmclient.h"
15 #define PACKAGE "cinelerra"
16 #define LOCALEDIR "/usr/share/locale"
18 #define _(String) gettext(String)
19 #define gettext_noop(String) String
20 #define N_(String) gettext_noop (String)
32 int main(int argc, char *argv[])
34 // handle command line arguments first
36 ArrayList<char*> filenames;
39 int operation = DO_GUI;
40 int deamon_port = DEAMON_PORT;
41 char deamon_path[BCTEXTLEN];
43 setlocale (LC_ALL, "");
44 bindtextdomain (PACKAGE, LOCALEDIR);
46 for(int i = 1; i < argc; i++)
48 if(!strcmp(argv[i], "-h"))
53 if(!strcmp(argv[i], "-d"))
55 operation = DO_DEAMON;
59 if(atol(argv[i + 1]) > 0)
60 deamon_port = atol(argv[i + 1]);
64 if(!strcmp(argv[i], "-b"))
66 operation = DO_BRENDER;
67 strcpy(deamon_path, argv[i + 1]);
72 new_filename = new char[1024];
73 strcpy(new_filename, argv[i]);
74 fs.complete_path(new_filename);
76 filenames.append(new_filename);
83 if(operation == DO_GUI || operation == DO_DEAMON || operation == DO_USAGE)
88 " (C)2003 Heroine Virtual Ltd.\n\n"
90 PROGRAM_NAME " is free software, covered by the GNU General Public License,\n"
91 "and you are welcome to change it and/or distribute copies of it under\n"
92 "certain conditions. There is absolutely no warranty for " PROGRAM_NAME ".\n");
101 printf(_("\nUsage:\n"));
102 printf(_("%s [-d] [port]\n"), argv[0]);
103 printf(_("\n-d = Run in the background as renderfarm client.\n"));
104 printf(_("port = Port for client to listen on. (400)\n\n\n"));
114 RenderFarmClient client(deamon_port, 0);
119 // Same thing without detachment
122 RenderFarmClient client(0, deamon_path);
130 mwindow.create_objects(1, !filenames.total);
132 // load the initial files on seperate tracks
135 mwindow.gui->lock_window();
136 mwindow.load_filenames(&filenames, LOAD_REPLACE);
137 if(filenames.total == 1)
138 mwindow.gui->mainmenu->add_load(filenames.values[0]);
139 mwindow.gui->unlock_window();
144 // mwindow.gui->run_window();
145 mwindow.save_defaults();
150 filenames.remove_all_objects();