1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 3 /* 4 Rosegarden 5 A MIDI and audio sequencer and musical notation editor. 6 Copyright 2000-2021 the Rosegarden development team. 7 8 Other copyrights also apply to some parts of this work. Please 9 see the AUTHORS file and individual file headers for details. 10 11 This program is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public License as 13 published by the Free Software Foundation; either version 2 of the 14 License, or (at your option) any later version. See the file 15 COPYING included with this distribution for more information. 16 */ 17 18 #ifndef RG_DOCUMENTMETACONFIGURATIONPAGE_H 19 #define RG_DOCUMENTMETACONFIGURATIONPAGE_H 20 21 #include "TabbedConfigurationPage.h" 22 #include <QString> 23 #include "base/Composition.h" 24 25 26 class QWidget; 27 class QListWidget; 28 29 30 namespace Rosegarden 31 { 32 33 class RosegardenDocument; 34 class HeadersConfigurationPage; 35 class CommentsConfigurationPage; 36 37 /** 38 * Document Meta-information page 39 * 40 * (document-wide settings) 41 */ 42 class DocumentMetaConfigurationPage : public TabbedConfigurationPage 43 { 44 Q_OBJECT 45 public: 46 DocumentMetaConfigurationPage(QWidget *parent); 47 void apply() override; 48 iconLabel()49 static QString iconLabel() { return tr("About"); } title()50 static QString title() { return tr("About"); } iconName()51 static QString iconName() { return "mm-mime-hi32-rosegarden"; } 52 53 /* hjj: WHAT TO DO WITH THIS ? 54 void selectMetadata(QString name); 55 */ 56 57 protected: durationToString(Composition & comp,timeT absTime,timeT duration,RealTime rt)58 static QString durationToString(Composition &comp, 59 timeT absTime, 60 timeT duration, 61 RealTime rt) { 62 return tr("%1 minutes %2.%3%4 seconds (%5 units, %6 measures)") // TODO - PLURAL 63 .arg(rt.sec / 60).arg(rt.sec % 60) 64 .arg(rt.msec() / 100).arg((rt.msec() / 10) % 10) 65 .arg(duration).arg(comp.getBarNumber(absTime + duration) - 66 comp.getBarNumber(absTime)); 67 } 68 69 //--------------- Data members --------------------------------- 70 71 HeadersConfigurationPage *m_headersPage; 72 CommentsConfigurationPage *m_commentsPage; 73 }; 74 75 76 77 } 78 79 #endif 80