#ifndef RM_APP_H #define RM_APP_H #include #include #include "rm_include.h" class QMainWindow; class QTranslator; class QApplication; class RMVideoItem; #if (DETECT_USB_CHANGE) class rm_usb; #endif // #if (DETECT_USB_CHANGE) class RMApp : public QObject { Q_OBJECT public: explicit RMApp(QObject *parent = nullptr); void initialize(QApplication& appliction); enum Event { WillFullScreen = 1, DidFullScreen = 2, WillNormalScreen = 3, DidNormalScreen = 4, WillCloseApplication = 5, #if (RM_MODEL == RM_MODEL_TYPE_TB4000 && USE_DATE_FILTER) ROOT_FOLDER_OPEN = 6, // PHOTO, VIDEO 가 존재하는 폴더 열기 NO_ROOT_FOLDER_OPEN = 7, // 일반폴더 열기 #endif // RM_MODEL_TYPE_TB4000 #if (RM_MODEL == RM_MODEL_TYPE_TB4000) ADDRESS_UPDATED = 8, // 주소 업데이트 완료 #endif }; #if (PENTA_CHANNEL) enum Channel { ChannelFront = 0, ChannelRear = 1, ChannelLeft = 2, ChannelRight = 3, ChannelSub = 4, }; enum ChannelMode { ChannelModeFR = (1 << ChannelFront) | (1 << ChannelRear), ChannelModeLR = (1 << ChannelLeft) | (1 << ChannelRight), ChannelModeFront = (1 << ChannelFront), ChannelModeRear = (1 << ChannelRear), ChannelModeLeft = (1 << ChannelLeft), ChannelModeRight = (1 << ChannelRight), ChannelModeSub = (1 << ChannelSub), }; ChannelMode chMode; #endif // PENTA_CHANNEL enum Path { UNDEFINED = 0, REPORT = 1, // report INI = 2, // BBConfig CAPTURE = 3, // backup (capture) #if (RM_TESTING) SCRIPT = 5, // test script #endif }; #if (USER_LOGER) static bool userLog; /** * @brief 사용자 로그 추가(날짜,시간은 제외) * @param log: 문자열 */ void appendLog(QString tag, QString log); /** * @brief 사용자 로그 저장 * 경로는 문서 폴더에 저장됨 */ void saveLog(); QStringList userLogs; #endif // USER_LOGER static bool isMPH; #if (SUPPORT_LIBRARY_MODE && !PLAYER_ONLY_LIBRARY_MODE) static bool isTB5000; #endif // SUPPORT_LIBRARY_MODE // 지원하지 않는 GPU 확인 가장 먼저 시작해야함 static bool unsupportedGPU; static bool checkGPU(); #if (USE_MAXIMIZE) static int mMAXIMIZE; #endif // #if (USE_MAXIMIZE) // USB 디스크 탐색 static QStringList getRemovableDisks(); // 모델명 일치하는 디스크 1개만 탐색 static QString searchInfoDisk(); #if (MULTI_MODEL_VIEWER) // 모델 디스크 인지 확인 (CFG 파일이 존재하며, 동일한 모델일 경우) static bool isModelDisk(QString& disk,bool* isEMS, char* pMODEL_NAME = NULL); // 모델 디스크 확인 static QList> searchModelDisk(); #else // MULTI_MODEL_VIEWER // 모델 디스크 인지 확인 (CFG 파일이 존재하며, 동일한 모델일 경우) static bool isModelDisk(QString& disk); #endif // MULTI_MODEL_VIEWER // 비디오 파일 열면 디스크 설정 하도록 한 부분 제거 //static QString isFolderInRemovableDisk(QString folderPath); // -> 제거 예정 static QString appPath(RMApp::Path type); // 플레이중 스크린 세이버 중지 void disableScreenSave(bool disable); static RMApp* instance() { static RMApp * _instance = 0; if ( _instance == 0 ) { _instance = new RMApp(); } return _instance; } //#if (PLAYER_ONLY_LIBRARY_MODE) // QMainWindow* p360Window; //#endif QMainWindow* pMainWindow; QTranslator* pTranslator; #if (DETECT_USB_CHANGE) rm_usb* usb; ///< 메인 윈도에서 생성 #endif // #if (DETECT_USB_CHANGE) static QString currentRoot; ///< 현재 열린폴더 #if (RM_MODEL == RM_MODEL_TYPE_TB4000) QString currentAddress; ///!< 현재 주소 QString playPath; ///!< 시작 파일이 USB 에 포함되어 있어 전체 경로를 모두 로딩할 경우 재생할 파일 경로 별도 저장 static QString password(); static bool setPassword(QString); #endif /** * @brief 최종 저장 폴더 경로 * @param tag: 타입 (eg. 동영상 보관) * @return */ static QString lastPath(QString tag); /** * @brief 최종 저장 경로 지정 * @param tag: 타입 (eg. 리포트 etc) * @param path: 사용자 지정 경로 */ static void setLastPath(QString tag, QString path); // PIP 단축키는 main/sub 에서 사용해야 해서 APP 에 정의 #if !(REMOVE_ALL_SHORT_CUTS) // 화면 캡쳐(보고서) 전 PIP 감추기 QShortcut* pipPositionShortcut; QShortcut* pipToggleShortcut; // 전역 Shortcut 생성 void installGlobalShortcuts(); #endif static QString openFolder(QString last,bool bCreateNew = false,QString title = ""); static void closeOpenFolder(); private: static void _initIERegistry(); static void _initDocumentFolder(); static void _setSystemFont(const char* fontName, bool res = false); signals: void appEvent(RMApp::Event event,int param); void hidePIPForCapture(bool hide); #if (RM_MODEL == RM_MODEL_TYPE_TB4000 && !PLAYER_ONLY_LIBRARY_MODE) void tb5000Close(RMVideoItem* lastItem); #endif public slots: }; #endif // RM_APP_H