comparison main/main.cpp @ 54:ec77936c268e

* Add system-specific LADSPA and DSSI plugin paths (for OS/X and Windows) * Add ability to open more than one audio file at once from the command line * Add plugin input source selection (with some caveats) * Show name of file being decoded in Ogg/mp3 decode progress dialog
author Chris Cannam
date Thu, 12 Oct 2006 14:56:28 +0000
parents 47bff9f88882
children f7f676a533e5
comparison
equal deleted inserted replaced
53:94f1c2747de4 54:ec77936c268e
136 gui.move(settings.value("position").toPoint()); 136 gui.move(settings.value("position").toPoint());
137 } 137 }
138 settings.endGroup(); 138 settings.endGroup();
139 139
140 gui.show(); 140 gui.show();
141 141 /*
142 QString path; 142 QStringList pathList;
143 for (QStringList::iterator i = args.begin(); i != args.end(); ++i) { 143 for (QStringList::iterator i = args.begin(); i != args.end(); ++i) {
144 if (i == args.begin()) continue; 144 if (i == args.begin()) continue;
145 if (!i->startsWith('-')) { 145 if (!i->startsWith('-')) {
146 path = *i; 146 pathList.push_back(*i);
147 break; 147 }
148 } 148 }
149 } 149 */
150 150 bool haveSession = false;
151 if (!path.isEmpty()) { 151 bool haveMainModel = false;
152
153 for (QStringList::iterator i = args.begin(); i != args.end(); ++i) {
154
155 bool success = false;
156
157 if (i == args.begin()) continue;
158 if (i->startsWith('-')) continue;
159
160 QString path = *i;
161
162 if (path.endsWith("sv")) {
163 if (!haveSession) {
164 success = gui.openSessionFile(path);
165 if (success) {
166 haveSession = true;
167 haveMainModel = true;
168 }
169 } else {
170 std::cerr << "WARNING: Ignoring additional session file argument \"" << path.toStdString() << "\"" << std::endl;
171 success = true;
172 }
173 }
174 if (!success) {
175 if (!haveMainModel) {
176 success = gui.openSomeFile(path, MainWindow::ReplaceMainModel);
177 if (success) haveMainModel = true;
178 } else {
179 success = gui.openSomeFile(path, MainWindow::CreateAdditionalModel);
180 }
181 }
182 if (!success) {
183 QMessageBox::critical
184 (&gui, QMessageBox::tr("Failed to open file"),
185 QMessageBox::tr("File \"%1\" could not be opened").arg(path));
186 }
187 }
188 /*
189
190 if (!pathList.isEmpty()) {
152 bool success = false; 191 bool success = false;
153 if (path.endsWith(".sv")) { 192 if (path.endsWith(".sv")) {
154 success = gui.openSessionFile(path); 193 success = gui.openSessionFile(path);
155 } 194 }
156 if (!success) { 195 if (!success) {
159 if (!success) { 198 if (!success) {
160 QMessageBox::critical(&gui, QMessageBox::tr("Failed to open file"), 199 QMessageBox::critical(&gui, QMessageBox::tr("Failed to open file"),
161 QMessageBox::tr("File \"%1\" could not be opened").arg(path)); 200 QMessageBox::tr("File \"%1\" could not be opened").arg(path));
162 } 201 }
163 } 202 }
203 */
164 204
165 int rv = application.exec(); 205 int rv = application.exec();
166 std::cerr << "application.exec() returned " << rv << std::endl; 206 std::cerr << "application.exec() returned " << rv << std::endl;
167 207
168 cleanupMutex.lock(); 208 cleanupMutex.lock();