File indexing completed on 2025-01-05 04:25:50

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Casey Link <unnamedrambler@gmail.com>                             *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef TIMECODELOADCAPABILITY_H
0018 #define TIMECODELOADCAPABILITY_H
0019 
0020 #include "amarok_export.h"
0021 #include "core/meta/forward_declarations.h"
0022 #include "core/capabilities/Capability.h"
0023 #include "amarokurls/AmarokUrl.h"
0024 
0025 #include "AmarokSharedPointer.h"
0026 
0027 #include <QList>
0028 
0029 namespace Capabilities {
0030 
0031 typedef QList<AmarokUrlPtr> BookmarkList;
0032 typedef AmarokSharedPointer<AmarokUrl> AmarokUrlPtr;
0033 /**
0034 * This capability determines whether a track has timecodes
0035 * that can be loaded from it, and supplies them if it can.
0036 * @author Casey Link
0037 */
0038 class AMAROK_EXPORT TimecodeLoadCapability : public Capability
0039 {
0040     Q_OBJECT
0041 public:
0042     ~TimecodeLoadCapability() override;
0043 
0044     /**
0045      * @return true if the track has timecodes, false if not
0046      */
0047     virtual bool hasTimecodes() = 0 ;
0048 
0049     /**
0050      * @return a QList of AmarokUrlPtrs representing the track's timecodes. Might return an empty list.
0051      */
0052     virtual BookmarkList loadTimecodes()  = 0;
0053 
0054     /**
0055     * Get the capabilityInterfaceType of this capability
0056     * @return The capabilityInterfaceType ( always Capabilities::Capability::LoadTimecode; )
0057     */
0058     static Type capabilityInterfaceType()
0059     {
0060         return Capabilities::Capability::LoadTimecode;
0061     }
0062 };
0063 
0064 }
0065 
0066 #endif // TIMECODELOADCAPABILITY_H