File indexing completed on 2024-04-21 15:02:15
0001 /* 0002 * Copyright 2013 Alex Merry <alex.merry@kdemail.net> 0003 * 0004 * Permission is hereby granted, free of charge, to any person obtaining a copy 0005 * of this software and associated documentation files (the "Software"), to deal 0006 * in the Software without restriction, including without limitation the rights 0007 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0008 * copies of the Software, and to permit persons to whom the Software is 0009 * furnished to do so, subject to the following conditions: 0010 * 0011 * The above copyright notice and this permission notice shall be included in 0012 * all copies or substantial portions of the Software. 0013 * 0014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0015 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0016 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0017 * X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 0018 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 0019 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 0020 * 0021 * Except as contained in this notice, the name of the X Consortium shall not be 0022 * used in advertising or otherwise to promote the sale, use or other dealings 0023 * in this Software without prior written authorization from the X Consortium. 0024 */ 0025 0026 #ifndef TESTPLAYER_H 0027 #define TESTPLAYER_H 0028 0029 #include <kmediaplayer/player.h> 0030 0031 class TestPlayer : public KMediaPlayer::Player 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 TestPlayer(QObject *parent) : Player(parent) {} 0037 0038 KMediaPlayer::View *view() override 0039 { 0040 return nullptr; 0041 } 0042 void pause() override 0043 { 0044 } 0045 void play() override 0046 { 0047 } 0048 void stop() override 0049 { 0050 } 0051 void seek(qlonglong) override 0052 { 0053 } 0054 bool isSeekable() const override 0055 { 0056 return false; 0057 } 0058 qlonglong position() const override 0059 { 0060 return 0L; 0061 } 0062 bool hasLength() const override 0063 { 0064 return false; 0065 } 0066 qlonglong length() const override 0067 { 0068 return 0L; 0069 } 0070 0071 void setStateWrapper(State state) 0072 { 0073 // this is protected 0074 setState(state); 0075 } 0076 }; 0077 0078 #endif // TESTPLAYER_H