A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 60 lines 2.4 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2014 by Amaury Pouly 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21#include <QApplication> 22#include <QDir> 23#include <QTextCodec> 24#include "mainwindow.h" 25 26int main(int argc, char *argv[]) 27{ 28 QApplication app(argc, argv); 29 app.setApplicationVersion(APP_VERSION); 30#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 31 /** NOTE: Qt4 only 32 * use the locale codec as the C-string codec, otherwise QString::toStdString() 33 * performs as toLatin1() which breaks conversion on virtually all systems. 34 * FIXME The documentation mentions that the C-string codec should produce ASCII 35 * compatible (ie 7-bit) encodings but nowadays most system are using UTF-8 36 * so I don't see why this is a problem */ 37 QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale()); 38#endif 39 40 Backend backend;; 41 QDir dir(QCoreApplication::applicationDirPath()); 42 dir.cdUp(); 43 dir.cd("desc"); 44 dir.setFilter(QDir::Files); 45 QFileInfoList list = dir.entryInfoList(); 46 for(int i = 0; i < list.size(); i++) 47 { 48 QFileInfo fileInfo = list.at(i); 49 if(fileInfo.fileName().right(4) != ".xml" || fileInfo.fileName().left(5) != "regs-") 50 continue; 51 backend.LoadSocDesc(fileInfo.absoluteFilePath()); 52 } 53 54 QCoreApplication::setOrganizationName("Rockbox"); 55 QCoreApplication::setApplicationName("Register Editor"); 56 QCoreApplication::setOrganizationDomain("rockbox.org"); 57 MainWindow win(&backend); 58 win.show(); 59 return app.exec(); 60}