File indexing completed on 2025-02-23 04:34:18
0001 /** 0002 * \file numbertracksdialog.h 0003 * Number tracks dialog. 0004 * 0005 * \b Project: Kid3 0006 * \author Urs Fleisch 0007 * \date 25 May 2006 0008 * 0009 * Copyright (C) 2006-2024 Urs Fleisch 0010 * 0011 * This file is part of Kid3. 0012 * 0013 * Kid3 is free software; you can redistribute it and/or modify 0014 * it under the terms of the GNU General Public License as published by 0015 * the Free Software Foundation; either version 2 of the License, or 0016 * (at your option) any later version. 0017 * 0018 * Kid3 is distributed in the hope that it will be useful, 0019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 * GNU General Public License for more details. 0022 * 0023 * You should have received a copy of the GNU General Public License 0024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0025 */ 0026 0027 #pragma once 0028 0029 #include <QDialog> 0030 #include "frame.h" 0031 0032 class QSpinBox; 0033 class QComboBox; 0034 class QCheckBox; 0035 0036 /** 0037 * Number tracks dialog. 0038 */ 0039 class NumberTracksDialog : public QDialog { 0040 Q_OBJECT 0041 public: 0042 /** 0043 * Constructor. 0044 * 0045 * @param parent parent widget 0046 */ 0047 explicit NumberTracksDialog(QWidget* parent); 0048 0049 /** 0050 * Destructor. 0051 */ 0052 ~NumberTracksDialog() override = default; 0053 0054 /** 0055 * Get start number. 0056 */ 0057 int getStartNumber() const; 0058 0059 /** 0060 * Get destination. 0061 * 0062 * @return TagV1, TagV2 or TagV2V1 if ID3v1, ID2v2 or both are destination 0063 */ 0064 Frame::TagVersion getDestination() const; 0065 0066 /** 0067 * Set the total number of tracks. 0068 * 0069 * @param numTracks number of tracks 0070 * @param enable true to enable setting of total 0071 */ 0072 void setTotalNumberOfTracks(int numTracks, bool enable); 0073 0074 /** 0075 * Get the total number of tracks. 0076 * 0077 * @param enable true is returned here if total number of tracks is checked 0078 * 0079 * @return number of tracks entered 0080 */ 0081 int getTotalNumberOfTracks(bool* enable) const; 0082 0083 /** 0084 * Check if track numbering is enabled. 0085 * @return true if enabled. 0086 */ 0087 bool isTrackNumberingEnabled() const; 0088 0089 /** 0090 * Check if counter has to be reset for each directory. 0091 * @return true if enabled. 0092 */ 0093 bool isDirectoryCounterResetEnabled() const; 0094 0095 private slots: 0096 /** 0097 * Save the local settings to the configuration. 0098 */ 0099 void saveConfig(); 0100 0101 /** 0102 * Show help. 0103 */ 0104 void showHelp(); 0105 0106 private: 0107 /** check box to enable track numbering */ 0108 QCheckBox* m_numberTracksCheckBox; 0109 /** spinbox with starting track number */ 0110 QSpinBox* m_trackSpinBox; 0111 /** combobox with destination */ 0112 QComboBox* m_destComboBox; 0113 /** checkbox to reset counter for each directory*/ 0114 QCheckBox* m_resetCounterCheckBox; 0115 /** total number of tracks checkbox */ 0116 QCheckBox* m_totalNumTracksCheckBox; 0117 /** spinbox with total number of tracks */ 0118 QSpinBox* m_totalNumTrackSpinBox; 0119 };