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 TIMECODEWRITECAPABILITY_H
0018 #define TIMECODEWRITECAPABILITY_H
0019 
0020 #include "amarok_export.h"
0021 #include "core/meta/forward_declarations.h"
0022 #include "core/capabilities/Capability.h"
0023 
0024 namespace Capabilities
0025 {
0026 /**
0027  * This capability determines whether a track can have a timecode
0028  * written to it.
0029  * @author Casey Link
0030  */
0031 class AMAROK_EXPORT TimecodeWriteCapability : public Capability
0032 {
0033     Q_OBJECT
0034 public:
0035 
0036     ~TimecodeWriteCapability() override;
0037 
0038     /**
0039      * Stores a timecode for the track
0040      * @param miliseconds the position in milliseconds at which the timecide should be stored.
0041      * @return  true if the write was successful, false if not.
0042      */
0043     virtual bool writeTimecode ( qint64 miliseconds ) = 0;
0044 
0045     /**
0046      * Stores an auto timecode for the track and deletes any previously added auto timecodes
0047      * @param miliseconds the position in milliseconds at which the timecide should be stored.
0048      * @return  true if the write was successful, false if not.
0049      */
0050     virtual bool writeAutoTimecode ( qint64 miliseconds ) = 0;
0051 
0052     /**
0053     * Get the capabilityInterfaceType of this capability
0054     * @return The capabilityInterfaceType ( always Capabilities::Capability::WriteTimecode; )
0055     */
0056     static Type capabilityInterfaceType()
0057     {
0058         return Capabilities::Capability::WriteTimecode;
0059     }
0060 
0061 protected:
0062 
0063     bool writeTimecode( qint64 miliseconds, const Meta::TrackPtr &track );
0064     bool writeAutoTimecode( qint64 miliseconds, Meta::TrackPtr track );
0065 };
0066 
0067 #endif // TIMECODEWRITECAPABILITY_H
0068 }